﻿/* ============================================================
   墨研自习室 · main.css
   纸墨研习空间：暖纸底、深墨字、朱砂点睛
   ============================================================ */

:root {
  --paper: #faf6ee;
  --paper-2: #f3ede0;
  --card: #ffffff;
  --ink: #232b36;
  --ink-2: #555f6b;
  --ink-3: #69727d;
  --cinnabar: #c4402e;
  --cinnabar-ink: #a33627;
  --bamboo: #3e7c59;
  --line: #e4dccb;
  --line-strong: #d5cbb4;
  --gold: #a8842c;
  --shadow: 0 8px 24px rgba(35, 43, 54, 0.08);
  --shadow-lift: 0 14px 34px rgba(35, 43, 54, 0.12);
  --radius: 10px;
  --serif: Georgia, "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --nav-h: 60px;
  --focus: 0 0 0 3px rgba(196, 64, 46, 0.35);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* 浏览器原生表面也随设计走 */
::selection { background: var(--cinnabar); color: var(--paper); }
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
a { color: var(--cinnabar); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cinnabar-ink); }

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.3rem; }

p { margin: 0; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.section { padding: 44px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head .hint { color: var(--ink-2); font-size: 0.875rem; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: var(--paper);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--paper); text-decoration: none; font-family: var(--serif);
  font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: #cfd6de; text-decoration: none; padding: 10px 14px;
  font-size: 0.875rem; border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; border-bottom-color: var(--cinnabar); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 10px 18px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
  transition: background 140ms ease-out, border-color 140ms ease-out, transform 140ms ease-out;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cinnabar); color: #fff; }
.btn-primary:hover { background: var(--cinnabar-ink); color: #fff; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #141a21; color: #fff; }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: 0.875rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2);
  cursor: pointer; transition: all 140ms ease-out;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- 卡片与列表 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }

.list-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 8px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.list-row[data-subject="政治"] { border-left-color: var(--cinnabar); }
.list-row[data-subject="英语"] { border-left-color: var(--gold); }
.list-row[data-subject="数学"] { border-left-color: var(--ink-2); }
.list-row[data-subject="专业课"] { border-left-color: var(--bamboo); }
.list-row[data-subject="方法"] { border-left-color: var(--ink-3); }

/* ---------- 表单 ---------- */
.input, .select, textarea.input {
  font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 10px 12px; width: 100%;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--cinnabar); box-shadow: var(--focus); }

.checkbox {
  width: 22px; height: 22px; flex: none;
  border: 1.5px solid var(--ink-3); border-radius: 5px;
  background: var(--card); cursor: pointer; position: relative;
  transition: background 140ms ease-out, border-color 140ms ease-out;
}
.checkbox svg { position: absolute; inset: 3px; opacity: 0; transition: opacity 140ms ease-out; }
.checkbox.checked { background: var(--bamboo); border-color: var(--bamboo); }
.checkbox.checked svg { opacity: 1; }

