/* ============================================================
   time.worldunity.cn — 北京时间授时（UTC+8）
   ============================================================ */
:root {
  --bg: #0a0608;
  --panel: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 120, 100, 0.16);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f6ece6;
  --dim: rgba(246, 236, 230, 0.55);
  --red: #ff5a5f;
  --red-2: #ff9a8a;
  --gold: #ffc36b;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #fff; }

h1, h2, h3 { margin: 0 0 .6em; line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; color: var(--dim); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: rgba(246, 236, 230, 0.35); }
.small { font-size: .84rem; }

/* 背景 */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 90, 95, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 90, 95, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 76%);
}
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.glow--a { width: 640px; height: 640px; background: rgba(255, 90, 95, 0.16); top: -220px; right: -160px; }
.glow--b { width: 520px; height: 520px; background: rgba(255, 195, 107, 0.10); bottom: -220px; left: -180px; }

main, .top, .foot { position: relative; z-index: 2; }

/* 顶栏 */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  width: min(100% - 3rem, var(--max));
  margin: 0 auto;
  padding: 1.5rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  font-family: var(--mono);
  letter-spacing: .26em;
  font-size: .95rem;
}
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: .6rem;
  letter-spacing: .06em;
  color: var(--dim);
  margin-top: 2px;
}
.brand__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 90, 95, .14), 0 0 18px var(--red);
  animation: blink 2.4s ease-in-out infinite;
}
.top__nav { display: flex; align-items: center; gap: 1.3rem; }
.top__nav a { font-size: .84rem; color: var(--dim); }
.top__nav a:hover { color: var(--gold); }
.top__back { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; }

/* 英雄 */
.hero {
  width: min(100% - 3rem, var(--max));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0 2rem;
  text-align: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 90, 95, .07);
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .22em;
  color: var(--red-2);
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.hero h1 { margin: 1.1rem 0 .6rem; }
.hero h1 span {
  background: linear-gradient(100deg, var(--gold), #ffdfae 40%, var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__desc { max-width: 62ch; margin: 0 auto 2.4rem; }
.hero__desc b { color: var(--gold); }

.big-clock {
  position: relative;
  padding: clamp(1.6rem, 4vw, 2.8rem) 1rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(700px 240px at 50% 0%, rgba(255, 90, 95, .12), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 40px 90px -60px rgba(255, 90, 95, .8);
  overflow: hidden;
}
.big-clock::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(255, 90, 95, .05) 50%, transparent);
  animation: scan 6s linear infinite;
  pointer-events: none;
}
.big-clock__time {
  font-family: var(--mono);
  font-size: clamp(2.6rem, 10vw, 6.4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  color: #fff8f4;
  text-shadow: 0 0 40px rgba(255, 90, 95, .5);
  font-variant-numeric: tabular-nums;
}
.big-clock__time .ms { font-size: .42em; color: var(--gold); letter-spacing: 0; }
.big-clock__date { margin-top: .9rem; font-size: clamp(.85rem, 1.6vw, 1rem); letter-spacing: .16em; color: var(--dim); }
.big-clock__label { margin-top: .5rem; font-family: var(--mono); font-size: .64rem; letter-spacing: .3em; color: rgba(255, 195, 107, .7); }

.clock-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.clock-card {
  padding: 1rem .9rem;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  text-align: left;
}
.clock-card__label { font-size: .72rem; letter-spacing: .1em; color: var(--dim); }
.clock-card__time {
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--text);
  margin: .25rem 0 .1rem;
  font-variant-numeric: tabular-nums;
}
.clock-card__zone { font-family: var(--mono); font-size: .62rem; color: rgba(255, 195, 107, .65); }

/* 校准 */
.calib {
  margin-top: 1.2rem;
  padding: 1.3rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  text-align: left;
}
.calib__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.calib__label { font-size: .76rem; letter-spacing: .14em; color: var(--dim); display: block; }
.calib__value { font-family: var(--mono); font-size: clamp(1.3rem, 3vw, 1.9rem); color: var(--gold); margin-top: .2rem; }
.calib__value.is-bad { color: var(--red); }
.calib__bar { height: 4px; margin-top: 1rem; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.calib__bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--red), var(--gold)); transition: width .5s ease; }
.calib__note { font-size: .76rem; margin: .8rem 0 0; color: rgba(246, 236, 230, .38); }

