/* ==========================================================================
   田曦薇 · 粉丝工具平台 — 视觉体系
   米白 / 黑 / 深灰 / 少量暖金；细线、留白、数字、微弱网格。
   移动端优先，桌面端在 720px / 1080px 处增强。
   ========================================================================== */

:root {
  --paper: #f4f0e6;
  --paper-raise: #fbf8f0;
  --paper-hover: #fffdf7;
  --ink: #181612;
  --ink-2: #4c473d;
  --ink-3: #898375;
  --line: #e3ddcc;
  --line-strong: #d3cab5;
  --gold: #98722f;
  --gold-2: #b18c4c;
  --gold-soft: rgba(177, 140, 76, 0.1);
  --ok: #55704a;
  --ok-soft: rgba(85, 112, 74, 0.12);
  --warn: #a3702c;
  --bad: #a64936;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 420px at 82% -140px, rgba(177, 140, 76, 0.11), transparent 62%),
    linear-gradient(rgba(24, 22, 18, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 22, 18, 0.032) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
  background-position: center top, center, center;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部条 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 240, 230, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark { color: var(--gold-2); flex: none; }
.brand__text {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.topbar__meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ---------- 顶部 Hero ---------- */
.hero { padding: 44px 0 30px; }
.eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 29px;
  line-height: 1.28;
  letter-spacing: 0.02em;
}
.hero__sep { color: var(--gold-2); padding: 0 2px; font-weight: 400; }
.hero__sub {
  margin: 12px 0 2px;
  font-size: 14px;
  color: var(--ink-2);
}
.hero__en {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-3);
}
.hero__state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raise);
  font-size: 12px;
  color: var(--ink-2);
  max-width: 100%;
}
#globalStateText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 区块 ---------- */
.block { margin-top: 42px; }
.block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.block__head h2 {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.04em;
}
.block__num {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.block__en {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.26em;
  color: var(--ink-3);
  white-space: nowrap;
}
.block__action { display: inline-flex; align-items: center; gap: 12px; }

/* ---------- 入口卡片 ---------- */
.entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.entry {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 16px;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: 3px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.35s ease, background-color 0.35s ease;
}
@media (hover: hover) {
  .entry:hover { border-color: var(--line-strong); background: var(--paper-hover); }
  .entry:hover .entry__arrow { color: var(--gold); transform: translate(2px, -2px); }
  .entry:hover .entry__cta { color: var(--gold); }
}
.entry:active { background: #f7f2e6; }
.entry__ghost {
  position: absolute;
  top: 6px;
  right: 10px;
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1;
  color: var(--ink);
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
}
.entry__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.entry__tag {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
  padding: 3px 7px 3px 8px;
  border: 1px solid rgba(177, 140, 76, 0.35);
  border-radius: 2px;
  background: var(--gold-soft);
}
.entry__arrow {
  color: var(--ink-3);
  flex: none;
  transition: transform 0.35s ease, color 0.35s ease;
}
.entry__title {
  margin: 16px 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.03em;
}
.entry__meta {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--ink-2);
  font-size: 12.5px;
}
.entry__meta li { position: relative; }
.entry__meta li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 3px;
  height: 3px;
  margin-top: -1.5px;
  background: var(--gold-2);
  border-radius: 50%;
}
.entry__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink);
  transition: color 0.35s ease;
}
.entry--tool { flex-direction: column; }
.entry__cta--end { margin-top: auto; padding-top: 18px; }

/* ---------- 今日数据 ---------- */
.refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
  min-height: 36px;
  padding: 6px 14px;
  transition: color 0.3s ease, border-color 0.3s ease;
}
@media (hover: hover) {
  .refresh:hover { color: var(--gold); border-color: var(--gold-2); }
}
.refresh__icon { transition: transform 0.6s ease; }
.refresh.is-busy .refresh__icon { animation: spin 0.9s linear infinite; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  display: flex;
  flex-direction: column;
  min-height: 138px;
  padding: 15px 14px 13px;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.stat__label {
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.03em;
}
.stat__value {
  margin: 10px 0 2px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: var(--ink);
  word-break: break-all;
}
.stat__value--unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 3px;
  letter-spacing: 0;
}
.stat__value--muted { font-size: 17px; font-weight: 500; color: var(--ink-3); }
.stat__delta {
  margin: 4px 0 0;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  min-height: 17px;
}
.stat__delta .tri { vertical-align: -1px; margin-right: 3px; }
.stat__delta--up { color: var(--ok); }
.stat__delta--down { color: var(--bad); }
.stat__delta--flat { color: var(--ink-3); }
.stat__meta {
  margin: auto 0 0;
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.stat__meta--warn { color: var(--warn); }
.stat__sub {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--ink-3);
}
.stat-note {
  margin: 12px 2px 0;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* ---------- 骨架屏 ---------- */
.skl {
  display: inline-block;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0,0,0,0.05), rgba(0,0,0,0.09), rgba(0,0,0,0.05));
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skl--v { width: 72%; height: 28px; }
.skl--s { width: 46%; height: 12px; }
.skl--m { width: 60%; height: 11px; }

