/* ============================================================
   句斩 · 主样式
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&family=Cormorant+Garamond:ital,wght@0,600;0,700;1,600&family=DM+Mono:wght@400;500&display=swap');

/* ── 变量系统 ── */
:root {
  --bg:       #0D1117;
  --bg2:      #131920;
  --bg3:      #1A2332;
  --card:     #1E2D3D;
  --card2:    #243447;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.13);
  --gold:     #F5C842;
  --gold2:    #E8A020;
  --red:      #E8453C;
  --teal:     #2DD4BF;
  --green:    #34D399;
  --text:     #F0EDE8;
  --text2:    #A8B4C0;
  --text3:    #5A6878;
  --f-display:'Cormorant Garamond', Georgia, serif;
  --f-body:   'Noto Sans SC', sans-serif;
  --f-mono:   'DM Mono', monospace;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px;
  --sh-card: 0 8px 32px rgba(0,0,0,0.4);
  --sh-gold: 0 8px 32px rgba(245,200,66,0.25);
  --max-w: 480px;
  --transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

/* 日间模式 */
html.light {
  --bg:      #F5F0E8;
  --bg2:     #EDE8DE;
  --bg3:     #E4DDD0;
  --card:    #FFFFFF;
  --card2:   #F9F5EE;
  --border:  rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.13);
  --text:    #1A1612;
  --text2:   #5A5048;
  --text3:   #9A8E80;
  --sh-card: 0 4px 24px rgba(0,0,0,0.08);
}

/* ── 基础重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--f-body); cursor: pointer; }
input, textarea { font-family: var(--f-body); }

/* ── 纹理叠加 ── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999; opacity: 0.5;
}

/* ── 布局容器 ── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 80px;
}
.container {
  width: 100%;
  max-width: var(--max-w);
  padding: 0 16px;
}

/* ── 顶部导航 ── */
.topnav {
  width: 100%;
  max-width: var(--max-w);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(to bottom, var(--bg) 80%, transparent);
}
.topnav-logo {
  font-family: var(--f-display);
  font-size: 28px; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: -1px;
}
.topnav-right { display: flex; align-items: center; gap: 10px; }
.streak-badge {
  display: flex; align-items: center; gap: 5px;
  background: rgba(232,69,60,0.12);
  border: 1px solid rgba(232,69,60,0.22);
  border-radius: 20px; padding: 5px 12px;
  font-size: 13px; font-weight: 700;
  color: #FF6B6B; font-family: var(--f-mono);
}
.theme-btn {
  width: 34px; height: 34px;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: var(--transition);
}
.theme-btn:hover { transform: rotate(20deg) scale(1.1); }
.avatar-btn {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 15px; text-decoration: none;
}

/* ── 底部导航 ── */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(13,17,23,0.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 10px 0 20px; z-index: 100;
}
html.light .bottomnav { background: rgba(245,240,232,0.95); }
.bnav {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 4px 16px; border-radius: var(--r-md);
  color: var(--text3); font-size: 10px; font-weight: 500;
  transition: var(--transition); text-decoration: none;
}
.bnav .ico { font-size: 22px; }
.bnav.active { color: var(--gold); }
.bnav:hover { color: var(--text2); }

/* ── 卡片 ── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 20px;
  box-shadow: var(--sh-card); transition: var(--transition);
}
.card:hover { border-color: var(--border2); }

/* ── 按钮系统 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; border: none; border-radius: var(--r-md);
  padding: 14px 20px; font-size: 15px; font-weight: 700;
  transition: var(--transition); cursor: pointer;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #1a1000; box-shadow: var(--sh-gold);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(245,200,66,0.35); }
.btn-gold:active { transform: translateY(0); }
.btn-full { width: 100%; }
.btn-outline {
  background: transparent; border: 1px solid var(--border2); color: var(--text2);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost { background: var(--bg3); color: var(--text2); }
.btn-ghost:hover { background: var(--card2); }

/* ── 表单 ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text3); margin-bottom: 8px; font-weight: 600;
}
.form-input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--r-md); padding: 13px 16px;
  font-size: 15px; color: var(--text); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,200,66,0.1); }
.form-input::placeholder { color: var(--text3); }

/* ── Section标题 ── */
.section-title {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text3); font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── 进度条 ── */
.progress-bar {
  height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 3px; transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.progress-fill.teal { background: linear-gradient(90deg, var(--teal), #22d3ee); }

/* ── 统计数字 ── */
.stat-num {
  font-family: var(--f-mono); font-size: 28px; font-weight: 500;
  color: var(--gold); line-height: 1;
}

/* ── 角标 ── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; border-radius: 20px;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  font-family: var(--f-mono); min-width: 18px;
}
.badge-teal { background: rgba(45,212,191,0.15); color: var(--teal); border: 1px solid rgba(45,212,191,0.25); }
.badge-gold { background: rgba(245,200,66,0.12); color: var(--gold2); border: 1px solid rgba(245,200,66,0.2); }

/* ── 动画 ── */
@keyframes fadeUp   { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }
@keyframes scaleIn  { from{opacity:0;transform:scale(0.94)} to{opacity:1;transform:scale(1)} }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:0.45} }
@keyframes float    { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
@keyframes spin     { from{transform:rotate(0)} to{transform:rotate(360deg)} }

.anim-1 { animation: fadeUp 0.45s ease both; }
.anim-2 { animation: fadeUp 0.45s 0.08s ease both; }
.anim-3 { animation: fadeUp 0.45s 0.16s ease both; }
.anim-4 { animation: fadeUp 0.45s 0.24s ease both; }
.anim-5 { animation: fadeUp 0.45s 0.32s ease both; }

/* ── Toast提示 ── */
.toast-wrap {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9000; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 10px 20px;
  font-size: 13px; color: var(--text);
  box-shadow: var(--sh-card); white-space: nowrap;
  animation: fadeUp 0.25s ease both;
}
.toast.success { border-color: rgba(52,211,153,0.3); color: var(--green); }
.toast.error   { border-color: rgba(232,69,60,0.3);  color: var(--red); }

/* ── Loading ── */
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── 响应式 ── */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .topnav { padding: 12px 12px 8px; }
}