/* ---------- 徽标/标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 5px; white-space: nowrap;
}
.badge-demo { background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge-subject { background: var(--paper-2); color: var(--ink-2); }

/* ---------- 页脚 ---------- */
.footer { background: var(--ink); color: #b9c1cb; margin-top: 48px; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 32px 24px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; font-size: 0.875rem; }
.footer a { color: #e8ebef; }

/* ---------- 倒计时 ---------- */
.countdown-card { text-align: center; padding: 30px 26px; }
.countdown-label { font-size: 0.875rem; color: var(--ink-2); letter-spacing: 0.06em; }
.countdown-num {
  font-family: var(--serif); font-size: clamp(3.4rem, 9vw, 5.4rem);
  font-weight: 700; line-height: 1; margin: 10px 0 4px;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.countdown-unit { color: var(--ink-2); font-size: 1.05rem; }
.countdown-date { color: var(--ink-3); font-size: 0.875rem; margin-top: 10px; }

/* ---------- 进度条 ---------- */
.progress { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.progress > span { display: block; width: 100%; height: 100%; background: var(--bamboo); border-radius: 4px; transform-origin: left; transform: scaleX(0); transition: transform 300ms ease-out; }
.progress-row { display: grid; grid-template-columns: 72px 1fr 64px; align-items: center; gap: 14px; padding: 9px 0; }
.progress-row .pct { font-size: 0.875rem; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 布局工具 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 34px; align-items: center; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 打卡日历 ---------- */
.streak-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.streak-day { text-align: center; padding: 10px 2px; border-radius: 8px; background: var(--paper-2); color: var(--ink-2); font-size: 0.8rem; }
.streak-day .d { font-weight: 700; font-size: 0.95rem; display: block; margin-bottom: 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.streak-day.done { background: var(--bamboo); color: #f4fbf6; }
.streak-day.done .d { color: #fff; }
.streak-day.today { outline: 2px solid var(--cinnabar); outline-offset: 1px; }

/* ---------- 真题 ---------- */
.quiz-options { display: grid; gap: 10px; margin-top: 18px; }
.quiz-option {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 14px 16px; cursor: pointer; transition: border-color 140ms ease-out, background 140ms ease-out;
}
.quiz-option:hover { border-color: var(--ink); }
.quiz-option .key {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--ink-3); display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700; color: var(--ink-2);
}
.quiz-option.selected { border-color: var(--cinnabar); background: #fdf1ee; }
.quiz-option.selected .key { border-color: var(--cinnabar); background: var(--cinnabar); color: #fff; }
.quiz-option.correct { border-color: var(--bamboo); background: #f0f7f2; }
.quiz-option.wrong { border-color: var(--cinnabar); background: #fdf1ee; }
.quiz-option:disabled { cursor: default; }
.quiz-explanation { background: var(--paper-2); border-radius: 8px; padding: 14px 16px; font-size: 0.875rem; margin-top: 14px; }
.quiz-progress-dots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.quiz-progress-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.quiz-progress-dots .dot.done { background: var(--bamboo); }
.quiz-progress-dots .dot.current { background: var(--cinnabar); }

/* ---------- 计划日历 ---------- */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.day-cell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; min-height: 150px; display: flex; flex-direction: column; gap: 8px; }
.day-cell.today { outline: 2px solid var(--cinnabar); outline-offset: 1px; }
.day-cell h4 { margin: 0; font-size: 0.875rem; color: var(--ink-2); font-family: var(--sans); display: flex; justify-content: space-between; }
.day-cell .date-num { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; }
.task-list li { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; background: var(--paper-2); border-radius: 6px; padding: 6px 8px; }
.task-list li.done { text-decoration: line-through; color: var(--ink-3); }
.task-add { display: flex; gap: 6px; }
.task-add .input { padding: 6px 8px; font-size: 0.875rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid-hero { grid-template-columns: 1fr; gap: 22px; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .nav-inner { padding: 0 16px; gap: 14px; }
  .brand span.brand-text { display: none; }
  .week-grid { grid-template-columns: 1fr; }
  .progress-row { grid-template-columns: 60px 1fr 52px; }
}

/* ---------- toast ---------- */
.mk-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--ink); color: var(--paper); font-size: 0.875rem;
  padding: 11px 20px; border-radius: 8px; box-shadow: var(--shadow-lift);
  opacity: 0; pointer-events: none; transition: opacity 180ms ease-out, transform 180ms ease-out;
  z-index: 99; max-width: 90vw;
}
.mk-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 打卡墨点动效（全站唯一动效时刻） ---------- */
.ink-burst-wrap { position: relative; display: inline-block; }
.ink-burst {
  position: absolute; inset: 50% auto auto 50%; width: 10px; height: 10px;
  margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(35,43,54,.9) 0%, rgba(35,43,54,.45) 40%, rgba(35,43,54,0) 70%);
  transform: scale(0); opacity: 0; z-index: 2;
}
.ink-burst.go { animation: inkblot 900ms cubic-bezier(.22,.61,.36,1) forwards; }
@keyframes inkblot {
  0% { transform: scale(0); opacity: 0; }
  18% { transform: scale(1.2); opacity: .9; }
  55% { transform: scale(3.4); opacity: .45; }
  100% { transform: scale(5.2); opacity: 0; }
}

/* ---------- 图标按钮 ---------- */
.btn-del {
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--ink-3); border-radius: 6px; flex: none;
  transition: color 140ms ease-out, background 140ms ease-out;
}
.btn-del:hover { color: var(--cinnabar); background: #fdf1ee; }


/* ---------- 公告横幅 ---------- */
.notice {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 18px;
  font-size: 0.875rem; color: var(--ink-2);
}
.notice .notice-label { color: var(--cinnabar); font-weight: 700; letter-spacing: 0.05em; flex: none; }
.notice-close {
  background: none; border: none; cursor: pointer; color: var(--ink-3);
  padding: 4px; margin-left: auto; flex: none; border-radius: 6px; display: inline-flex;
}
.notice-close:hover { color: var(--cinnabar); background: rgba(196, 64, 46, 0.08); }