:root {
  color-scheme: light;
  --primary: #175cd3;
  --primary-hover: #1849a9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --background: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #dbe3ef;
  --success: #067647;
  --success-bg: #ecfdf3;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warning: #b54708;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 8% 0%, #dbeafe 0, transparent 28rem), var(--background); font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif; line-height: 1.5; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(23, 92, 211, 0.28); outline-offset: 2px; }
[hidden] { display: none !important; }

.shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 56px; }
.login-card { width: min(460px, 100%); margin: 7vh auto 0; padding: 36px; background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.8); border-radius: 20px; box-shadow: var(--shadow); }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 24px; border-radius: 14px; color: white; background: linear-gradient(135deg, #2563eb, #0ea5e9); font-size: 22px; font-weight: 700; }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 32px); line-height: 1.25; }
h2 { margin-bottom: 4px; font-size: 18px; }
.intro, .panel-heading p { color: var(--text-muted); }
.login-card form { display: grid; gap: 8px; margin-top: 28px; }
label { margin-top: 10px; font-size: 14px; font-weight: 600; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 9px; color: var(--text); background: white; transition: border-color 180ms ease, box-shadow 180ms ease; }
input:hover, select:hover { border-color: #94a3b8; }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.text-button { position: absolute; right: 6px; top: 6px; height: 32px; border: 0; color: var(--primary); background: transparent; font-size: 13px; font-weight: 600; }
.primary-button, .secondary-button { min-height: 44px; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; font-weight: 650; transition: background 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.primary-button { color: white; background: var(--primary); }
.primary-button:hover { background: var(--primary-hover); }
.secondary-button { color: #334155; background: white; border-color: #cbd5e1; }
.secondary-button:hover { background: #f8fafc; border-color: #94a3b8; }
.compact { min-height: 38px; padding: 7px 13px; font-size: 13px; }
.login-card .primary-button { margin-top: 18px; }
.form-error { margin: 4px 0 0; padding: 10px 12px; border-radius: 8px; color: var(--danger); background: var(--danger-bg); font-size: 13px; }
.helper { margin: 2px 0 0; color: var(--text-muted); font-size: 12px; }

.dashboard { display: grid; gap: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 4px 2px; }
.topbar h1 { margin-bottom: 0; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.service-status { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 13px; font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px #d1fadf; }
.current-user { color: #475569; font-size: 14px; }
.password-notice { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 18px; border: 1px solid #fedf89; border-radius: 12px; color: #713b12; background: #fffaeb; }
.password-notice span { display: block; margin-top: 2px; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metrics article { padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 20px rgba(15,23,42,.045); }
.metrics span { display: block; color: var(--text-muted); font-size: 13px; }
.metrics strong { display: block; margin-top: 6px; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(320px, .8fr); gap: 20px; align-items: start; }
.panel { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 20px rgba(15,23,42,.045); }
.release-panel { padding: 18px 20px 20px; overflow: visible; }
.release-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.release-heading h2 { margin-bottom: 0; }
.release-current { margin: 4px 0 0; color: #475569; font-size: 13px; text-align: right; }
.release-current a { color: var(--primary); font-weight: 650; text-decoration: none; }
.release-current a:hover { text-decoration: underline; }
.release-form { display: grid; grid-template-columns: minmax(180px, .55fr) minmax(360px, 1.45fr) minmax(300px, 1.15fr) auto; gap: 12px; align-items: end; }
.release-form label { display: grid; gap: 5px; margin: 0; }
.release-form input, .release-form textarea { min-height: 44px; }
.release-form textarea { height: 44px; padding: 10px 12px; resize: vertical; border: 1px solid #cbd5e1; border-radius: 9px; color: var(--text); background: white; font: inherit; line-height: 1.45; }
.release-form input[type="file"] { padding: 6px 8px; }
.release-form input[type="file"]::file-selector-button { height: 30px; margin-right: 9px; padding: 4px 10px; border: 1px solid #bfdbfe; border-radius: 7px; color: var(--primary); background: #eff6ff; font-weight: 650; cursor: pointer; }
.release-submit { min-width: 112px; }
.release-error { margin: 12px 0 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-heading p { margin-bottom: 0; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 14px; color: #475569; background: var(--surface-muted); text-align: left; font-size: 12px; font-weight: 700; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #eef2f6; vertical-align: middle; }
tbody tr:hover { background: #f8fbff; }
.actions-column { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.small-button { min-height: 32px; padding: 5px 9px; border: 1px solid #cbd5e1; border-radius: 7px; color: #334155; background: white; font-size: 12px; font-weight: 600; }
.small-button:hover { background: #f8fafc; }
.small-button.danger { color: var(--danger); border-color: #fda29b; }
.small-button.success { color: var(--success); border-color: #6ce9a6; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.badge.success { color: var(--success); background: var(--success-bg); }
.badge.muted { color: #475569; background: #f1f5f9; }
.badge.warning { color: var(--warning); background: #fffaeb; }
.audit-list { max-height: 590px; margin: 0; padding: 4px 20px 12px; overflow-y: auto; list-style: none; }
.audit-list li { display: grid; grid-template-columns: 9px 1fr; gap: 11px; padding: 14px 0; border-bottom: 1px solid #eef2f6; }
.audit-list li::before { content: ""; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: #60a5fa; }
.audit-list strong { display: block; font-size: 13px; }
.audit-list span { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.audit-list li > div { min-width: 0; }
.audit-list span { overflow-wrap: anywhere; }
.empty-state { margin: 0; padding: 34px 20px; color: var(--text-muted); text-align: center; }

dialog { width: min(500px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 16px; color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15,23,42,.55); }
dialog form { display: grid; gap: 7px; padding: 24px; }
.copy-status { min-height: 20px; margin: 0; color: var(--success); font-size: 13px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #cbd5e1; border-radius: 9px; color: #475569; background: white; font-size: 24px; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(420px, calc(100% - 48px)); padding: 12px 16px; border-radius: 10px; color: white; background: #0f172a; box-shadow: var(--shadow); font-size: 14px; }

@media (max-width: 1000px) {
  .content-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .release-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 20px, 1440px); padding-top: 18px; }
  .login-card { margin-top: 2vh; padding: 24px 20px; }
  .topbar, .password-notice, .panel-heading { align-items: flex-start; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .metrics { gap: 10px; }
  .metrics article { padding: 14px; }
  .metrics strong { font-size: 24px; }
  .row-actions { flex-direction: column; }
  .release-heading { flex-direction: column; }
  .release-current { text-align: left; }
  .release-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition-duration: 0.01ms !important; } }