.btn {
  padding: .6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 90, 95, .08);
  color: var(--red-2);
  font-family: inherit;
  font-size: .82rem;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .3s, border-color .3s, transform .3s;
}
.btn:hover { background: rgba(255, 90, 95, .18); border-color: var(--red); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: wait; }

/* 区块 */
.section { width: min(100% - 3rem, var(--max)); margin: 0 auto; padding: clamp(3.4rem, 8vw, 6rem) 0; }
.sec-head { max-width: 70ch; margin-bottom: 2.2rem; }
.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .3em;
  color: var(--red-2);
  margin-bottom: .8rem;
}
.sec-head h2 span { color: var(--red); }
.sec-head p { margin-bottom: 0; }

/* 状态 */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.stat { padding: 1.15rem 1.25rem; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--panel); }
.stat__label { display: block; font-size: .7rem; letter-spacing: .14em; color: var(--dim); margin-bottom: .35rem; }
.stat__value { font-size: .95rem; color: var(--text); word-break: break-all; }

/* 表格 */
.table-wrap { margin-top: 1.4rem; border-radius: 16px; border: 1px solid var(--line-soft); background: var(--panel); overflow: hidden; }
.table-title {
  padding: .9rem 1.2rem;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .24em;
  color: var(--gold);
  border-bottom: 1px solid var(--line-soft);
}
.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.tbl th, .tbl td { padding: .62rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.tbl th {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .16em;
  color: var(--dim);
  font-weight: 500;
  text-transform: uppercase;
}
.tbl td { font-family: var(--mono); font-size: .8rem; color: rgba(246, 236, 230, .78); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl--mini th { width: 32%; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.tab {
  padding: .55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: all .3s;
}
.tab:hover { color: var(--text); border-color: var(--line); }
.tab.is-active { color: #1b0608; background: linear-gradient(100deg, var(--gold), #ffe0b0); border-color: transparent; font-weight: 600; }
.code-panel { display: none; }
.code-panel.is-active { display: block; animation: fade .4s ease; }
.steps { margin: 0 0 1rem; padding-left: 1.3rem; color: var(--dim); font-size: .9rem; }
.steps li { margin-bottom: .35rem; }

pre {
  margin: 0 0 1rem;
  padding: 1.2rem 1.3rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .45);
  overflow-x: auto;
}
pre code { font-family: var(--mono); font-size: .82rem; color: #ffd9cd; line-height: 1.8; }
code {
  font-family: var(--mono);
  font-size: .85em;
  padding: .1em .35em;
  border-radius: 5px;
  background: rgba(255, 90, 95, .12);
  color: var(--gold);
}
pre code { background: none; padding: 0; }
.tip { font-size: .82rem; color: rgba(246, 236, 230, .45); }

.note {
  margin-top: 1.6rem;
  padding: 1.2rem 1.4rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 195, 107, .25);
  background: rgba(255, 195, 107, .06);
  font-size: .88rem;
  color: rgba(255, 230, 200, .88);
}
.note b { color: var(--gold); }

/* 说明 */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.6rem, 4vw, 3.4rem); }
.prose h3 { color: var(--text); margin-top: 1.4rem; }
.prose h3:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; color: var(--dim); font-size: .92rem; }
.prose li { margin-bottom: .45rem; }
.prose .tbl { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }

/* 页脚 */
.foot { border-top: 1px solid var(--line-soft); padding: 1.8rem 0 2.4rem; margin-top: 2rem; }
.foot__inner {
  width: min(100% - 3rem, var(--max));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.6rem;
  justify-content: space-between;
  font-size: .76rem;
  color: rgba(246, 236, 230, .38);
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

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

@media (max-width: 940px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
  .top__nav a:not(.top__back) { display: none; }
}
@media (max-width: 620px) {
  .clock-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .big-clock__time { font-size: clamp(2.4rem, 15vw, 3.4rem); }
}
