/* 檀阁瑞木 TANGRAM 官网 · 编辑式排版
   设计原则：纸面质感、衬线标题、细线分隔、实拍照片为主角。
   不依赖任何外部字体或 CDN，深浅主题随系统或手动切换。 */

:root {
  --paper:      #f5f2ea;
  --paper-2:    #efebe0;
  --surface:    #fbf9f3;
  --ink:        #1a1917;
  --ink-soft:   #45423b;
  --muted:      #777268;
  --line:       #d9d3c5;
  --line-soft:  #e7e2d7;
  --accent:     #a4472b;
  --accent-ink: #8c3a22;
  --sel:        #e8d9c9;
  /* 实底块（按钮 / 页脚）：两个主题下都保持深底浅字，不随语义反转 */
  --solid-bg:   #1a1917;
  --solid-fg:   #f5f2ea;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1160px;
}

[data-theme="dark"] {
  --paper:      #15161a;
  --paper-2:    #1b1d22;
  --surface:    #1e2026;
  --ink:        #efece4;
  --ink-soft:   #c4c0b6;
  --muted:      #8b8a84;
  --line:       #35373e;
  --line-soft:  #2a2c32;
  --accent:     #d98a68;
  --accent-ink: #e39b7c;
  --sel:        #3a3229;
  --solid-bg:   #2b2d33;
  --solid-fg:   #efece4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--sel); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--solid-bg); color: var(--solid-fg); padding: 10px 16px; z-index: 99; }
.skip:focus { left: 12px; top: 12px; }
.sep { color: var(--muted); margin: 0 .35em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- 顶栏 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: none; }
.brand-mark { width: 30px; height: 30px; }
[data-theme="dark"] .brand-mark { filter: invert(1); }
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .02em; line-height: 1.1; }
.brand-latin { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .28em; font-weight: 400; color: var(--muted); margin-top: 3px; }
.head-nav { display: flex; gap: 30px; margin-left: auto; }
.head-nav a { text-decoration: none; font-size: 14px; color: var(--ink-soft); position: relative; padding: 4px 0; }
.head-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--accent); transition: right .25s; }
.head-nav a:hover { color: var(--ink); }
.head-nav a:hover::after { right: 0; }
.head-actions { display: flex; align-items: center; gap: 14px; }
.theme-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: border-color .2s, color .2s; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .theme-btn svg { display: none; }
[data-theme="dark"] .theme-btn::before { content: ""; width: 15px; height: 15px; border-radius: 50%; box-shadow: inset -4px -2px 0 0 currentColor; transform: rotate(-25deg); }
.head-download { background: var(--solid-bg); color: var(--solid-fg); text-decoration: none; font-size: 14px; padding: 8px 20px; border-radius: 2px; transition: opacity .2s; }
.head-download:hover { opacity: .82; }
.menu-btn { display: none; width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; padding: 8px; }
.menu-btn span { display: block; height: 1.5px; background: var(--ink); margin: 5px 0; transition: transform .2s; }

