/* Shared Ruizhi palette. Dark green carries text; leaf green marks selections. */
:root {
  color-scheme: light dark;
  --ground: #f5f6f3;
  --paper: #ffffff;
  --surface-2: #f2f5ef;
  --ink: #19251e;
  --muted: #54645a;
  --line: #d8dfd6;
  --edge: #a1afa3;
  --brand: #125f33;
  --accent: #38b035;
  --deep: #123e29;
  --lift: #e5f1e4;
  --focus: #186d46;
  --primary-bg: #125f33;
  --primary-hover: #0b4927;
  --on-primary: #fff;
  --warn: #78530e;
  --warn-bg: #fbf0d5;
  --error: #a03124;
  --error-bg: #fcece7;
  --overlay: #10231970;
  --radius: 14px;
  --shadow: 0 2px 6px #16291b08;
  --fast: 100ms;
  --settle: 180ms;
  --ease: cubic-bezier(.2,.7,.25,1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  accent-color: var(--brand);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111814; --paper: #19221d; --surface-2: #202c23; --ink: #eff5ee;
    --muted: #adbcad; --line: #36463b; --edge: #748879;
    --brand: #9ae29a; --lift: #243d2b; --deep: #0c2e1e; --focus: #aceda6;
    --primary-bg: #a1e59b; --primary-hover: #b6efaf; --on-primary: #112b19;
    --warn: #eac880; --warn-bg: #3c3220; --error: #ffb7a5; --error-bg: #3e2822;
    --overlay: #030b0785; --shadow: 0 3px 9px #00000016;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.55 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
button[aria-busy=true] { cursor: progress; }
a { color: var(--brand); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--lift); color: var(--brand); }
.btn, .text-btn { touch-action: manipulation; }
.btn {
  display: inline-flex; gap: .4em; align-items: center; justify-content: center;
  min-height: 42px; padding: 8px 16px; border: 1px solid var(--edge);
  border-radius: 9px; background: var(--paper); color: var(--brand);
  font-weight: 620; line-height: 1.4; text-decoration: none;
  transition: background-color var(--fast) ease, border-color var(--fast) ease, transform var(--fast) var(--ease);
}
.btn.primary { border-color: transparent; background: var(--primary-bg); color: var(--on-primary); }
.btn.warn { color: var(--warn); border-color: var(--warn); }
.btn.small-btn { min-height: 36px; padding: 5px 12px; font-size: 13px; }
.text-btn { background: transparent; color: var(--brand); border: 0; padding: 5px 1px; font-weight: 600; }
@media (hover:hover) {
  .btn:hover:not(:disabled) { background: var(--lift); border-color: var(--brand); }
  .btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
  .text-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
}
button:active:not(:disabled) { transform: translateY(1px); }
input:not([type=radio]):not([type=checkbox]), textarea, select {
  max-width: 100%; min-width: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--edge);
  padding: 8px 10px; border-radius: 7px; min-height: 40px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input[readonly], textarea[readonly], select:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; }
dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
dialog::backdrop { background: var(--overlay); }
dialog[open] { animation: rz-dialog-in var(--settle) var(--ease); }
dialog[open]::backdrop { animation: rz-fade-in var(--fast) ease-out; }
@keyframes rz-dialog-in { from { opacity: 0; transform: translateY(5px) scale(.993); } to { opacity: 1; transform: none; } }
@keyframes rz-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:active:not(:disabled) { transform: none; }
}
