:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1b2738;
  --muted: #6b7890;
  --line: #e4e9f2;
  --brand: #1c5d99;
  --brand-deep: #153f6b;
  --brand-soft: #e8f1fa;
  --accent: #c8972f;
  --green: #2f8a5b;
  --amber: #b7791f;
  --red: #c0453b;
  --shadow: 0 10px 30px rgba(28, 63, 107, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 246px;
  flex: 0 0 246px;
  background: linear-gradient(180deg, #123c68 0%, #0f3055 100%);
  color: #dbe8f6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #f0c96a, #c9972a);
  color: #17385c; font-weight: 800; font-size: 20px;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.brand-title { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: #9fb8d4; margin-top: 2px; }
.nav { padding: 18px 12px; flex: 1; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: #b9cde3;
  padding: 11px 14px; margin-bottom: 6px; border-radius: 9px;
  display: flex; align-items: center; gap: 10px; text-align: left;
  transition: .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #7fa7cf; }
.nav-item.active .nav-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(200,151,47,.18); }
.side-foot { padding: 18px 20px 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: #9fb8d4; }
.side-term { color: #d8e6f5; font-weight: 600; margin-bottom: 4px; }

.main { flex: 1; min-width: 0; padding: 26px 32px 48px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; }
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: 1px; }
.top-sub { margin: 4px 0 0; color: var(--muted); }
.top-actions { display: flex; gap: 10px; }

.nav-group-title { padding: 10px 14px 4px; font-size: 11px; letter-spacing: 1px; color: #7292b6; }
.nav-num { flex: 0 0 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.12); color: #dceaf7; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav-item.active .nav-num { background: var(--accent); color: #17385c; }

.flow-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: -8px 0 20px; }
.step-item { position: relative; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px 12px 44px; box-shadow: 0 4px 14px rgba(28,63,107,.05); transition: .18s; }
.step-item:hover { border-color: var(--brand); transform: translateY(-2px); }
.step-item.active { border-color: var(--brand); background: linear-gradient(135deg, #fff, var(--brand-soft)); }
.step-item > span { position: absolute; left: 12px; top: 13px; width: 24px; height: 24px; border-radius: 7px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.step-item b { display: block; font-size: 13.5px; color: var(--ink); }
.step-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }

.handoff-panel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; }
.handoff-main { flex: 1; min-width: 240px; }
.handoff-label { color: var(--brand); font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.handoff-desc { color: var(--muted); font-size: 12.5px; }
.handoff-select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-width: 260px; background: #fff; }
.handoff-divider { width: 1px; height: 28px; background: var(--line); margin: 0 4px; }
.next-panel { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.next-panel b { color: var(--brand); }
.next-panel p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.flow-step { cursor: pointer; }
.flow-step:hover, .flow-step.active { border-color: var(--brand); background: var(--brand-soft); }

.btn {
  border: 1px solid transparent; border-radius: 9px; padding: 10px 16px;
  font-weight: 600; background: #fff; color: var(--ink); transition: .18s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(28,63,107,.12); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 7px; }
.btn-danger { background: #fff2f0; color: var(--red); border-color: #f3d3cf; }
.icon-btn { border: 0; background: transparent; font-size: 22px; color: var(--muted); line-height: 1; }

.tab { display: none; }
.tab.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 800; margin: 4px 0; color: var(--brand); }
.stat-value.amber { color: var(--amber); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-foot { color: #9aa5b7; font-size: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-tag { font-size: 12px; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 20px; }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.flow { display: grid; gap: 10px; }
.flow-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: #fafbfe; border: 1px solid var(--line); border-radius: 10px; }
.flow-step > span { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.flow-step b { font-size: 14px; }
.flow-step p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.notice-list { margin: 0; padding-left: 18px; color: var(--muted); }
.notice-list li { margin-bottom: 8px; }
.notice-list b { color: var(--ink); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-card { text-align: left; border: 1px solid var(--line); background: #fafbfe; border-radius: 11px; padding: 14px 16px; transition: .18s; }
.quick-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.quick-card b { display: block; color: var(--brand); font-size: 14px; }
.quick-card span { color: var(--muted); font-size: 12px; }

.form-panel { padding-bottom: 12px; }
.form-hint { background: #fff9e9; border: 1px solid #f2e2b8; color: #7a5c17; border-radius: 9px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 16px; }
.form-hint em { color: var(--red); font-style: normal; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: span 2; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: #46536a; }
.field label em { color: var(--red); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #d8e0ec; border-radius: 8px; padding: 9px 10px;
  background: #fff; color: var(--ink); outline: none; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28,93,153,.1); }
.field textarea { min-height: 78px; resize: vertical; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); background: #fff7f6; }
.field-note { font-size: 11px; color: #94a0b3; }

.attachment-block { margin-top: 18px; border: 1px dashed #cbd6e6; border-radius: 11px; padding: 14px 16px; background: #fbfcfe; }
.attachment-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.attachment-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.att-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; font-size: 12px; }
.att-chip button { border: 0; background: transparent; color: var(--red); font-size: 14px; line-height: 1; }
.att-empty { color: #9aa5b7; font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 0 6px; border-top: 1px solid var(--line); margin-top: 18px; }

.filters { display: flex; gap: 8px; }
.filters input, .filters select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; background: #f7f9fc; color: #5c6880; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.data-table tr:hover td { background: #fbfcff; }
.data-table .cell-main { font-weight: 600; color: var(--ink); }
.data-table .cell-sub { color: var(--muted); font-size: 11.5px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.草稿 { background: #f1f3f7; color: #667085; }
.badge.已提交 { background: #e8f3ee; color: var(--green); }
.badge.审核中 { background: #e9f1fb; color: var(--brand); }
.badge.已通过 { background: #e6f5ec; color: #237a4e; }
.badge.退回修改 { background: #fdecea; color: var(--red); }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.link-btn { border: 0; background: transparent; color: var(--brand); padding: 3px 5px; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

.conflict-banner { background: #fff8e8; border: 1px solid #f0dfb5; color: #7a5c17; border-radius: 11px; padding: 11px 14px; margin-bottom: 16px; font-size: 13px; }
.panel.narrow { max-width: 720px; }

.download-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.download-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: #fafbfe; }
.download-card.link-card { text-decoration: none; color: inherit; transition: .18s; }
.download-card.link-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.dl-icon { flex: 0 0 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.download-card > div:nth-child(2) { flex: 1; min-width: 0; }
.download-card b { display: block; font-size: 13.5px; }
.download-card p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.dl-arrow { color: var(--brand); font-size: 18px; }

.priority-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.priority-card { border: 1px solid var(--line); border-radius: 11px; padding: 16px; background: linear-gradient(180deg, #fff, #fafbfe); }
.priority-card > b { color: var(--accent); font-size: 22px; }
.priority-card h3 { margin: 4px 0 6px; font-size: 15px; }
.priority-card p { margin: 0; color: var(--muted); font-size: 12.5px; }
.rules-list { columns: 2; padding-left: 20px; margin: 0; color: #4c5a70; }
.rules-list li { margin-bottom: 9px; break-inside: avoid; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12,30,52,.48); }
.modal-body { position: relative; background: #fff; border-radius: 14px; width: min(860px, 92vw); max-height: 86vh; overflow: auto; padding: 22px 24px; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.detail-item { border-bottom: 1px solid #eef1f6; padding-bottom: 6px; }
.detail-item span { display: block; color: var(--muted); font-size: 11px; }
.detail-item b { font-size: 13px; font-weight: 600; }
.detail-attachments { margin-top: 16px; }

.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.teacher-lookup { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid #cbdcf0; background: linear-gradient(180deg, #f8fbff, #fff); border-radius: 11px; padding: 12px 14px; margin-bottom: 12px; }
.teacher-lookup label { font-weight: 700; color: var(--brand); }
.teacher-lookup input { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.teacher-lookup .field-note { flex: 1; min-width: 180px; }
.catalog-help { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px dashed #cbd6e6; border-radius: 11px; padding: 10px 14px; background: #fbfcfe; margin-bottom: 14px; }
.catalog-help b { color: var(--brand); margin-right: 8px; }
.catalog-help span { color: var(--muted); font-size: 12.5px; }
.modal-hint { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.notice-upload-panel { border-color: #cbdcf0; background: linear-gradient(180deg, #fff, #f8fbff); }
.notice-upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice-upload-row .field-note { flex: 1; min-width: 220px; }
.notice-file-list, .notice-modal-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.notice-file-row, .notice-modal-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; }
.notice-badge { flex: 0 0 auto; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; padding: 2px 7px; }
.notice-file-name { flex: 1; min-width: 180px; font-weight: 600; word-break: break-all; }
.notice-file-row .field-note { flex: 0 0 auto; }
.notice-file-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.att-chip .notice-ref { color: var(--green); font-weight: 600; }

.import-panel { margin-bottom: 16px; border-color: #cbdcf0; background: linear-gradient(180deg, #fff, #f8fbff); }
.import-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.import-row .field-note { flex: 1; min-width: 240px; }
.import-result { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.import-result.hidden { display: none; }
.import-summary { color: #35506e; font-size: 13px; }
.import-summary b { color: var(--brand); }
.import-missing { margin-top: 10px; background: #fff8e8; border: 1px solid #f0dfb5; border-radius: 10px; padding: 10px 12px; color: #7a5c17; font-size: 12.5px; }
.import-missing > b { display: block; margin-bottom: 6px; }
.import-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.import-chip { border: 1px solid #e6cf95; background: #fffdf7; color: #7a5c17; border-radius: 16px; padding: 4px 10px; font-size: 12px; }
.import-chip:hover { border-color: var(--accent); background: #fff6df; }
.import-ok { margin-top: 8px; color: var(--green); font-size: 12.5px; }
.import-error { margin-top: 10px; color: var(--red); font-size: 12.5px; }

.once-panel { margin-bottom: 16px; border-color: #cfe3d8; background: linear-gradient(180deg, #fff, #f7fcf9); }
.common-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.common-grid .field { display: flex; flex-direction: column; gap: 6px; }
.common-grid label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.common-grid input, .common-grid select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: #fff; }
.common-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.common-actions .field-note { flex: 1; min-width: 220px; }

.check-panel { margin-bottom: 16px; }
.check-summary { font-size: 13px; color: var(--muted); }
.check-summary b { color: var(--brand); }
.check-actions { margin-top: 10px; }
.check-result { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.check-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; border: 1px solid; }
.check-item.error { background: #fff5f5; border-color: #f3cccc; color: #a33; }
.check-item.warn { background: #fff9ec; border-color: #f0dfb5; color: #7a5c17; }
.check-item.ok { background: #f4fbf6; border-color: #cfe8d8; color: #2f7a4d; }
.check-item span { flex: 1; }

.booklib-lookup { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #f7fbff; border: 1px dashed #cbdcf0; border-radius: 10px; padding: 11px 13px; margin-bottom: 14px; }
.booklib-lookup label { font-size: 12.5px; font-weight: 700; color: #35506e; }
.booklib-lookup input { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.booklib-lookup .field-note { flex-basis: 100%; }
.booklib-lookup .btn { order: 3; }

.booklib-form { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfdff; }
.booklib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.booklib-grid .field { display: flex; flex-direction: column; gap: 5px; }
.booklib-grid label { font-size: 12px; color: var(--muted); font-weight: 600; }
.booklib-grid input, .booklib-grid select, .booklib-grid textarea { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-size: 12.5px; }
.booklib-grid .field.wide { grid-column: span 2; }
.booklib-filter { margin: 14px 0 10px; }
.booklib-filter input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.booklib-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 7px; }
.booklib-row { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; }
.booklib-row-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.booklib-row-head b { font-size: 13px; }
.booklib-row-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.booklib-row-actions { display: flex; gap: 6px; }
.source-tag { display: inline-block; font-size: 10.5px; color: var(--green); background: #edf8f1; border-radius: 4px; padding: 1px 5px; margin-left: 5px; font-weight: 600; }

.history-panel { margin-bottom: 16px; border-color: #d9d5ee; background: linear-gradient(180deg, #fff, #faf9ff); }
.history-import-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.history-import-row .field { display: flex; flex-direction: column; gap: 5px; }
.history-import-row label:not(.btn) { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.history-import-row input, .history-import-row select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.history-import-result { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 12.5px; }
.history-import-result.hidden { display: none; }
.history-import-result .ok { color: var(--green); }
.history-import-result .warn { color: #a86b13; }

.history-lookup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #f8f7ff; border: 1px dashed #d3cbef; border-radius: 10px; padding: 11px 13px; margin-bottom: 14px; }
.history-lookup > label { font-size: 12.5px; font-weight: 700; color: #4b4380; }
.history-lookup > input { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.history-lookup .field-note { flex-basis: 100%; }
.history-match-list { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
.history-match { border: 1px solid #d9d2f0; background: #fff; border-radius: 16px; padding: 5px 11px; font-size: 12px; cursor: pointer; color: #4b4380; }
.history-match:hover { border-color: #8f7fd0; background: #f5f2ff; }
.history-match b { color: var(--brand); }

.history-modal-list { max-height: 420px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.history-row { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff; }
.history-row-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.history-row-head b { font-size: 13px; }
.history-row-meta { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.history-row-actions { display: flex; gap: 6px; align-items: center; }
.history-term-tag { font-size: 11px; background: #f0ecff; color: #5c4fa6; border-radius: 5px; padding: 2px 7px; }

.toast { position: fixed; right: 26px; bottom: 26px; background: #17385c; color: #fff; padding: 11px 18px; border-radius: 9px; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s; z-index: 80; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .form-grid { grid-template-columns: repeat(3, 1fr); }
  .download-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { width: 76px; flex-basis: 76px; }
  .brand { padding: 18px 12px; justify-content: center; }
  .brand > div:last-child, .nav-item span:last-child, .side-foot { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .main { padding: 20px 18px 40px; }
  .dashboard-grid, .priority-grid { grid-template-columns: 1fr; }
  .flow-nav { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: 1fr; }
  .rules-list { columns: 1; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .form-grid, .download-grid, .stats-grid, .detail-grid, .flow-nav { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .field.wide, .field.full { grid-column: auto; }
}

/* 云端账号与权限 */
.hidden { display: none !important; }
.auth-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #173a5e, #0c1b2b 70%); }
.auth-overlay.hidden { display: none; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 28px 30px 24px; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand span { width: 36px; height: 36px; border-radius: 10px; background: #16569c; color: #fff; display: grid; place-items: center; font-weight: 700; }
.auth-brand b { display: block; font-size: 16px; color: #17324d; }
.auth-brand small { color: #8794a6; font-size: 12px; }
.auth-card h2 { font-size: 21px; margin: 0 0 6px; color: #17324d; }
.auth-sub { color: #7b8797; font-size: 13px; margin: 0 0 16px; line-height: 1.6; }
.auth-card label { display: block; font-size: 13px; font-weight: 600; color: #455a70; margin: 12px 0 6px; }
.auth-card input, .auth-card select, .auth-card textarea, .admin-panel textarea { width: 100%; box-sizing: border-box; border: 1px solid #d7e0ea; border-radius: 8px; padding: 10px 12px; font: inherit; color: #1f3247; background: #fff; }
.auth-card input:focus, .auth-card select:focus { outline: 2px solid #bcd6f2; border-color: #4a86c8; }
.auth-btn { width: 100%; margin-top: 18px; padding: 11px; }
.auth-code { display: flex; gap: 8px; }
.auth-code input { flex: 1; }
.auth-code .btn { white-space: nowrap; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; }
.auth-error { color: #b42318; font-size: 13px; min-height: 18px; margin-top: 6px; }
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid #edf1f5; color: #98a4b3; font-size: 12px; text-align: center; }
.auth-note { background: #f2f7fc; border: 1px solid #d7e6f5; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #47627d; line-height: 1.7; margin-bottom: 12px; }
.cloud-identity { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0 12px 12px; background: rgba(255,255,255,.07); border-radius: 10px; }
.ci-avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: #2f7fd1; color: #fff; display: grid; place-items: center; font-size: 12px; }
.ci-info { flex: 1; min-width: 0; }
.ci-info b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-info small { display: block; color: #9fb6cd; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-btn { border: 1px solid rgba(255,255,255,.25); background: transparent; color: #d8e6f5; border-radius: 6px; padding: 4px 6px; font-size: 11px; cursor: pointer; }
.ci-btn:hover { background: rgba(255,255,255,.12); }
.admin-panel { padding: 4px 2px; }
.admin-panel h3 { font-size: 14px; margin: 18px 0 8px; color: #27435e; }
.admin-users { margin-top: 12px; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.admin-user { display: grid; grid-template-columns: 1.6fr 1.2fr 1.2fr .8fr auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid #e4ebf2; border-radius: 8px; }
.admin-user b { display: block; font-size: 13px; }
.admin-user small { display: block; color: #8b98a7; font-size: 11px; }
.admin-user select, .admin-user input { border: 1px solid #d7e0ea; border-radius: 6px; padding: 6px; font: inherit; font-size: 12px; min-width: 0; }
.panel-intro { color: #64758a; font-size: 13px; line-height: 1.7; }
.admin-hint-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.admin-hint-grid div { background: #f7fafc; border: 1px solid #e3ebf3; border-radius: 10px; padding: 12px; }
.admin-hint-grid b { display: block; color: #24435f; font-size: 13px; margin-bottom: 4px; }
.admin-hint-grid span { color: #75879a; font-size: 12px; }
@media (max-width: 900px) { .admin-user { grid-template-columns: 1fr 1fr; } .admin-hint-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .admin-hint-grid { grid-template-columns: 1fr; } }

