:root {
  --ink: #17232d;
  --muted: #667784;
  --line: #dbe3e8;
  --surface: #ffffff;
  --canvas: #f2f5f6;
  --primary: #087f73;
  --primary-soft: #e4f4f1;
  --danger: #c63f3f;
  --warning: #a96808;
  --shadow: 0 10px 30px rgba(26, 45, 56, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #12333a, #0a7068 58%, #d5ebe5); }
.login-panel { width: min(390px, 100%); padding: 38px; border-radius: 8px; background: rgba(255,255,255,.98); box-shadow: 0 24px 70px rgba(4,28,32,.28); }
.login-panel h1 { margin: 18px 0 4px; font-size: 25px; }
.login-panel p { margin: 0 0 28px; color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 8px; background: var(--primary); color: white; font: 800 28px/1 Georgia, serif; }
.brand-mark.small { width: 34px; height: 34px; font-size: 18px; }
label { display: block; margin-bottom: 15px; color: #40515c; font-weight: 600; }
input, select, textarea { width: 100%; margin-top: 7px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,127,115,.12); }
textarea { min-height: 90px; resize: vertical; }
.form-error { min-height: 20px; margin-top: 12px; color: var(--danger); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; color: #dbe9e8; background: #153138; }
.brand { display: flex; align-items: center; gap: 11px; padding: 3px 8px 24px; color: white; font-size: 16px; }
nav { display: grid; gap: 4px; }
nav button { padding: 11px 13px; border: 0; border-radius: 5px; color: #bed0d2; background: transparent; text-align: left; }
nav button:hover, nav button.active { color: white; background: rgba(255,255,255,.11); }
.sidebar-footer { margin-top: auto; padding: 18px 9px 4px; display: grid; gap: 8px; border-top: 1px solid rgba(255,255,255,.12); }
.link-button { padding: 0; border: 0; color: #b9d1d2; background: transparent; text-align: left; font-size: 13px; }
.danger-text { color: #ffb9b9; }
.main { min-width: 0; }
.topbar { min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: white; }
.topbar h2 { margin: 0; font-size: 20px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.content { padding: 24px 28px 48px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 5px; background: transparent; font-size: 21px; }
#menu-button { display: none; }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.toolbar .filters { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.toolbar label { margin: 0; font-size: 12px; }
.toolbar input, .toolbar select { min-width: 150px; margin-top: 4px; }
.button { min-height: 38px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: white; font-weight: 600; }
.button:hover { border-color: #94a8b3; }
.button.primary { border-color: var(--primary); color: white; background: var(--primary); }
.button.danger { border-color: #e8b7b7; color: var(--danger); background: #fff7f7; }
.button.small { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.button.block { width: 100%; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { min-height: 112px; padding: 20px; border-left: 4px solid var(--primary); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.stat span { color: var(--muted); }
.stat strong { display: block; margin-top: 13px; font-size: 28px; }
.panel { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-header h3 { margin: 0; font-size: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e8edef; text-align: left; vertical-align: middle; }
th { color: #51636e; background: #f7f9fa; font-size: 12px; }
td.wrap { min-width: 220px; white-space: normal; word-break: break-all; }
.actions { display: flex; align-items: center; gap: 6px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; color: #3e5360; background: #edf1f3; font-size: 12px; }
.badge.success { color: #096d4f; background: #dff3ea; }
.badge.danger { color: #a52e2e; background: #f9e1e1; }
.badge.warning { color: #875307; background: #f7edd8; }
.empty { padding: 38px; color: var(--muted); text-align: center; }
.pagination { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(8,25,30,.58); }
.modal-panel { width: min(820px, 100%); max-height: calc(100vh - 48px); overflow: hidden; border-radius: 7px; background: white; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.modal-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-panel h3 { margin: 0; font-size: 18px; }
.modal-content { max-height: calc(100vh - 115px); overflow-y: auto; padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-help { margin: -7px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.notice-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.setting-card { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfb; }
.setting-card h4 { margin: 0 0 6px; color: var(--primary); font-size: 16px; }
.setting-card > p { min-height: 38px; margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.setting-card .form-grid { grid-template-columns: 1fr; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 18px; }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 5px; }
.checkbox-grid input { width: auto; margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.priority-list { display: grid; gap: 8px; margin: 14px 0; }
.priority-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 5px; }
.priority-number { display: grid; place-items: center; width: 30px; height: 30px; color: var(--primary); background: var(--primary-soft); border-radius: 4px; font-weight: 700; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: 360px; padding: 12px 16px; border-radius: 5px; color: white; background: #18353b; box-shadow: var(--shadow); }
.toast.error { background: #a92f2f; }
.chart-bars { height: 230px; display: flex; align-items: end; gap: 8px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.chart-column { flex: 1; min-width: 24px; display: grid; align-items: end; height: 100%; text-align: center; }
.chart-column i { display: block; min-height: 2px; background: var(--primary); border-radius: 3px 3px 0 0; }
.chart-column span { margin-top: 7px; color: var(--muted); font-size: 10px; }
.settings-tabs { display: flex; gap: 6px; margin-bottom: 15px; border-bottom: 1px solid var(--line); }
.settings-tabs button { padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; }
.settings-tabs button.active { border-color: var(--primary); color: var(--primary); }
@media (max-width: 960px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 15; left: -240px; width: 228px; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  #menu-button { display: inline-grid; place-items: center; }
}
@media (max-width: 620px) {
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .stats-grid, .form-grid { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .notice-settings-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .filters { align-items: stretch; flex-direction: column; }
  .toolbar input, .toolbar select { min-width: 100%; }
}
