:root {
  color: #172033;
  background: #f4f7fb;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  --primary: #2468e5;
  --primary-dark: #174fac;
  --cyan: #08bdd8;
  --ink: #172033;
  --muted: #68758c;
  --line: #dfe6f0;
  --surface: #ffffff;
  --soft: #f7f9fc;
  --success: #168763;
  --warning: #b76c08;
  --danger: #c43c4b;
  --shadow: 0 12px 34px rgba(31, 55, 91, .10);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1180px; min-height: 100vh; background: #f4f7fb; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(36, 104, 229, .22);
  outline-offset: 2px;
}

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(460px, 44%) 1fr; background: var(--surface); }
.auth-brand { padding: 64px; color: white; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, #0d3675, #1b63d4 58%, #0bb6d2); }
.auth-brand img { width: 152px; height: 152px; object-fit: contain; background: white; border-radius: 8px; padding: 6px; }
.auth-brand h1 { font-size: 34px; line-height: 1.35; margin: 26px 0 14px; font-weight: 700; }
.auth-brand p { max-width: 480px; font-size: 16px; line-height: 1.9; color: rgba(255,255,255,.82); }
.auth-brand small { color: rgba(255,255,255,.68); line-height: 1.8; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 64px; }
.auth-box { width: 420px; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.auth-box h2 { margin: 10px 0 8px; font-size: 28px; }
.auth-box > p { color: var(--muted); line-height: 1.7; margin-bottom: 30px; }

.shell { display: grid; grid-template-columns: 232px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 22px 14px; background: #101b31; color: white; display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand img { width: 46px; height: 46px; object-fit: contain; background: white; border-radius: 6px; }
.brand strong { display: block; font-size: 15px; }
.brand span { display: block; color: #93a3be; font-size: 11px; margin-top: 4px; }
.nav { display: grid; gap: 5px; margin-top: 20px; }
.nav button { height: 44px; border: 0; border-radius: 6px; background: transparent; color: #b7c3d8; text-align: left; padding: 0 14px; cursor: pointer; display: flex; align-items: center; gap: 11px; }
.nav button:hover { background: rgba(255,255,255,.07); color: white; }
.nav button.active { background: #2468e5; color: white; font-weight: 600; box-shadow: 0 6px 18px rgba(36,104,229,.25); }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.operator { margin-top: auto; padding: 14px 10px 2px; border-top: 1px solid rgba(255,255,255,.09); }
.operator strong, .operator span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator span { color: #93a3be; font-size: 12px; margin-top: 4px; }
.operator button { margin-top: 12px; width: 100%; color: #b7c3d8; background: transparent; border: 1px solid rgba(255,255,255,.15); }
.main { grid-column: 2; min-width: 0; }
.topbar { height: 64px; position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar strong { font-size: 14px; }
.system-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.system-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(22,135,99,.12); }
.content { max-width: 1600px; margin: 0 auto; padding: 28px 34px 48px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; margin: 0 0 8px; }
.page-head p { margin: 0; color: var(--muted); line-height: 1.7; }
.actions { display: flex; gap: 10px; flex: 0 0 auto; }

.btn { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); cursor: pointer; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: #a7b9d4; background: #f9fbff; }
.btn.primary { color: white; background: var(--primary); border-color: var(--primary); }
.btn.primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn.danger { color: var(--danger); border-color: #f0c8cf; }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { border: 0; padding: 0; color: var(--primary); background: none; cursor: pointer; font-weight: 600; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 20px; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 28px; margin: 9px 0 3px; }
.metric small { color: #8793a6; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .75fr); gap: 18px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel-head { min-height: 58px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; margin: 0; }
.panel-head span { color: var(--muted); font-size: 12px; }
.panel-body { padding: 18px; }

.toolbar { min-height: 58px; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: white; border: 1px solid var(--line); border-radius: 7px 7px 0 0; }
.search { width: 320px; }
.toolbar .spacer { flex: 1; }
.input, .select, .textarea { width: 100%; border: 1px solid #cfd8e5; border-radius: 6px; background: white; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.input, .select { height: 40px; padding: 0 11px; }
.textarea { min-height: 82px; padding: 10px 11px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #98abc7; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36,104,229,.10); outline: none; }
.field { display: grid; gap: 7px; }
.field label { font-size: 12px; font-weight: 700; color: #3f4a5e; }
.field small { color: var(--muted); line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.table-wrap { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 7px 7px; background: white; overflow: auto; }
.table-wrap.flush { border: 0; }
.table-wrap.standalone { border-top: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th { height: 44px; text-align: left; padding: 0 14px; background: #f7f9fc; color: #5d687b; border-bottom: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
td { height: 54px; padding: 8px 14px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
tbody tr:hover { background: #f9fbff; }
tbody tr:last-child td { border-bottom: 0; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: Consolas, monospace; font-size: 12px; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: #edf2f8; color: #556278; }
.status.success { color: #126d51; background: #e7f6f0; }
.status.warning { color: #965707; background: #fff3dd; }
.status.danger { color: #a82f3e; background: #fdebed; }
.status.info { color: #235bb1; background: #eaf1ff; }
.empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--muted); }
.empty strong { color: #354157; font-size: 15px; margin-bottom: 8px; }
.empty p { max-width: 420px; line-height: 1.7; margin: 0 0 18px; }
.empty-icon { width: 50px; height: 50px; border: 1px solid #cfdae9; background: #f4f8fd; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px; color: var(--primary); font-size: 20px; }
.loading { min-height: 320px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; margin-right: 10px; display: inline-block; vertical-align: middle; border: 3px solid #dce7f8; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.product-list { display: grid; gap: 12px; }
.product-row { display: grid; grid-template-columns: minmax(220px, 1fr) 110px 160px minmax(260px, 1.3fr); align-items: center; gap: 18px; padding: 16px 18px; background: white; border: 1px solid var(--line); border-radius: 7px; }
.product-row strong { display: block; margin-bottom: 5px; }
.product-row small { color: var(--muted); }
.product-row .status + small { display: block; margin-top: 8px; }
.url { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice { padding: 13px 15px; margin-bottom: 18px; border: 1px solid #c9daf7; border-radius: 6px; background: #f0f6ff; color: #365985; line-height: 1.65; }
.notice.warning { border-color: #f1d5a4; background: #fff8ea; color: #7f5a1d; }
.audit-brief { padding: 10px 0; border-bottom: 1px solid #edf1f6; }
.audit-brief:last-child { border-bottom: 0; }
.audit-brief div { color: var(--muted); font-size: 12px; margin-top: 5px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 32px; background: rgba(10, 19, 35, .48); }
.modal { width: min(620px, 92vw); max-height: calc(100vh - 64px); overflow: auto; border-radius: 8px; background: white; box-shadow: var(--shadow); }
.modal.wide { width: min(780px, 92vw); }
.modal-head { padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0 0 7px; font-size: 18px; }
.modal-head p { margin: 0; color: var(--muted); line-height: 1.6; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fafbfd; }
.toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: grid; gap: 10px; }
.muted { color: var(--muted); }
.toast { width: 360px; padding: 13px 15px; color: #253148; background: white; border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: 6px; box-shadow: var(--shadow); line-height: 1.55; }
.toast.error { border-left-color: var(--danger); }

@media (min-width: 1700px) {
  .content { padding-left: 46px; padding-right: 46px; }
  .metrics { gap: 18px; }
}
