/* Wesala 官网样式表。
   配色直接取自 app 的设计令牌 lib/core/theme/tokens.dart —— 深青主色、
   琥珀金辅色、暖白底 —— 这样网站和 app 内看到的是同一套颜色。 */

:root {
  --brand: #0B6E5B;        /* T.primary */
  --brand-deep: #0B3A31;   /* 导航与页脚通栏用的更深一档 */
  --brand-ink: #062621;
  --gold: #D49B32;         /* T.secondary */
  --paper: #F7F8F6;        /* T.bg */
  --card: #FFFFFF;         /* T.surface */
  --ink: #18201E;          /* T.text */
  --muted: #66716D;        /* T.textSecondary */
  --line: #DCE3DF;         /* T.border */
  --soft: #EFF2F0;         /* T.neutralSoft */

  --r: 12px;               /* T.rLarge */
  --r-sm: 8px;             /* T.rMedium */
  --shell: 1060px;
  --measure: 70ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    Roboto, "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
}

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------ 顶部导航 --
   Swayli 的头部是透明居中的一行；这里改成深青通栏 + 金色底边，
   滚动时吸顶。 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--brand-deep);
  border-bottom: 2px solid var(--gold);
}

.topbar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 155, 50, 0.22);
}

.wordmark .age {
  margin-left: 2px;
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.topnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.topnav a {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  text-decoration: none;
}

.topnav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.topnav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }

.topnav .lang {
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--gold);
  font-weight: 600;
}

.topnav .lang:hover { background: transparent; color: #fff; }

/* --------------------------------------------------------------- 标题区 --
   首页是深色大区块，内页是浅色窄条，二者共用 .masthead。 */

.masthead { background: var(--brand); color: #fff; }
.masthead .shell { padding-top: 56px; padding-bottom: 56px; }
.masthead.slim .shell { padding-top: 36px; padding-bottom: 32px; }

.masthead h1 {
  max-width: 22ch;
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.masthead.slim h1 { max-width: none; font-size: clamp(26px, 4vw, 34px); margin-bottom: 8px; }

.masthead p { max-width: var(--measure); color: rgba(255, 255, 255, 0.86); }
.masthead .lede { font-size: 18px; }
.masthead a { color: #fff; }

.kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* 首页标题区右侧的事实清单，替代参考站的纯文字 hero */
.hero-split { display: grid; gap: 32px; }

@media (min-width: 900px) {
  .hero-split { grid-template-columns: 1.35fr 1fr; align-items: start; }
}

.factsheet {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--r);
  padding: 4px 18px;
}

.factsheet dl { margin: 0; }
.factsheet div { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.factsheet div:last-child { border-bottom: 0; }

.factsheet dt {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.factsheet dd { margin: 2px 0 0; font-size: 15px; }

/* ----------------------------------------------------------------- 正文 --*/

main .shell { padding-top: 48px; padding-bottom: 24px; }

section { margin-bottom: 44px; }
section > p, section > ul, section > ol, section > table { max-width: var(--measure); }

h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* 编号小节：法务页靠它做锚点标题，参考站没有编号 */
h2 .num {
  display: inline-block;
  min-width: 26px;
  margin-right: 10px;
  padding: 1px 0;
  border-bottom: 2px solid var(--gold);
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
}

h3 { margin: 0 0 6px; font-size: 16px; }
p { margin: 0 0 14px; }

.lede { font-size: 18px; }
.muted, .meta, .note { color: var(--muted); font-size: 14px; }
.note { max-width: var(--measure); }

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.stamp b { color: #fff; font-weight: 600; }
.stamp span { opacity: 0.5; }

/* ----------------------------------------------------------------- 卡片 --
   Swayli 用四边描边卡片；这里改成左侧金色竖条 + 极淡投影。 */

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(24, 32, 30, 0.04);
}

.card p:last-child { margin-bottom: 0; }
.card p { color: var(--muted); font-size: 15px; }

.slab {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
}

.slab > :last-child { margin-bottom: 0; }
.slab h2 { margin-top: 0; }

.tinted { background: var(--soft); border-color: transparent; }

/* 强调条：用于 18+ 声明这类需要一眼看到的句子 */
.rulebar {
  border-left: 3px solid var(--brand);
  background: var(--card);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 14px 18px;
  max-width: var(--measure);
  font-weight: 500;
}

/* ------------------------------------------------------------- 列表/表格 --*/

.ticks { list-style: none; margin: 0 0 14px; padding: 0; max-width: var(--measure); }

.ticks li { position: relative; margin-bottom: 10px; padding-left: 26px; }

.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
}

.terms { margin: 0; max-width: var(--measure); }
.terms dt { margin-top: 14px; font-weight: 600; }
.terms dt:first-child { margin-top: 0; }
.terms dd { margin: 2px 0 0; color: var(--muted); }

.rows { width: 100%; border-collapse: collapse; }

.rows th, .rows td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rows th {
  width: 38%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* -------------------------------------------------------------- 文档索引 --*/

.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.docs li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
}

.docs a { font-size: 18px; font-weight: 650; text-decoration: none; }
.docs .meta { display: block; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.docs p { margin: 0; color: var(--muted); font-size: 15px; }

/* ------------------------------------------------------ 法务页双栏 + 目录 --
   参考站的法务页是单列长文；这里给宽屏加一个吸顶目录。 */

.withtoc { display: block; }

@media (min-width: 960px) {
  .withtoc { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 48px; align-items: start; }
  .toc { position: sticky; top: 88px; }
}

.toc { margin-bottom: 32px; }

.toc h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }

.toc li { counter-increment: toc; }

.toc a {
  display: block;
  padding: 6px 0 6px 26px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  position: relative;
}

.toc a::before {
  content: counter(toc);
  position: absolute;
  left: 10px;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.toc a:hover { border-left-color: var(--gold); color: var(--ink); }

.doc section { scroll-margin-top: 88px; }
.doc section:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------- 页脚 --*/

footer.sitefoot {
  margin-top: 40px;
  background: var(--brand-ink);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

footer.sitefoot .shell { padding-top: 32px; padding-bottom: 40px; }

footer.sitefoot .rule {
  max-width: var(--measure);
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 500;
}

footer.sitefoot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 14px; }
footer.sitefoot a { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
footer.sitefoot a:hover { color: #fff; text-decoration: underline; }
footer.sitefoot .fine { margin: 0; color: rgba(255, 255, 255, 0.45); font-size: 13px; }

/* --------------------------------------------------------------- 暗色 --*/

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1513;
    --card: #17201D;
    --ink: #EDF2EF;
    --muted: #96A39E;
    --line: #26312D;
    --soft: #1C2622;
    --brand: #3E9D86;
    --brand-deep: #0A1C18;
    --brand-ink: #06110F;
  }

  .masthead { background: #0D2A24; }
  .card { box-shadow: none; }
}
