/* ============================================
   设计系统 - Alist 目录浏览
   风格: Modern Minimalism + Glass Effects
   版本: 2.0 - 全面视觉升级
   ============================================ */

/* ============================================
   CSS 变量 - 设计令牌
   ============================================ */
:root {
  /* 主色调 - 专业蓝 */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  
  /* 中性色 - 灰色系 */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* 语义色 */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;
  
  /* 功能色 */
  --folder: #f59e0b;
  --folder-light: #fef3c7;
  --file: #6b7280;
  --file-light: #f3f4f6;
  --image: #10b981;
  --image-light: #d1fae5;
  --video: #ef4444;
  --video-light: #fee2e2;
  --audio: #8b5cf6;
  --audio-light: #ede9fe;
  --document: #3b82f6;
  --document-light: #dbeafe;
  --archive: #f97316;
  --archive-light: #ffedd5;
  
  /* 背景色 */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-hover: rgba(255, 255, 255, 0.95);
  --bg-overlay: rgba(0, 0, 0, 0.5);
  
  /* 文字色 */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #6b7280;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  
  /* 边框色 */
  --border-light: rgba(229, 231, 235, 0.8);
  --border-default: rgba(209, 213, 219, 0.9);
  --border-focus: var(--primary-500);
  --border-glass: rgba(255, 255, 255, 0.3);
  
  /* 阴影 - 多层次阴影系统 */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-glow-strong: 0 0 30px rgba(59, 130, 246, 0.25);
  
  /* 圆角 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-full: 9999px;
  
  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  
  /* 字号 */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* 行高 */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* 字重 */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* 过渡 */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 400ms ease;
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-spring: 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* 触控区域 */
  --touch-target: 44px;
  
  /* 安全区域 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  
  /* Z-index 层级 */
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-popover: 60;
  --z-tooltip: 70;
  --z-toast: 80;
  
  /* 动画 */
  --animation-duration: 300ms;
  --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   全局重置与基础样式
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: 
    linear-gradient(135deg, 
      rgba(219, 234, 254, 0.3) 0%, 
      rgba(243, 244, 246, 0.5) 25%,
      rgba(229, 231, 235, 0.3) 50%,
      rgba(243, 244, 246, 0.5) 75%,
      rgba(219, 234, 254, 0.3) 100%
    ),
    linear-gradient(45deg,
      rgba(59, 130, 246, 0.02) 0%,
      rgba(139, 92, 246, 0.02) 50%,
      rgba(236, 72, 153, 0.02) 100%
    );
  background-attachment: fixed;
  min-height: 100vh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  bottom: -50%;
  left: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ============================================
   容器布局
   ============================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-6);
  min-height: 100vh;
  position: relative;
}

/* ============================================
   头部导航
   ============================================ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-2xl);
  box-shadow: 
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

/* 头部装饰光效 */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.8), 
    transparent
  );
}

.header-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-title i {
  color: var(--primary-500);
  font-size: 1.4em;
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.title-short {
  display: none;
}

/* ============================================
   导航工具栏
   ============================================ */
.nav-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* 导航按钮 */
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target);
  height: var(--touch-target);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.nav-button:not(:disabled):hover {
  color: var(--primary-600);
  border-color: var(--primary-300);
  background: var(--primary-50);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.nav-button:not(:disabled):active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.nav-button:disabled {
  color: var(--text-muted);
  background: var(--gray-100);
  border-color: var(--border-light);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: var(--bg-glass);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  min-height: var(--touch-target);
  box-shadow: var(--shadow-sm);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--primary-600);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 32px;
  position: relative;
}

.breadcrumb a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-500);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
  border-radius: var(--radius-full);
}

.breadcrumb a:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.breadcrumb a:hover::after {
  width: 60%;
}

.breadcrumb a:active {
  background: var(--primary-100);
  transform: scale(0.98);
}

.breadcrumb span {
  color: var(--text-muted);
  user-select: none;
  font-size: var(--text-sm);
  padding: 0 var(--space-1);
}

