:root {
  color-scheme: light;
  --paper: #f8f4ed;
  --green: #143f32;
  --sage: #c9d6bc;
  --ink: #29473a;
  --muted: #5b675e;
  --line: #d8d7cb;
  --gold: #e9a137;
  --red: #aa422e;
  --heading: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font: 16px/1.55 system-ui, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.symbols { position: absolute; width: 0; height: 0; }
.icon { width: 1.3em; height: 1.3em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.topbar { min-height: 68px; padding: 12px clamp(18px, 3.4vw, 52px); display: flex; gap: 12px; justify-content: space-between; align-items: center; background: #fffdf9; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--green); font: bold clamp(1.1rem, 2.25vw, 1.7rem)/1.2 var(--heading); text-decoration: none; }
.storage { color: var(--muted); font-size: .82rem; text-align: right; }
.layout { display: grid; grid-template-columns: clamp(188px, 17.7vw, 262px) minmax(0, 1fr); max-width: 1680px; margin: auto; min-height: calc(100dvh - 68px); }
.sidebar { padding: 54px 20px 24px clamp(20px, 2vw, 30px); border-right: 1px solid var(--line); }
.sidebar h2 { margin-left: 8px; font-size: clamp(1.5rem, 2.65vw, 2.28rem); }
.ruled::after { content: ""; display: block; width: 50px; height: 3px; margin-top: 13px; border-radius: 4px; background: var(--gold); }
.sidebar nav { display: grid; gap: 9px; margin-top: 38px; }
.sidebar button { display: flex; align-items: center; gap: 13px; padding: 12px 16px; background: transparent; border: 0; border-radius: 8px; color: var(--green); font-size: clamp(1rem, 1.65vw, 1.38rem); text-align: left; white-space: nowrap; }
.sidebar button:hover { background: #e7ecdf; }
.sidebar [aria-current] { background: var(--sage); font-weight: 600; }
main { min-width: 0; padding: 34px clamp(20px, 2.5vw, 40px) 24px; }
.hero { min-height: clamp(245px, 21vw, 330px); position: relative; overflow: hidden; display: flex; align-items: center; background: var(--green); border-radius: 21px; color: #fffdf7; isolation: isolate; }
.hero-copy { padding: 40px clamp(24px, 5vw, 74px); }
.hero h1 { font-size: clamp(2.55rem, 5.4vw, 5rem); letter-spacing: .035em; }
.hero p { margin-top: 15px; font: 500 clamp(1rem, 1.8vw, 1.55rem)/1.6 var(--heading); letter-spacing: .04em; }
.swoop { width: clamp(105px, 10.7vw, 160px); display: block; margin-top: 21px; fill: none; stroke: #ed805c; stroke-width: 3; stroke-linecap: round; }
.hero-art { position: absolute; z-index: -1; width: 57%; max-height: 100%; object-fit: contain; object-position: right bottom; right: 0; bottom: 2px; }
.shelf { margin-top: 38px; }
.shelf-head { display: flex; gap: 17px; justify-content: space-between; align-items: center; margin-bottom: 33px; }
.shelf h2 { font-size: clamp(1.8rem, 3.25vw, 3rem); white-space: nowrap; }
.tools { display: flex; align-items: center; gap: 15px; width: min(100%, 620px); }
.search { display: flex; align-items: center; gap: 10px; padding: 0 15px; min-width: 0; flex: 1; border: 1px solid #9ba795; border-radius: 11px; color: #536958; }
.search input { min-width: 0; width: 100%; background: transparent; border: 0; padding: 10px 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 9px 19px; font-weight: 650; white-space: nowrap; }
.accent { background: var(--red); color: white; }
.accent:hover:not(:disabled) { background: #923421; }
.primary { background: var(--green); color: #fffdf7; }
.primary:hover:not(:disabled) { background: #215646; }
.notice { color: #853626; margin-bottom: 12px; }
.notice:empty { display: none; }
.empty { display: grid; justify-items: center; align-content: center; gap: 12px; text-align: center; padding: 35px 18px 31px; min-height: 350px; border: 1px solid #859b80; border-radius: 17px; background: #fdf9f240; }
.empty .illustration { width: 125px; height: 100px; margin-bottom: 6px; }
.empty h3 { font-size: clamp(1.5rem, 3vw, 2.55rem); }
.empty p { color: var(--muted); max-width: 33ch; }
.empty .button { margin-top: 12px; }
.record { background: #fffdf8; border: 1px solid var(--line); border-radius: 13px; padding: 16px 20px; margin-bottom: 12px; }
.record summary { cursor: pointer; overflow-wrap: anywhere; }
.record-title { font-weight: 700; font-size: 1.16rem; }
.record-meta { display: block; margin: 5px 0 0 17px; color: var(--muted); font-size: .84rem; }
.record-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 18px 0; }
.record button { background: transparent; border-color: #9ba795; }
footer { display: flex; align-items: center; gap: 18px; margin-top: 32px; color: var(--muted); text-align: center; font: .88rem var(--heading); letter-spacing: .1em; }
footer::before, footer::after { content: ""; height: 1px; background: var(--line); flex: 1; }
dialog { width: min(530px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 23px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
dialog::backdrop { background: #17382db0; }
dialog form { display: grid; gap: 15px; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-actions { justify-content: flex-end; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; background: none; border: 0; border-radius: 8px; }
.icon-button:hover { background: var(--sage); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
form label { display: grid; gap: 5px; min-width: 0; }
form :is(select, input, textarea) { width: 100%; min-width: 0; background: #fffdf9; border: 1px solid #a4ad9d; border-radius: 7px; padding: 9px; }
form textarea { resize: vertical; }
@media (max-width: 1000px) { .hero-art { opacity: .65; } .tools { width: min(64%, 620px); } }
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { padding: 12px 17px 0; border: 0; }
  .sidebar h2 { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
  .sidebar button { gap: 4px; font-size: .9rem; padding: 7px 8px; min-height: 40px; }
  main { padding: 14px 17px 24px; }
  .hero { min-height: 260px; align-items: flex-start; }
  .hero-copy { padding: 26px 21px; }
  .hero-art { width: min(75%, 365px); opacity: 1; }
  .shelf { margin-top: 26px; }
  .shelf-head { display: grid; margin-bottom: 20px; }
  .tools { width: 100%; gap: 9px; }
  .tools .button { padding-inline: 13px; }
  .empty { min-height: 300px; }
  footer { gap: 8px; font-size: .78rem; letter-spacing: 0; }
}

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 25rem); display: grid; gap: 1rem; padding: 2rem; border: 1px solid #d8dece; border-radius: 1rem; background: #fffdf7; }
.login-card img { object-fit: contain; }
.login-card h1, .login-card p { margin: 0; }
.login-card label { display: grid; gap: .35rem; }
.login-card input { width: 100%; padding: .65rem .75rem; border: 1px solid #a9b49d; border-radius: .5rem; font: inherit; }
.login-card .notice:empty { display: none; }
.account-tools { display: flex; align-items: center; gap: .75rem; }
