/* 闰年判定 · Leap Year Guide — Editorial Luxury, oxblood accent */
:root {
  --bg: oklch(97.5% 0.01 75);
  --bg-2: oklch(94.4% 0.014 75);
  --card: oklch(99.2% 0.005 75);
  --ink: oklch(26% 0.022 45);
  --ink-2: oklch(42% 0.02 45);
  --muted: oklch(56% 0.018 50);
  --line: oklch(88% 0.012 55);
  --line-strong: oklch(80% 0.014 55);
  --accent: oklch(45% 0.12 25);
  --accent-2: oklch(58% 0.12 25);
  --accent-soft: oklch(94.5% 0.03 25);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(45, 32, 24, 0.06);
  --shadow-2: 0 18px 42px -20px rgba(45, 32, 24, 0.24);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Songti SC", "STSong", serif;
  --sans: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

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

/* components that set display:flex/grid would otherwise override [hidden] (E12) */
[hidden] { display: none !important; }

html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 82% -10%, oklch(95.5% 0.035 25 / 0.5), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  letter-spacing: 0.001em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }

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

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap;
}
.brand .mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--ink); color: var(--bg);
  font-family: var(--serif); font-size: 17px; line-height: 1;
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  text-decoration: none; color: var(--ink-2);
  padding: 7px 11px; border-radius: 9px; font-size: 14.5px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.visits {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.visits b { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 600; min-width: 1ch; }
.lang {
  text-decoration: none; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 5px 12px; color: var(--ink-2); white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.lang:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.hero { padding: 58px 0 30px; }
.eyebrow {
  font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 16px;
}
h1.title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.08; letter-spacing: -0.012em; max-width: 24ch;
}
h1.title em { font-style: italic; color: var(--accent); }
.lede { margin-top: 16px; font-size: 17px; color: var(--ink-2); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  text-decoration: none; font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.1s ease, box-shadow 0.16s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent); box-shadow: var(--shadow-2); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.num-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px; padding: 30px 0 8px; }
.num {
  font-family: var(--serif);
  font-size: clamp(60px, 12vw, 136px);
  line-height: 0.92; letter-spacing: -0.03em; color: var(--ink);
}
.num .deg { color: var(--accent); }
.num-sub { color: var(--ink-2); font-size: 15px; }
.num-pop { animation: pop 0.6s ease both; }

section.block { padding: 30px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.01em; }
.section-head p { color: var(--muted); font-size: 14px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-1);
  min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.card .k { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.card .v { font-family: var(--serif); font-size: 25px; letter-spacing: -0.01em; word-break: break-word; }
.card .v .mono { font-family: var(--mono); font-size: 16px; }
.card .hint { margin-top: 6px; font-size: 13px; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fact {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  min-width: 0;
}
.fact dt { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fact dd { margin: 0; font-family: var(--serif); font-size: 20px; word-break: break-word; }
.fact dd .mono { font-family: var(--mono); font-size: 15px; }
.fact dd .exact { color: var(--accent); }
.fact.is-hot { border-color: var(--line-strong); background: oklch(98.8% 0.012 25); }

.prose { max-width: 74ch; color: var(--ink-2); }
.prose p { margin-bottom: 14px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code {
  font-family: var(--mono); font-size: 0.92em;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 8px 16px; min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { border: 0; outline: none; background: transparent; width: 100%; font-size: 15px; }
.search span { color: var(--muted); font-size: 14px; }

.squares-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sq {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none; min-width: 0;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.sq:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--accent-soft); }
.sq b { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.sq span { font-size: 12px; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); font-size: 14px; padding: 20px 0; }

/* data table for 361 angles */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td {
  padding: 8px 14px; text-align: right;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th {
  position: sticky; top: 0;
  background: var(--bg-2);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  font-weight: 600;
}
table.data td:first-child a { text-decoration: none; font-weight: 600; color: var(--accent); }
table.data td:first-child a:hover { text-decoration: underline; }
table.data tr:hover td { background: var(--accent-soft); }
table.data td.undef { color: var(--muted); }

.converter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; min-width: 0; }
.field label { font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }
.field input {
  width: 100%;
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 11px 14px; background: var(--card);
  font-size: 16px; font-family: var(--mono);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.result-box {
  flex: 2 1 320px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px;
  font-family: var(--mono); font-size: 15px;
  min-height: 44px; display: flex; align-items: center;
  word-break: break-all;
}
.result-box .muted { color: var(--muted); }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); padding: 4px 18px;
  transition: border-color 0.15s ease;
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 13px 0; font-weight: 600;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 18px; font-family: var(--mono); transition: transform 0.18s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--ink-2); padding-bottom: 14px; margin: 0; max-width: 72ch; }

.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding-top: 22px; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--line-strong); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.pager a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.pager a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pager a span { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.pager a b { font-family: var(--serif); font-size: 20px; }
.pager .next { text-align: right; align-items: flex-end; }

.site-footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 34px 0 48px; color: var(--muted); font-size: 13.5px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.footer-inner a { text-decoration: none; color: var(--ink-2); }
.footer-inner a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.965); } to { opacity: 1; transform: none; } }
.reveal { animation: fadeUp 0.6s ease both; animation-delay: var(--d, 0s); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .num-pop { animation: none; opacity: 1; transform: none; }
  .card, .sq, .btn, .lang { transition: none; }
}

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-3, .grid-2, .facts { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; align-items: flex-start; }
  .hero { padding-top: 40px; }
  .num-hero { gap: 10px; }
}
@media (max-width: 560px) {
  .header-inner { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 8px 14px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; }
  .nav a { white-space: nowrap; }
  .header-right { gap: 10px; }
  .visits span.lbl { display: none; }
}