:root {
  font-family: Inter, "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #172e26;
  background: #f5f6f2;
  --ink: #193e32;
  --muted: #596b61;
  --line: #d8dfd6;
  --accent: #daefb1;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
button, input, textarea { border: 1px solid var(--line); }
button { background: white; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #558d68; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.container { width: calc(100% - clamp(28px, 6vw, 100px)); max-width: 1536px; margin-inline: auto; }
.masthead { background: var(--ink); color: #fff; }
.brand-bar, .brand, .source, .heading, .toolbar, .result-controls, .pager, .actions,
.dialog-heading, footer { display: flex; align-items: center; }
.brand-bar { min-height: 46px; justify-content: space-between; }
.brand { gap: 10px; font-size: 14px; font-weight: 700; letter-spacing: .05em; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); gap: 2px; transform: rotate(-7deg); }
.brand-mark i { height: 8px; background: var(--accent); border-radius: 2px; }
.brand-mark i:last-child { border-radius: 2px 2px 6px 2px; background: #82b598; }
.source { gap: 7px; font-size: 12px; color: #deebdf; }
.source span { color: var(--accent); font-size: 17px; font-weight: 700; }
main { padding-bottom: 30px; }
.heading { justify-content: space-between; gap: 14px; padding: 23px 0 21px; }
h1 { font-size: clamp(26px, 2.25vw, 36px); line-height: 1.25; letter-spacing: -.045em; }
#overview { margin-top: 6px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.primary, .secondary { padding: 8px 14px; border-radius: 8px; font-size: 13px; line-height: 20px; font-weight: 650; }
.primary { color: white; background: var(--ink); border-color: var(--ink); }
.primary:hover { background: #2a5645; }
.primary span { color: var(--accent); font-size: 17px; line-height: 1; vertical-align: -1px; }
.secondary:hover, .close:hover { background: #edf2e9; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
a.secondary { display: inline-block; background: white; border: 1px solid var(--line); }
a.primary:hover, a.secondary:hover { text-decoration: none; }
.brand-bar > a { color: white; }
.brand-bar > a.account-action { font-size: 13px; }
.rules-main { width: min(820px, calc(100% - 32px)); margin: 0 auto; padding: 8px 0 40px; }
.rules-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.rules-prose, .rules-form, .rules-compare { border-top: 1px solid var(--line); padding: 18px 0; overflow-wrap: anywhere; }
.rules-heading h1 { font-size: 30px; letter-spacing: 0; }
.rules-main h2 { margin: 24px 0 8px; font-size: 18px; color: var(--ink); }
.rules-prose > :first-child { margin-top: 0; }
.rules-main ul { margin: 0; padding-left: 1.4em; }
.rules-main li, .rules-prose p, .rules-compare p { font-size: 14px; line-height: 1.8; margin: 5px 0; }
.rules-main li::marker { color: #538266; }
.rules-form label { margin: 0 0 10px; font-weight: 600; }
.rules-form textarea { line-height: 1.65; font-size: 15px; margin-bottom: 14px; }
.rules-notice { margin: 0 0 12px; padding: 10px 14px; background: #e3efda; border-radius: 6px; font-size: 14px; }
.rules-compare { margin-bottom: 12px; }
.rules-compare summary { cursor: pointer; }
@media (max-width: 540px) { .heading:has(.heading-actions) { flex-wrap: wrap; } }
.categories { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.category { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; padding: 6px 10px; border-radius: 7px; border-color: transparent; background: transparent; color: #48594f; font-size: 13px; font-weight: 600; text-align: left; }
.category:hover { background: #e9ede5; }
.category > span:first-child { overflow-wrap: anywhere; }
.category[aria-pressed="true"] { background: var(--accent); color: #203d27; border-color: #c3db9c; }
.badge { min-width: 20px; padding: 1px 5px; border-radius: 4px; background: #e4e9e1; color: #465a4b; text-align: center; font-size: 11px; line-height: 15px; font-variant-numeric: tabular-nums; }
.category[aria-pressed="true"] .badge { background: #c2dc98; color: #233e24; }
.toolbar { justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; scroll-margin-top: 8px; }
.search-box { width: min(299px, 100%); display: flex; align-items: center; gap: 9px; background: white; border: 1px solid #cfd8ce; border-radius: 7px; padding: 0 11px; }
.search-box:focus-within { outline: 2px solid #75a484; outline-offset: 1px; }
.search-box input { width: 100%; min-width: 0; height: 33px; border: 0; background: transparent; outline: none; font-size: 13px; color: inherit; }
input::placeholder { color: #69796f; }
.magnifier { width: 12px; height: 12px; flex: 0 0 12px; border: 1.6px solid #687b6d; border-radius: 50%; position: relative; margin-right: 2px; }
.magnifier::after { content: ""; position: absolute; width: 6px; height: 1.6px; background: #687b6d; top: 8px; left: 8px; transform: rotate(45deg); transform-origin: left; }
.result-controls { margin-left: auto; gap: 13px; flex-wrap: wrap; }
#count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager { gap: 3px; }
.pager button { min-width: 29px; height: 29px; border-radius: 6px; border-color: transparent; background: transparent; font-size: 13px; font-weight: 600; }
.pager button:first-child, .pager button:last-child { font-size: 22px; line-height: 1; }
.pager button:hover:enabled { background: #e3eae0; }
.pager button[aria-current="page"], .pager button[aria-current="page"]:hover { background: var(--ink); color: white; }
.pager button:disabled { color: #98a49a; }
.ellipsis { color: var(--muted); font-size: 12px; }
.bottom-pages { justify-content: center; margin-top: 16px; }

#records { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 12px; }
.card { min-width: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px #253b2b09; overflow: hidden; }
.card:hover, .card:focus-within { border-color: #b1c3ad; }
.identity { display: flex; align-items: center; gap: 10px; margin: 15px 15px 0; }
.avatar { --tile: #dcdfc5; --motif: #c6cca3; --letter: #49522c; flex: none; width: 39px; height: 39px; border-radius: 10px; display: grid; place-items: center; color: var(--letter); background: radial-gradient(circle at 98% 104%, transparent 0 13%, var(--motif) 14% 28%, transparent 29% 36%, var(--motif) 37% 42%, transparent 43%), var(--tile); font-size: 16px; font-weight: 750; }
.avatar[data-tone="1"] { --tile: #d7e5ea; --motif: #bdd5df; --letter: #31586b; }
.avatar[data-tone="2"] { --tile: #fae1cc; --motif: #f0cdb2; --letter: #774b30; }
.avatar[data-tone="3"] { --tile: #e4dbec; --motif: #d3c4e2; --letter: #614675; }
.avatar[data-tone="4"] { --tile: #d1e7da; --motif: #b7d9c6; --letter: #335d46; }
.avatar[data-tone="5"] { --tile: #f3dbdc; --motif: #e7c4c8; --letter: #78474d; }
.person { flex: 1; min-width: 0; }
.person h2 { font-size: 16px; line-height: 1.45; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-meta { margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.platform-tag { display: inline-block; margin-right: 5px; padding: 1px 5px; border-radius: 4px; background: #e6efe8; color: #31583d; font-size: 11px; font-weight: 650; }
.platform-filter { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.platform-filter select { height: 35px; padding: 0 8px; font: inherit; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 7px; }
.source-hint { margin-top: -7px; font-size: 12px; color: var(--muted); }
.metric { flex: none; display: grid; gap: 1px; justify-items: end; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 10px; line-height: 1.3; }
.metric strong { font-size: 18px; letter-spacing: -.035em; line-height: 1.25; }
.excerpt { flex: 1; padding: 10px 15px 12px; }
.excerpt-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); }
.text-button { border: 0; background: transparent; padding: 4px 0 4px 8px; font-size: 11px; color: #3a6753; }
.text-button:hover { text-decoration: underline; }
.description { margin-top: 2px; line-height: 1.55; font-size: 13px; color: #39483f; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; min-height: 3.1em; }
.actions { justify-content: space-between; gap: 6px; padding: 6px 15px; min-height: 34px; background: #fbfcf9; border-top: 1px solid #e9ede5; }
.work-link, .profile-link { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; }
.work-link { color: #25563c; font-size: 12px; font-weight: 650; }
.play { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: #e4efda; }
.play::after { content: ""; margin-left: 2px; border-block: 3.5px solid transparent; border-left: 5px solid #396344; }
.profile-link { color: #506758; font-size: 12px; }
.empty { grid-column: 1/-1; padding: 42px 20px; text-align: center; background: white; border: 1px dashed var(--line); border-radius: 12px; }
.empty h2 { font-size: 17px; }
.empty button { margin-top: 14px; }
dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 32px); color: inherit; border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 16px 60px #11291f38; }
dialog::backdrop { background: #11291f68; }
.dialog-heading { justify-content: space-between; gap: 15px; }
.dialog-heading h2 { font-size: 20px; overflow-wrap: anywhere; }
.close { flex: none; background: #f4f6f1; height: 30px; width: 30px; border-radius: 7px; font-size: 21px; line-height: 1; }
.full-work { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 14px; }
.full-work h3 { font-size: 13px; color: var(--muted); }
.full-work p { font-size: 14px; line-height: 1.75; margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
form label { display: grid; gap: 5px; margin: 13px 0; font-size: 13px; }
form input, textarea { color: inherit; border-radius: 7px; padding: 8px 10px; min-width: 0; width: 100%; }
textarea { resize: vertical; }
footer { justify-content: flex-end; gap: 8px; }
#error { color: #a03f34; font-size: 13px; margin-bottom: 10px; }

.login-page { min-height: 100dvh; display: flex; flex-direction: column; }
.login-main { flex: 1; display: grid; place-items: center; padding: 48px 20px max(48px, 12vh); }
.login-form { width: min(384px, 100%); background: white; border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: 8px; padding: 32px; }
.login-form h1 { font-size: 26px; letter-spacing: 0; margin-bottom: 24px; }
.login-form label { margin: 16px 0 7px; color: var(--ink); font-weight: 600; }
.login-form input { height: 44px; font-size: 16px; }
.login-form .primary { width: 100%; margin-top: 24px; min-height: 44px; font-size: 15px; }
.login-error { color: #a03f34; font-size: 13px; line-height: 1.5; }
.login-error:not(:empty) { margin-top: 14px; }
.account-actions { display: flex; align-items: center; gap: 16px; }
.account-action { margin: 0; }
.account-action button { border: 0; padding: 6px 0; background: transparent; color: white; font-size: 13px; }
.account-action button:hover { text-decoration: underline; }
.account-actions a.account-action { color: white; font-size: 13px; }
.login-page .brand { color: white; }
.login-form input[readonly] { background: #f5f6f2; color: var(--muted); }
.back-link { display: block; margin-top: 16px; text-align: center; font-size: 13px; }
.login-notice:not(:empty) { margin-bottom: 16px; color: var(--ink); font-size: 14px; }
@media (max-width: 430px) { .account-actions .source { display: none; } }

@media (max-width: 1179px) {
  #records { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 859px) {
  #records { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .heading { padding: 18px 0 16px; }
}
@media (max-width: 620px) {
  .container { width: calc(100% - 24px); }
  .brand-bar { min-height: 40px; }
  .heading { padding: 15px 0; }
  .categories { gap: 3px; padding-bottom: 9px; }
  .category { padding: 5px 7px; font-size: 12px; gap: 4px; }
  .toolbar { margin: 10px 0; gap: 6px; }
  .search-box { flex: 1 0 180px; }
  .result-controls { gap: 4px; }
  .pager { gap: 1px; }
  .pager button { min-width: 25px; height: 27px; padding: 0 3px; }
  .identity { gap: 6px; margin: 11px 10px 0; }
  .avatar { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
  .person h2 { font-size: 14px; }
  .metric strong { font-size: 15px; }
  .excerpt { padding: 6px 10px 9px; }
  .actions { padding: 5px 10px; }
}
@media (max-width: 449px) {
  #records { grid-template-columns: minmax(0, 1fr); }
  .search-box { flex-basis: 100%; }
  .result-controls { width: 100%; justify-content: space-between; }
}
