/* ================================================================
   考试急 PWA — Layout v4.0 「排版 Editorial」
   ----------------------------------------------------------------
   核心变化（相对 v3.0）：
   1. 去掉深色噪点背景纹理（本方案用纯白纸面，噪点会显脏）
   2. 导航栏：去掉阴影与模糊，用 1px 线分层；标题改为左对齐排版
   3. TabBar：改为"文字 + 顶部短横线"，字号缩小字距加大（杂志栏目感）
   4. 卡片边距改为通栏线（容器不再左右缩进）
   5. 进度条：细线 + 橙色电流头
   ================================================================ */

/* ================================================================
   App 容器
   ================================================================ */

#app {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-height));
  min-height: calc(100dvh - var(--nav-height));
  padding-bottom: var(--nav-height);
}

/* 刘海屏安全区 */
@supports (padding: env(safe-area-inset-bottom)) {
  .tabbar { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--nav-height) + env(safe-area-inset-bottom)); }
}

/* ================================================================
   顶部导航栏 — 1px 线分层，左对齐排版
   ================================================================ */

.navbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: var(--space-sm) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  z-index: 100;
  border-bottom: 1px solid var(--ink);
  height: 52px;
}

.navbar-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  color: var(--ink-3);
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

/* 返回 / 图标按钮 — 触控区 ≥ 44px */
.navbar-back {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
  padding: var(--space-xs) 0;
  border-radius: 0;
  transition: color var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
  white-space: nowrap;
  background: transparent;
  border: none;
}
.navbar-back:active { color: var(--accent); }

/* 右侧占位（保持标题居中） */
.navbar-spacer { width: 44px; flex-shrink: 0; }

/* ================================================================
   底部 Tab 栏 — 文字 + 顶部短横线
   ================================================================ */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: var(--nav-height);
  background: var(--bg);
  display: flex;
  border-top: 1px solid var(--ink);
  z-index: 100;
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  gap: 4px;
  transition: color var(--duration-fast) var(--ease-default);
  position: relative;
}

.tabbar-item.active { color: var(--ink); }

/* 活动指示：顶部短横线（从中间生长） */
.tabbar-item.active::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  width: 26px;
  height: 3px;
  background: var(--ink);
  transform: translateX(-50%);
  animation: tabIndicator var(--duration-normal) var(--ease-default);
}
@keyframes tabIndicator {
  from { transform: translateX(-50%) scaleX(0); }
  to   { transform: translateX(-50%) scaleX(1); }
}

.tabbar-item .tab-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tabbar-item .tab-icon svg { width: 22px; height: 22px; }

/* 向后兼容 — JS 中的 .icon（emoji 时代遗留，待阶段 3 替换为 SVG） */
.tabbar-item .icon {
  font-size: 20px;
  line-height: 1;
  transition: transform var(--duration-fast) var(--ease-default);
}
.tabbar-item:active .icon { transform: translateY(-1px); }

/* ================================================================
   页面内容区
   ================================================================ */

.page-content { padding: var(--space-md) var(--gutter); }

/* ================================================================
   空状态 — 留白 + 排版（不用插画色块）
   ================================================================ */

.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--gutter);
  color: var(--ink-2);
}
.empty-state .empty-icon,
.empty-state .icon {
  display: block;
  margin: 0 auto var(--space-md);
  color: var(--ink-3);
  font-size: 34px;
  line-height: 1;
}
.empty-state .empty-title,
.empty-state .title {
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-snug);
  color: var(--ink);
  margin-bottom: var(--space-xs);
}
.empty-state .empty-desc,
.empty-state p {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink-2);
  max-width: 280px;
  margin: 0 auto;
}

/* ================================================================
   进度 — 细线 + 橙色电流头 + 衬线大数字
   ================================================================ */

.progress-wrap {
  text-align: center;
  padding: var(--space-2xl) var(--gutter);
  max-width: 400px;
  margin: 0 auto;
}

.progress-bar {
  width: 100%;
  height: 2px;
  background: var(--bg-sunk);
  border-radius: 0;
  overflow: hidden;
  margin: var(--space-lg) 0 0 0;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0;
  width: 0%;
  box-shadow: 8px 0 10px rgba(232, 84, 30, 0.4);   /* 电流拖尾 */
  transition: width var(--duration-slow) var(--ease-default);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: var(--space-sm);
}
.progress-text {
  font-size: var(--text-sm);
  color: var(--ink-2);
  margin: 0;
  letter-spacing: 0.03em;
}
.progress-pct {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-normal);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.progress-stage {
  font-size: var(--text-xs);
  color: var(--ink-3);
  letter-spacing: var(--tracking-wide);
  margin-top: var(--space-xs);
}

/* ================================================================
   响应式 — 平板及以上居中（保持纸面通栏线）
   ================================================================ */

@media (min-width: 600px) {
  body {
    max-width: 600px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

@media (min-width: 768px) {
  body { max-width: 760px; }
  .tabbar { max-width: 760px; }
  .navbar { padding: var(--space-sm) var(--space-xl); }
  .page-content { padding: var(--space-lg) var(--space-xl); }
  :root { --gutter: 32px; }
}

@media (min-width: 1024px) {
  body { max-width: 900px; }
  .tabbar { max-width: 900px; }
}
