:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --fg: #0f172a;
  --muted: #566070;
  --line: #dfe4ea;
  --accent: #2457d6;
  --accent-soft: rgba(36, 87, 214, 0.09);
  --chip-bg: #ffffff;
  --chip-active: #e9edf4;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0f17;
    --fg: #e8ecf2;
    --muted: #98a3b3;
    --line: #232c3a;
    --accent: #7aa2ff;
    --accent-soft: rgba(122, 162, 255, 0.14);
    --chip-bg: #151b27;
    --chip-active: #273140;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

.wrap {
  width: min(960px, 100% - 2 * clamp(20px, 5vw, 48px));
  margin-inline: auto;
}

/* 顶栏 */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  flex: none;
  width: 32px;
  height: 32px;
}

@media (prefers-color-scheme: dark) {
  .brand-mark {
    filter: invert(1);
  }
}

/* 语言切换：分段按钮，当前语言高亮 */
.lang {
  flex: none;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
}

.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 36px; /* 加上外框，触控区域高 44px */
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.lang a[aria-current="true"] {
  color: var(--fg);
  background: var(--chip-active);
  font-weight: 600;
}

/* 主体 */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 32px 48px;
}

.status {
  align-self: flex-start;
  margin-bottom: 24px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 8vw, 88px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.04em;
}

.h1-small {
  font-size: clamp(30px, 6vw, 56px);
}

.lead {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2.4vw, 22px);
}

.lead + .lead {
  margin-top: 8px;
}

.back {
  display: inline-block;
  padding-block: 8px;
  color: var(--accent);
  text-decoration: none;
}

.back:hover {
  text-decoration: underline;
}

/* 刻度尺：指针逐寸前行 */
.ruler {
  position: relative;
  height: 28px;
  margin-top: 48px;
  background:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px) left bottom / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 60px) left bottom / 100% 20px no-repeat,
    linear-gradient(var(--line), var(--line)) left bottom / 100% 1px no-repeat;
}

.ruler::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3px;
  height: 28px;
  border-radius: 2px;
  background: var(--accent);
  animation: inch 9s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
}

@keyframes inch {
  from {
    left: 0;
  }
  to {
    left: calc(100% - 3px);
  }
}

/* 页脚：左版权，中间备案号 */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px 24px;
  padding-block: 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.icp {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.icp:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .site-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    text-align: center;
  }
}

/* 宽屏：放宽间距 */
@media (min-width: 641px) {
  .site-header {
    padding-block: 28px;
  }

  .brand {
    gap: 12px;
    font-size: 17px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding-block: 48px 72px;
  }

  .ruler {
    margin-top: 72px;
  }
}

/* 矮屏幕（手机横屏等）：收紧间距，让首页一屏放得下 */
@media (max-height: 560px) {
  .site-header {
    padding-block: 10px;
  }

  .hero {
    padding-block: 8px 16px;
  }

  .status {
    margin-bottom: 16px;
  }

  .ruler {
    margin-top: 16px;
  }

  .site-footer {
    padding-block: 14px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ruler::after {
    left: 38%;
    animation: none;
  }
}
