@font-face {
  font-family: Newsreader;
  src: url("newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Serif CJK SC";
  src: url("serifsc-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+2E80-9FFF, U+3000-303F, U+FF00-FFEF;
}

@font-face {
  font-family: "Serif CJK JP";
  src: url("serifjp-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+2E80-9FFF, U+3000-303F, U+FF00-FFEF;
}

:root {
  --paper: #f4f8fc;
  color-scheme: light;
  --ink: #233c55;
  --heading-ink: #152f4d;
  --panel-blue: #e8f1f9;
  --deep-blue: #0b223c;
  --on-deep-blue: #f4f8fc;
  --dark-accent: #d8b978;
  --accent: #205985;
  --secondary: #425c72;
  --white: #fff;
  --rule: #cfdeeb;
  --control-border: #718aa3;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --heading: Newsreader, Georgia, serif;
  --prose-leading: 1.65;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 100%;
}

:lang(zh) {
  --heading: "Serif CJK SC", Newsreader, "Songti SC", Georgia, serif;
  --prose-leading: 1.8;
}

:lang(ja) {
  --heading: "Serif CJK JP", Newsreader, "Hiragino Mincho ProN", Georgia, serif;
  --prose-leading: 1.8;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}
main { inline-size: 100%; overflow-wrap: anywhere; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; }

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

h1, h2, h3 { color: var(--heading-ink); font-family: var(--heading); font-weight: 600; }
h1, .article-title { margin: 0; font-size: clamp(1.5rem, 3.1vw, 2.25rem); line-height: 1.22; }
h2 { margin: 0; font-size: clamp(1.125rem, 2.2vw, 1.45rem); line-height: 1.35; }
p { margin: 0; }

.shell { max-inline-size: 74rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; padding-block: 1rem .65rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand img { display: block; flex: none; }
.brand-cn, .brand-en { display: block; }
.brand-cn { font-family: var(--heading); font-weight: 600; font-size: 1.075rem; line-height: 1.32; }
.brand-en { margin-top: .13rem; font-size: .66rem; font-weight: 650; letter-spacing: .035em; line-height: 1.3; text-transform: uppercase; }
.language-nav, .section-nav { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.section-nav { flex-basis: 100%; border-top: 1px solid var(--rule); padding-top: .4rem; }
.language-nav a, .section-nav a { display: inline-flex; align-items: center; min-block-size: 2.75rem; text-decoration: none; }
.language-nav a { font-size: .875rem; color: var(--secondary); }
.section-nav a { font-weight: 600; }
nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.article-body a, .source a { color: var(--accent); text-decoration: underline; }
.article-body a:visited, .source a:visited { color: #405977; }
.article-body a:hover, .source a:hover { text-decoration-thickness: 2px; }
.site-footer { margin-block-start: auto; padding-block: 1.35rem; color: var(--on-deep-blue); background: var(--deep-blue); border-top: 1px solid var(--rule); font-size: .875rem; }
.site-footer a:is(:hover, :focus-visible) { color: var(--dark-accent); outline-color: var(--dark-accent); }

.public-main { min-block-size: 52vh; padding-block: clamp(1.65rem, 5vw, 3.5rem) 3.25rem; }
.public-main > h1 { margin-bottom: 1.4rem; }
.article-list, .draft-list { list-style: none; padding: 0; margin: 0; }
.article-list { max-inline-size: 45rem; }
.article-card { padding-block: 1.1rem 1.2rem; border-top: 1px solid var(--rule); }
.article-card h2 { margin-block: .2rem .35rem; }
.article-card h2 a { text-decoration-thickness: 1px; }
.article-card p { color: var(--secondary); line-height: var(--prose-leading); }
.article-card time, .article-kicker, .main-title p, .draft-meta { color: var(--accent); font-size: .875rem; font-weight: 600; }
.empty, .hint { color: var(--secondary); }
.back { display: inline-flex; align-items: center; min-block-size: 2.75rem; font-weight: 600; }
.article { max-inline-size: 45rem; }
.article-header { margin-block: 1.25rem 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.article-title { margin-block: .45rem .65rem; }
.byline { color: var(--secondary); margin-block-end: .85rem; font-size: .875rem; }
.byline time { margin-inline-start: .65em; }
.author-label { color: var(--accent); font-weight: 650; }
.article-excerpt { color: var(--secondary); line-height: var(--prose-leading); }
.article-body { line-height: var(--prose-leading); }
.article-body > p { margin-block-end: .9em; }
.article:lang(zh) .article-body > p { text-indent: 2em; }
.article:lang(ja) .article-body > p { text-indent: 1em; }
.source { border-top: 1px solid var(--rule); margin-top: 1.35rem; padding-top: .85rem; }
.source span { color: var(--accent); margin-inline-end: .5em; font-weight: 650; }

.admin-main { max-inline-size: 54rem; padding-block: 2rem 3.5rem; }
.main-title { margin-block-end: 1.35rem; }
.main-title p { margin-block-start: .5rem; }
.panel { margin-block-end: 1.25rem; padding: clamp(.9rem, 3.5vw, 1.55rem); border: 1px solid var(--rule); background: var(--white); }
.panel-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; }
.panel .hint { margin-top: .35rem; }
.preview .article { margin: 1rem 0 0; }
.notice { border-inline-start: .25rem solid var(--accent); background: var(--panel-blue); margin-block-end: 1rem; padding: .65rem .85rem; }
.error { color: #812d1c; background: #f8ece7; border-color: #812d1c; }
form { display: grid; gap: .95rem; margin-top: 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
label { display: block; font-weight: 650; }
label .optional { color: var(--secondary); font-size: .8rem; font-weight: 400; }
input:not([type="hidden"]):not([type="checkbox"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  margin-top: .25rem;
  padding: .55rem .6rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--control-border);
  border-radius: .15rem;
  font-weight: 400;
}
textarea { resize: vertical; }
.case-confirm { display: flex; align-items: flex-start; gap: .55rem; font-weight: 400; }
.case-confirm input { flex: none; width: 1rem; height: 1rem; margin: .25em 0 0; accent-color: var(--accent); }
@supports selector(form:has(select option:checked)) {
  form:not([data-published-case]):not(:has(select[name="section"] option[value="cases"]:checked)) .case-confirm { display: none; }
}
.form-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
button { min-height: 2.75rem; padding: .45rem .8rem; border: 1px solid var(--ink); border-radius: .15rem; color: var(--ink); background: var(--white); font-weight: 650; cursor: pointer; }
button.primary { color: var(--white); background: var(--deep-blue); }
button:hover { border-color: var(--accent); color: var(--accent); }
button.primary:hover { background: var(--accent); color: var(--white); }
.draft-list { margin-top: .8rem; }
.draft-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem 1rem; padding-block: .65rem; border-top: 1px solid var(--rule); }
.draft-title { font-weight: 600; }
