/* ==========================================================================
   oszfoz.com — 全站样式
   单屏站点：深色默认，浅色可切换；变量驱动，不引任何框架。
   ========================================================================== */

:root {
  --radius: 10px;

  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #52525b;
  --card: #f4f4f5;
  --border: rgb(0 0 0 / 10%);
  --hover: rgb(0 0 0 / 5%);

  --brand-17: #7dd3fc;
  --brand-04: #a78bfa;
  --brand-10: #f472b6;

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;

  color-scheme: light;
}

.dark {
  --bg: #0a0a0a;
  --fg: #fafafa;
  --muted: #a1a1aa;
  --card: #171717;
  --border: rgb(255 255 255 / 10%);
  --hover: rgb(255 255 255 / 8%);

  color-scheme: dark;
}

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

html {
  height: 100%;
}

body {
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;

  display: flex;
  flex-direction: column;

  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ---------- 图标按钮 ---------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: none;

  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;

  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--fg);
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

/* ---------- 布局 ---------- */

.container {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.site-header {
  flex: none;
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand svg {
  width: 24px;
  height: 24px;
  flex: none;
}

#main:focus {
  outline: none;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 1.5rem;
}

.site-footer {
  flex: none;
  border-top: 1px solid var(--border);
}

.site-footer .container {
  padding-block: 0.9rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- 首屏 ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.4rem;
}

.display {
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.lede {
  max-width: 34rem;
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  color: var(--muted);
}

/* ---------- 链接行 ---------- */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  font-size: 0.9rem;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.links svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.links a:hover svg {
  color: inherit;
}

.links a:hover {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 404 等次级标题 */
.display--sm {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
}

/* ---------- 数字 ---------- */

.stats {
  display: grid;
  /* minmax(0, 1fr)：否则内容最小宽度会撑破网格，导致整页横向溢出 */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  width: 100%;
  margin-top: 0.25rem;

  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}

.stat {
  min-width: 0; /* 同上：允许收缩 */
  background: var(--card);
  padding: 0.85rem 1rem;
}

.stat__label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__value {
  margin-top: 0.15rem;
  /* 下限压到 0.85rem：360px 宽时 "2017.04.10" 才放得进 1/3 栏 */
  font-size: clamp(0.85rem, 3.2vw, 1.5rem);
  letter-spacing: -0.01em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 首屏隐藏、聚焦时出现 */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
}

.skip-link:focus {
  inset-inline-start: 1rem;
  top: 1rem;
  z-index: 50;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
}

/* 小屏：压缩留白，保证一屏放得下 */
@media (max-height: 680px) {
  main {
    padding-block: 0.6rem;
  }

  .hero {
    gap: 0.85rem;
  }

  .display {
    font-size: clamp(2.2rem, 9vw, 3.4rem);
  }

  .stat {
    padding: 0.7rem 0.85rem;
  }
}

@media (max-width: 420px) {
  .stat {
    padding: 0.7rem 0.6rem;
  }
}

/* 极窄视口：日期放不进 1/3 栏，再收一档字号与内边距 */
@media (max-width: 340px) {
  .stat {
    padding: 0.5rem 0.4rem;
  }

  .stat__label {
    font-size: 0.62rem;
  }

  .stat__value {
    font-size: 0.75rem;
    letter-spacing: -0.02em;
  }
}

/* 极矮视口（如 320×568）：再压一档，保证不出现滚动 */
@media (max-height: 600px) {
    .hero {
    gap: 0.7rem;
  }

  .display {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .lede {
    font-size: 0.85rem;
    line-height: 1.55;
  }

  .stat {
    padding: 0.55rem 0.65rem;
  }
}

/* ---------- 主题图标 ---------- */

.theme-icon-dark {
  display: none;
}

.dark .theme-icon-dark {
  display: block;
}

.dark .theme-icon-light {
  display: none;
}

/* ---------- 动效偏好 ---------- */

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

/* ---------- 语言切换 ---------- */

.lang {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.lang:hover {
  color: var(--fg);
  background: var(--hover);
}

/* 页头右侧动作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* 语言切换组 */
.langs {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.langs .lang {
  font-size: 0.75rem;
  padding: 0.25rem 0.35rem;
  text-align: center;
}

.langs .lang[aria-current="page"] {
  color: var(--fg);
  background: var(--hover);
}

/* 横屏手机等极矮视口（约 390px 高）：再压一档，保证仍是单屏 */
@media (max-height: 480px) {
    main {
    padding-block: 0.35rem;
  }

  .hero {
    gap: 0.55rem;
  }

  .display {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }

  .lede {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .stat {
    padding: 0.45rem 0.6rem;
  }

  .stat__label {
    font-size: 0.6rem;
  }

  .stat__value {
    font-size: clamp(0.75rem, 2.4vw, 1rem);
  }

  .links {
    font-size: 0.85rem;
  }
}

/* 语言过多时的折叠菜单 */
.lang-menu {
  position: relative;
}

.lang-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--fg);
  background: var(--hover);
  cursor: pointer;
  list-style: none;
}

.lang-menu > summary::-webkit-details-marker {
  display: none;
}

.lang-menu > summary::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  rotate: 45deg;
  translate: 0 -1px;
  opacity: 0.6;
}

.lang-menu > ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.4rem);
  z-index: 50;
  min-width: 9rem;
  padding: 0.3rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 12px 32px rgb(0 0 0 / 35%);
}

.lang-menu > ul a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.lang-menu > ul a:hover {
  background: var(--hover);
  color: var(--fg);
}

.lang-menu > ul a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
}

/* 仅读屏可见 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* RTL：下拉箭头方向镜像 */
[dir="rtl"] .lang-menu > summary::after {
  rotate: -45deg;
  translate: 0 1px;
}
