/* ============================================================
   云链盘 · 全局样式表 style.css
   ------------------------------------------------------------
   设计规范：
   - 主色渐变 #6366F1 → #8B5CF6 → #A855F7
   - 毛玻璃卡片 + 圆角统一（面板24px/卡片16px/控件14px/模态框28px）
   - 深色模式：<html class="dark"> + CSS 变量自动切换
   - 所有可点击元素：hover 上浮 -2px + 阴影加深，active 缩放 0.97
   - 微交互 150ms / 常规 250ms / 页面级 400ms
   ============================================================ */

/* ============ 一、设计令牌（CSS 变量） ============ */
:root {
  /* 品牌色 */
  --primary:        #6366F1;                    /* 主色（靛蓝） */
  --primary-2:      #8B5CF6;                    /* 主色渐变中段（紫） */
  --primary-3:      #A855F7;                    /* 主色渐变尾段（品紫） */
  --gradient:       linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A855F7 100%);

  /* 语义色 */
  --success:        #10B981;                    /* 成功 */
  --warning:        #F59E0B;                    /* 警告 */
  --danger:         #EF4444;                    /* 危险 */

  /* 背景与卡片（浅色模式） */
  --bg:             #F7F8FC;                    /* 页面底色 */
  --bg-card:        rgba(255, 255, 255, 0.72);  /* 卡片毛玻璃底色 */
  --bg-solid:       #FFFFFF;                    /* 不透明底色（输入框等） */
  --bg-hover:       rgba(99, 102, 241, 0.06);   /* 列表悬停底色 */
  --bg-active:      rgba(99, 102, 241, 0.10);   /* 激活底色 */

  /* 文字 */
  --text-1:         #0F172A;                    /* 主文字 */
  --text-2:         #64748B;                    /* 次要文字 */
  --text-3:         #94A3B8;                    /* 弱化文字 */

  /* 边框 */
  --border:         rgba(148, 163, 184, 0.18);  /* 通用边框 */

  /* 圆角 */
  --r-panel:        24px;                       /* 大卡片/面板 */
  --r-card:         16px;                       /* 小卡片/列表项 */
  --r-control:      14px;                       /* 按钮/输入框/下拉框 */
  --r-badge:        9999px;                     /* 标签/徽章/头像 */
  --r-thumb:        12px;                       /* 图片缩略图 */
  --r-modal:        28px;                       /* 模态框 */

  /* 阴影（柔和有色彩倾向） */
  --shadow-card:    0 4px 24px rgba(99, 102, 241, 0.08);
  --shadow-card-hover: 0 12px 40px rgba(99, 102, 241, 0.16);
  --shadow-btn:     0 6px 20px rgba(99, 102, 241, 0.35);
  --shadow-modal:   0 24px 80px rgba(15, 23, 42, 0.24);
  --shadow-input:   0 0 0 4px rgba(99, 102, 241, 0.12); /* 输入聚焦光环 */

  /* 时长与缓动 */
  --dur-micro:      150ms;                      /* 微交互 */
  --dur:            250ms;                      /* 常规 */
  --dur-page:       400ms;                      /* 页面级 */
  --ease:           cubic-bezier(0.4, 0, 0.2, 1);   /* 标准缓动 */
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1); /* 弹性缓动 */

  /* 毛玻璃 */
  --blur:           20px;

  /* 间距栅格（4px 基准） */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px; --sp-12: 48px;

  /* 字体 */
  --font: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
}

/* 深色模式变量覆盖（切换 <html class="dark"> 即整体换肤） */
html.dark {
  --bg:             #0B0F1A;                    /* 深色页面底色 */
  --bg-card:        rgba(30, 41, 59, 0.6);      /* 深色毛玻璃卡片 */
  --bg-solid:       #1E293B;                    /* 深色不透明底 */
  --bg-hover:       rgba(148, 163, 184, 0.08);  /* 深色悬停底 */
  --bg-active:      rgba(139, 92, 246, 0.16);   /* 深色激活底 */
  --text-1:         #F1F5F9;                    /* 深色主文字（反色） */
  --text-2:         #94A3B8;                    /* 深色次要文字 */
  --text-3:         #64748B;                    /* 深色弱化文字 */
  --border:         rgba(148, 163, 184, 0.16);  /* 深色边框 */
  --shadow-card:    0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-modal:   0 24px 80px rgba(0, 0, 0, 0.6);
}

