:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --sidebar: #0f172a;
  --sidebar-muted: #94a3b8;
  --text: #172033;
  --muted: #667085;
  --border: #e4e8ef;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --success: #067647;
  --success-bg: #ecfdf3;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warning: #b54708;
  --warning-bg: #fff7ed;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #e5e7eb;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 7px 24px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.brand-mark.large { width: 42px; height: 42px; border-radius: 12px; font-size: 21px; }
.brand strong { display: block; color: #fff; font-size: 16px; letter-spacing: .1px; }
.brand small { display: block; margin-top: 1px; color: var(--sidebar-muted); font-size: 11px; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-section { margin: 21px 10px 7px; color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 9px;
  color: #cbd5e1;
  font-weight: 550;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: #1d4ed8; color: #fff; }
.nav-icon { width: 20px; text-align: center; font-size: 17px; opacity: .9; }
.sidebar-footer { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #334155; color: #fff; font-weight: 700; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy strong { color: #f8fafc; font-size: 13px; }
.user-copy small { color: #94a3b8; font-size: 11px; }
.text-button { border: 0; background: transparent; color: #94a3b8; padding: 8px 0 0 41px; font-size: 12px; }
.text-button:hover { color: #fff; }

.main-content { margin-left: 238px; padding: 30px 34px 52px; min-height: 100vh; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.025em; }
.page-header p { margin: 7px 0 0; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--accent); font-size: 13px; }
.status-block { display: flex; align-items: center; gap: 10px; min-width: 150px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.status-block small, .status-block strong { display: block; }
.status-block small { color: var(--muted); font-size: 11px; }
.status-block strong { font-size: 13px; letter-spacing: .04em; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #98a2b3; box-shadow: 0 0 0 4px #f2f4f7; }
.status-dot.healthy, .status-dot.running { background: #12b76a; box-shadow: 0 0 0 4px #ecfdf3; }
.status-dot.attention { background: #f79009; box-shadow: 0 0 0 4px #fff6ed; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 19px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric-card > span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-card > strong { display: block; margin: 8px 0 3px; font-size: 29px; line-height: 1; letter-spacing: -.03em; }
.metric-card > small { color: #8490a3; font-size: 11px; }
.metric-status { font-size: 22px !important; letter-spacing: .02em !important; }
.metric-status.healthy, .metric-status.running { color: var(--success); }
.metric-status.attention { color: var(--warning); }

.content-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two-columns { grid-template-columns: minmax(0,1.65fr) minmax(300px,.85fr); }
.detail-layout { grid-template-columns: minmax(0,1.6fr) minmax(280px,.6fr); }
.panel { margin-bottom: 18px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.panel-header h2 { margin: 0; font-size: 16px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.run-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.run-title strong { margin-left: 3px; font-size: 13px; }

.badge, .mini-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.badge { padding: 3px 8px; background: #f2f4f7; color: #475467; font-size: 10px; letter-spacing: .03em; }
.badge.success, .badge.healthy, .badge.running { background: var(--success-bg); color: var(--success); }
.badge.failed, .badge.attention { background: var(--danger-bg); color: var(--danger); }
.badge.mode { background: var(--accent-soft); color: #1d4ed8; }
.badge.muted-badge { background: #f2f4f7; color: #667085; }
.large-badge { padding: 6px 11px; font-size: 12px; }
.mini-tag { margin-left: 7px; padding: 2px 6px; background: #fff1f0; color: #d92d20; font-size: 9px; vertical-align: 2px; }

.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; margin: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.detail-grid > div { padding: 13px 14px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.detail-grid dt { color: var(--muted); font-size: 11px; }
.detail-grid dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.detail-grid.compact > div { padding: 11px 12px; }
.summary-list { display: grid; }
.summary-list > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid #eef1f5; }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list span { color: var(--muted); }
.summary-list strong { text-align: right; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #edf0f4; vertical-align: top; }
th { background: #fafbfc; color: #667085; font-size: 11px; font-weight: 700; white-space: nowrap; }
td { font-size: 12px; }
tbody tr:hover { background: #fbfcfe; }
.notice-table th:nth-child(2) { min-width: 340px; }
.notice-table th:nth-child(3) { min-width: 210px; }
.notice-title-cell a { color: #1f3c77; font-weight: 650; }
.notice-title-cell a:hover { color: var(--accent); }
.crawler-table { min-width: 1120px; }
.table-empty { padding: 36px; text-align: center; color: var(--muted); }
.nowrap { white-space: nowrap; }
.error-row td { background: #fff8f7; color: var(--danger); font-size: 11px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.filter-panel { margin-bottom: 18px; padding: 17px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.filter-grid { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 12px; align-items: end; }
.filter-grid .span-2 { grid-column: span 2; }
.compact-filter .filter-grid { grid-template-columns: 220px 220px 1fr; }
.filter-actions { display: flex; align-items: end; gap: 8px; }
label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d7dce5;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: #84adff; box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
textarea { resize: vertical; min-height: 84px; }
select[multiple] { min-height: 220px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #d7dce5;
  border-radius: 9px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.button:hover { background: #f9fafb; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover { background: #1d4ed8; }
.button.ghost { background: #fff; }
.button.danger { border-color: #fecaca; background: #fff; color: var(--danger); }
.button.danger:hover { background: var(--danger-bg); }
.button.wide { width: 100%; min-height: 42px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; color: var(--muted); font-size: 12px; }
.pagination > div { display: flex; gap: 7px; }

.notice-detail-header h1 { max-width: 950px; font-size: 25px; }
.side-info .summary-list strong { max-width: 190px; overflow-wrap: anywhere; font-size: 12px; }
.prose { white-space: pre-wrap; color: #344054; line-height: 1.85; font-size: 14px; overflow-wrap: anywhere; }
.raw-block { overflow: auto; max-height: 420px; margin: 0; padding: 14px; border-radius: 10px; background: #0f172a; color: #dbeafe; font-size: 11px; }

.subscription-list { display: grid; gap: 12px; }
.subscription-card { display: flex; justify-content: space-between; gap: 22px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.subscription-main { flex: 1; min-width: 0; }
.subscription-title-row { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.subscription-title-row h2 { margin: 0; font-size: 17px; }
.subscription-actions { display: flex; align-items: flex-start; gap: 7px; }
.rule-row { display: grid; grid-template-columns: 66px 1fr; gap: 10px; margin: 8px 0; }
.rule-label { color: var(--muted); font-size: 11px; padding-top: 4px; }
.rule-values { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-values > span, .rule-chip { padding: 3px 8px; border-radius: 6px; background: #f3f6fa; color: #475467; font-size: 11px; }
.rule-chip.exclude { background: #fff1f0; color: #b42318; }
.rule-values em { color: #98a2b3; font-style: normal; font-size: 11px; }
.form-layout { max-width: 980px; }
.form-section { margin-bottom: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.field-grid .span-2 { grid-column: span 2; }
.checkbox-field { display: flex; align-items: center; align-self: end; gap: 8px; min-height: 40px; }
.checkbox-field input, .mini-check input { width: auto; }
.form-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 0 24px; }

.message-list { display: grid; }
.message-row { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.message-row:last-child { border-bottom: 0; }
.message-row.unread { background: #fbfdff; }
.message-indicator { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.message-row.unread .message-indicator { background: var(--accent); }
.message-meta { display: flex; gap: 12px; color: #8490a3; font-size: 10px; }
.message-title { display: inline-block; margin: 3px 0 2px; color: #1f3c77; font-weight: 700; }
.message-content p { margin: 0; color: var(--muted); font-size: 11px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.segmented a { padding: 6px 11px; border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.segmented a.active { background: #eef4ff; color: #1d4ed8; }

.inline-form { display: flex; align-items: center; gap: 7px; }
.inline-form select { width: 90px; padding: 7px 8px; }
.mini-check { display: flex; grid-template-columns: auto auto; align-items: center; gap: 5px; white-space: nowrap; font-size: 11px; }
.muted { color: var(--muted); }
.alert { margin: 12px 0; padding: 10px 12px; border-radius: 9px; font-size: 12px; }
.alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecdca; }
.alert.success { background: var(--success-bg); color: var(--success); border: 1px solid #abefc6; }
.alert.warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fedf89; }
.empty-state { padding: 64px 24px; text-align: center; border: 1px dashed #ccd3dd; border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.empty-state strong { display: block; color: var(--text); font-size: 16px; }
.empty-state p { margin: 6px auto 16px; max-width: 520px; }
.empty-state.small { padding: 32px 18px; }

.auth-body { background: #fff; }
.auth-layout { display: grid; grid-template-columns: minmax(480px,1.1fr) minmax(420px,.9fr); min-height: 100vh; }
.auth-intro { display: flex; flex-direction: column; justify-content: center; padding: 72px clamp(50px,7vw,110px); background: #0f172a; color: #fff; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 48px; font-size: 19px; font-weight: 800; }
.auth-intro h1 { margin: 0; max-width: 620px; font-size: clamp(36px,4.2vw,58px); line-height: 1.12; letter-spacing: -.035em; }
.auth-intro > p { max-width: 580px; margin: 20px 0 0; color: #b8c2d3; font-size: 16px; }
.auth-points { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 48px; color: #cbd5e1; font-size: 12px; }
.auth-points span::before { content: "✓"; margin-right: 7px; color: #60a5fa; }
.auth-panel { display: grid; place-items: center; padding: 40px; background: #f8fafc; }
.auth-card { width: min(420px,100%); padding: 34px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 20px 50px rgba(15,23,42,.08); }
.auth-card h2 { margin: 0; font-size: 25px; }
.auth-card > .muted { margin: 6px 0 22px; }
.login-heading { margin-bottom: 22px; }
.login-heading .muted { margin: 7px 0 0; }
.login-system-label { display: block; margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.form-stack { display: grid; gap: 15px; }
.form-stack input { min-height: 42px; }
.auth-switch { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.auth-switch a { color: var(--accent); font-weight: 700; }

.settings-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(320px,.85fr); gap: 18px; }
.settings-form { gap: 17px; }
.field-help { color: var(--muted); font-size: 11px; font-weight: 400; }
.switch-line { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); }
.switch-line input { width: auto; margin-top: 3px; }
.switch-line span { display: grid; gap: 2px; }
.switch-line small { color: var(--muted); font-weight: 400; }
.scheduler-status-card .detail-grid { margin-top: 4px; }
.status-note { margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--surface-muted); color: var(--muted); font-size: 12px; }
.panel-header.padded { padding: 20px 20px 0; }
.job-message { max-width: 280px; color: var(--muted); overflow-wrap: anywhere; }

.manual-run-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.manual-run-bar h2 { margin: 0 0 4px; font-size: 16px; }
.manual-run-bar p { margin: 0; max-width: 760px; color: var(--muted); font-size: 12px; }
.manual-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scheduler-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--border); }
.scheduler-strip > div { padding: 13px 14px; background: var(--surface); }
.scheduler-strip span, .scheduler-strip strong { display: block; }
.scheduler-strip span { color: var(--muted); font-size: 10px; }
.scheduler-strip strong { margin-top: 3px; font-size: 12px; }
.scheduler-strip.online > div:first-child strong { color: var(--success); }
.scheduler-strip.offline > div:first-child strong { color: var(--danger); }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .two-columns, .detail-layout, .settings-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scheduler-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { display: none; }
  .auth-panel { min-height: 100vh; }
}

@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; min-height: auto; padding: 12px; }
  .brand { padding-bottom: 10px; }
  .nav-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .nav-section { grid-column: 1 / -1; margin-top: 10px; }
  .sidebar-footer { display: none; }
  .main-content { margin-left: 0; padding: 20px 14px 36px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .manual-run-bar { align-items: stretch; flex-direction: column; }
  .manual-actions { width: 100%; }
  .manual-actions form, .manual-actions .button { flex: 1; }
  .scheduler-strip { grid-template-columns: 1fr; }
  .metric-grid, .field-grid, .filter-grid, .compact-filter .filter-grid { grid-template-columns: 1fr; }
  .field-grid .span-2, .filter-grid .span-2 { grid-column: auto; }
  .subscription-card { flex-direction: column; }
  .subscription-actions { flex-wrap: wrap; }
  .message-row { grid-template-columns: 8px minmax(0,1fr); }
  .message-actions { grid-column: 2; }
  .detail-grid { grid-template-columns: 1fr; }
  .auth-panel { padding: 20px; }
  .auth-card { padding: 25px; }
}
