:root {
    color-scheme: light;
    --bg: #f5f7fa;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #667085;
    --line: #dfe4ea;
    --brand: #116acc;
    --brand-dark: #0d4f99;
    --ok: #168a4a;
    --danger: #b42318;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.nav {
    max-width: 1120px;
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.brand { font-size: 20px; font-weight: 700; color: var(--text); }
.nav-links { display: flex; gap: 16px; align-items: center; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; }

.hero {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 18px;
}

.hero h1 { font-size: 30px; margin-bottom: 8px; }
.muted { color: var(--muted); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.card, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.card h2 { font-size: 18px; margin-bottom: 8px; }
.label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.value { color: var(--brand); font-size: 28px; font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; color: var(--muted); font-size: 13px; }
.tag { background: #eef2f6; color: #475467; border-radius: 4px; padding: 2px 8px; }
.tag.ok { background: #e7f6ee; color: var(--ok); }
.tag.danger { background: #feeceb; color: var(--danger); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.secondary:hover { background: #eef5ff; color: var(--brand-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); }

.detail-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: start;
}

.section-title { font-size: 20px; margin: 24px 0 12px; }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

th, td { border-bottom: 1px solid #edf1f5; padding: 11px 12px; text-align: left; font-size: 14px; vertical-align: top; }
th { background: #f0f3f7; color: #475467; }

form .row { display: grid; gap: 10px; margin-bottom: 10px; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    min-height: 40px;
    padding: 8px 10px;
    font: inherit;
    background: #fff;
}
input[type="checkbox"], input[type="radio"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin-right: 6px;
    vertical-align: -2px;
}
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-weight: 600; margin-bottom: 4px; }

.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; background: #eef5ff; border: 1px solid #cde0ff; }
.error { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; background: #feeceb; border: 1px solid #fac5c1; color: var(--danger); }

.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
}

.side { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; height: fit-content; }
.side a { display: block; padding: 9px 10px; border-radius: 6px; color: var(--text); }
.side a:hover { background: #eef2f6; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 760px) {
    .detail-head, .admin-layout { grid-template-columns: 1fr; }
    .nav { align-items: flex-start; flex-direction: column; gap: 8px; padding: 14px 20px; }
}
