/* 五金公寓 · 水管状况
 *
 * 设计系统源自 mahoro.cn Portal（_tokens.css / _theme-dark.css / _chrome.css /
 * _build/home.css）。搬的是手艺不是外壳，两处刻意分歧见文末。
 *
 * light —— 编辑印刷感：粉紫暖白、衬线负字距、等宽小标签宽字距、卡片四角套准标记
 * dark  —— 克制版深空：青发丝线、玻璃卡片、微辉光
 *
 * 零外部依赖：字体自托管（Newsreader 子集化到 ASCII，76 KB），
 * 无 CDN、无第三方脚本、无埋点。
 */

/* ══════════════════════════════════════════════════════════
   FONTS —— 自托管，只含 ASCII 子集
   中文一律走 PingFang SC / Songti SC 系统字体，不加载 CJK webfont
   ══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/newsreader-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/newsreader-400-italic.woff2') format('woff2');
}

/* ══════════════════════════════════════════════════════════
   TOKENS — light
   ══════════════════════════════════════════════════════════ */

:root {
  --bg:      #FBF8F7;
  --bg-tint: linear-gradient(180deg, #FEF4F7 0%, #FBF8F7 40%, #F8F5FB 100%);
  --card:    #FFFFFF;
  --line:    rgba(60, 60, 67, 0.10);
  --ink:     #17151C;
  --ink2:    #4A4551;
  --ink3:    #8A8392;
  --ink4:    #B5AFBA;

  --brand:       #E8379A;
  --brand-soft:  #FCE4EF;
  --brand-ink:   #B01F76;
  --brand-light: #FF6BB8;
  --brand-ring:  rgba(232, 55, 154, 0.25);

  --violet:      #7C5CFF;
  --violet-soft: #EFEAFF;

  --surface:       #FFFFFF;
  --surface-hover: rgba(23, 21, 28, 0.04);

  --ok:      #2F7D6B;
  --ok-soft: #DCF2EC;
  --warn:      #B08900;
  --warn-soft: #FFF6DC;

  --ink-on-accent: #FFFFFF;

  --topbar-bg: rgba(253, 247, 250, 0.72);
  --tick:      rgba(232, 55, 154, 0.35);   /* 卡片四角套准标记 */

  --glow-a: rgba(232, 55, 154, 0.14);
  --glow-b: rgba(124, 92, 255, 0.08);
  --glow-c: rgba(232, 55, 154, 0.05);

  --shadow-card: 0 1px 2px rgba(23,21,28,0.04), 0 8px 24px rgba(23,21,28,0.05);
  --shadow-pop:  0 2px 4px rgba(23,21,28,0.06), 0 24px 60px rgba(23,21,28,0.14);

  --font-serif: 'Newsreader', 'Iowan Old Style', 'Songti SC', 'Source Han Serif SC', Georgia, serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC',
                'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono:  'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  --grad: linear-gradient(100deg, var(--violet) 0%, var(--brand) 60%, var(--brand-light) 100%);

  color-scheme: light;
}

/* ══════════════════════════════════════════════════════════
   TOKENS — dark（深空终端，克制版）
   ══════════════════════════════════════════════════════════ */

:root[data-theme="dark"] {
  --bg:      #05070C;
  --bg-tint: linear-gradient(180deg, #070C14 0%, #05070C 40%, #030509 100%);
  --card:    #0A0E16;
  --line:    rgba(127, 220, 255, 0.14);
  --ink:     #F4F0F7;
  --ink2:    #C7C0D2;
  --ink3:    #8B8194;
  --ink4:    #5C535F;

  --brand:       #7FDCFF;
  --brand-soft:  rgba(127, 220, 255, 0.14);
  --brand-ink:   #B8E9FF;
  --brand-light: #A8E6FF;
  --brand-ring:  rgba(127, 220, 255, 0.30);

  --violet:      #FFB454;
  --violet-soft: rgba(255, 180, 84, 0.14);

  --surface:       #0A0E16;
  --surface-hover: rgba(255, 255, 255, 0.08);

  --ok:      #6FE3C1;
  --ok-soft: rgba(111, 227, 193, 0.13);
  --warn:      #F0C44C;
  --warn-soft: rgba(240, 196, 76, 0.13);

  --ink-on-accent: #05070C;

  --topbar-bg: rgba(5, 7, 12, 0.72);
  --tick:      rgba(127, 220, 255, 0.32);

  --glow-a: rgba(127, 220, 255, 0.13);
  --glow-b: rgba(255, 180, 84, 0.08);
  --glow-c: rgba(127, 220, 255, 0.05);

  --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.5);
  --shadow-pop:  0 2px 4px rgba(0,0,0,0.65), 0 24px 60px rgba(0,0,0,0.7);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:      #05070C;
    --bg-tint: linear-gradient(180deg, #070C14 0%, #05070C 40%, #030509 100%);
    --card:    #0A0E16;
    --line:    rgba(127, 220, 255, 0.14);
    --ink:     #F4F0F7;
    --ink2:    #C7C0D2;
    --ink3:    #8B8194;
    --ink4:    #5C535F;

    --brand:       #7FDCFF;
    --brand-soft:  rgba(127, 220, 255, 0.14);
    --brand-ink:   #B8E9FF;
    --brand-light: #A8E6FF;
    --brand-ring:  rgba(127, 220, 255, 0.30);

    --violet:      #FFB454;
    --violet-soft: rgba(255, 180, 84, 0.14);

    --surface:       #0A0E16;
    --surface-hover: rgba(255, 255, 255, 0.08);

    --ok:      #6FE3C1;
    --ok-soft: rgba(111, 227, 193, 0.13);
    --warn:      #F0C44C;
    --warn-soft: rgba(240, 196, 76, 0.13);

    --ink-on-accent: #05070C;

    --topbar-bg: rgba(5, 7, 12, 0.72);
    --tick:      rgba(127, 220, 255, 0.32);

    --glow-a: rgba(127, 220, 255, 0.13);
    --glow-b: rgba(255, 180, 84, 0.08);
    --glow-c: rgba(127, 220, 255, 0.05);

    --shadow-card: 0 1px 2px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.5);
    --shadow-pop:  0 2px 4px rgba(0,0,0,0.65), 0 24px 60px rgba(0,0,0,0.7);

    color-scheme: dark;
  }
}

