/* ============ 流予刷题 · 启动页 ============ */
:root {
  --bg: #F4F5F7;
  --text: #15181E;
  --sub: #667085;
  --muted: #98A2B3;
  --line: #E6E8EF;
  --accent: #2F6BFF;
  --accent-soft: rgba(47, 107, 255, 0.08);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-hover: rgba(255, 255, 255, 0.9);
  --glass-line: rgba(255, 255, 255, 0.62);
  --glass-shadow: 0 16px 40px -22px rgba(16, 24, 40, .45), inset 0 1px 0 rgba(255, 255, 255, .38), 0 0 0 1px rgba(16, 24, 40, .07);
  --glass-blur: blur(30px) saturate(1.9);
}
[data-theme="dark"] {
  --bg: #0F1115;
  --text: #F2F4F8;
  --sub: #98A2B3;
  --muted: #6B7480;
  --line: #262B35;
  --accent: #5B9BFF;
  --accent-soft: rgba(91, 155, 255, 0.14);
  --glass: rgba(18, 21, 27, 0.52);
  --glass-strong: rgba(22, 26, 33, 0.72);
  --glass-hover: rgba(34, 39, 49, 0.8);
  --glass-line: rgba(255, 255, 255, 0.13);
  --glass-shadow: 0 16px 40px -22px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 0 1px rgba(255, 255, 255, .09);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden; -webkit-user-select: none; user-select: none;
  font-size: 14px; line-height: 1.5;
}
button { font-family: inherit; color: inherit; }

.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); }
.bg-img {
  position: absolute; inset: -2%;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  opacity: 0; transition: opacity 1s var(--ease);
  animation: drift 70s ease-in-out infinite alternate;
}
.bg-img.on { opacity: 1; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06) translate3d(-1%, -1.2%, 0); } }
.bg-veil {
  position: absolute; inset: 0;
  background: radial-gradient(1100px 700px at 50% 40%, rgba(255,255,255,.08), rgba(255,255,255,0) 70%),
    linear-gradient(180deg, rgba(250,251,253,.04), rgba(246,247,250,.14));
}
[data-theme="dark"] .bg-veil {
  background: radial-gradient(1100px 700px at 50% 40%, rgba(8,10,13,.14), rgba(8,10,13,0) 70%),
    linear-gradient(180deg, rgba(8,10,13,.16), rgba(12,14,18,.28));
}