/* ============ 二、重置与基础 ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;                 /* 字间距 -0.01em */
  color: var(--text-1);
  background: var(--bg);
  min-height: 100vh;
  /* 两个模糊光斑：紫色 + 青色，模糊 120px，透明度 0.25 */
  background-image:
    radial-gradient(600px 600px at 12% -6%, rgba(168, 85, 247, 0.25), transparent 60%),
    radial-gradient(700px 700px at 96% 4%, rgba(34, 211, 238, 0.25), transparent 60%);
  background-repeat: no-repeat;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  overflow-x: hidden;
}

/* 页面主体区域 */
.site-main { min-height: calc(100vh - 160px); }

img, svg { display: inline-block; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text-1); }

/* 容器：居中定宽 */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ============ 三、通用组件 ============ */

/* --- 毛玻璃面板 --- */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-card);
}

/* --- 按钮 --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-control);
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform var(--dur-micro) var(--ease),
              box-shadow var(--dur-micro) var(--ease),
              background-color var(--dur-micro) var(--ease),
              color var(--dur-micro) var(--ease),
              opacity var(--dur-micro) var(--ease);
  user-select: none; white-space: nowrap;
}
.btn:hover  { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); filter: brightness(1.04); }
.btn:active { transform: scale(0.97); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* 主按钮：渐变 + 品牌色阴影 + 悬停发光 */
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { box-shadow: 0 8px 28px rgba(139, 92, 246, 0.5); }

/* 次按钮：浅色底 */
.btn-secondary { background: var(--bg-active); color: var(--primary); }
.btn-secondary:hover { background: rgba(99, 102, 241, 0.16); }

/* 幽灵按钮：透明底 + 边框 */
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-hover); }

/* 危险按钮 */
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3); }
.btn-danger:hover { box-shadow: 0 8px 26px rgba(239, 68, 68, 0.45); }

/* 尺寸 */
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* 按钮加载态：内部文字淡出 + 居中旋转圈 */
.btn.loading { pointer-events: none; position: relative; color: transparent !important; }
.btn.loading::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* --- 图标按钮 --- */
.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-badge);
  color: var(--text-2);
  transition: transform var(--dur-micro) var(--ease),
              background-color var(--dur-micro) var(--ease),
              color var(--dur-micro) var(--ease);
}
.icon-btn:hover  { background: var(--bg-hover); color: var(--primary); transform: translateY(-2px); }
.icon-btn:active { transform: scale(0.94); }

/* 太阳/月亮图标互显（深色模式切换，带旋转过渡） */
.icon-moon { display: none; }
html.dark .icon-sun { display: none; }
html.dark .icon-moon { display: inline-block; }
#themeToggle svg { transition: transform 0.5s var(--ease-spring); }
#themeToggle:hover svg { transform: rotate(60deg); }

/* --- 输入框 --- */
.input, .select, textarea.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  background: var(--bg-solid);
  transition: border-color var(--dur-micro) var(--ease),
              box-shadow var(--dur-micro) var(--ease),
              transform var(--dur-micro) var(--ease);
}
.input::placeholder, textarea.input::placeholder { color: var(--text-3); }
.input:hover { border-color: rgba(99, 102, 241, 0.4); }
/* 聚焦：边框渐变 + 外发光光环 + 轻微放大 */
.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  border-color: transparent;
  background-image: linear-gradient(var(--bg-solid), var(--bg-solid)), var(--gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: var(--shadow-input);
  transform: scale(1.01);
}

/* 输入错误态：边框变红 */
.input.input-error {
  border-color: var(--danger);
  background-image: none;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
  animation: shake 0.4s var(--ease);
}

/* --- 标签 --- */
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

