:root {
    --bg: #f8f3eb;
    --surface: #fffdfa;
    --surface-soft: #fbf7f0;
    --text: #2f302a;
    --muted: #756f66;
    --line: #e4dbcf;
    --green: #607766;
    --green-dark: #405947;
    --coral: #c86f5d;
    --shadow: 0 10px 28px rgba(66, 52, 39, .08);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
body { margin: 0; font-size: 15px; line-height: 1.55; }
a { color: var(--green-dark); text-decoration: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { padding: 26px 18px; border-right: 1px solid var(--line); background: #f5eee4; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 22px; font-weight: 700; letter-spacing: 0; margin-bottom: 26px; }
.nav { display: grid; gap: 8px; }
.nav a { padding: 10px 12px; border-radius: 8px; color: var(--text); }
.nav a.active, .nav a:hover { background: #e9dfd2; }
.main { padding: 30px min(4vw, 48px); max-width: 1280px; width: 100%; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; }
h1 { font-size: 28px; margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 19px; margin: 0 0 14px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.panel { padding: 18px; }
.card { padding: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.stat strong { display: block; font-size: 25px; }
form { margin: 0; }
label { display: block; font-weight: 650; margin: 12px 0 6px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 7px; padding: 10px 11px; font: inherit; }
textarea { min-height: 94px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
button, .button { border: 1px solid var(--green); background: var(--green); color: white; border-radius: 7px; padding: 9px 13px; font: inherit; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; }
.button.secondary, button.secondary { background: transparent; color: var(--green-dark); }
.button.coral, button.coral { background: var(--coral); border-color: var(--coral); }
.button.danger, button.danger { background: #8e5148; border-color: #8e5148; }
.list { display: grid; gap: 10px; }
.topic-card { display: grid; gap: 8px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; background: var(--surface-soft); }
.flash { margin-bottom: 16px; border: 1px solid var(--line); background: #fff8ef; border-radius: 8px; padding: 12px 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 650; background: var(--surface-soft); }
.detail-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); }
.compact { font-size: 13px; }
@media (max-width: 850px) {
    .shell { display: block; }
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px; }
    .brand { margin-bottom: 12px; }
    .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main { padding: 20px 14px 32px; }
    .grid.two, .grid.three, .row, .row.three, .stats { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
    h1 { font-size: 24px; }
}