.app { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.topbar { flex: 0 0 auto; height: 58px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}
.logo {
  width: 29px; height: 29px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #2F6BFF, #00C2D1);
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(47,107,255,.7);
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.brand-sub { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; color: var(--muted); padding-top: 2px; }
.today {
  font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums;
  padding: 6px 13px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}

main { flex: 1 1 auto; min-height: 0; display: flex; }
.home {
  width: 100%; max-width: 880px; margin: auto;
  padding: 10px 34px 40px;
  display: flex; flex-direction: column; gap: 22px;
}
.hello-title {
  font-size: 25px; font-weight: 700; letter-spacing: -.4px;
  color: #fff;
  text-shadow: 0 1px 16px rgba(8, 12, 22, .38);
}
.hello-sub {
  font-size: 12.5px; color: rgba(255, 255, 255, .84); margin-top: 5px;
  text-shadow: 0 1px 12px rgba(8, 12, 22, .32);
}
[data-theme="dark"] .hello-title { color: var(--text); text-shadow: none; }
[data-theme="dark"] .hello-sub { color: var(--sub); text-shadow: none; }
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.module {
  position: relative; overflow: hidden; text-align: left;
  display: flex; flex-direction: column; gap: 0;
  padding: 22px 22px 18px;
  border-radius: 22px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s;
}
.module::after {
  content: ""; position: absolute; right: -56px; top: -70px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(47,107,255,.16), rgba(47,107,255,0) 70%);
  pointer-events: none;
}
.module:hover { transform: translateY(-3px); background: var(--glass-hover); box-shadow: 0 26px 52px -26px rgba(16,24,40,.4), var(--glass-shadow); }
.module:active { transform: scale(.99); }
.module-head { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.module-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700; color: #fff;
}
.module-ico.vocab { background: linear-gradient(150deg, #2F6BFF, #00C2D1); box-shadow: 0 8px 18px -8px rgba(47,107,255,.8); }
.module-ico.quiz { background: linear-gradient(150deg, #10B981, #059669); box-shadow: 0 8px 18px -8px rgba(16,185,129,.8); }
.module-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  color: var(--sub); padding: 3px 9px; border-radius: 999px;
  background: rgba(127,127,137,.12);
}
.module-name { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.module-sub { font-size: 12px; color: var(--sub); margin-top: 4px; }
.module-stats {
  display: flex; gap: 16px; margin-top: 16px;
  font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums;
}
.module-stats b { color: var(--text); font-size: 14px; font-weight: 700; margin-left: 2px; }
.module-bar { height: 6px; border-radius: 999px; background: rgba(127,127,137,.16); overflow: hidden; margin-top: 13px; }
.module-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #2F6BFF, #00C2D1); transition: width .6s var(--ease); }
#modQuiz .module-bar i { background: linear-gradient(90deg, #10B981, #34D399); }
.module-cta {
  margin-top: 15px; font-size: 12.5px; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: 5px;
}
#modQuiz .module-cta { color: #0B9E75; }
.arrow { transition: transform .18s var(--ease); }
.module:hover .arrow { transform: translateX(3px); }
.launcher-note { font-size: 11.5px; color: var(--sub); text-align: center; opacity: .85; }

@media (max-width: 780px) {
  .home { padding: 8px 18px 28px; }
  .modules { grid-template-columns: 1fr; }
  .hello-title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* 顶部暗色渐变：保证左上角 logo 在亮背景上可读 */
.bg-veil {
  background:
    linear-gradient(180deg, rgba(10, 14, 22, .38) 0%, rgba(10, 14, 22, .10) 16%, rgba(10, 14, 22, 0) 30%),
    radial-gradient(1100px 700px at 50% 40%, rgba(255,255,255,.06), rgba(255,255,255,0) 70%),
    linear-gradient(180deg, rgba(250,251,253,.04), rgba(246,247,250,.12));
}
.brand { background: rgba(255,255,255,.86); }
.brand-name { color: #15181E; text-shadow: 0 1px 0 rgba(255,255,255,.5); }

/* 底部随机名言 */
.quote {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(6px);
  width: min(760px, calc(100vw - 80px));
  text-align: center;
  z-index: 3;
  opacity: 0;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  pointer-events: none;
}
.quote.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.quote-text {
  font-size: 14px;
  line-height: 1.7;
  font-weight: 500;
  letter-spacing: .2px;
  color: rgba(255, 255, 255, .96);
  text-shadow: 0 1px 18px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .45);
}
.quote-author {
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .72);
  letter-spacing: 1px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .6);
}
.home { padding-bottom: 120px; }

/* ============ 丝滑动效（华为式弹簧缓动） ============ */
:root {
  --spring: cubic-bezier(.16, 1, .3, 1);
  --spring-soft: cubic-bezier(.22, 1, .36, 1);
  --pop: cubic-bezier(.34, 1.45, .64, 1);
}

/* 屏幕切换：淡入 + 轻微上浮缩放，收尾更慢更柔 */
.screen.active { animation: screenSwap .46s var(--spring) both; }
@keyframes screenSwap {
  0% { opacity: 0; transform: translateY(16px) scale(.986); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 列表逐项入场（华为式错峰） */
.book-card, .chapter, .tile, .q-item, .stat-card, .set-row, .module, .mini, .filter-block, .chapter-acc .acc-row {
  animation: itemRise .52s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 34ms);
}
@keyframes itemRise {
  from { opacity: 0; transform: translateY(14px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 选项入场 */
.opts .opt { animation: optRise .36s var(--spring-soft) both; animation-delay: calc(var(--i, 0) * 38ms); }
@keyframes optRise {
  from { opacity: 0; transform: translateY(10px) scale(.994); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 按下与悬停更柔和 */
.btn, .icon-btn, .opt, .tile, .book-card, .chapter, .q-item, .module {
  transition: transform .22s var(--spring-soft), box-shadow .3s var(--spring-soft),
              background .24s var(--spring-soft), border-color .24s var(--spring-soft), color .2s;
}
.btn:active, .icon-btn:active, .tile:active, .module:active, .book-card:active, .chapter:active, .q-item:active {
  transform: scale(.972);
}
.opt:active { transform: scale(.985); }

/* 判定 / 解析面板：上浮展开 */
.judge { animation: judgeIn .44s var(--spring) both; }
@keyframes judgeIn {
  from { opacity: 0; transform: translateY(18px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 弹窗：背景淡入 + 卡片弹簧 */
.modal { animation: veilIn .26s var(--spring-soft) both; }
.modal-card { animation: cardPop .42s var(--spring) both; }
@keyframes veilIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardPop {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 进度条 / 环形图更顺 */
.progress i, .hero-bar i, .book-bar i, .acc-bar i, .module-bar i, .chapter-bar i, .ring .ring-fg {
  transition: width .75s var(--spring), stroke-dashoffset 1s var(--spring);
}
.progress i, .hero-bar i { }

/* 名言淡入更缓 */
.quote { transition: opacity .8s var(--spring-soft), transform .8s var(--spring-soft); }

/* 背景交叉淡入 + 缓慢推拉 */
.bg-img { transition: opacity 1.6s var(--spring-soft); }
.bg-img.on { animation: drift 90s ease-in-out infinite alternate; }

/* 主题切换柔和 */
body, .screen, .brand, .topbar { transition: background .35s var(--spring-soft), color .35s var(--spring-soft); }

@media (prefers-reduced-motion: reduce) {
  .screen.active, .book-card, .chapter, .tile, .q-item, .stat-card, .set-row, .module,
  .mini, .filter-block, .acc-row, .opts .opt, .judge, .modal, .modal-card { animation: none !important; }
}

/* ============ 更慢更柔的动效（覆盖前面的参数） ============ */
:root {
  --spring: cubic-bezier(.16, 1, .3, 1);
  --spring-soft: cubic-bezier(.25, .8, .25, 1);
  --pop: cubic-bezier(.34, 1.35, .64, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);
}

/* 旧界面淡出（与新界面交叉） */
.screen.exiting {
  display: flex !important;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  animation: screenOut .5s var(--ease-soft) both;
}
@keyframes screenOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(.988); }
}

/* 新界面：更慢更柔的入场 */
.screen.active { animation: screenSwap .68s var(--ease-soft) both; }
@keyframes screenSwap {
  0% { opacity: 0; transform: translateY(22px) scale(.98); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 列表错峰更明显 */
.book-card, .chapter, .tile, .q-item, .stat-card, .set-row, .module, .mini, .filter-block, .acc-row {
  animation: itemRise .72s var(--ease-soft) both;
  animation-delay: calc(var(--i, 0) * 52ms);
}
@keyframes itemRise {
  from { opacity: 0; transform: translateY(22px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.opts .opt {
  animation: optRise .55s var(--ease-soft) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes optRise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.judge { animation: judgeIn .62s var(--ease-soft) both; }
.modal { animation: veilIn .38s var(--ease-soft) both; }
.modal-card { animation: cardPop .56s var(--pop) both; }
@keyframes cardPop {
  from { opacity: 0; transform: translateY(24px) scale(.955); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 交互过渡更绵长 */
.btn, .icon-btn, .opt, .tile, .book-card, .chapter, .q-item, .module {
  transition: transform .34s var(--ease-soft), box-shadow .42s var(--ease-soft),
              background .34s var(--ease-soft), border-color .34s var(--ease-soft), color .28s var(--ease-soft);
}
.btn:active, .icon-btn:active, .tile:active, .module:active, .book-card:active, .chapter:active, .q-item:active { transform: scale(.966); }

.progress i, .hero-bar i, .book-bar i, .acc-bar i, .module-bar i, .chapter-bar i {
  transition: width 1.1s var(--ease-soft);
}
.ring .ring-fg { transition: stroke-dashoffset 1.3s var(--ease-soft); }

.bg-img { transition: opacity 2.2s var(--ease-soft); }
.quote { transition: opacity 1.1s var(--ease-soft), transform 1.1s var(--ease-soft); }

/* 悬停不再那么跳 */
.book-card:hover, .chapter:hover, .tile:hover, .module:hover { transform: translateY(-2px); }
.btn.primary:hover { transform: translateY(-2px); }

/* Liouy 艺术字 logo */
.brand.brand-art {
  padding: 3px 14px 4px 12px;
  background: rgba(255,255,255,.88);
  gap: 9px;
}
.brand-word {
  font-family: "Snell Roundhand", "Apple Chancery", "Savoye LET", "Brush Script MT", cursive;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: .5px;
  font-style: italic;
  background: linear-gradient(100deg, #3B3F8F 0%, #5F6DFF 38%, #8B5CF6 72%, #B06CFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 2px;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.6));
}
.brand-sub { padding-top: 1px; color: #6C7480; }

/* 模块图标：铅笔画线条 */
.module-ico { color: #fff; }
.module-ico svg { width: 27px; height: 27px; display: block; }
.module-ico { width: 44px; height: 44px; border-radius: 13px; }

/* 品牌：只留 Liouy 艺术字，无外框 */
.brand.brand-art {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  padding: 2px 2px 2px 0 !important;
}
.brand.brand-art:hover { transform: none; background: transparent !important; }
.brand-word {
  font-family: "Snell Roundhand", "Apple Chancery", "Savoye LET", "Brush Script MT", cursive;
  font-size: 27px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: .8px;
  font-style: italic;
  background: linear-gradient(100deg, #2F3470 0%, #5563F0 40%, #8B5CF6 75%, #B06CFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 6px rgba(255,255,255,.55)) drop-shadow(0 1px 0 rgba(255,255,255,.7));
}

/* 模块图标：去掉方块外框，只留铅笔线稿 */
.module-ico, .module-ico.vocab, .module-ico.quiz {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: 46px;
  height: 46px;
  color: #3E4358;
}
.module-ico svg { width: 34px; height: 34px; stroke-width: 1.55; }
.module-ico.vocab { color: #4E4AB0; }
.module-ico.quiz { color: #0F7C5C; }

/* 底部暗色渐变：底部名言在亮背景上可读 */
.bg-veil::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26%;
  background: linear-gradient(0deg, rgba(10, 14, 22, .42) 0%, rgba(10, 14, 22, .18) 45%, rgba(10, 14, 22, 0) 100%);
  pointer-events: none;
}

/* 图标位置与比例优化 + 统一蓝色（与 Liouy 渐变一致） */
.module-ico, .module-ico.vocab, .module-ico.quiz {
  width: 42px;
  height: 42px;
  margin: 0 2px 0 0;
  display: grid;
  place-items: center;
  color: #4F5BFF !important;
}
.module-ico svg { width: 32px; height: 32px; stroke-width: 1.5; }
.module-head { gap: 11px; margin-bottom: 12px; align-items: center; }
.module-tag { margin-top: 3px; }

/* Liouy 艺术字：与图标同一套蓝色渐变 */
.brand-word {
  background: linear-gradient(105deg, #3A46D8 0%, #4F5BFF 42%, #7B6CFF 74%, #9B7BFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 26px;
  letter-spacing: .6px;
  filter: drop-shadow(0 1px 7px rgba(255,255,255,.6)) drop-shadow(0 1px 0 rgba(255,255,255,.75));
}

/* 图标最终版：无标签、无外框、深灰铅笔线、放大 30% */
.module-ico, .module-ico.vocab, .module-ico.quiz {
  width: 56px; height: 56px;
  background: none !important; box-shadow: none !important; border-radius: 0 !important;
  color: #33384A !important;
  margin: 0 4px 0 0;
}
.module-ico svg { width: 43px; height: 43px; stroke-width: 1.45; }
.module-head { gap: 4px; margin-bottom: 10px; }
.module-tag { display: none !important; }

/* Liouy：明显的亮蓝渐变 */
.brand-word {
  background: linear-gradient(100deg, #2C6BFF 0%, #3F8CFF 40%, #6FB4FF 72%, #9BD0FF 100%) !important;
  -webkit-background-clip: text; background-clip: text; color: transparent !important;
  font-size: 27px; letter-spacing: .8px;
  filter: drop-shadow(0 1px 2px rgba(8, 20, 60, .45)) drop-shadow(0 0 10px rgba(120, 180, 255, .45));
}

/* 修正：渐变文字必须让 clip 也 !important */
.brand-word {
  background: linear-gradient(100deg, #2C6BFF 0%, #3F8CFF 40%, #6FB4FF 72%, #9BD0FF 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}

/* ===== 最终品牌样式（统一，放在最后覆盖）===== */
.brand.brand-art {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  padding: 2px 6px 2px 2px !important;
  gap: 0 !important;
  display: flex;
  align-items: center;
  min-height: 36px;
}
.brand.brand-art:hover { transform: none !important; background: transparent !important; }
.brand-word {
  font-family: "Snell Roundhand", "Apple Chancery", "Savoye LET", "Brush Script MT", cursive !important;
  font-size: 27px !important;
  line-height: 1.1 !important;
  font-style: italic;
  font-weight: 500;
  letter-spacing: .8px;
  background: linear-gradient(100deg, #2C6BFF 0%, #3F8CFF 40%, #6FB4FF 72%, #9BD0FF 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 1px 2px rgba(8, 20, 60, .42)) drop-shadow(0 0 10px rgba(120, 180, 255, .42));
}
