@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/space-grotesk-regular.5ede28c4425f.ttf") format("truetype");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/space-grotesk-bold.7209bbb75fc0.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/noto-sans-sc-regular.faa6c9df6521.otf") format("opentype");
}
@font-face {
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/noto-sans-sc-bold.c6cb5a93abaa.otf") format("opentype");
}
:root {
  --ink: #15171c;
  --paper: #f5f1ea;
  --accent: #e4572e;
  --sand: #cfc6b8;
  --bg: var(--paper);
  --text: var(--ink);
  --line: var(--sand);
  color-scheme: light;
  background: var(--bg);
  color: var(--text);
}

:root[data-theme="dark"] {
  --bg: var(--ink);
  --text: var(--paper);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--ink);
    --text: var(--paper);
    color-scheme: dark;
  }
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

html[lang="zh-Hans"] body {
  font-family: "Noto Sans SC", "Space Grotesk", sans-serif;
}

body::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--accent);
}

.wrap {
  width: min(40rem, calc(100% - 2rem));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  background: var(--bg);
  color: var(--text);
  padding: 0.5rem 0.75rem;
}

.skip:focus {
  top: 0.75rem;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

.brand {
  display: block;
  flex: 1 1 12rem;
  max-width: 16.5rem;
  line-height: 0;
}

.brand img {
  width: 100%;
  height: auto;
}

.logo-dark {
  display: none;
}

:root[data-theme="dark"] .logo-light {
  display: none;
}

:root[data-theme="dark"] .logo-dark {
  display: block;
}

:root[data-theme="light"] .logo-light {
  display: block;
}

:root[data-theme="light"] .logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light {
    display: none;
  }

  :root:not([data-theme="light"]) .logo-dark {
    display: block;
  }
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lang,
.theme {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.lang:hover,
.theme:hover {
  background: var(--sand);
  color: var(--ink);
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(2rem, 7vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.intro {
  margin: 0;
  max-width: 38rem;
  font-size: 1.125rem;
}

.explore {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: item;
}

.explore li {
  counter-increment: item;
  border-top: 1px solid var(--line);
  padding: 0.9rem 0 1rem;
}

.explore li:last-child {
  border-bottom: 1px solid var(--line);
}

.explore li::before {
  content: counter(item, decimal-leading-zero);
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.explore strong {
  font-weight: 700;
}

.note {
  margin: 0;
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
}

.limits {
  margin: 0.5rem 0 0;
}

main a {
  color: inherit;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

main a:hover {
  background: var(--sand);
  color: var(--ink);
}

.footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0.4rem 0;
}

.licenses {
  font-size: 0.95rem;
}

.site-links a,
.licenses a {
  color: inherit;
  margin-right: 1rem;
}

.site-links a:hover,
.licenses a:hover {
  background: var(--sand);
  color: var(--ink);
}

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

::selection {
  background: var(--accent);
  color: var(--ink);
}

@media (min-width: 900px) {
  .wrap {
    width: min(42rem, calc(100% - 6rem));
  }

  .calc-page .wrap {
    width: min(68rem, calc(100% - 3rem));
  }

  .header {
    padding-top: 2rem;
  }

  .brand {
    max-width: 18rem;
  }
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1rem;
}

@media (min-width: 720px) {
  .calc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.95rem;
}

.field input,
.field select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  width: 100%;
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.8rem 0;
}

.checks label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  min-height: 44px;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.5rem;
}

.pillar {
  border: 1px solid var(--line);
  min-width: 0;
  text-align: center;
}

.pillar-day {
  border: 2px solid var(--accent);
}

.pillar h3 {
  margin: 0;
  padding: 0.4rem 0.2rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
}

:root[data-theme="dark"] .pillar h3,
:root:not([data-theme="light"]) .pillar h3 {
  background: var(--sand);
  color: var(--ink);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .pillar h3 {
    background: var(--ink);
    color: var(--paper);
  }
}

.glyph {
  margin: 0.2rem 0;
  font-size: 2.4rem;
  line-height: 1.1;
  font-weight: 700;
}

.chip {
  margin: 0.15rem 0.25rem;
  border: 1px solid var(--sand);
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 0.1rem 0.15rem;
}

.chip-bad {
  border-color: var(--accent);
  color: var(--ink);
}

:root[data-theme="dark"] .chip-bad {
  color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip-bad {
    color: var(--accent);
  }
}

.chip-mixed {
  background: var(--sand);
  color: var(--ink);
  border-color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 0.35rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.bar-track {
  flex: 1 1 auto;
  min-width: 4rem;
  height: 0.7rem;
}

.bar-fill {
  display: block;
  height: 100%;
}

.wx-fg-0 { color: #3e8e5e; }
.wx-fg-1 { color: #e4572e; }
.wx-fg-2 { color: #b0832f; }
.wx-fg-3 { color: #8a8f98; }
.wx-fg-4 { color: #2f6fa8; }
.wx-bg-0 { background-color: #3e8e5e; }
.wx-bg-1 { background-color: #e4572e; }
.wx-bg-2 { background-color: #b0832f; }
.wx-bg-3 { background-color: #8a8f98; }
.wx-bg-4 { background-color: #2f6fa8; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.error {
  border-left: 4px solid var(--accent);
  padding-left: 0.8rem;
}

/* Element-bar widths. External classes only; style-src stays 'self'. */
.bar-w-0 { width: 0%; }
.bar-w-1 { width: 1%; }
.bar-w-2 { width: 2%; }
.bar-w-3 { width: 3%; }
.bar-w-4 { width: 4%; }
.bar-w-5 { width: 5%; }
.bar-w-6 { width: 6%; }
.bar-w-7 { width: 7%; }
.bar-w-8 { width: 8%; }
.bar-w-9 { width: 9%; }
.bar-w-10 { width: 10%; }
.bar-w-11 { width: 11%; }
.bar-w-12 { width: 12%; }
.bar-w-13 { width: 13%; }
.bar-w-14 { width: 14%; }
.bar-w-15 { width: 15%; }
.bar-w-16 { width: 16%; }
.bar-w-17 { width: 17%; }
.bar-w-18 { width: 18%; }
.bar-w-19 { width: 19%; }
.bar-w-20 { width: 20%; }
.bar-w-21 { width: 21%; }
.bar-w-22 { width: 22%; }
.bar-w-23 { width: 23%; }
.bar-w-24 { width: 24%; }
.bar-w-25 { width: 25%; }
.bar-w-26 { width: 26%; }
.bar-w-27 { width: 27%; }
.bar-w-28 { width: 28%; }
.bar-w-29 { width: 29%; }
.bar-w-30 { width: 30%; }
.bar-w-31 { width: 31%; }
.bar-w-32 { width: 32%; }
.bar-w-33 { width: 33%; }
.bar-w-34 { width: 34%; }
.bar-w-35 { width: 35%; }
.bar-w-36 { width: 36%; }
.bar-w-37 { width: 37%; }
.bar-w-38 { width: 38%; }
.bar-w-39 { width: 39%; }
.bar-w-40 { width: 40%; }
.bar-w-41 { width: 41%; }
.bar-w-42 { width: 42%; }
.bar-w-43 { width: 43%; }
.bar-w-44 { width: 44%; }
.bar-w-45 { width: 45%; }
.bar-w-46 { width: 46%; }
.bar-w-47 { width: 47%; }
.bar-w-48 { width: 48%; }
.bar-w-49 { width: 49%; }
.bar-w-50 { width: 50%; }
.bar-w-51 { width: 51%; }
.bar-w-52 { width: 52%; }
.bar-w-53 { width: 53%; }
.bar-w-54 { width: 54%; }
.bar-w-55 { width: 55%; }
.bar-w-56 { width: 56%; }
.bar-w-57 { width: 57%; }
.bar-w-58 { width: 58%; }
.bar-w-59 { width: 59%; }
.bar-w-60 { width: 60%; }
.bar-w-61 { width: 61%; }
.bar-w-62 { width: 62%; }
.bar-w-63 { width: 63%; }
.bar-w-64 { width: 64%; }
.bar-w-65 { width: 65%; }
.bar-w-66 { width: 66%; }
.bar-w-67 { width: 67%; }
.bar-w-68 { width: 68%; }
.bar-w-69 { width: 69%; }
.bar-w-70 { width: 70%; }
.bar-w-71 { width: 71%; }
.bar-w-72 { width: 72%; }
.bar-w-73 { width: 73%; }
.bar-w-74 { width: 74%; }
.bar-w-75 { width: 75%; }
.bar-w-76 { width: 76%; }
.bar-w-77 { width: 77%; }
.bar-w-78 { width: 78%; }
.bar-w-79 { width: 79%; }
.bar-w-80 { width: 80%; }
.bar-w-81 { width: 81%; }
.bar-w-82 { width: 82%; }
.bar-w-83 { width: 83%; }
.bar-w-84 { width: 84%; }
.bar-w-85 { width: 85%; }
.bar-w-86 { width: 86%; }
.bar-w-87 { width: 87%; }
.bar-w-88 { width: 88%; }
.bar-w-89 { width: 89%; }
.bar-w-90 { width: 90%; }
.bar-w-91 { width: 91%; }
.bar-w-92 { width: 92%; }
.bar-w-93 { width: 93%; }
.bar-w-94 { width: 94%; }
.bar-w-95 { width: 95%; }
.bar-w-96 { width: 96%; }
.bar-w-97 { width: 97%; }
.bar-w-98 { width: 98%; }
.bar-w-99 { width: 99%; }
.bar-w-100 { width: 100%; }