/* --- 徽章（状态标签） --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px;
  border-radius: var(--r-badge);
  font-size: 12px; font-weight: 600;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.badge-success { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.badge-danger  { background: rgba(239, 68, 68, 0.12);  color: var(--danger); }
.badge-muted   { background: var(--bg-hover); color: var(--text-2); }
.badge-primary { background: rgba(99, 102, 241, 0.12); color: var(--primary); }

/* --- 头像 --- */
.avatar {
  width: 38px; height: 38px;
  border-radius: var(--r-badge);
  background: var(--gradient);
  color: #fff;
  font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-btn);
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }

/* --- 骨架屏（shimmer 扫光） --- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-hover);
  border-radius: var(--r-card);
}
/* shimmer 扫光：从左到右循环 */
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 1.4s infinite;
}
html.dark .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); }
.skeleton-line { height: 14px; border-radius: 6px; margin-bottom: 8px; }
.skeleton-line:last-child { margin-bottom: 0; }

/* --- 空状态 --- */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-3); }
.empty-icon { font-size: 52px; margin-bottom: 16px; animation: float 3s ease-in-out infinite; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-desc { font-size: 13px; margin-bottom: 20px; }

/* --- 进度条（渐变填充，300ms 过渡） --- */
.progress {
  height: 6px; border-radius: 9999px;
  background: var(--bg-hover);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--gradient);
  border-radius: 9999px;
  width: 0%;
  transition: width 300ms var(--ease);
}
.progress-bar.success { background: var(--success); }
.progress-bar.danger  { background: var(--danger); }

/* --- 开关 Switch --- */
.switch { position: relative; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  width: 44px; height: 24px;
  border-radius: 9999px;
  background: var(--border);
  transition: background-color var(--dur) var(--ease);
  display: inline-flex; align-items: center; padding: 2px;
}
.switch-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform var(--dur) var(--ease-spring);
}
.switch input:checked + .switch-track { background: var(--gradient); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--shadow-input); }

/* --- 分段控件（胶囊形，选中项滑动渐变背景块） --- */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-badge);
  background: var(--bg-hover);
  border: 1px solid var(--border);
}
.segmented button {
  position: relative; z-index: 1;
  padding: 7px 18px;
  border-radius: var(--r-badge);
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  transition: color var(--dur) var(--ease);
}
.segmented button:hover { color: var(--text-1); }
.segmented button.active { color: #fff; }
/* 滑动渐变背景块 */
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  border-radius: var(--r-badge);
  background: var(--gradient);
  box-shadow: var(--shadow-btn);
  transition: left var(--dur) var(--ease), width var(--dur) var(--ease);
  z-index: 0;
}

/* --- Tooltip（纯 CSS，hover 300ms 后淡入上移） --- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--text-1); color: var(--bg);
  font-size: 12px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  transition-delay: 0s;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); transition-delay: 300ms; }

/* --- Toast（顶部滑入 + 淡入，3 秒后滑出） --- */
#toastStack {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  border-radius: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  font-size: 14px; font-weight: 500; color: var(--text-1);
  opacity: 0;
  transform: translateY(-24px) scale(0.96);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-spring);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.hide  { opacity: 0; transform: translateY(-24px) scale(0.96); }
.toast-icon {
  width: 22px; height: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #fff; font-size: 12px; font-weight: 700;
  animation: bounce-in 0.45s var(--ease-spring);
}
.toast-success .toast-icon { background: var(--success); }
.toast-error   .toast-icon { background: var(--danger); }
.toast-warning .toast-icon { background: var(--warning); }
.toast-info    .toast-icon { background: var(--primary); }

/* --- 模态框 --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  /* 背景透明度 0→1 + 毛玻璃 */
  background: rgba(15, 23, 42, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background-color var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease);
}
.modal-overlay.show {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal {
  width: 100%; max-width: 480px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--r-modal);
  box-shadow: var(--shadow-modal);
  padding: 28px;
  /* 内容缩放 0.94→1 + 位移 12px→0 */
  opacity: 0;
  transform: scale(0.94) translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-spring);
}
.modal-overlay.show .modal { opacity: 1; transform: scale(1) translateY(0); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { margin-bottom: 20px; }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; }
.modal-foot .btn { flex: 0 1 auto; }
/* 锁定 body 滚动（JS 加类） */
body.modal-open { overflow: hidden; }

