:root {
  --ink: #20252b;
  --muted: #646c76;
  --accent: #245faa;
  --border: #dce0e5;
  --bg: #f4f5f7;
  --red: #b52b2b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 13px; line-height: 1.5; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 19px; font-weight: 600; }
h2 { font-size: 14px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button[aria-busy="true"] { cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.muted { color: var(--muted); }
.primary, .secondary, .danger, .quiet {
  border: 1px solid transparent; border-radius: 3px; padding: 5px 12px; min-height: 30px; white-space: nowrap;
}
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #194c8c; }
.secondary { background: #fff; border-color: #cbd1d9; color: var(--ink); }
.secondary:hover { background: #f0f2f5; }
.quiet { background: transparent; color: var(--accent); }
.quiet:hover { background: #edf2f8; }
.danger { color: var(--red); background: #fff; border-color: #e1bcbc; }
.danger:hover { background: #fff4f4; }
.small-button { padding: 2px 8px; min-height: 26px; font-size: 12px; }
.skip { position: fixed; top: -80px; left: 12px; z-index: 20; background: white; padding: 8px; }
.skip:focus { top: 12px; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #cbd1d9; border-radius: 3px; padding: 5px 8px; color: var(--ink); background: #fff; }
input, select { min-height: 30px; }
input::placeholder, textarea::placeholder { color: #858c96; }
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 7px; }
textarea { resize: vertical; line-height: 1.6; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.field .hint { color: var(--muted); font-size: 12px; }
.login-view { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.login-card { width: 100%; max-width: 360px; padding: 28px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card .muted { margin-bottom: 24px; }
.login-card label { display: block; margin-bottom: 6px; }
.login-card input { padding: 8px; }
.login-card .primary { width: 100%; margin-top: 16px; padding: 7px; }
.login-note { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px; font-size: 12px; color: var(--muted); }
.error-text { color: var(--red); font-size: 12px; margin-top: 10px; }
.error-text:empty { display: none; }
.workspace { display: grid; grid-template-columns: 168px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 10px 12px; }
.brand { padding: 0 10px 18px; font-size: 16px; font-weight: 600; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 3px; }
.sidebar nav { display: grid; gap: 3px; }
.nav-item { border: 0; border-left: 3px solid transparent; border-radius: 2px; background: transparent; color: #4c535c; text-align: left; padding: 8px 12px; font-size: 13px; }
.nav-item:hover { background: #f2f3f5; }
.nav-item.active { border-left-color: var(--accent); background: #edf2f8; color: var(--accent); font-weight: 600; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.environment { padding: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.environment small { display: block; font-size: 11px; overflow-wrap: anywhere; margin-top: 2px; }
.sidebar-bottom .quiet { padding-left: 10px; color: #4c535c; font-size: 12px; }
.main-shell { min-width: 0; }
main { padding: 14px 18px 24px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 32px; margin-bottom: 12px; }
.refresh-box { display: flex; align-items: center; gap: 12px; }
.refresh-box > span { font-size: 11px; color: var(--muted); }
.notice { border: 1px solid #bdd4c4; background: #f1f8f3; padding: 8px 12px; margin-bottom: 12px; border-radius: 3px; white-space: pre-line; }
.notice.error { border-color: #e0baba; background: #fff5f5; color: var(--red); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--border); border-radius: 3px; margin-bottom: 12px; }
.metric { padding: 10px 14px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 3px; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-value.date-value { font-size: 13px; line-height: 34px; white-space: nowrap; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 3px; margin-bottom: 12px; min-width: 0; overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.panel-header > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-header p { font-size: 12px; color: var(--muted); }
.panel-body { padding: 10px 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 12px; }
.split.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.system-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.system-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid #eceef1; font-size: 12px; }
.badge { display: inline-block; white-space: nowrap; color: #326947; background: #f0f6f1; padding: 1px 5px; border-radius: 2px; font-size: 11px; }
.badge.off { color: var(--muted); background: #f0f1f3; }
.table-scroll { max-width: 100%; max-height: 65vh; overflow: auto; }
table { border-collapse: separate; border-spacing: 0; width: 100%; text-align: left; font-size: 12px; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 1; background: #eef0f3; color: #424a54; font-weight: 600; white-space: nowrap; }
td, th { padding: 7px 10px; border-bottom: 1px solid #e4e7eb; vertical-align: middle; }
td { max-width: 320px; overflow-wrap: anywhere; }
td.numeric, th.numeric { text-align: right; white-space: nowrap; }
tbody tr:nth-child(even) { background: #fafbfc; }
tbody tr:hover { background: #f0f4f9; }
tr:last-child td { border-bottom: 0; }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 7px 10px; }
.table-toolbar input { width: 220px; font-size: 12px; }
.table-toolbar .muted { font-size: 12px; margin-right: auto; }
.table-toolbar > button { margin-left: auto; }
.pagination { border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 6px 10px; color: var(--muted); font-size: 12px; }
.empty { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.empty strong { display: block; font-size: 13px; font-weight: 400; margin-bottom: 3px; }
.form-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.form-row > .field { flex: 1; min-width: 150px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.help { color: var(--muted); font-size: 12px; margin: 8px 0; }
.callout { background: #f7f8fa; border-left: 2px solid #bcc5cf; padding: 8px 10px; color: #545d68; font-size: 12px; margin-bottom: 12px; }
.check-label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.section-title { margin: 12px 0 8px; }
.details { padding: 0 12px 8px; }
.details summary { padding: 8px 0; color: var(--accent); cursor: pointer; font-size: 12px; }
.json { margin: 0; padding: 10px; background: #f6f7f9; border: 1px solid var(--border); font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.editor { font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; min-height: 180px; }
.announcement-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.announcement-toolbar > div { display: flex; align-items: center; gap: 12px; }
.announcement-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 16px; }
.announcement-editor { display: grid; gap: 12px; }
.announcement-import { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.announcement-import > button { justify-self: start; }
.announcement-preview { padding: 24px; margin: 8px auto; max-width: 450px; border: 1px solid #d5e1ed; border-radius: 8px; background: #f8fbff; }
.announcement-preview h3 { font-size: 18px; text-align: center; padding-bottom: 18px; }
.announcement-preview-content { min-height: 250px; max-height: 440px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.announcement-preview-signature { text-align: right; white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 20px; }
.announcement-preview-close { display: block; width: 100px; padding: 6px; margin: 24px auto 0; text-align: center; border: 1px solid #d5e1ed; border-radius: 4px; background: white; color: var(--muted); }
.announcement-url { overflow-wrap: anywhere; }
@media (max-width: 1050px) { .announcement-layout { grid-template-columns: 1fr; } }
.load-state { padding: 48px 16px; text-align: center; color: var(--muted); }
.filter-bar { display: flex; align-items: center; margin-bottom: 10px; }
.filter-bar .field { flex-direction: row; align-items: center; gap: 8px; }
.filter-bar select { width: 320px; max-width: 70vw; }
.raffle-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--muted); font-size: 12px; }
.raffle-meta strong { color: var(--ink); font-weight: 400; }
.code-name { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
dialog { width: min(480px, calc(100% - 32px)); border: 1px solid #bfc6ce; border-radius: 4px; padding: 20px; color: var(--ink); box-shadow: 0 8px 32px #0002; }
dialog::backdrop { background: #0005; }
dialog h2 { font-size: 16px; margin-bottom: 12px; }
dialog p { font-size: 13px; white-space: pre-line; max-height: 45vh; overflow: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@media (max-width: 1050px) {
  .split, .split.equal { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .timezone { display: none; }
}
@media (max-width: 700px) {
  .workspace { display: block; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 10px 7px; }
  .brand { padding: 0 4px 10px; font-size: 14px; }
  .brand small { display: inline; margin-left: 8px; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 0; }
  .nav-item { flex-shrink: 0; border-left: 0; border-bottom: 2px solid transparent; padding: 7px 10px; font-size: 12px; }
  .nav-item.active { border-bottom-color: var(--accent); }
  .sidebar-bottom { position: absolute; top: 5px; right: 8px; padding: 0; }
  .environment { display: none; }
  main { padding: 12px 10px; }
  h1 { font-size: 17px; }
  .page-heading { gap: 8px; }
  .refresh-box { gap: 8px; }
  .refresh-box > span { font-size: 10px; max-width: 115px; text-align: right; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-row > .field { min-width: 140px; }
  .table-toolbar { flex-wrap: wrap; gap: 6px; }
  .table-toolbar input { width: 150px; flex: 1; }
  .table-scroll { max-height: 60vh; }
  .metric { padding: 8px 10px; }
  .metric-value { font-size: 21px; }
  .metric-value.date-value { white-space: normal; line-height: 1.5; padding-top: 3px; min-height: 34px; }
}
