:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2b2723;
  --muted: #7a7168;
  --border: #e4ddd2;
  --accent: #2f6f62;
  --accent-text: #ffffff;
  --danger: #b3412f;
  --notice: #f1ebdd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1916;
    --surface: #24211d;
    --text: #ece6dc;
    --muted: #a39a8e;
    --border: #3a352e;
    --accent: #5fb3a1;
    --accent-text: #11201c;
    --danger: #e58a77;
    --notice: #2d2a24;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
a { color: var(--accent); }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.brand { font-weight: 600; color: var(--text); text-decoration: none; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--notice); color: var(--muted); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 20px 16px 64px; }
.wrap.wide { max-width: 1180px; }
h1 { font-size: 24px; margin: 8px 0 12px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin: 20px 0; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.notice { background: var(--notice); border-radius: 10px; padding: 10px 14px; }
.notice.err { color: var(--danger); }
label { display: block; margin: 12px 0; font-size: 14px; color: var(--muted); }
input[type="text"], input[type="password"], input:not([type]), textarea, input[type="file"] {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
button, .btn {
  font: inherit; font-size: 15px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.ghost { background: transparent; color: var(--muted); }
button.danger { color: var(--danger); }
button:disabled { opacity: 0.55; cursor: default; }
kbd { font: 11px ui-monospace, Menlo, Consolas, monospace; padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; opacity: 0.6; }

.brief { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; }
.brief h2 { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.brief p { margin: 0; }
.ask { font-weight: 600; margin: 18px 0 10px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 820px) { .cards { grid-template-columns: 1fr 1fr; align-items: start; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.text p { margin: 0 0 0.9em; text-indent: 2em; }
.text p:last-child { margin-bottom: 0; }
.aiguess { border: 0; margin: 18px 0 0; padding: 0; font-size: 14px; color: var(--muted); }
.aiguess legend { padding: 0; margin-bottom: 4px; }
.aiguess label { display: inline-block; margin: 0 14px 0 0; }
.setting { margin-top: 10px; font-size: 14px; color: var(--muted); }
.setting summary, .why summary { cursor: pointer; }
.setting .text p { text-indent: 0; margin: 0 0 0.5em; }
.why { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.tags { border: 0; padding: 0; margin: 10px 0 0; }
.tags legend { padding: 0; margin-bottom: 4px; }
.chip { display: inline-block; margin: 0 8px 8px 0; padding: 4px 10px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--notice); }
.chip input { margin-right: 2px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.actions .ghost { grid-column: 1 / -1; }
@media (min-width: 820px) { .actions { grid-template-columns: repeat(4, auto); justify-content: start; } .actions .ghost { grid-column: auto; } }
.actions button { min-height: 48px; }

.table-wrap { overflow-x: auto; margin: 8px 0 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline-block; margin-right: 6px; }
.row-actions button { padding: 4px 12px; font-size: 13px; }
.matrix td, .matrix th { text-align: center; white-space: nowrap; }
.matrix .self { color: var(--muted); }
meter { width: 70px; height: 8px; vertical-align: middle; margin-left: 6px; }
.logout { margin-top: 24px; }