/* --- 字段组 --- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

/* --- 开关行（文字 + Switch） --- */
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 500;
}

/* ============ 四、导航栏 ============ */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: transparent;              /* 默认透明 */
  transition: background-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              backdrop-filter var(--dur) var(--ease);
}
/* 滚动后：毛玻璃吸顶（JS 加 scrolled 类） */
.navbar.scrolled {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-card);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
/* Logo */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-btn);
  transition: transform var(--dur) var(--ease-spring);
}
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
.brand-text { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }

/* 中部导航项 */
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-control);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur-micro) var(--ease);
}
.nav-link:hover  { color: var(--text-1); background: var(--bg-hover); transform: translateY(-1px); }
/* 当前项：下方滑动渐变下划线 */
.nav-link.active { color: var(--primary); }
.nav-link.active::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 2px;
  height: 3px; border-radius: 9999px;
  background: var(--gradient);
  animation: slide-in 0.35s var(--ease);
}

/* 右侧操作区 */
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* 用户头像下拉菜单 */
.user-menu { position: relative; }
.user-menu .avatar { cursor: pointer; transition: transform var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease); }
.user-menu .avatar:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45); }
/* 下拉面板：缩放 + 淡入 */
.dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 240px;
  padding: 8px;
  border-radius: var(--r-card);
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  opacity: 0; visibility: hidden;
  transform: scale(0.92) translateY(-6px);
  transform-origin: top right;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-spring), visibility var(--dur);
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: scale(1) translateY(0); }
.dropdown-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.dropdown-user { min-width: 0; }
.dropdown-email {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dropdown-sub { font-size: 12px; color: var(--text-3); }
.dropdown-item {
  display: flex; align-items: center; width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px; color: var(--text-2);
  text-align: left;
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-1); transform: translateX(2px); }
.dropdown-danger { color: var(--danger); }
.dropdown-danger:hover { background: rgba(239, 68, 68, 0.08); color: var(--danger); }

/* 汉堡按钮 */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; padding: 8px;
  border-radius: 10px;
  transition: background-color var(--dur-micro) var(--ease);
}
.hamburger:hover { background: var(--bg-hover); }
.hamburger span {
  display: block; height: 2px; width: 100%;
  border-radius: 2px;
  background: var(--text-1);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端抽屉 */
.drawer-mask {
  position: fixed; inset: 0; z-index: 1400;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
.drawer-mask.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1450;
  width: 280px;
  background: var(--bg-solid);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  padding: 20px;
  display: flex; flex-direction: column;
  /* 从右侧滑入 */
  transform: translateX(100%);
  transition: transform var(--dur-page) var(--ease);
}
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.drawer-links { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.drawer-link {
  padding: 12px 14px;
  border-radius: var(--r-control);
  font-size: 15px; font-weight: 500; color: var(--text-2);
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.drawer-link:hover { background: var(--bg-hover); color: var(--text-1); }
.drawer-link.active { background: var(--bg-active); color: var(--primary); }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.drawer-email { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 五、认证页（登录/注册） ============ */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 32px 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  padding: 36px 32px;
  /* 入场：透明度 0→1 + 位移 16px→0 */
  animation: fade-up 0.5s var(--ease) backwards;
}
.auth-logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 24px; }
.auth-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; letter-spacing: -0.02em; }
.auth-sub { font-size: 13px; color: var(--text-3); text-align: center; margin-bottom: 28px; }
.auth-link-row { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-2); }
.auth-link-row a { color: var(--primary); font-weight: 600; }
.auth-link-row a:hover { text-decoration: underline; }
/* 密码可见切换按钮 */
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); border-radius: 8px;
  transition: color var(--dur-micro) var(--ease);
}
.input-eye:hover { color: var(--primary); }
/* 发送验证码按钮（含 60 秒倒计时） */
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; min-width: 0; }
.code-send { flex: none; white-space: nowrap; }
/* 验证码 6 格输入 */
.code-box { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.code-box .input {
  width: 44px; height: 52px;
  text-align: center; font-size: 20px; font-weight: 700;
  padding: 0;
}

/* ============ 六、上传页 ============ */
.upload-hero { text-align: center; margin: 40px 0 28px; }
.upload-hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.upload-hero p { color: var(--text-3); font-size: 14px; }
.upload-hero h1 .grad { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 大型拖拽上传区 */
.dropzone {
  position: relative;
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--r-panel);
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-card);
  padding: 64px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}
