:root {
  --text: #0b3d2b;
  --text-soft: rgba(11, 61, 43, 0.62);
  --accent: #178a5a;
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-bg-strong: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 8px 32px rgba(30, 90, 60, 0.16);
  --bg-gradient: linear-gradient(135deg, #d8f3e5 0%, #c7edda 35%, #b2e5cb 70%, #cbeedd 100%);
  --radial-a: rgba(122, 214, 168, 0.5);
  --radial-b: rgba(95, 200, 150, 0.45);
  --radial-c: rgba(170, 232, 200, 0.5);
  --blob-a: #8fd9b2;
  --blob-b: #67cc96;
  --blob-c: #bfe9d1;
  --hero-text: linear-gradient(135deg, #0b3d2b 0%, #178a5a 55%, #2fae79 100%);
  --btn-grad: linear-gradient(135deg, #a3e6c4, #55c792);
  --btn-fg: #0b3d2b;
  --btn-glow: rgba(85, 199, 146, 0.4);
  --btn-glow-strong: rgba(85, 199, 146, 0.55);
  --icon-grad: linear-gradient(135deg, rgba(163, 230, 196, 0.6), rgba(85, 199, 146, 0.4));
  --tag-avail-bg: rgba(23, 138, 90, 0.15);
  --tag-avail-fg: #178a5a;
}

/* 云盘页：水蜜桃嫩粉主题 */
.theme-pink {
  --text: #7c2140;
  --text-soft: rgba(124, 33, 64, 0.6);
  --accent: #d6336c;
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-bg-strong: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 8px 32px rgba(170, 50, 90, 0.16);
  --bg-gradient: linear-gradient(135deg, #ffe6ec 0%, #ffd7e1 35%, #ffc7d4 70%, #ffd9e3 100%);
  --radial-a: rgba(255, 150, 180, 0.5);
  --radial-b: rgba(255, 120, 160, 0.45);
  --radial-c: rgba(255, 180, 200, 0.5);
  --blob-a: #ffb0c4;
  --blob-b: #ff9cb6;
  --blob-c: #ffccd8;
  --hero-text: linear-gradient(135deg, #7c2140 0%, #d6336c 55%, #f06595 100%);
  --btn-grad: linear-gradient(135deg, #ffc2d1, #f78fb0);
  --btn-fg: #7c2140;
  --btn-glow: rgba(240, 120, 160, 0.4);
  --btn-glow-strong: rgba(240, 120, 160, 0.55);
  --icon-grad: linear-gradient(135deg, rgba(255, 194, 209, 0.6), rgba(247, 143, 176, 0.4));
  --tag-avail-bg: rgba(214, 51, 108, 0.15);
  --tag-avail-fg: #d6336c;
}

/* 相册页：灰白主题 */
.theme-gray {
  --text: #2f3640;
  --text-soft: rgba(47, 54, 64, 0.6);
  --accent: #5b6472;
  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-bg-strong: rgba(255, 255, 255, 0.66);
  --glass-border: rgba(255, 255, 255, 0.85);
  --shadow: 0 8px 32px rgba(80, 90, 110, 0.16);
  --bg-gradient: linear-gradient(135deg, #f6f7f9 0%, #eceef1 35%, #e2e5ea 70%, #eff1f5 100%);
  --radial-a: rgba(205, 210, 220, 0.55);
  --radial-b: rgba(180, 188, 200, 0.5);
  --radial-c: rgba(225, 229, 236, 0.55);
  --blob-a: #dcdfe6;
  --blob-b: #c5cbd5;
  --blob-c: #e9ebf0;
  --hero-text: linear-gradient(135deg, #2f3640 0%, #5b6472 55%, #7d8694 100%);
  --btn-grad: linear-gradient(135deg, #e6e9ee, #c3cad4);
  --btn-fg: #2f3640;
  --btn-glow: rgba(150, 160, 175, 0.4);
  --btn-glow-strong: rgba(150, 160, 175, 0.55);
  --icon-grad: linear-gradient(135deg, rgba(230, 233, 238, 0.6), rgba(195, 202, 212, 0.4));
  --tag-avail-bg: rgba(91, 100, 114, 0.15);
  --tag-avail-fg: #5b6472;
}

/* 笔记页：淡黄主题 */
.theme-yellow {
  --text: #6b5410;
  --text-soft: rgba(107, 84, 16, 0.62);
  --accent: #c7940a;
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-bg-strong: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 8px 32px rgba(185, 150, 40, 0.16);
  --bg-gradient: linear-gradient(135deg, #fffbe8 0%, #fff4cf 35%, #ffeeb8 70%, #fff6dc 100%);
  --radial-a: rgba(250, 220, 120, 0.5);
  --radial-b: rgba(245, 205, 90, 0.45);
  --radial-c: rgba(255, 235, 170, 0.5);
  --blob-a: #ffe9a8;
  --blob-b: #f6d477;
  --blob-c: #fff3c4;
  --hero-text: linear-gradient(135deg, #6b5410 0%, #c7940a 55%, #e0b23a 100%);
  --btn-grad: linear-gradient(135deg, #ffeaa9, #f2cc6a);
  --btn-fg: #6b5410;
  --btn-glow: rgba(235, 190, 80, 0.4);
  --btn-glow-strong: rgba(235, 190, 80, 0.55);
  --icon-grad: linear-gradient(135deg, rgba(255, 234, 169, 0.6), rgba(242, 204, 106, 0.4));
  --tag-avail-bg: rgba(199, 148, 10, 0.15);
  --tag-avail-fg: #c7940a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-gradient);
}

/* ---------- 背景 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 15% 10%, var(--radial-a), transparent 60%),
    radial-gradient(1000px 700px at 85% 20%, var(--radial-b), transparent 60%),
    radial-gradient(900px 900px at 50% 100%, var(--radial-c), transparent 60%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: float 14s ease-in-out infinite;
}
.blob-1 { width: 420px; height: 420px; background: var(--blob-a); top: -120px; left: -100px; }
.blob-2 { width: 380px; height: 380px; background: var(--blob-b); bottom: -120px; right: -80px; animation-delay: -5s; }
.blob-3 { width: 260px; height: 260px; background: var(--blob-c); top: 40%; left: 60%; animation-delay: -9s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.1); }
}

/* ---------- 玻璃卡片 ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 16px;
  margin: 16px auto;
  max-width: 1100px;
  width: calc(100% - 32px);
  border-radius: 999px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--text);
}
.logo img { width: 30px; height: 30px; display: block; }
.nav-links { display: flex; gap: 20px; }
.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }

/* ---------- 主区 ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 80px 0 60px; }
.badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 1;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.12));
}
.hero-frog { width: clamp(120px, 24vw, 190px); height: auto; display: inline-block; }

/* 沿着页面底部蹦跶的小青蛙（逐帧 canvas 绘制，动作与位移同步） */
.hop-frog {
  position: fixed;
  left: 0;
  top: 0;
  width: 96px;
  height: auto;
  aspect-ratio: 191 / 450;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
  will-change: transform;
}
main,
.footer { position: relative; z-index: 2; }

/* 减弱动态时脚本只画静止的第 0 帧，不做位移 */
.subtitle {
  margin: 24px auto 0;
  max-width: 560px;
  font-size: 1.15rem;
  color: var(--text-soft);
  line-height: 1.7;
}
.hero-actions { margin-top: 36px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--btn-grad);
  color: var(--btn-fg);
  box-shadow: 0 10px 30px var(--btn-glow);
}
.btn-primary:hover { box-shadow: 0 14px 36px var(--btn-glow-strong); transform: translateY(-2px); }
.btn-ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--glass-bg-strong); }
.btn-sm { padding: 8px 18px; font-size: 0.9rem; }

/* ---------- 功能卡片 ---------- */
.features { padding: 40px 0; }
.features h2 { text-align: center; font-size: 2rem; margin-bottom: 36px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; max-width: 980px; margin: 0 auto; }
.card {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  padding: 46px 32px;
  min-height: 220px;
  text-decoration: none;
  color: inherit;
  position: relative;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.25s, background 0.25s;
}
.card:hover { transform: translateY(-6px); background: rgba(255, 255, 255, 0.38); }
.card-icon {
  width: 100px;
  height: 100px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-grad);
  border: 1px solid var(--glass-border);
}
.card-icon img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  display: block;
}
.card h3 { font-size: 1.5rem; margin-bottom: 12px; }
.card p { color: var(--text-soft); line-height: 1.6; font-size: 0.95rem; margin-bottom: 16px; }
.card-tag {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.card-tag.available { background: var(--tag-avail-bg); color: var(--tag-avail-fg); }
.card-tag.soon { background: rgba(0, 0, 0, 0.06); color: var(--text-soft); }

/* ---------- 页脚 ---------- */
.footer { text-align: center; padding: 40px 24px; color: var(--text-soft); font-size: 0.9rem; }

/* ---------- 顶部信息小部件 ---------- */
.top-widget {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 18px;
}
.widget-text { display: flex; flex-direction: column; line-height: 1.35; }
.widget-date { font-size: 0.95rem; font-weight: 700; }
.widget-week { font-size: 0.8rem; color: var(--text-soft); }
.widget-weather { font-size: 1.7rem; line-height: 1; }

/* 登录页样式见 login.css（插画版布局） */

/* ========== 云盘页 ========== */
.drive-main { max-width: 1000px; margin: 0 auto; padding: 40px 24px 80px; }
.drive-head { text-align: center; margin-bottom: 32px; }
.drive-head h1 { font-size: 2.4rem; margin-bottom: 8px; }
.drive-head p { color: var(--text-soft); }

.coming-soon {
  text-align: center;
  padding: 60px 32px;
  border-radius: 24px;
}
.coming-icon { font-size: 3.5rem; margin-bottom: 16px; }
.coming-soon p { color: var(--text-soft); font-size: 1.05rem; }

.upload-zone {
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.upload-zone.dragover { background: var(--glass-bg-strong); border-color: var(--accent); }
.upload-icon { font-size: 2.4rem; margin-bottom: 12px; }
.upload-inner p { font-size: 1.05rem; color: var(--text); }
.upload-hint { font-size: 0.85rem; opacity: 0.7; margin-top: 6px; color: var(--text-soft); }
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  padding: 0;
}

.upload-progress { margin-top: 20px; padding: 16px 20px; border-radius: 16px; }
.hidden { display: none !important; }
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--btn-grad);
  border-radius: 999px;
  transition: width 0.15s;
}
#progressText { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--text-soft); }

.files { margin-top: 24px; border-radius: 24px; padding: 24px; }
.files-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.files-head h2 { font-size: 1.2rem; }
.count { font-size: 0.9rem; color: var(--text-soft); }

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.file-card {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, background 0.2s;
}
.file-card:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.58); }
.file-thumb {
  position: relative;
  height: 120px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb-img { width: 100%; height: 100%; object-fit: cover; }
.thumb-icon { font-size: 2.6rem; }
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.9rem;
}
.file-thumb:hover .thumb-overlay { opacity: 1; }
.file-card-info { padding: 10px 12px 4px; }
.file-name { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 0.75rem; color: var(--text-soft); margin-top: 2px; }
.file-card-actions { display: flex; gap: 6px; padding: 8px 12px 12px; }
.file-card-actions .icon-btn { flex: 1; }

.icon-btn {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.75); }

.empty { text-align: center; padding: 30px; color: var(--text-soft); }

/* ---------- 预览弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.85); }
.modal-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.preview-img { max-width: 100%; max-height: 68vh; border-radius: 12px; object-fit: contain; }
.preview-media { max-width: 100%; max-height: 68vh; border-radius: 12px; }
.preview-frame { width: 100%; height: 68vh; border: none; border-radius: 12px; background: #fff; }
.preview-audio { text-align: center; padding: 30px; }
.audio-art { font-size: 4rem; margin-bottom: 12px; }
.preview-audio h3 { margin-bottom: 20px; word-break: break-all; font-size: 1.1rem; }
.preview-audio audio { width: 100%; max-width: 420px; }
.preview-text { text-align: left; width: 100%; }
.preview-text pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.6;
  max-height: 68vh;
  overflow: auto;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 16px;
  font-family: "Consolas", "Menlo", monospace;
  color: var(--text);
}
.preview-unsupported { text-align: center; padding: 40px; color: var(--text-soft); }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.modal-filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); font-size: 0.9rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero { padding: 60px 0 40px; }
  .cards { grid-template-columns: 1fr; }
  .upload-zone { padding: 28px 16px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .file-thumb { height: 100px; }
}
