/* An academic register: ivory paper, serif headings, numbered chapters, rules instead of boxes. */
:root {
  --paper: #f8f6f1;
  --paper-2: #f1eee6;
  --ink: #1b2230;
  --ink-2: #39404d;
  --muted: #6b6f78;
  --line: #d8d3c7;
  --burgundy: #7d2433;
  --serif-latin: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --serif-zh: 'Songti SC', STSong, 'Noto Serif SC', 'Source Han Serif SC', 'Source Han Serif', SimSun, serif;
  --serif: var(--serif-latin), var(--serif-zh);
  --sans: 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 64px);
  --wrap: min(1080px, 100% - var(--gutter) * 2);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.9; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, p, ol, figure, table { margin: 0; padding: 0; }
a:focus-visible, input:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }
::selection { background: color-mix(in oklab, var(--burgundy) 18%, white); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.inner { width: var(--wrap); margin-inline: auto; }
code { font-family: var(--mono); font-size: .86em; padding: 1px 5px; background: var(--paper-2); border: 1px solid var(--line); white-space: nowrap; }
.chapter-body a:not(.apply), .abstract a, .colophon a, .utility a { color: var(--burgundy); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Utility strip, as on a university site. */
.utility { background: var(--ink); color: #d6d9de; font-size: 12.5px; letter-spacing: .04em; }
.utility .inner { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.utility a { color: #fff; text-decoration-color: rgb(255 255 255 / 40%); }
.utility [data-owner] { font-family: var(--serif-latin); }

/* Masthead: emblem, title, table of contents; closed by a double rule. */
.masthead { border-bottom: 3px double var(--ink); }
.masthead-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 28px; padding: 36px 0 30px; }
.emblem { display: block; width: 104px; height: 104px; }
.emblem img { display: block; width: 100%; height: 100%; }
.masthead h1 { display: grid; gap: 2px; font-weight: 400; }
.domain { font-family: var(--serif-latin); font-size: clamp(34px, 4.6vw, 52px); line-height: 1.1; letter-spacing: -.01em; }
.title-zh { font-family: var(--serif-zh); font-size: clamp(18px, 1.9vw, 22px); font-weight: 600; letter-spacing: .14em; }
.title-en { margin-top: 2px; font-family: var(--serif-latin); font-size: 14px; font-style: italic; color: var(--muted); letter-spacing: .02em; }
.contents-title { font-family: var(--serif-latin); font-size: 12px; font-style: italic; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.contents { display: grid; gap: 2px; padding-left: 28px; border-left: 1px solid var(--line); font-size: 14px; }
.contents a { display: flex; gap: 12px; text-decoration: none; color: var(--ink-2); padding: 1px 0; }
.contents a:hover { color: var(--burgundy); }
.contents span { width: 1.8em; font-family: var(--serif-latin); color: var(--burgundy); font-size: 13px; }

/* Abstract, set like the first page of a paper. */
.abstract { max-width: 760px; margin: clamp(40px, 6vw, 64px) auto 0; padding: 22px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.abstract p + p { margin-top: 8px; font-family: var(--serif-latin); font-size: 15.5px; line-height: 1.7; color: var(--muted); }
.abstract b { font-family: var(--serif); font-weight: 700; color: var(--ink); margin-right: 1em; }
.abstract .keywords { font-family: var(--sans); font-size: 14px; color: var(--ink-2); }

/* Numbered chapters: number and heading in the margin, text in the measure. */
.chapter { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 48px; padding: clamp(48px, 6vw, 72px) 0; border-bottom: 1px solid var(--line); }
.chapter:last-child { border-bottom: 0; }
.chapter-head { display: flex; align-items: baseline; gap: 14px; align-self: start; position: sticky; top: 24px; }
.chapter-no { font-family: var(--serif-latin); font-size: 40px; line-height: 1; color: var(--burgundy); font-variant-numeric: lining-nums; }
.chapter-head h2 { display: grid; font-family: var(--serif-zh); font-size: 20px; font-weight: 600; letter-spacing: .08em; line-height: 1.5; }
.chapter-head h2 span { font-family: var(--serif-latin); font-size: 14px; font-weight: 400; font-style: italic; letter-spacing: .02em; color: var(--muted); }
.chapter-body { max-width: 700px; }
.chapter-body > p + p, .chapter-body > p + form, .chapter-body > table + .figures { margin-top: 18px; }
.chapter-body strong { font-family: var(--serif-latin); }
.chapter-body [data-owner] { font-family: var(--serif-latin); font-weight: 600; }

sup { line-height: 0; font-size: .7em; }
sup a { font-family: var(--serif-latin); text-decoration: none !important; padding: 0 1px; }
.notes { list-style: none; margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); max-width: 16em; font-size: 13px; color: var(--muted); }
.notes li { display: flex; gap: 8px; max-width: none; white-space: nowrap; }
.notes a { font-family: var(--serif-latin); color: var(--burgundy); text-decoration: none !important; }
.rules { list-style: none; display: grid; gap: 14px; }
.rules li { display: grid; grid-template-columns: 3em minmax(0, 1fr); text-wrap: pretty; }
.rules li > span { font-family: var(--serif-latin); color: var(--burgundy); }

/* Three-line table (booktabs): heavy top and bottom rules, a light rule under the head. */
.registry { width: 100%; border-collapse: collapse; font-size: 15px; }
.registry caption { caption-side: top; text-align: left; padding-bottom: 10px; font-size: 14px; color: var(--ink-2); }
.registry caption span, figcaption span { font-family: var(--serif); font-weight: 700; color: var(--ink); margin-right: .8em; }
.registry thead tr { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.registry tbody tr:last-child { border-bottom: 2px solid var(--ink); }
.registry th { font-family: var(--serif-zh); font-weight: 600; text-align: left; padding: 8px 16px 8px 0; }
.registry td { padding: 10px 16px 10px 0; vertical-align: baseline; }
.registry .num { font-family: var(--serif-latin); color: var(--muted); width: 3.5em; }
.registry .address a { font-family: var(--serif-latin); font-size: 17px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .2s ease, color .2s ease; }
.registry .address a span { color: var(--muted); }
/* Like a member colour in an idol group's profile: each society's own site colour. */
.registry .colour { white-space: nowrap; }
.registry .colour i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: .05em; background: var(--muted); }
.registry .colour code { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12.5px; }
.registry tr[data-name="gdut"] .colour i { background: #b42342; }
.registry tr[data-name="sdut"] .colour i { background: #2f7d79; }
.registry .address a:hover { color: var(--burgundy); border-color: var(--burgundy); }

.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 36px; }
figure a { display: block; border: 1px solid var(--line); background: #fff; padding: 6px; transition: border-color .2s ease; }
figure a:hover { border-color: var(--ink-2); }
figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
figcaption { margin-top: 10px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }

/* Lookup form: a plain boxed field and a stated result. */
.lookup-form { margin-top: 28px; padding: 24px; background: var(--paper-2); border: 1px solid var(--line); }
.lookup-form label { display: block; font-family: var(--serif-zh); font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.lookup { display: flex; align-items: baseline; max-width: 520px; background: #fff; border: 1px solid var(--ink-2); font-family: var(--serif-latin); font-size: 22px; }
.lookup:focus-within { outline: 2px solid var(--burgundy); outline-offset: 2px; }
.lookup input { flex: 1; min-width: 0; padding: 10px 2px 10px 14px; border: 0; background: transparent; color: var(--ink); font: inherit; outline: none; text-align: right; }
.lookup input::placeholder { color: #b7b3aa; font-style: italic; }
.lookup-suffix { padding-right: 14px; color: var(--muted); }
.result { display: flex; gap: 14px; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.result-label { flex-shrink: 0; font-family: var(--serif-zh); font-weight: 600; color: var(--ink); }
#status[data-state="open"] { color: #2e6e6a; }
#status[data-state="taken"], #status[data-state="reserved"], #status[data-state="invalid"] { color: var(--burgundy); }
.apply { display: inline-block; margin-top: 18px; padding: 9px 22px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-family: var(--serif-zh); font-size: 15px; letter-spacing: .12em; text-decoration: none; transition: background-color .2s ease; }
.apply:hover { background: var(--burgundy); border-color: var(--burgundy); }
.apply[aria-disabled="true"] { background: transparent; color: var(--muted); border-color: var(--line); pointer-events: none; }

.colophon { margin-top: clamp(40px, 6vw, 72px); border-top: 3px double var(--ink); font-size: 13px; color: var(--muted); }
.colophon .inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding: 22px 0 36px; }
.colophon .domain-small { font-family: var(--serif-latin); font-size: 15px; color: var(--ink); margin-right: 1em; }
.colophon [data-owner] { font-family: var(--serif-latin); }

@media (max-width: 900px) {
  .masthead-inner { grid-template-columns: auto minmax(0, 1fr); }
  .contents { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 22px; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .chapter { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .chapter-head { position: static; }
}
@media (max-width: 600px) {
  .utility .inner { flex-direction: column; gap: 0; }
  .masthead-inner { gap: 18px; padding-top: 28px; }
  .emblem { width: 72px; height: 72px; }
  .title-zh { letter-spacing: .08em; }
  .figures { grid-template-columns: minmax(0, 1fr); }
  .registry thead { display: none; }
  .registry caption { display: block; }
  .registry, .registry tbody, .registry tr, .registry td { display: block; }
  .registry tbody { border-top: 2px solid var(--ink); }
  .registry tbody tr { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); padding: 10px 0; border-bottom: 1px solid var(--line); }
  .registry tbody tr:last-child { border-bottom: 2px solid var(--ink); }
  .registry td { padding: 0; }
  .registry .num { grid-row: 1 / span 3; }
  .registry td:not(.num) { grid-column: 2; }
  .registry td:nth-child(3), .registry td:nth-child(4), .registry td:nth-child(5) { font-size: 14px; color: var(--ink-2); }
  .lookup-form { padding: 18px; }
  .lookup { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