.dropzone:hover { border-color: var(--primary); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
/* 拖入时：虚线 + 呼吸发光 + 缩放 1.02 */
.dropzone.dragging {
  border-color: var(--primary-2);
  border-style: solid;
  background: var(--bg-active);
  transform: scale(1.02);
  animation: breath 1.2s ease-in-out infinite;
}
.dropzone.disabled { pointer-events: none; opacity: 0.6; }
.dropzone-icon { font-size: 56px; color: var(--primary); margin-bottom: 16px; display: inline-block; }
/* 悬浮云朵图标：缓慢上下浮动 */
.dropzone-icon svg { animation: float 3.2s ease-in-out infinite; filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.3)); }
.dropzone-text { font-size: 17px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.dropzone-text .pick { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.dropzone-hint { font-size: 13px; color: var(--text-3); }

/* 上传队列 */
.upload-queue { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.queue-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  border-radius: var(--r-card);
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  animation: fade-up 0.4s var(--ease) backwards;
}
.qi-icon {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-thumb);
  background: var(--bg-active);
  color: var(--primary);
  font-weight: 700; font-size: 13px; text-transform: uppercase;
}
.qi-main { flex: 1; min-width: 0; }
.qi-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qi-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.qi-progress { margin-top: 8px; }
.qi-right { flex: none; display: flex; align-items: center; gap: 10px; }
.qi-percent { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 42px; text-align: right; }
/* 上传成功：绿色对勾弹跳 */
.qi-check {
  width: 26px; height: 26px;
  display: none; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--success);
  color: #fff; font-size: 13px; font-weight: 700;
  animation: bounce-in 0.5s var(--ease-spring);
}
.queue-item.done .qi-check { display: inline-flex; }
.queue-item.done .qi-percent { display: none; }
.queue-item.error .qi-name { color: var(--danger); }

/* ============ 七、我的文件页 ============ */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 32px 0 20px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }

/* 顶部工具栏 */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-card);
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar-search { flex: 1; min-width: 200px; position: relative; }
.toolbar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.toolbar-search .input { padding-left: 38px; }
/* 搜索框聚焦：边框渐变发光 + 轻微放大（输入框聚焦样式已覆盖） */
.toolbar .select { width: auto; min-width: 140px; }
.view-toggle { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-hover); border: 1px solid var(--border); }
.view-toggle button {
  width: 36px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-3);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.view-toggle button.active { background: var(--bg-solid); color: var(--primary); box-shadow: var(--shadow-card); }
.view-toggle button:hover { transform: scale(1.08); }

/* 文件卡片网格 */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
/* 列表视图 */
.files-list { display: flex; flex-direction: column; gap: 10px; }

/* 文件卡片 */
.file-card {
  position: relative;
  padding: 16px;
  border-radius: 20px;                    /* 卡片圆角 20px */
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  /* 入场：透明度 + 位移，JS 按索引加 40ms 延迟；backwards 填充避免动画结束后覆盖 hover 效果 */
  animation: fade-up 0.45s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.file-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(99, 102, 241, 0.3);
}
.file-card:active { transform: scale(0.98); }
.file-card.selected {
  border-color: transparent;
  /* 选中卡片：渐变描边 */
  background-image: linear-gradient(var(--bg-solid), var(--bg-solid)), var(--gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: var(--shadow-card-hover);
}
html.dark .file-card.selected { background-image: linear-gradient(rgba(30,41,59,0.9), rgba(30,41,59,0.9)), var(--gradient); }

/* 缩略图区 */
.file-thumb {
  height: 130px;
  border-radius: var(--r-thumb);
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--bg-hover);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur) var(--ease); }
.file-card:hover .file-thumb img { transform: scale(1.05); }
.file-thumb .thumb-icon { font-size: 44px; color: var(--primary); opacity: 0.85; }