/* ---------- 数据状态 ---------- */
.status {
  margin: 0;
  padding: 0 2px;
  list-style: none;
  border-top: 1px solid var(--line);
}
.status__row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.status__name { color: var(--ink); letter-spacing: 0.03em; }
.status__time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.status__state {
  font-size: 11.5px;
  color: var(--ink-3);
  min-width: 56px;
  text-align: right;
  white-space: nowrap;
}
.status__state--ok { color: var(--ok); }
.status__state--warn { color: var(--warn); }
.status__state--bad { color: var(--bad); }

/* 状态点 */
.sdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  flex: none;
}
.sdot[data-dot="ok"] { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: breathe 2.6s ease-in-out infinite; }
.sdot[data-dot="warn"] { background: var(--warn); box-shadow: 0 0 0 3px rgba(163, 112, 44, 0.14); }
.sdot[data-dot="bad"] { background: var(--bad); box-shadow: 0 0 0 3px rgba(166, 73, 54, 0.12); }
.sdot[data-dot="loading"] { animation: blink 1.2s ease-in-out infinite; }

/* ---------- 底部 ---------- */
.footer {
  margin-top: 58px;
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  text-align: center;
}
.footer__mark {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink-2);
}
.footer__note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--ink-3);
}

/* ---------- 入场动效 ---------- */
.rise {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.72s cubic-bezier(0.22, 0.7, 0.2, 1) both;
}
.hero.rise { animation-delay: 0.04s; }
.block:nth-of-type(2).rise { animation-delay: 0.1s; }
.block:nth-of-type(3).rise { animation-delay: 0.16s; }
.block:nth-of-type(4).rise { animation-delay: 0.22s; }
.block:nth-of-type(5).rise { animation-delay: 0.28s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px var(--ok-soft); }
  50% { box-shadow: 0 0 0 5px rgba(85, 112, 74, 0.05); }
}
@keyframes blink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.8; }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   ≥720px：手机 → 平板/桌面
   ========================================================================== */
@media (min-width: 720px) {
  body { background-size: auto, 64px 64px, 64px 64px; }
  .wrap { padding: 0 32px; }
  .topbar__inner { height: 58px; }
  .brand__text { font-size: 16px; }
  .topbar__meta { font-size: 10px; }

  .hero { padding: 66px 0 40px; }
  .hero__title { font-size: 40px; }
  .hero__sub { font-size: 15px; }

  .block { margin-top: 58px; }
  .block__head { margin-bottom: 20px; }
  .block__head h2 { font-size: 20px; }

  .entry-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .entry { padding: 24px 22px 18px; }
  .entry--tool { flex-direction: row; align-items: stretch; }
  .entry__tool-main { flex: 1; display: flex; flex-direction: column; }
  .entry__cta--end { margin: 0; align-self: flex-end; padding: 0; }

  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .stat { min-height: 152px; padding: 18px 18px 15px; }
  .stat__value { font-size: 34px; }
  .skl--v { height: 32px; }

  .status__row { grid-template-columns: 14px minmax(0, 1fr) auto auto; padding: 15px 2px; font-size: 13.5px; }
  .status__time { font-size: 11px; }
}

/* ==========================================================================
   ≥1080px：宽屏再放大留白
   ========================================================================== */
@media (min-width: 1080px) {
  .hero { padding: 84px 0 46px; }
  .hero__title { font-size: 46px; }
  .block { margin-top: 68px; }
  .stat__value { font-size: 36px; }
  .footer { margin-top: 74px; }
}

/* 小屏细节：≤379px 顶栏英文与 Hero 重复，隐藏避免拥挤（iPhone 窄屏） */
@media (max-width: 379px) {
  .topbar__meta { display: none; }
}

/* 小屏细节：≤360px 防拥挤 */
@media (max-width: 360px) {
  .wrap { padding: 0 16px; }
  .hero__title { font-size: 26px; }
  .stat { min-height: 128px; padding: 13px 12px 12px; }
  .stat__value { font-size: 26px; }
  .status__state { min-width: 0; }
  .status__row { gap: 8px; }
}

/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  .rise,
  .sdot[data-dot="ok"],
  .sdot[data-dot="loading"],
  .skl,
  .refresh__icon {
    animation: none !important;
  }
  .rise { opacity: 1; transform: none; }
  .entry,
  .entry__arrow,
  .entry__cta,
  .refresh { transition: none; }
}