/* ---------- 首屏 ---------- */
.hero { padding: 84px 0 96px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1fr .92fr; gap: 72px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--accent-ink); margin: 0 0 26px; }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(44px, 5.4vw, 76px); line-height: 1.18; letter-spacing: -.01em; margin: 0 0 28px; }
.period { color: var(--accent); }
.lede { font-size: 16.5px; line-height: 1.95; color: var(--ink-soft); max-width: 500px; margin: 0 0 34px; }
.hero-cta { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.btn-solid { background: var(--accent); color: #fff; text-decoration: none; padding: 13px 26px; border-radius: 2px; font-size: 15px; font-weight: 600; transition: background .2s, transform .2s; }
.btn-solid:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn-solid span { margin-left: 8px; }
.btn-text { font-size: 14.5px; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.btn-text:hover { color: var(--accent); border-color: var(--accent); }
.hero-facts { display: flex; gap: 30px; margin: 52px 0 0; padding-top: 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hero-facts div { display: flex; flex-direction: column; gap: 3px; }
.hero-facts dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.hero-facts dd { margin: 0; font-size: 14px; color: var(--ink); }
.hero-fig, .band-fig, .about-fig, .cap-fig, .qr-fig { margin: 0; }
.hero-fig img { width: 100%; height: auto; aspect-ratio: 3 / 2.15; object-fit: cover; }
figcaption { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--muted); margin-top: 10px; }

/* ---------- 整幅照片 + 引言 ---------- */
.band { position: relative; }
.band-fig img { width: 100%; height: clamp(300px, 42vw, 500px); object-fit: cover; object-position: center 55%; }
.band-fig figcaption { position: absolute; right: 24px; bottom: 14px; color: #fff; opacity: .7; margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.band-quote { padding-top: 0; }
.band-quote p { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 34px); line-height: 1.65; margin: 0; padding: 46px 0 8px; color: var(--ink); }

/* ---------- 通用区块 ---------- */
.section { padding: 96px 0; border-bottom: 1px solid var(--line); }
.section-alt { background: var(--paper-2); }
.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 52px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.sec-no { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .1em; }
.sec-head h2 { font-family: var(--serif); font-size: clamp(28px, 3.2vw, 40px); font-weight: 700; margin: 0; letter-spacing: .01em; }
.sec-en { margin-left: auto; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sec-head--plain { border-bottom: 0; padding-bottom: 0; margin-bottom: 24px; }

/* ---------- 写在前面 ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 72px; align-items: start; }
.about-text p { font-size: 16px; line-height: 2.05; color: var(--ink-soft); margin: 0 0 22px; }
.about-text .drop { font-family: var(--serif); font-size: 21px; line-height: 1.85; color: var(--ink); }
.about-text .drop::first-letter { font-size: 2.5em; float: left; line-height: .9; padding: 6px 10px 0 0; color: var(--accent); font-weight: 700; }
.sign { font-family: var(--mono); font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 20px; margin-top: 30px !important; }
.date { color: var(--ink-soft); }
.about-fig img { width: 100%; aspect-ratio: 4 / 3.1; object-fit: cover; }

/* ---------- 能力条目 ---------- */
.cap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; padding: 44px 0; border-top: 1px solid var(--line); }
.cap-row:first-of-type { border-top: 0; padding-top: 0; }
.cap-row--flip .cap-body { order: 2; }
.cap-row--flip .cap-fig { order: 1; }
.cap-no { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--accent); }
.cap-body h3 { font-family: var(--serif); font-size: clamp(23px, 2.4vw, 30px); font-weight: 700; margin: 12px 0 16px; line-height: 1.4; }
.cap-body p { font-size: 15.5px; line-height: 2; color: var(--ink-soft); margin: 0; max-width: 460px; }
.cap-fig img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- 下载 ---------- */
.dl-intro { margin-bottom: 44px; }
.dl-lead { font-size: 17px; line-height: 1.9; color: var(--ink-soft); max-width: 760px; margin: 0 0 10px; }
.dl-lead strong { color: var(--ink); font-weight: 700; }
.dl-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0; }
.dl-table { border-top: 1px solid var(--ink); }
.dl-row { display: grid; grid-template-columns: 1.1fr 1.5fr .7fr 1.2fr; gap: 20px; align-items: center; padding: 20px 8px; border-bottom: 1px solid var(--line); }
.dl-row--head { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 8px; border-bottom: 1px solid var(--line); }
.dl-os { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.dl-fmt { font-size: 14px; color: var(--ink-soft); }
.dl-size { font-family: var(--mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-links { display: flex; align-items: center; gap: 16px; justify-content: flex-end; }
.dl-primary { background: var(--solid-bg); color: var(--solid-fg); text-decoration: none; font-size: 13.5px; padding: 9px 18px; border-radius: 2px; white-space: nowrap; transition: opacity .2s; }
.dl-primary:hover { opacity: .8; }
.dl-primary span { margin-left: 4px; }
.dl-alt { font-size: 12.5px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.dl-alt:hover { color: var(--accent); border-color: var(--accent); }
.dl-note { font-size: 13px; line-height: 1.9; color: var(--muted); margin: 24px 0 0; max-width: 820px; }
.update-note { margin-top: 56px; padding: 30px 34px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.update-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.update-text { font-family: var(--serif); font-size: clamp(20px, 2.2vw, 27px); font-weight: 700; margin: 0; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 860px; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary { font-family: var(--serif); font-size: 19px; font-weight: 600; padding: 22px 4px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-family: var(--mono); font-size: 20px; color: var(--accent); flex: none; }
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { font-size: 15px; line-height: 2; color: var(--ink-soft); margin: 0; padding: 0 4px 26px; }

/* ---------- 社区 ---------- */
.community { border-bottom: 0; }
.community-grid { display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: center; }
.community-text { font-size: 16px; line-height: 2; color: var(--ink-soft); max-width: 540px; margin: 0; }
.qr-fig { text-align: center; }
.qr-fig img { width: 168px; height: 168px; margin: 0 auto; background: #fff; padding: 8px; border: 1px solid var(--line); }
.qr-fig figcaption { text-align: center; margin-top: 12px; }

/* ---------- 页脚 ---------- */
.site-foot { background: var(--solid-bg); color: var(--solid-fg); padding: 56px 0 30px; }
.foot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.16); flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 20px; font-weight: 700; }
.foot-brand img { filter: invert(1); }
.foot-brand .brand-latin { display: inline; margin-left: 8px; color: rgba(255,255,255,.5); }
.foot-line { font-family: var(--serif); font-size: 15px; color: rgba(255,255,255,.72); margin: 0; max-width: 480px; line-height: 1.9; }
.foot-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 24px; font-family: var(--mono); font-size: 11.5px; color: rgba(255,255,255,.5); flex-wrap: wrap; }
.foot-credit a { color: rgba(255,255,255,.75); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .wrap { padding: 0 22px; }
  .head-nav { position: fixed; top: 68px; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; gap: 0; padding: 8px 22px 18px; display: none; }
  .head-nav.open { display: flex; }
  .head-nav a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
  .menu-btn { display: block; }
  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-fig { order: -1; }
  .hero-fig img { aspect-ratio: 16 / 10; }
  .hero h1 { font-size: clamp(40px, 9vw, 60px); }
  .band-quote p { padding-top: 32px; }
  .section { padding: 68px 0; }
  .sec-head { margin-bottom: 36px; }
  .sec-en { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-fig { order: -1; }
  .about-fig img { aspect-ratio: 16 / 10; }
  .cap-row, .cap-row--flip { grid-template-columns: 1fr; gap: 26px; padding: 34px 0; }
  .cap-row--flip .cap-body, .cap-row--flip .cap-fig { order: initial; }
  .cap-fig img { aspect-ratio: 16 / 10; }
  .dl-row { grid-template-columns: 1fr auto; gap: 8px 14px; padding: 18px 4px; }
  .dl-row--head { display: none; }
  .dl-os { grid-column: 1; }
  .dl-fmt { grid-column: 1; font-size: 13px; }
  .dl-size { grid-column: 1; }
  .dl-size::before { content: "大小 "; color: var(--muted); }
  .dl-links { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; align-items: flex-end; gap: 10px; }
  .community-grid { grid-template-columns: 1fr; gap: 36px; }
  .qr-fig { text-align: left; }
  .qr-fig img { margin: 0; }
  .qr-fig figcaption { text-align: left; }
}

@media (max-width: 480px) {
  .head-download { display: none; }
  .hero-facts { gap: 18px; }
  .hero-facts dd { font-size: 13px; }
  .btn-solid { width: 100%; text-align: center; }
  .foot-bottom { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