/* 文件信息 */
.file-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.file-meta { font-size: 12px; color: var(--text-3); }

/* 右上角悬浮操作按钮：默认透明，hover 淡入下移 */
.file-actions {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 6px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.file-card:hover .file-actions,
.file-card.selected .file-actions { opacity: 1; transform: translateY(0); }
.file-action {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  color: var(--text-2);
  transition: transform var(--dur-micro) var(--ease),
              color var(--dur-micro) var(--ease),
              box-shadow var(--dur-micro) var(--ease),
              background-color var(--dur-micro) var(--ease);
}
.file-action:hover { transform: translateY(-2px); color: var(--primary); box-shadow: var(--shadow-card-hover); }
.file-action.danger:hover { color: var(--danger); }

/* 批量选择勾选框（缩放动画） */
.file-check {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border);
  background: var(--bg-solid);
  display: none; align-items: center; justify-content: center;
  transition: transform var(--dur-micro) var(--ease-spring), border-color var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease);
}
.file-card.batch .file-check { display: inline-flex; }
.file-card.selected .file-check {
  background: var(--gradient); border-color: transparent;
  transform: scale(1.1);
}
.file-check svg { color: #fff; width: 12px; height: 12px; opacity: 0; transition: opacity var(--dur-micro) var(--ease); }
.file-card.selected .file-check svg { opacity: 1; }

/* 列表视图卡片样式 */
.files-list .file-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; animation: fade-up 0.4s var(--ease) backwards; }
.files-list .file-thumb { width: 48px; height: 48px; margin: 0; flex: none; }
.files-list .file-thumb .thumb-icon { font-size: 24px; }
.files-list .file-body { flex: 1; min-width: 0; }
.files-list .file-name { margin: 0; }
.files-list .file-actions { position: static; opacity: 1; transform: none; }

/* 分页：加载更多 */
.load-more-wrap { text-align: center; margin: 28px 0; }
.load-more-hint { font-size: 13px; color: var(--text-3); margin-top: 10px; }

/* 批量操作栏 */
.batch-bar {
  position: sticky; bottom: 20px; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 20px auto; max-width: 560px;
  padding: 12px 18px;
  border-radius: var(--r-card);
  background: var(--bg-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  animation: fade-up 0.3s var(--ease) both;
}
.batch-bar .btn { flex: none; }

/* ============ 八、分享管理页 ============ */
.share-list { display: flex; flex-direction: column; gap: 12px; }
.share-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border-radius: var(--r-card);
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  animation: fade-up 0.4s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  flex-wrap: wrap;
}
.share-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.share-icon {
  width: 46px; height: 46px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-thumb);
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.share-main { flex: 1; min-width: 200px; }
.share-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.share-meta .dot { margin: 0 4px; }
/* 倒计时颜色：>3天灰 / <3天橙 / <1天红闪 */
.countdown { font-weight: 600; }
.countdown.mid  { color: var(--warning); }
.countdown.late { color: var(--danger); animation: blink 1s infinite; }
.share-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }

/* ============ 九、游客分享页 ============ */
.share-page {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  overflow: hidden;
}
/* 动态光斑：缓慢漂移 */
.share-bg { position: absolute; inset: 0; pointer-events: none; }
.share-bg .orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: drift 12s ease-in-out infinite alternate;
}
.share-bg .orb-1 { width: 320px; height: 320px; left: -80px; top: -60px; background: #8B5CF6; }
.share-bg .orb-2 { width: 280px; height: 280px; right: -60px; bottom: -80px; background: #22D3EE; animation-delay: -4s; }
.share-bg .orb-3 { width: 200px; height: 200px; left: 40%; top: 60%; background: #6366F1; opacity: 0.35; animation-delay: -8s; }

.share-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  padding: 36px 32px;
  text-align: center;
  /* 入场：下方淡入 + 轻微放大 */
  animation: fade-up-scale 0.55s var(--ease) both;
}
.share-file-icon {
  width: 84px; height: 84px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 24px;
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-btn);
  /* 光晕 */
  animation: glow 2.4s ease-in-out infinite;
}
.share-file-icon svg { width: 40px; height: 40px; }
.share-name-big { font-size: 18px; font-weight: 700; margin-bottom: 6px; word-break: break-all; }
.share-meta-big { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }
.share-meta-big .dot { margin: 0 6px; }

/* 提取码 4 个独立输入框 */
.extract-box { display: flex; gap: 10px; justify-content: center; margin: 22px 0; }
.extract-input {
  width: 52px; height: 60px;
  text-align: center;
  font-size: 22px; font-weight: 700;
  border-radius: var(--r-control);
  border: 1px solid var(--border);
  background: var(--bg-solid);
  transition: border-color var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}
.extract-input:focus {
  outline: none;
  border-color: transparent;
  background-image: linear-gradient(var(--bg-solid), var(--bg-solid)), var(--gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: var(--shadow-input);
  transform: scale(1.05);
}
/* 错误抖动 */
.extract-box.shake .extract-input { border-color: var(--danger); animation: shake 0.45s var(--ease); }

/* 下载按钮加载态与进度 */
.download-zone { margin-top: 16px; }
.download-progress { margin-top: 16px; display: none; }
.download-progress.show { display: block; }

/* 失效提示（过期/不存在/用完） */
.share-fail { padding: 16px 0; }
.share-fail .fail-icon {
  width: 72px; height: 72px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-3);
  animation: float 3s ease-in-out infinite;
}
.share-fail h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.share-fail p { font-size: 13px; color: var(--text-3); }

/* ============ 十、页脚 ============ */
.footer { margin-top: 48px; padding: 24px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.footer-muted { font-size: 12px; }

/* ============ 十一、关键帧动画 ============ */
@keyframes spin { to { transform: rotate(360deg); } }                      /* 旋转圈 */
@keyframes fade-up {                                                       /* 卡片入场：透明 + 上移 */
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-up-scale {                                                 /* 分享卡片入场：下方淡入放大 */
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } } /* 骨架屏扫光 */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } } /* 悬浮漂浮 */
@keyframes breath {                                                       /* 呼吸发光 */
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.35), var(--shadow-card); }
  50%      { box-shadow: 0 0 36px 6px rgba(139, 92, 246, 0.28), var(--shadow-card-hover); }
}
@keyframes bounce-in {                                                    /* 弹跳入场（对勾/图标） */
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
@keyframes shake {                                                        /* 错误抖动 */
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }       /* 紧急闪烁 */
@keyframes slide-in { from { transform: scaleX(0); } to { transform: scaleX(1); } } /* 导航下划线滑入 */
@keyframes drift {                                                         /* 光斑漂移 */
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, -30px) scale(1.15); }
}
@keyframes glow {                                                          /* 图标光晕呼吸 */
  0%, 100% { box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35); }
  50%      { box-shadow: 0 6px 44px rgba(139, 92, 246, 0.6); }
}

/* 列表项按索引交错入场（JS 设置 --i 变量与动画延迟；backwards 避免覆盖 hover） */
.stagger { animation: fade-up 0.45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); }

/* ============ 十二、响应式（桌面 / 平板 / 手机） ============ */
@media (max-width: 900px) {
  .nav-links { display: none; }          /* 平板：隐藏中部导航，用抽屉 */
  .hamburger { display: inline-flex; }
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .auth-card { padding: 28px 20px; }
  .upload-hero h1 { font-size: 22px; }
  .dropzone { padding: 44px 16px; }
  .files-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .file-thumb { height: 100px; }
  .share-item { padding: 14px 16px; }
  .toolbar { padding: 12px; }
  .modal { padding: 22px 18px; }
  .footer-inner { flex-direction: column; text-align: center; }
  /* 手机上不显示"已登录"按钮文字以节省空间 */
  .nav-actions .btn-sm { padding: 6px 10px; font-size: 12px; }
}

/* 减少动效偏好：系统开启"减少动态效果"时关闭大动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