/* ══════════════════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-tint);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.68;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ol, ul { list-style: none; }

.wrap {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 22px;
  position: relative;
  z-index: 1;
}

/* 背景：三团品牌辉光（mahoro _chrome.css 同构，但不要它那层点阵图案） */
.dots-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 85% 4%,  var(--glow-a) 0%, transparent 28%),
    radial-gradient(circle at 8% 88%,  var(--glow-b) 0%, transparent 26%),
    radial-gradient(circle at 5% 5%,   var(--glow-c) 0%, transparent 20%);
}


/* ══════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 0.5px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
  padding-bottom: 0;
}

.wordmark {
  padding: 14px 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.4px;
  color: var(--ink);
  white-space: nowrap;
}

.wordmark em {
  font-style: italic;
  color: var(--brand);
}

/* dark 专属：topbar 底部青发丝线，两端渐隐 */
:root[data-theme="dark"] .topbar::after,
:root:not([data-theme="light"]) .topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -0.5px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent 0%, rgba(127,220,255,0.28) 28%,
    rgba(127,220,255,0.28) 72%, transparent 100%);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .topbar::after { display: none; }
}

.theme-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0.5px solid var(--line);
  border-radius: 999px;
  transition: border-color .18s, background .18s;
}

.theme-btn:hover { border-color: var(--brand-ring); background: var(--surface-hover); }

.theme-btn-icon {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink3);
  box-shadow: inset -4px -2px 0 0 var(--bg);
  transition: background .2s;
}

.theme-btn:hover .theme-btn-icon { background: var(--brand); }

/* ══════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════ */

.hero { padding: clamp(44px, 7vh, 84px) 22px 44px; }

/* 等宽小标签 + 44px 渐变短线（mahoro .home-kicker 同构） */
.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--violet);
  text-transform: uppercase;
}

.kicker::before {
  content: '';
  width: 44px;
  height: 1px;
  flex: none;
  background: linear-gradient(90deg, var(--brand), var(--violet));
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5.4vw, 46px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 18px;
}

.lede {
  max-width: 33em;
  color: var(--ink2);
  font-size: 15.5px;
  line-height: 1.72;
  margin-bottom: 22px;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════
   套准标记（印刷感来源；仅 light，dark 走玻璃态）
   ══════════════════════════════════════════════════════════ */

.ticked {
  background-image:
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick));
  background-size: 11px 1px, 1px 11px, 11px 1px, 1px 11px,
                   11px 1px, 1px 11px, 11px 1px, 1px 11px;
  background-position:
    left 9px top 9px,      left 9px top 9px,
    right 9px top 9px,     right 9px top 9px,
    left 9px bottom 9px,   left 9px bottom 9px,
    right 9px bottom 9px,  right 9px bottom 9px;
  background-repeat: no-repeat;
}

:root[data-theme="dark"] .ticked { background-image: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ticked { background-image: none; }
}

/* ══════════════════════════════════════════════════════════
   STATUS CARD
   ══════════════════════════════════════════════════════════ */

.status-card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 26px 26px 24px;
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: '';
  position: absolute;
  top: -70px; right: -70px;
  width: 190px; height: 190px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--brand-soft), transparent 70%);
  pointer-events: none;
}

.status-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 0.5px solid var(--line);
  position: relative;
}