/* 面包屑当前项 */
.breadcrumb-current {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 面包屑折叠按钮 */
.breadcrumb-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.breadcrumb-collapse:hover {
  color: var(--primary-600);
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.breadcrumb-collapse:active {
  transform: scale(0.95);
}

/* 面包屑分隔符 */
.breadcrumb-separator {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* 面包屑路径项 */
.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.breadcrumb-item-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 移动端面包屑优化 */
@media screen and (max-width: 768px) {
  .breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .breadcrumb::-webkit-scrollbar {
    display: none;
  }
  
  .breadcrumb-current {
    max-width: 120px;
  }
  
  .breadcrumb-item-name {
    max-width: 80px;
  }
}

@media screen and (max-width: 576px) {
  .breadcrumb-current {
    max-width: 100px;
    font-size: var(--text-xs);
  }
  
  .breadcrumb-item-name {
    max-width: 60px;
    font-size: var(--text-xs);
  }
  
  .breadcrumb a {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
  }
}

/* ============================================
   加载状态
   ============================================ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  min-height: 320px;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-5);
  box-shadow: 
    0 0 0 3px var(--primary-50),
    var(--shadow-md);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  letter-spacing: 0.02em;
}

/* 骨架屏动画 */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-100) 25%,
    var(--gray-50) 50%,
    var(--gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ============================================
   错误提示
   ============================================ */
.error {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8);
  margin-bottom: var(--space-5);
  background: linear-gradient(135deg, var(--error-light) 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.error p {
  margin-bottom: var(--space-5);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--error);
}

#retryButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--error) 0%, #dc2626 100%);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  min-height: var(--touch-target);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

#retryButton:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

#retryButton:active {
  transform: translateY(0);
}

/* ============================================
   排序控制
   ============================================ */
.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: var(--bg-glass);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  min-height: var(--touch-target);
  box-shadow: var(--shadow-sm);
}

.sort-controls label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  white-space: nowrap;
}

#sortSelect {
  flex: 1;
  max-width: 200px;
  padding: var(--space-2) var(--space-3);
  padding-right: var(--space-8);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  background: var(--bg-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-2) center;
  background-size: 20px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  min-height: 36px;
  outline: none;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

#sortSelect:hover {
  border-color: var(--gray-400);
  box-shadow: var(--shadow-sm);
}

#sortSelect:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* ============================================
   文件列表
   ============================================ */
.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-glass);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  cursor: default;
  transition: all var(--transition-base);
  min-height: calc(var(--touch-target) + 12px);
  user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* 文件项入场动画 */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-item {
  animation: slideIn var(--transition-slow) var(--animation-timing) forwards;
}

.file-item.clickable {
  cursor: pointer;
}

.file-item.clickable:hover {
  background: var(--bg-glass-hover);
  border-color: var(--primary-200);
  box-shadow: 
    var(--shadow-lg),
    var(--shadow-glow);
  transform: translateY(-3px);
}

.file-item.clickable:hover .file-icon {
  transform: scale(1.1) rotate(-3deg);
}

.file-item.clickable:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.file-item.not-clickable {
  opacity: 0.85;
}

.file-item.not-clickable:hover {
  background: var(--bg-glass);
}

/* 涟漪效果 */
.file-item.clickable::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.file-item.clickable:active::after {
  width: 300px;
  height: 300px;
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 24px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  transition: transform var(--transition-base);
  position: relative;
}

