/* 解梦站 — fleet tokens aligned to DESIGN-TOKENS 母版 (§1 颜色 / §2 字阶 / §3 间距 / §4 圆角阴影 / §5 组件 / §6 动效 / §7 验收)
   2026-11-21 设计返工：页头成型（sticky+表面底+发丝底线）、首屏 Display 层级、搜索台、
   签/CTA 语义浅底、词条卡等高 + 分类徽章、词条页阅读版心 760、报告空状态、后台登录卡居中收窄。
   只改呈现层，不动接口与数据口径。 */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #efefec;
  --text: #1a1d21;
  --text-2: #5c6470;
  --text-3: #8a919c;
  --border: #e3e3de;
  --border-2: #cfcfc8;
  --accent: #2563eb;
  --accent-hover: #1d4fd0;
  --accent-soft: #eaf0fe;
  --accent-border: #c3d4fb;
  --on-accent: #ffffff;
  --success: #177245;
  --warning: #9a6a00;
  --warning-bg: #fdf3e0;
  --warning-border: #f0d9a8;
  --danger: #c62f3b;
  --danger-bg: #fdeeee;
  --focus: #2563eb;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --fs-display: 40px;
  --fs-h1: 30px;
  --fs-h2: 22px;
  --fs-h3: 17px;
  --fs-body: 15.5px;
  --fs-small: 13.5px;
  --fs-cap: 12px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(26, 29, 33, .05), 0 1px 6px rgba(26, 29, 33, .04);
  --shadow-2: 0 8px 28px rgba(26, 29, 33, .10);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --wrap: 1120px;
  --wrap-read: 760px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-body); line-height: 1.65; }
a { color: var(--accent); text-decoration: none; transition: color .18s var(--ease); }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::placeholder { color: var(--text-3); }

/* ---------- 页头（sticky、表面底、发丝底线；品牌字标 17/700 按母版 §5） ---------- */
.top { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.top-in { display: flex; justify-content: space-between; align-items: center; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; min-height: 60px; }
.brand { font-size: 17px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--accent); }
.top nav { display: flex; gap: 4px; align-items: center; }
.top nav a { font-size: 15px; color: var(--text-2); padding: 8px 12px; border-radius: var(--r-pill); transition: all .18s var(--ease); }
.top nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

main { max-width: var(--wrap); margin: 0 auto; padding: 24px 24px 64px; }
h1 { font-size: var(--fs-h1); line-height: 1.25; font-weight: 700; letter-spacing: 0; margin: 16px 0 8px; }
h2 { font-size: var(--fs-h2); line-height: 1.35; font-weight: 650; letter-spacing: 0; margin: 40px 0 14px; }
.sub { color: var(--text-2); font-size: 16px; line-height: 1.65; margin: 0; }
.muted { color: var(--text-2); font-size: var(--fs-small); }
.small { font-size: var(--fs-small); font-weight: 400; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; }

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

/* ---------- 首屏 ---------- */
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: var(--fs-display); line-height: 1.15; margin: 8px 0 12px; }
.hero .sub { max-width: 640px; }
/* 搜索台：全站主行动，白色台面 + 单层极淡阴影；输入框 46px 与搜索主按钮同高（全站唯一例外） */
.search { display: flex; gap: 12px; margin: 24px 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 12px; box-shadow: var(--shadow-1); }
.search input { flex: 1; height: 46px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-md); font-size: 16px; background: var(--surface); color: var(--text); }
.search input:focus { border-color: var(--accent); outline: 2px solid var(--focus); outline-offset: 2px; }
/* 今日梦境签：强调浅底，与普通卡拉开层级 */
.sign { background: var(--accent-soft); border-color: var(--accent-border); margin-top: 0; }
.sign-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sign-head .pill { background: var(--surface); }
.sign p { margin: 0; color: var(--text); font-size: 16px; }
/* AI 报告 CTA：核心入口，浅底 + 强调边线 */
.ai-cta { background: var(--accent-soft); border-color: var(--accent-border); }
.ai-cta h2 { margin-top: 0; }
.ai-cta p { color: var(--text); margin: 0 0 16px; }

