/* 考研作战系统 · style.css v1 · 手机基准，桌面展开 */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #22303c;
  --muted: #7a8a99;
  --line: #e3e8ee;
  --primary: #1a5fb4;
  --primary-ink: #ffffff;
  --danger: #c0392b;
  --warn: #d35400;
  --ok: #1e8e5a;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 1.35rem; margin: 18px 4px 10px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
h2 small { font-weight: 400; font-size: .82rem; }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: .85rem; }

/* 布局：手机单列，桌面左侧栏 */
.layout { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main { flex: 1; padding: 0 12px 90px; max-width: 860px; margin: 0 auto; width: 100%; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; padding: 12px 0 10px; color: var(--muted); font-size: .85rem;
}
.tabbar a.active { color: var(--primary); font-weight: 600; }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .main { padding-bottom: 40px; }
  .sidebar {
    display: flex; flex-direction: column; width: 220px; flex-shrink: 0;
    background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px;
    position: sticky; top: 0; height: 100vh;
  }
  .side-brand { font-weight: 700; margin-bottom: 18px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav a {
    color: var(--ink); padding: 9px 12px; border-radius: 8px;
  }
  .side-nav a.active, .side-nav a:hover { background: #eef3f9; color: var(--primary); font-weight: 600; }
  .side-mini { margin-top: auto; font-size: .9rem; color: var(--muted); }
  .side-mini strong { color: var(--ink); }
  .btn-link { background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px 0 0; font-size: .9rem; }
}

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0;
}

/* 首页英雄区 */
.hero { background: linear-gradient(135deg, #1a3a5c, #1a5fb4); color: #fff; border: none; }
.hero h2 { color: #fff; }
.count-num { font-size: 3.2rem; font-weight: 700; line-height: 1.1; }
.count-num .unit { font-size: 1.2rem; font-weight: 400; }
.count-sub { color: rgba(255,255,255,.75); font-size: .9rem; margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: rgba(255,255,255,.12); border-radius: 8px; padding: 10px 12px; }
.stat-label { font-size: .78rem; color: rgba(255,255,255,.75); }
.stat-main { font-size: 1.7rem; font-weight: 700; }
.stat-sub { font-size: 1.3rem; font-weight: 600; }
.stat-warn { font-size: 1.3rem; font-weight: 700; color: #ffd7a8; }
.alert-banner {
  margin-top: 12px; background: rgba(255, 90, 60, .18); border: 1px solid rgba(255,120,90,.5);
  color: #ffd2c4; padding: 8px 12px; border-radius: 8px; font-size: .92rem;
}

/* 进度条 */
.subject-row { margin: 10px 0; }
.subject-head { display: flex; justify-content: space-between; font-size: .92rem; margin-bottom: 4px; }
.bar { background: #edf1f5; border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--primary); height: 100%; border-radius: 6px; transition: width .4s; }
.bar-idle { background: #b8c4cf; }

/* 任务 */
.task-list { list-style: none; margin: 0 0 10px; padding: 0; }
.task { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.task:last-child { border-bottom: none; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-check { border: none; background: none; font-size: 1.1rem; cursor: pointer; color: var(--ok); }
.task-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; margin-left: auto; }
.task-del:hover { color: var(--danger); }
.task-form { display: flex; gap: 8px; }
.task-form input[type=text] { flex: 1; }
.task-form input[type=number] { width: 76px; }
.task-empty { padding: 8px 0; }

/* 计时器 */
.timer-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer-display { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer-row select { flex: 1; min-width: 180px; }
.timer-actions { display: flex; gap: 10px; margin-top: 12px; }
.timer-hint { font-size: .82rem; margin: 10px 0 0; }
.timer-running .timer-display { color: var(--ok); }

/* 14 天柱状图 */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; margin-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar-val { background: linear-gradient(180deg, var(--primary), #4a83c8); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-date { font-size: .62rem; color: var(--muted); text-align: center; margin-top: 3px; white-space: nowrap; overflow: hidden; }

.milestone-card { border-left: 4px solid var(--warn); }

/* 表格 */
.plan-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.plan-table th, .plan-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.plan-table th { color: var(--muted); font-weight: 500; font-size: .85rem; }

/* 表单 */
label { display: block; font-size: .9rem; margin-bottom: 8px; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; background: #fff; color: var(--ink);
}
input:disabled { background: #f1f4f7; color: var(--muted); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid-form { grid-template-columns: 1fr; } }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .checkbox { display: flex; align-items: center; gap: 6px; margin: auto 0 8px; }
.grid-form .checkbox input { width: auto; margin: 0; }

/* 按钮 */
button, .btn-inline {
  display: inline-block; border: none; border-radius: 8px; padding: 10px 18px;
  font-size: .95rem; cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #164d94; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn-block { width: 100%; }
.btn-inline { text-decoration: none; }
.btn-link { padding: 6px 0; }

/* 资料区 */
.doc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-card { display: block; color: var(--ink); }
.doc-card:hover { border-color: var(--primary); }
.doc-name { font-weight: 700; margin-bottom: 4px; }

/* 登录 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1a3a5c, #1a5fb4); }
.login-card { background: #fff; border-radius: 16px; padding: 32px 28px; width: min(360px, 92vw); }
.login-card h1 { margin: 0; font-size: 1.4rem; }
.login-sub { color: var(--muted); margin: 6px 0 18px; font-size: .9rem; }
.alert { background: #fdecea; color: var(--danger); border-radius: 8px; padding: 8px 12px; font-size: .9rem; margin-bottom: 12px; }

/* 计划页资源链接列 */
.res-cell { font-size: .8rem; line-height: 1.7; }
.res-link { color: var(--primary); text-decoration: none; border-bottom: 1px dashed rgba(26,95,180,.4); white-space: nowrap; }
.res-link:hover { border-bottom-style: solid; }

/* 注册 / 管理后台 */
.auth-box { max-width: 420px; margin: 6vh auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px 26px; }
.auth-box h1 { margin: 0 0 4px; font-size: 1.3rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { font-size: .85rem; color: var(--ink); display: flex; flex-direction: column; gap: 5px; }
.stack input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.invite-new { display: flex; gap: 8px; margin: 10px 0 14px; }
.invite-new input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.code-flash { background: #e8f1fd; border: 1px dashed var(--primary); color: var(--primary); border-radius: 8px; padding: 10px 12px; font-weight: 700; margin-bottom: 12px; }
.code-cell { font-family: monospace; font-size: 1.05rem; font-weight: 700; letter-spacing: 1px; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 10px; background: #eef2f6; color: var(--muted); }
.tag-ok { background: #e6f5ea; color: #1d7a3a; }
.tag-off { background: #fdecea; color: var(--danger); }
.inline-form { display: inline; }
.btn-link.danger { color: var(--danger); }
.user-ops summary { cursor: pointer; color: var(--primary); font-size: .82rem; }
.reset-form { margin-top: 8px; max-width: 200px; }
.reset-form input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }

/* 今日计划卡片 */
.plan-card h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-card h2 small { flex: 1; }
.btn-small { padding: 5px 10px; font-size: .8rem; border-radius: 8px; border: none; cursor: pointer; text-decoration: none; }
.plan-list { list-style: none; margin: 8px 0 6px; padding: 0; }
.plan-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plan-item:last-child { border-bottom: none; }
.plan-item.done .plan-main { color: var(--muted); text-decoration: line-through; }
.plan-check { font-size: 1.1rem; }
.plan-main { flex: 1; min-width: 180px; }
.plan-main small { display: block; }
.plan-empty { padding: 10px 4px; }