/* 图标装饰 */
.file-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.folder-icon {
  color: var(--folder);
  background: linear-gradient(135deg, var(--folder-light) 0%, #fde68a 100%);
  box-shadow: 
    0 4px 12px rgba(245, 158, 11, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.file-icon-generic {
  color: var(--file);
  background: linear-gradient(135deg, var(--file-light) 0%, var(--gray-100) 100%);
  box-shadow: 
    0 4px 12px rgba(107, 114, 128, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.file-icon-image {
  color: var(--image);
  background: linear-gradient(135deg, var(--image-light) 0%, #a7f3d0 100%);
  box-shadow: 
    0 4px 12px rgba(16, 185, 129, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.file-icon-video {
  color: var(--video);
  background: linear-gradient(135deg, var(--video-light) 0%, #fecaca 100%);
  box-shadow: 
    0 4px 12px rgba(239, 68, 68, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.file-icon-audio {
  color: var(--audio);
  background: linear-gradient(135deg, var(--audio-light) 0%, #ddd6fe 100%);
  box-shadow: 
    0 4px 12px rgba(139, 92, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.file-icon-document {
  color: var(--document);
  background: linear-gradient(135deg, var(--document-light) 0%, #bfdbfe 100%);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.file-icon-compressed {
  color: var(--archive);
  background: linear-gradient(135deg, var(--archive-light) 0%, #fed7aa 100%);
  box-shadow: 
    0 4px 12px rgba(249, 115, 22, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.file-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.file-name {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  word-break: break-word;
  flex: 1;
  min-width: 0;
  line-height: var(--leading-snug);
}

.file-meta {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  flex-shrink: 0;
  white-space: nowrap;
}

.file-size {
  min-width: 80px;
  text-align: right;
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.file-modified {
  min-width: 130px;
  text-align: right;
}

/* ============================================
   空状态
   ============================================ */
.empty-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-tertiary);
  font-size: var(--text-lg);
  text-align: center;
  font-weight: var(--font-medium);
}

.empty-message::before {
  content: '📁';
  font-size: 64px;
  margin-bottom: var(--space-5);
  opacity: 0.6;
  animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================
   响应式设计 - 大屏 (> 1280px)
   ============================================ */
@media screen and (min-width: 1280px) {
  .container {
    padding: var(--space-8);
  }
  
  .header {
    padding: var(--space-6) var(--space-8);
  }
}

/* ============================================
   响应式设计 - 平板 (768px - 1024px)
   ============================================ */
@media screen and (max-width: 1024px) {
  .container {
    padding: var(--space-5);
  }
  
  .header {
    padding: var(--space-4) var(--space-5);
  }
  
  .header-title {
    font-size: var(--text-lg);
  }
  
  .file-item {
    padding: var(--space-3) var(--space-4);
  }
}

/* ============================================
   响应式设计 - 大屏手机 (576px - 768px)
   ============================================ */
@media screen and (max-width: 768px) {
  .container {
    padding: var(--space-4);
  }
  
  .header {
    padding: var(--space-4);
    border-radius: var(--radius-xl);
  }
  
  .header-title {
    justify-content: center;
    font-size: var(--text-lg);
  }
  
  .nav-toolbar {
    padding: var(--space-3);
    gap: var(--space-2);
  }
  
  .nav-button {
    width: 40px;
    height: 40px;
    font-size: var(--text-base);
  }
  
  .file-item {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
  }
  
  .file-info {
    flex-wrap: wrap;
  }
  
  .file-name {
    width: 100%;
    margin-bottom: var(--space-1);
  }
  
  .file-meta {
    width: 100%;
    justify-content: flex-start;
    gap: var(--space-4);
  }
  
  .file-size,
  .file-modified {
    min-width: auto;
    text-align: left;
  }
  
  .file-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
}

/* ============================================
   响应式设计 - 小屏手机 (< 576px)
   ============================================ */
@media screen and (max-width: 576px) {
  :root {
    --text-base: 15px;
  }
  
  .container {
    padding: var(--space-3);
  }
  
  .header {
    padding: var(--space-3);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-lg);
  }
  
  .header-title {
    font-size: var(--text-base);
    gap: var(--space-2);
  }
  
  .title-text {
    display: none;
  }
  
  .title-short {
    display: inline;
  }
  
  .nav-toolbar {
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-lg);
    gap: var(--space-1);
  }
  
  .nav-button {
    width: 38px;
    height: 38px;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
  }
  
  .breadcrumb {
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-lg);
    flex-wrap: nowrap;
  }
  
  .breadcrumb a {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
  }
  
  .sort-controls {
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-lg);
  }
  
  #sortSelect {
    font-size: var(--text-xs);
    max-width: none;
  }
  
  .file-list {
    gap: var(--space-2);
  }
  
  .file-item {
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    gap: var(--space-3);
  }
  
  .file-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: var(--radius-md);
  }
  
  .file-name {
    font-size: var(--text-sm);
  }
  
  .file-meta {
    font-size: 10px;
    gap: var(--space-3);
  }
  
  .loading {
    padding: var(--space-10) var(--space-4);
    min-height: 220px;
  }
  
  .loading-spinner {
    width: 44px;
    height: 44px;
  }
  
  .empty-message {
    padding: var(--space-10) var(--space-4);
  }
  
  .empty-message::before {
    font-size: 48px;
  }
}

/* ============================================
   响应式设计 - 超小屏 (< 375px)
   ============================================ */
@media screen and (max-width: 375px) {
  :root {
    --text-base: 14px;
  }
  
  .file-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .file-meta {
    font-size: 9px;
  }
  
  .go-button {
    padding: var(--space-3) var(--space-4);
  }
}

/* ============================================
   横屏模式优化
   ============================================ */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .container {
    padding: var(--space-3);
  }
  
  .header {
    margin-bottom: var(--space-3);
    padding: var(--space-3);
  }
  
  .loading {
    padding: var(--space-4);
    min-height: 140px;
  }
  
  .loading-spinner {
    width: 36px;
    height: 36px;
    margin-bottom: var(--space-3);
  }
  
  .file-item {
    min-height: calc(var(--touch-target) + 4px);
  }
}

/* ============================================
   深色模式
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #0f172a;
    --bg-glass: rgba(31, 41, 55, 0.85);
    --bg-glass-hover: rgba(31, 41, 55, 0.95);
    
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-tertiary: #9ca3af;
    --text-muted: #6b7280;
    
    --border-light: rgba(55, 65, 81, 0.8);
    --border-default: rgba(75, 85, 99, 0.9);
    --border-glass: rgba(75, 85, 99, 0.3);
  }
  
  body {
    background: 
      linear-gradient(135deg, 
        rgba(15, 23, 42, 0.9) 0%, 
        rgba(30, 41, 59, 0.8) 50%,
        rgba(15, 23, 42, 0.9) 100%
      ),
      linear-gradient(45deg,
        rgba(59, 130, 246, 0.05) 0%,
        rgba(139, 92, 246, 0.05) 50%,
        rgba(236, 72, 153, 0.05) 100%
      );
  }
  
  body::before {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  }
  
  body::after {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
  }
  
  .header {
    box-shadow: 
      var(--shadow-lg),
      0 0 0 1px rgba(75, 85, 99, 0.3) inset;
  }
  
  .path-input {
    background: var(--bg-secondary);
    border-color: var(--border-default);
    color: var(--text-primary);
  }
  
  .path-input:focus {
    box-shadow: 
      var(--shadow-md),
      0 0 0 4px rgba(59, 130, 246, 0.2);
  }
  
  #sortSelect {
    background-color: var(--bg-secondary);
    border-color: var(--border-default);
    color: var(--text-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  }
  
  .file-icon-generic {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
  }
  
  .file-item.clickable:hover {
    border-color: var(--primary-400);
    box-shadow: 
      var(--shadow-lg),
      0 0 20px rgba(59, 130, 246, 0.2);
  }
  
  .skeleton {
    background: linear-gradient(
      90deg,
      var(--gray-800) 25%,
      var(--gray-700) 50%,
      var(--gray-800) 75%
    );
    background-size: 200% 100%;
  }
}

/* ============================================
   无障碍优化
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .header-title i {
    animation: none;
  }
  
  .empty-message::before {
    animation: none;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border-light: #000;
    --border-default: #000;
    --border-glass: rgba(0, 0, 0, 0.5);
  }
  
  .file-item {
    border-width: 2px;
  }
  
  .breadcrumb a {
    text-decoration: underline;
  }
  
  .file-icon {
    border: 2px solid currentColor;
  }
}

/* 焦点可见性 */
:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* 跳过链接 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-600);
  color: var(--text-inverse);
  padding: var(--space-2) var(--space-4);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   打印样式
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }
  
  body::before,
  body::after {
    display: none;
  }
  
  .header,
  .sort-controls,
  .loading,
  .error {
    display: none;
  }
  
  .container {
    padding: 0;
    max-width: none;
  }
  
  .file-item {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    background: white;
  }
  
  .file-icon {
    box-shadow: none;
    background: #f5f5f5;
  }
  
  .breadcrumb {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* ============================================
   触摸设备优化
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  .file-item.clickable:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
  
  .file-item.clickable:active {
    background: var(--bg-glass-hover);
    transform: scale(0.98);
  }
  
  .go-button:hover {
    transform: none;
  }
  
  .go-button:active {
    transform: scale(0.95);
  }
}

/* ============================================
   高性能模式 (低配设备)
   ============================================ */
@media (prefers-reduced-data: reduce) {
  .header-title i {
    animation: none;
  }
  
  .empty-message::before {
    animation: none;
  }
  
  .file-item {
    animation: none;
  }
  
  .header::before,
  .go-button::before {
    display: none;
  }
}
