/* 人类记忆库 · 专业化设计系统
   暖纸白背景 + 墨色 + 深墨绿强调 + 衬线展示标题，克制、层次分明 */

:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --ink: #1d1c18;
  --ink-2: #46423a;
  --muted: #8b8578;
  --accent: #2f5d50;
  --accent-hover: #243f36;
  --accent-soft: #e9f0ec;
  --border: #e7e3d7;
  --rule: #e3dfd2;
  --danger: #b8442e;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(29,28,24,.05);
  --shadow-md: 0 10px 34px rgba(29,28,24,.09);
  --font-display: "Georgia", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
}
a { text-decoration: none; color: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.serif, h1, h2, h3, .masthead-name, .hero-title, .page-head h1, .auth-card h2,
.card-title, .section-title, .shelf-item .title, .footer-brand {
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
}

/* ---------- 报头 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,249,245,.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.masthead { max-width: 1120px; margin: 0 auto; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; }
.masthead-brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.mark {
  width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
}
.masthead-name { font-size: 21px; letter-spacing: 2px; line-height: 1.2; }
.masthead-sub { font-size: 10px; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; font-family: var(--font-body); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav-link { font-size: 15px; color: var(--ink-2); background: none; border: none; cursor: pointer; padding: 0; font-family: var(--font-body); letter-spacing: .5px; transition: color .15s; }
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--accent); font-weight: 600; }
.guard-pill { font-size: 12px; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 4px 12px; letter-spacing: 1px; white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 26px; border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; border: 1px solid transparent; font-family: var(--font-body); transition: all .2s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { border-color: var(--border); color: var(--ink-2); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-text { background: none; color: var(--muted); padding: 0; border: none; font-size: 15px; cursor: pointer; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.btn-text:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 首页 Hero（左右分栏、编辑式） ---------- */
.page { min-height: 70vh; }
.page.hidden { display: none; }
.hero { padding: 96px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: center; }
.hero-left .eyebrow { font-size: 12px; letter-spacing: 4px; color: var(--accent); text-transform: uppercase; font-weight: 600; margin-bottom: 18px; }
.hero-title { font-size: 60px; line-height: 1.16; letter-spacing: -1px; margin: 0 0 24px; }
.hero-sub { font-size: 18px; color: var(--ink-2); margin: 0 0 36px; max-width: 480px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-right { position: relative; }
.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-md);
}
.hero-card .cat { font-size: 11px; letter-spacing: 3px; color: var(--accent); text-transform: uppercase; margin-bottom: 12px; }
.hero-card h3 { font-size: 26px; margin: 0 0 12px; line-height: 1.4; }
.hero-card p { font-size: 14px; color: var(--ink-2); margin: 0 0 20px; }
.hero-card .meta { display: flex; gap: 20px; color: var(--muted); font-size: 13px; padding-top: 18px; border-top: 1px solid var(--rule); }

/* ---------- 区块 ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-eyebrow { font-size: 12px; letter-spacing: 3px; color: var(--accent); text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.section-title { font-size: 30px; letter-spacing: .5px; margin: 0; }
.section-more { font-size: 14px; color: var(--muted); cursor: pointer; transition: color .15s; }
.section-more:hover { color: var(--accent); }
.rule { height: 1px; background: var(--rule); border: none; margin: 48px 0; }

/* ---------- 卡片 ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.card .body { padding: 24px 22px; }
.card .no { font-family: ui-monospace, monospace; font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.card h3 { font-size: 20px; margin: 10px 0 8px; line-height: 1.4; }
.card .excerpt { font-size: 14px; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--muted); }
.card .tag { color: var(--accent); letter-spacing: 1px; font-weight: 600; }

/* ---------- 书架 ---------- */
.shelf { border-top: 1px solid var(--rule); }
.shelf-item { display: flex; align-items: center; gap: 24px; padding: 22px 6px; border-bottom: 1px solid var(--rule); cursor: pointer; transition: padding-left .2s, background .2s; }
.shelf-item:hover { padding-left: 14px; background: rgba(47,93,80,.04); }
.shelf-item .no { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); width: 48px; flex-shrink: 0; }
.shelf-item .title { font-size: 18px; flex: 1; }
.shelf-item .date { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.shelf-item .arrow { color: var(--accent); flex-shrink: 0; }

/* ---------- 表单 ---------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 36px; max-width: 640px; }
.form-card label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 22px 0 8px; }
textarea, input {
  width: 100%; border: 1px solid var(--border); background: #fff; padding: 13px 15px;
  font-size: 15px; font-family: var(--font-body); color: var(--ink);
  border-radius: var(--radius); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.8; }
textarea:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,93,80,.12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 16px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--ink-2); background: #fff; transition: all .15s; user-select: none; letter-spacing: .5px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 页面头 ---------- */
.page-head { margin: 64px 0 40px; }
.page-head h1 { font-size: 38px; letter-spacing: 1px; margin: 0 0 8px; }
.page-head p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- 弹窗 ---------- */
.overlay, .auth-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(20,19,16,.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.overlay.hidden, .auth-overlay.hidden { display: none; }
.overlay-card { width: 100%; max-width: 620px; background: var(--surface); border-radius: var(--radius); padding: 36px 34px; max-height: 85vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(20,19,16,.25); }
.overlay-card h2 { font-size: 28px; margin: 0 0 4px; }
.read-meta { font-size: 13px; color: var(--muted); margin: 0 0 18px; letter-spacing: .5px; }
.mem-text { white-space: pre-wrap; font-size: 16px; line-height: 2; color: var(--ink); }
.read-tags { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.read-actions { display: flex; gap: 12px; margin-top: 22px; }
.ticket { width: 100%; border: 1px solid var(--border); background: var(--bg); padding: 11px; font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); word-break: break-all; resize: vertical; border-radius: 8px; }
.result { margin-top: 14px; font-size: 14px; }
.ok { color: #3a7a4a; }
.err { color: var(--danger); }

/* ---------- 登录 ---------- */
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; padding: 44px 38px; box-shadow: 0 24px 60px rgba(20,19,16,.3); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px; }
.auth-brand .masthead-name { font-size: 21px; letter-spacing: 3px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.auth-card h2 { text-align: center; font-size: 26px; letter-spacing: 2px; margin: 0 0 22px; }
.auth-card input { margin-bottom: 12px; }
.auth-card .btn-primary { width: 100%; margin-top: 8px; padding: 13px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.auth-switch a { color: var(--accent); cursor: pointer; font-weight: 600; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 52px 0 30px; }
.footer-inner { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer-brand { font-size: 18px; letter-spacing: 2px; margin-bottom: 8px; }
.footer-note { color: var(--muted); font-size: 14px; max-width: 400px; margin: 0; }
.footer-cols { display: flex; gap: 56px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col .h { font-size: 12px; letter-spacing: 2px; color: var(--ink-2); text-transform: uppercase; font-weight: 600; }
.footer-col a { font-size: 14px; color: var(--muted); cursor: pointer; transition: color .15s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { text-align: center; color: var(--muted); font-size: 13px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-title { font-size: 42px; }
  .grid-3 { grid-template-columns: 1fr; }
  .masthead { flex-direction: column; gap: 12px; align-items: flex-start; }
  .nav { flex-wrap: wrap; gap: 18px; }
  .footer-cols { flex-wrap: wrap; gap: 32px; }
}