.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink4);
  box-shadow: 0 0 0 4px var(--surface-hover);
  flex: none;
}

.status-dot.is-active { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.status-dot.is-ok     { background: var(--ok);    box-shadow: 0 0 0 4px var(--ok-soft); }
.status-dot.is-warn   { background: var(--warn);  box-shadow: 0 0 0 4px var(--warn-soft); }

.status-state {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.status-headline {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink3);
  text-transform: uppercase;
  margin-left: auto;
}

.status-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 26px;
  position: relative;
}

.status-grid dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink3);
  white-space: nowrap;
  text-transform: uppercase;
  padding-top: 4px;
}

.status-grid dd {
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════
   SECTION / FILTERS
   ══════════════════════════════════════════════════════════ */

.section { padding-top: 62px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.filters { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  padding: 5px 13px;
  border: 0.5px solid var(--line);
  border-radius: 999px;
  color: var(--ink3);
  letter-spacing: -0.1px;
  transition: all .15s;
}

.chip:hover { border-color: var(--brand-ring); color: var(--ink2); }

.chip.is-on {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════════ */

.timeline { counter-reset: entry-no; }

.entry {
  counter-increment: entry-no;
  position: relative;
  padding-left: 26px;
  padding-bottom: 30px;
}

/* 轴线：最后一条不画，避免尾部悬空 */
.entry::before {
  content: '';
  position: absolute;
  left: 4px; top: 22px; bottom: -8px;
  width: 1px;
  background: var(--line);
}

.entry:last-child::before { display: none; }

.entry::after {
  content: '';
  position: absolute;
  left: 0; top: 13px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--ink4);
}

.entry:first-child::after {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.entry-date {
  display: block;
  margin-bottom: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
}

.entry-card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 26px 24px 22px;
  position: relative;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), box-shadow .22s, border-color .22s;
}

/* 编号：01 02 03…，等宽字 + 渐变文字（mahoro .home-card:after 同构） */
.entry-card::after {
  content: counter(entry-no, decimal-leading-zero);
  position: absolute;
  top: 13px; right: 22px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  pointer-events: none;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
  border-color: var(--brand-ring);
}

.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }

.tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.6;
  padding: 2px 9px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  text-transform: uppercase;
}

.entry-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.25px;
  margin-bottom: 11px;
  padding-right: 34px;
}

.entry-card p {
  color: var(--ink2);
  font-size: 14.5px;
  line-height: 1.75;
  margin-bottom: 11px;
}

.entry-card p:last-child { margin-bottom: 0; }

.entry-links {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 0.5px solid var(--line);
}

.entry-links li { margin-bottom: 6px; }
.entry-links li:last-child { margin-bottom: 0; }

.entry-links a {
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 0.5px solid transparent;
  transition: border-color .15s;
}

.entry-links a::before { content: '↳ '; opacity: .55; }
.entry-links a:hover { border-bottom-color: currentColor; }

/* dark：卡片走玻璃态 + 青边辉光（mahoro .home-card dark 同构） */
:root[data-theme="dark"] .entry-card,
:root[data-theme="dark"] .status-card {
  background: linear-gradient(150deg, rgba(6,16,30,0.78), rgba(4,9,18,0.68));
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

:root[data-theme="dark"] .entry-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-pop), 0 0 18px rgba(127,220,255,0.18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .entry-card,
  :root:not([data-theme="light"]) .status-card {
    background: linear-gradient(150deg, rgba(6,16,30,0.78), rgba(4,9,18,0.68));
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
  }
  :root:not([data-theme="light"]) .entry-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-pop), 0 0 18px rgba(127,220,255,0.18);
  }
}

/* ══════════════════════════════════════════════════════════
   状态 / 页脚
   ══════════════════════════════════════════════════════════ */

.state {
  padding: 52px 20px;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  letter-spacing: -0.1px;
  color: var(--ink3);
}

.state .spinner {
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.site-foot {
  border-top: 0.5px solid var(--line);
  margin-top: 76px;
  padding: 30px 0 60px;
  color: var(--ink3);
  font-size: 13px;
  line-height: 1.75;
}

.site-foot p { max-width: 42em; margin-bottom: 10px; }

.foot-sig {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--ink4);
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════
   小屏
   ══════════════════════════════════════════════════════════ */

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .hero { padding: 34px 22px 34px; }
  .status-card { padding: 20px 19px 18px; }
  .status-headline { margin-left: 0; width: 100%; }
  .status-grid { grid-template-columns: 1fr; gap: 3px 0; }
  .status-grid dd { margin-bottom: 13px; }
  .status-grid dd:last-child { margin-bottom: 0; }
  .section { padding-top: 46px; }
  .entry-card { padding: 22px 18px 19px; }
  .entry-title { font-size: 17.5px; }
  .ticked { background-image: none; }   /* 小卡片上套准标记会挤 */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