/* ---------- 按钮（一站一套） ---------- */
button.btn, .btn, .search button { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: var(--r-md); height: 40px; padding: 0 18px; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all .18s var(--ease); }
.search .btn, .search button { height: 46px; padding: 0 22px; }
.btn.secondary { background: var(--surface); color: var(--accent); border-color: var(--accent-border); }
button.btn:hover, .btn:hover, .search button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); text-decoration: none; }
.btn.secondary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
button.btn:active, .btn:active, .search button:active { transform: translateY(1px); }
button.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 词条 / 分类网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.entry-card, .cat-card { color: var(--text); transition: all .18s var(--ease); }
.entry-card { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 20px; min-height: 172px; }
.entry-card:hover, .cat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-1); text-decoration: none; }
.kw { font-size: var(--fs-h3); font-weight: 650; line-height: 1.45; }
.snip { color: var(--text-2); font-size: var(--fs-small); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cat { align-self: flex-start; margin-top: auto; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; }
.cat-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 20px; min-height: 76px; }
.cat-card .muted { white-space: nowrap; }

/* ---------- 词条页（阅读版心 760） ---------- */
.entry { max-width: var(--wrap-read); margin: 0 auto; }
.crumb { color: var(--text-2); font-size: var(--fs-small); margin: 8px 0 0; }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--accent); }
.view h2 { margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--accent); font-size: var(--fs-h3); line-height: 1.45; }
.view p { margin: 0 0 8px; }
.src { color: var(--text-3); font-size: 12.5px; margin: 0; }
.caution { background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: var(--r-lg); padding: 12px 16px; color: var(--warning); margin: 16px 0; font-size: var(--fs-small); line-height: 1.55; }

/* ---------- 表单 ---------- */
textarea { width: 100%; min-height: 42px; border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 11px 12px; font-size: 15px; font-family: inherit; background: var(--surface); color: var(--text); resize: vertical; line-height: 1.65; }
#dream { min-height: 168px; }
input { height: 42px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-md); font-size: 15px; background: var(--surface); color: var(--text); font-family: inherit; }
select { height: 42px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-md); font-size: 15px; background: var(--surface); color: var(--text); font-family: inherit; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); outline: 2px solid var(--focus); outline-offset: 2px; }
label { display: block; font-size: var(--fs-small); font-weight: 600; margin-bottom: 8px; }
.row { display: flex; gap: 10px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.err { color: var(--danger); font-size: var(--fs-small); min-height: 1em; margin: 8px 0 0; }
.err:empty { margin: 0; min-height: 0; }

/* ---------- 报告页 ---------- */
.unlock { background: var(--accent-soft); border: 1px dashed var(--accent-border); border-radius: var(--r-md); padding: 16px; margin-top: 16px; }
.unlock p { margin: 0; }
.report-result { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; font-size: 15px; line-height: 1.65; }
.report-result h2 { font-size: var(--fs-h3); margin: 18px 0 6px; }
.report-result p { margin: 0 0 10px; }
.saved-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 24px; margin: 12px 0; font-size: 15px; line-height: 1.65; color: var(--text); }
.saved-item .muted { display: block; margin-bottom: 8px; }
.saved-item h2 { font-size: var(--fs-h3); margin: 14px 0 6px; }
.saved-item p { margin: 0 0 8px; }
/* 空状态（母版 §5：线性图标 + 一句文案 + 一个主行动） */
.empty-state { text-align: center; padding: 40px 24px; background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--r-lg); color: var(--text-2); }
.empty-state svg { display: block; margin: 0 auto 12px; color: var(--text-3); }
.empty-state p { margin: 0 0 16px; font-size: var(--fs-small); }

/* ---------- 后台 ---------- */
.admin { max-width: 1280px; }
.admin-login { max-width: 440px; margin: 48px auto; }
.admin-login .row { margin-bottom: 0; }
.admin-login input { flex: 1; }
pre { white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; max-height: 420px; overflow: auto; margin: 0; }
#elist .row { border-top: 1px solid var(--border); padding: 10px 0; margin: 0; }
#elist .row:first-child { border-top: 0; }

/* ---------- 页脚 ---------- */
.foot { max-width: var(--wrap); margin: 0 auto; padding: 24px 24px 40px; color: var(--text-2); font-size: var(--fs-small); line-height: 1.65; border-top: 1px solid var(--border); }
.foot p { margin: 0 0 6px; }

@media (max-width: 640px) {
  .top-in { padding: 0 16px; min-height: 54px; }
  .top nav a { padding: 10px 8px; }
  main { padding: 16px 16px 48px; }
  .foot { padding: 20px 16px 32px; }
  h1 { font-size: 24px; }
  .hero { padding-top: 12px; }
  .hero h1 { font-size: 30px; }
  h2 { margin-top: 32px; }
  .card { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .entry-card { min-height: 0; }
  .search { flex-wrap: wrap; padding: 10px; }
  .search input { flex: 1 1 100%; }
  .search .btn, .search button { width: 100%; }
  .saved-item { padding: 16px; }
  .admin-login { margin: 24px auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
