:root {
  color-scheme: light;
  --paper: #f3efe6;
  --card: #fbf8f1;
  --ink: #262720;
  --muted: #68675c;
  --line: #ded7c8;
  --cinnabar: #963d2c;
  --serif: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font: 15px var(--sans);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
button { font: inherit; }
:focus-visible { outline: 2px solid #a65741; outline-offset: 3px; }
a { color: #8e3c2d; text-underline-offset: 3px; }

.shell { width: min(100% - 88px, 1312px); margin: 0 auto; padding: 33px 0 42px; }
.header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "identity nav clock";
  align-items: center;
  gap: 14px 16px;
  padding: 0 0 20px;
  border-bottom: 1px solid #cfc6b5;
}
.identity { grid-area: identity; display: flex; align-items: center; gap: 14px; }
.identity h1 { margin: 0; font: bold clamp(29px, 3.6vw, 36px)/1 var(--serif); letter-spacing: .12em; white-space: nowrap; }
.seal { display: grid; place-content: center; gap: 4px; width: 42px; height: 42px; flex-shrink: 0; border-radius: 7px; background: #833927; }
.seal span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #f5e8d8; }
.seal span:nth-child(even) { background: linear-gradient(90deg, #f5e8d8 42%, transparent 42% 58%, #f5e8d8 58%); }
.site-nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f4eb;
}
.site-nav a { display: grid; place-items: center; min-height: 38px; padding: 5px 15px; border-radius: 5px; color: #5e4435; font-size: 14px; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { background: #efe7d9; }
.site-nav a[aria-current="page"] { color: #773421; background: #ebdcc8; font-weight: 700; }
.clock { grid-area: clock; justify-self: end; display: grid; gap: 5px; text-align: right; }
.clock span { color: var(--muted); font-size: 11px; letter-spacing: .13em; }
.clock time { font: 600 15px/1.3 ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }

.panel-surface { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 0 0 19px; }
.panel-heading h2 { margin: 0; font: bold 29px/1.25 var(--serif); }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-heading p:empty { display: none; }
input[type=text], input[type=number], select, textarea {
  min-width: 0; width: 100%; padding: 10px 11px; border: 1px solid #d4cbbb; border-radius: 6px;
  background: #fffdf7; color: var(--ink); font: inherit;
}
textarea { resize: vertical; }
.dark-button, .gold-button {
  border-radius: 6px; padding: 10px 15px; cursor: pointer; font: 600 14px/1.35 var(--sans); white-space: nowrap;
}
.dark-button { border: 1px solid #493625; background: #513a2c; color: #fff5e4; }
.dark-button:hover:not(:disabled) { background: #674734; }
.gold-button {
  border: 1px solid #d3aa73;
  background: linear-gradient(165deg, #eed5a6, #d6a468);
  color: #2d1a0f; font-weight: bold; letter-spacing: .04em;
}
.gold-button:hover:not(:disabled) { background: linear-gradient(165deg, #f8e2bc, #deaf74); }
.gold-button:active:not(:disabled) { transform: translateY(1px); }
.dark-button:disabled, .gold-button:disabled { cursor: wait; opacity: .65; }

.reading-articles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.reading-articles article { background: #f4eee3; padding: 17px 19px; border-top: 2px solid #baa181; border-radius: 0 0 6px 6px; }
.reading-articles h3 { color: #62412e; font-size: 16px; margin: 0 0 8px; }
.reading-articles p { margin: 0; line-height: 1.8; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reading-articles p + p { margin-top: 8px; }
.reading-summary { border-left: 3px solid #9e6246; margin: 0 0 16px; padding: 14px 18px; background: #f0e6d5; }
.reading-summary h3 { color: #6e432e; font-size: 13px; margin: 0 0 7px; }
.reading-summary p { margin: 0; font: 600 18px/1.65 var(--sans); overflow-wrap: anywhere; }
.reading-highlight { color: #8a3a27; font-weight: 750; }
.reading-prose { max-width: 49em; color: var(--ink); font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.reading-prose > p { margin: 0; white-space: pre-wrap; }
.reading-prose > p + p { margin-top: .8em; }
.reading-prose > p:first-child strong { color: #633a29; }
.reading-status { color: #813a2b; font-size: 13px; line-height: 1.65; }
.reading-status:empty { display: none; }
.reading-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 15px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 15px; color: var(--muted); font-size: 13px; }
.feedback-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.feedback-choice { min-height: 40px; padding: 7px 13px; border: 1px solid #d4c2ad; border-radius: 6px; color: #694733; background: #f9f3e9; font-weight: 600; cursor: pointer; }
.feedback-choice:hover:not(:disabled) { border-color: #9a7453; }
.feedback-choice[aria-pressed="true"] { border-color: #704b34; background: #704b34; color: #fff7e9; }
.feedback-choice:disabled { cursor: wait; opacity: .65; }

@media (max-width: 1010px) {
  .shell { width: calc(100% - 42px); }
}
@media (max-width: 800px) {
  .header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "identity clock" "nav nav";
    padding-bottom: 14px;
  }
  .site-nav a { padding-inline: 5px; }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); padding: 18px 0 25px; }
  .identity { gap: 9px; }
  .identity h1 { font-size: clamp(23px, 6vw, 29px); }
  .seal { width: 33px; height: 33px; }
  .site-nav a { font-size: 13px; }
  .clock time { font-size: 12px; }
  .reading-heading h2 { font-size: clamp(23px, 6.5vw, 29px); }
  .reading-articles { grid-template-columns: minmax(0, 1fr); }
}
