:root {
  --ink: #18342b; --muted: #6d766f; --paper: #f4f1e9; --panel: #fffdf8;
  --brand: #12372a; --mint: #d7eadf; --gold: #c9923e; --line: #dedbd2;
  --danger: #a33c35; --warning: #b7791f; --ok: #23734c; --shadow: 0 12px 34px rgb(23 52 43 / 9%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--paper); font-synthesis: none;
}
* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 5%, #e4cda8 0, transparent 26rem), var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(360px, .9fr); }
.login-hero { padding: clamp(42px, 8vw, 110px); display: flex; flex-direction: column; justify-content: space-between; background: var(--brand); color: #fff; position: relative; overflow: hidden; }
.login-hero::after { content: ""; width: 380px; height: 380px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 50%; position: absolute; right: -80px; bottom: -120px; box-shadow: 0 0 0 80px rgb(255 255 255 / 4%), 0 0 0 160px rgb(255 255 255 / 3%); }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: 12px; font-weight: 800; opacity: .72; }
.login-hero h1 { font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 7vw, 82px); line-height: .98; max-width: 720px; margin: 24px 0; font-weight: 500; }
.login-hero p { max-width: 620px; color: rgb(255 255 255 / 72%); line-height: 1.8; }
.privacy-chip { width: fit-content; padding: 10px 14px; border: 1px solid rgb(255 255 255 / 24%); border-radius: 999px; font-size: 13px; }
.login-panel { padding: clamp(30px, 7vw, 90px); align-content: center; background: rgb(255 253 248 / 86%); backdrop-filter: blur(18px); }
.login-card { max-width: 520px; margin: auto; }
.login-card h2 { font-family: Georgia, "Songti SC", serif; font-size: 34px; margin: 0 0 10px; font-weight: 500; }
.login-card > p { color: var(--muted); margin: 0 0 30px; }
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 22px; }
.role-button { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 15px; text-align: left; color: var(--ink); transition: .18s ease; }
.role-button:hover, .role-button.selected { border-color: var(--brand); background: var(--mint); transform: translateY(-1px); }
.role-button span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; background: #fff; color: var(--ink); outline: none; }
.field textarea { min-height: 98px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(18 55 42 / 10%); }
.primary, .secondary, .danger, .quiet { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 750; }
.primary { background: var(--brand); color: #fff; }
.secondary { background: var(--mint); color: var(--brand); }
.danger { background: #f8dfdc; color: var(--danger); }
.quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.wide { width: 100%; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: var(--brand); color: #fff; padding: 24px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { padding: 8px 12px 24px; border-bottom: 1px solid rgb(255 255 255 / 12%); }
.brand strong { font-family: Georgia, "Songti SC", serif; display: block; font-size: 25px; font-weight: 500; }
.brand small { color: rgb(255 255 255 / 55%); }
.nav { display: grid; gap: 4px; margin: 20px 0; overflow: auto; }
.nav button { border: 0; background: transparent; color: rgb(255 255 255 / 68%); border-radius: 10px; padding: 11px 12px; text-align: left; }
.nav button:hover, .nav button.active { background: rgb(255 255 255 / 12%); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid rgb(255 255 255 / 12%); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer small { margin: 5px 0 12px; color: rgb(255 255 255 / 55%); }
.main { min-width: 0; padding: 28px clamp(20px, 4vw, 54px) 70px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.topbar h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(30px, 4vw, 44px); font-weight: 500; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.env-badge { border: 1px solid #e4cda8; background: #fff8e8; color: #8d6329; border-radius: 999px; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; font: 500 30px/1.2 Georgia, "Songti SC", serif; margin-top: 10px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.panel.full { grid-column: 1 / -1; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel h2, .panel h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-weight: 500; }
.panel h2 { font-size: 24px; }
.panel h3 { font-size: 19px; }
.panel-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; letter-spacing: .04em; padding: 11px 10px; border-bottom: 1px solid var(--line); }
td { padding: 13px 10px; border-bottom: 1px solid #ece9e1; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; background: var(--mint); color: var(--brand); }
.badge.red { background: #f8dfdc; color: var(--danger); }
.badge.yellow { background: #fbebc9; color: var(--warning); }
.badge.green { background: #dff0e4; color: var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { padding: 7px 9px; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.empty { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.code { white-space: pre-wrap; word-break: break-word; background: #14261f; color: #dcebe3; border-radius: 12px; padding: 14px; max-height: 300px; overflow: auto; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.progress { width: 100%; height: 8px; border: 0; appearance: none; background: #e8e5dd; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress::-webkit-progress-bar { background: #e8e5dd; border-radius: 99px; }
.progress::-webkit-progress-value { background: var(--gold); border-radius: 99px; }
.progress::-moz-progress-bar { background: var(--gold); border-radius: 99px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 48px)); background: #14261f; color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: 0 16px 50px rgb(0 0 0 / 24%); z-index: 10; }
.toast.error { background: var(--danger); }
.mobile-menu { display: none; }
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { min-height: 340px; padding: 42px 28px; }
  .login-hero h1 { font-size: 48px; }
  .login-panel { padding: 38px 24px 60px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 8; width: 260px; left: -280px; transition: left .2s; }
  .sidebar.open { left: 0; }
  .mobile-menu { display: inline-flex; }
  .main { padding-top: 18px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .panel.full { grid-column: auto; }
}
@media (max-width: 540px) {
  .role-grid, .metrics, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .topbar { align-items: flex-start; }
  .env-badge { display: none; }
  .main { padding-left: 14px; padding-right: 14px; }
  .panel { border-radius: 14px; padding: 16px; }
}
