:root {
  --primary: #3b5bdb;
  --primary-strong: #2844b8;
  --primary-soft: #eef1ff;
  --purple: #7c5cfc;
  --cyan: #18b6d9;
  --coral: #ef5b5b;
  --coral-soft: #fff0f1;
  --amber: #e58a2a;
  --amber-soft: #fff6e8;
  --green: #10a676;
  --ink: #111827;
  --muted: #667085;
  --line: #dde3ee;
  --surface: #ffffff;
  --page: #f3f5fa;
  --shadow: 0 10px 30px rgba(35, 51, 102, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 1180px; min-height: 100vh; color: var(--ink); background: var(--page); font: 15px/1.5 "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body.drawer-open { overflow: hidden; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(59, 91, 219, .25); outline-offset: 2px; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px !important;
  color: var(--ink);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #73809a 50%),
    linear-gradient(135deg, #73809a 50%, transparent 50%);
  background-position:
    calc(100% - 15px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
select:hover { border-color: #aebbd4 !important; background-color: #fbfcff; }
select:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(59, 91, 219, .11); }
select:disabled { color: #98a2b3; background-color: #f2f4f8; cursor: not-allowed; opacity: .72; }
select option { color: var(--ink); background: #fff; }

.custom-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.custom-select { position: relative; min-width: 0; display: inline-flex; vertical-align: middle; }
.custom-select-trigger {
  position: relative;
  width: 100%;
  height: 40px;
  padding: 0 38px 0 12px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid #748199;
  border-bottom: 1.5px solid #748199;
  transform: rotate(45deg);
  transition: margin-top .18s, transform .18s;
}
.custom-select.open .custom-select-trigger::after { margin-top: -1px; transform: rotate(225deg); }
.custom-select-trigger:hover { border-color: #aebbd4; background: #fbfcff; }
.custom-select-trigger:focus-visible, .custom-select.open .custom-select-trigger { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 91, 219, .11); }
.custom-select-trigger:disabled { color: #98a2b3; background: #f2f4f8; cursor: not-allowed; opacity: .72; }
.custom-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-menu {
  position: fixed;
  z-index: 1000;
  max-height: 280px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid #d9e0ee;
  border-radius: 10px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 42px rgba(32, 48, 96, .18), 0 3px 10px rgba(32, 48, 96, .08);
  backdrop-filter: blur(12px);
  animation: custom-select-in .14s ease-out;
}
.custom-select-option {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  color: #273149;
  background: transparent;
  text-align: left;
  white-space: nowrap;
}
.custom-select-option:hover, .custom-select-option.active { color: var(--primary-strong); background: #f1f4ff; }
.custom-select-option.selected { color: var(--primary-strong); background: var(--primary-soft); font-weight: 700; }
.custom-select-option i { width: 7px; height: 12px; flex: 0 0 auto; border-right: 2px solid transparent; border-bottom: 2px solid transparent; transform: rotate(45deg); }
.custom-select-option.selected i { border-color: var(--primary); }
.custom-select-option:disabled { color: #a3aaba; cursor: not-allowed; }
@keyframes custom-select-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.field-control .custom-select { min-width: 112px; height: 44px; flex: 1; }
.field-control .custom-select-trigger { height: 44px; padding: 0 34px 0 0; border: 0; border-radius: 0 8px 8px 0; background: transparent; box-shadow: none; }
.field-control .custom-select-trigger:hover, .field-control .custom-select-trigger:focus-visible, .field-control .custom-select.open .custom-select-trigger { background: transparent; box-shadow: none; }
.compact-control .custom-select { min-width: 102px; height: 34px; }
.compact-control .custom-select-trigger { height: 34px; padding: 0 32px 0 10px; border: 0; border-radius: 7px; background: transparent; box-shadow: none; font-size: 13px; }
.compact-control .custom-select-trigger:hover, .compact-control .custom-select-trigger:focus-visible, .compact-control .custom-select.open .custom-select-trigger { background: transparent; box-shadow: none; }
.source-filters .custom-select { width: 100%; height: 38px; }
.source-filters .custom-select-trigger { height: 38px; border-color: #d9dfeb; border-radius: 7px; }
.source-pagination .custom-select { width: 54px; height: 32px; margin: 0 4px; }
.source-pagination .custom-select-trigger { height: 32px; padding: 0 28px 0 9px; border-radius: 6px; font-size: 12px; }
.source-pagination .custom-select-trigger::after { right: 10px; width: 6px; height: 6px; }
.application-filter-row .custom-select, .application-form .custom-select { width: 100%; min-height: 40px; }
.application-filter-row .custom-select-trigger, .application-form .custom-select-trigger { min-height: 40px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 120px; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.brand-mark { height: 101px; display: grid; place-items: center; border-bottom: 1px solid var(--line); color: var(--primary); text-decoration: none; }
.brand-mark > span, .login-brand { position: relative; width: 42px; height: 42px; display: block; border: 2px solid currentColor; border-radius: 13px; background: var(--primary-soft); }
.brand-mark > span::before, .brand-mark > span::after, .login-brand::before, .login-brand::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 22px; height: 6px; border-radius: 3px; background: currentColor; transform: translate(-50%, -50%); }
.brand-mark > span::after, .login-brand::after { width: 6px; height: 22px; }
.sidebar nav { padding-top: 8px; display: flex; flex-direction: column; }
.nav-link, .sidebar-logout { position: relative; min-height: 60px; padding: 8px 7px; display: flex; align-items: center; gap: 10px; border: 0; color: #46506a; background: transparent; text-align: left; text-decoration: none; }
.nav-link::before { content: ""; position: absolute; inset: 8px auto 8px 0; width: 3px; border-radius: 0 4px 4px 0; background: transparent; }
.nav-link i, .sidebar-logout i { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #ccd4e4; border-radius: 8px; font-size: 12px; font-style: normal; font-weight: 700; }
.nav-link span, .sidebar-logout span { font-size: 14px; white-space: nowrap; }
.nav-link b { min-width: 19px; height: 19px; margin-left: auto; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--coral); font-size: 10px; }
.nav-link b[hidden] { display: none; }
.nav-link:hover, .nav-link.active { color: var(--primary-strong); background: #f6f7ff; }
.nav-link.active { font-weight: 700; }
.nav-link.active::before { background: var(--primary); }
.nav-link.active i { color: #fff; border-color: var(--primary); background: var(--primary); }
.sidebar-logout { width: 100%; margin-top: auto; border-top: 1px solid var(--line); }
.sidebar-logout:hover { color: var(--coral); background: var(--coral-soft); }

.main-content { min-height: 100vh; margin-left: 120px; background: #fff; }
.topbar { min-height: 112px; padding: 16px 24px; display: grid; grid-template-columns: minmax(310px, 1fr) minmax(390px, 1.55fr) 152px 150px; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #fff 0%, #fff 64%, #f7f8ff 100%); }
.page-heading { min-width: 0; }
.page-heading > span { display: block; margin-bottom: 3px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.topbar h1 { margin: 0; font-size: clamp(29px, 2vw, 36px); line-height: 1.15; letter-spacing: -.045em; white-space: nowrap; }
.page-heading p { margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-controls { display: flex; align-items: center; gap: 12px; min-width: 0; }
.field-control, .search-control { min-height: 46px; display: flex; align-items: center; border: 1px solid #d5dceb; border-radius: 8px; background: #fff; }
.field-control { min-width: 178px; padding-left: 13px; }
.field-control > span { margin-right: 8px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.field-control:hover, .field-control:focus-within { border-color: #aebbd4; box-shadow: 0 0 0 3px rgba(59, 91, 219, .08); }
.field-control select { min-width: 112px; height: 44px; padding: 0 34px 0 0 !important; border: 0; color: var(--ink); background-color: transparent; outline: 0; box-shadow: none; }
.field-control select:hover, .field-control select:focus { border-color: transparent !important; background-color: transparent; box-shadow: none; }
.search-control { flex: 1; min-width: 205px; padding: 0 10px 0 13px; gap: 9px; }
.search-mark { width: 15px; height: 15px; flex: 0 0 auto; border: 2px solid #8490a7; border-radius: 50%; position: relative; }
.search-mark::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -2px; border-radius: 2px; background: #8490a7; transform: rotate(45deg); }
.search-control input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; }
.search-control input::placeholder { color: #98a2b3; }
.search-control kbd { padding: 2px 5px; color: #7b8499; border: 1px solid #d9deea; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.freshness-status, .sync-status { min-height: 62px; padding-left: 18px; display: flex; flex-direction: column; justify-content: center; gap: 2px; border-left: 1px solid var(--line); }
.freshness-status > span, .sync-status > span { color: #596178; font-size: 13px; }
.freshness-status strong { color: var(--primary); font-size: 20px; }
.freshness-status small, .sync-status small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sync-status strong { display: flex; align-items: center; gap: 8px; color: #7d879a; font-size: 16px; }
.sync-status strong b { font-weight: 700; }
.sync-status.problem strong, .sync-status.problem small { color: var(--coral); }
#node-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa3b3; box-shadow: 0 0 0 4px rgba(154, 163, 179, .14); }
#node-status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(16, 166, 118, .14); }

.time-band { min-height: 96px; margin: 0 24px; display: grid; grid-template-columns: 1fr 1.4fr 2fr .75fr auto; gap: 24px; align-items: center; border-bottom: 1px solid var(--line); }
.time-band > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.time-band span { color: var(--muted); font-size: 13px; }
.time-band strong { overflow: hidden; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.time-band.stale .time-message strong, .time-band.stale #freshness-status-value { color: var(--coral); }
.refresh-button { min-width: 114px; height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--primary); background: #fff; font-weight: 650; }
.refresh-button:hover { border-color: var(--primary); background: var(--primary-soft); }
.refresh-button:disabled { opacity: .58; cursor: progress; }
.refresh-button i { width: 15px; height: 15px; border: 2px solid currentColor; border-left-color: transparent; border-radius: 50%; }
.refresh-button:disabled i { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.metrics-strip { min-height: 142px; padding: 20px 24px; display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); scroll-margin-top: 18px; }
.metric { min-width: 0; padding: 5px 20px; display: flex; align-items: center; gap: 15px; border-right: 1px solid var(--line); }
.metric:first-child { padding-left: 4px; }
.metric:last-child { border-right: 0; }
.metric-icon { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); border: 1.5px solid currentColor; border-radius: 50%; background: #fff; font-size: 15px; font-weight: 800; }
.metric-purple .metric-icon, .metric-purple strong { color: var(--purple); }
.metric-cyan .metric-icon, .metric-cyan strong { color: var(--cyan); }
.metric > div { min-width: 0; display: flex; flex-direction: column; }
.metric > div > span { color: #596178; font-size: 14px; }
.metric strong { overflow: hidden; color: var(--primary); font-size: clamp(22px, 1.7vw, 29px); line-height: 1.35; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.metric small { color: #4d566c; font-size: 14px; }

.dashboard-grid { padding: 14px 20px 12px; display: grid; grid-template-columns: minmax(620px, 1.3fr) minmax(450px, 1fr); gap: 12px; background: var(--page); }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 14px; }
.panel-header { min-height: 66px; padding: 14px 17px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 19px; line-height: 1.35; letter-spacing: -.02em; }
.panel-header > div > span, .panel-header > span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.panel-tag { padding: 4px 8px; border-radius: 5px; color: var(--primary) !important; background: var(--primary-soft); white-space: nowrap; }
.panel-tag.stale { color: #9a5c16 !important; background: var(--amber-soft); }
.compact-control { height: 36px; padding: 0; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.compact-control:hover, .compact-control:focus-within { border-color: #aebbd4; box-shadow: 0 0 0 3px rgba(59, 91, 219, .08); }
.compact-control select { height: 34px; padding: 0 32px 0 10px !important; border: 0; border-radius: 7px; background-color: transparent; outline: 0; box-shadow: none; font-size: 13px; }
.compact-control select:hover, .compact-control select:focus { border-color: transparent !important; background-color: transparent; box-shadow: none; }

.chart-meta { padding: 10px 17px 0; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.chart-legend { height: 33px; padding: 0 17px; display: flex; align-items: center; gap: 18px; color: #566077; font-size: 13px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; }
.chart-legend .sales { background: var(--primary); }
.chart-legend .purchase { background: var(--purple); }
.chart-legend .profit { background: var(--cyan); }
.chart-stage { position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr); margin: 0 14px; }
.chart-axis { height: 272px; padding: 12px 7px 24px 0; display: flex; flex-direction: column; justify-content: space-between; color: #7b8497; text-align: right; font-size: 10px; }
.bar-chart { height: 272px; margin: 0; padding: 14px 4px 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(68px, 1fr); align-items: end; gap: 11px; overflow-x: auto; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 66px, #edf0f6 67px); }
.month-group { height: 100%; min-width: 68px; display: grid; grid-template-rows: 1fr 24px; gap: 7px; }
.month-bars { min-height: 0; }
.month-bars svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bar { transition: opacity .18s, filter .18s; }
.bar:hover { opacity: .75; filter: brightness(1.06); }
.bar.sales { fill: var(--primary); }
.bar.purchase { fill: var(--purple); }
.bar.profit { fill: var(--cyan); }
.month-label { color: #70798e; text-align: center; font-size: 11px; }
.chart-insight { min-height: 58px; margin: 12px 14px 0; padding: 9px 13px; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; border-left: 3px solid var(--primary); background: #f2f4ff; }
.chart-insight > span { color: var(--primary); font-size: 13px; }
.chart-insight > strong { font-size: 15px; }
.chart-insight p { margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.trend-comparison { min-height: 52px; margin: 0 14px 12px; padding: 0 13px; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); align-items: center; border: 1px solid #e3e7f2; border-top: 0; }
.trend-comparison > span { color: var(--muted); font-size: 12px; }
.trend-comparison > div { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12px; }
.trend-comparison b { color: var(--muted); font-weight: 500; }
.trend-comparison.partial { border-color: #f1d9ad; background: var(--amber-soft); }
.trend-comparison.partial > span, .trend-comparison.partial strong { color: #9a5c16; }

.risk-total { color: var(--coral); font-size: 13px; white-space: nowrap; }
.risk-toolbar { min-height: 50px; padding: 9px 13px; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); }
.filter-chip { padding: 6px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: #f7f8fb; font-size: 12px; }
.filter-chip span { margin-left: 3px; font-variant-numeric: tabular-nums; }
.filter-chip.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.risk-list { min-height: 285px; }
.risk-item { width: 100%; min-height: 72px; padding: 10px 14px; display: grid; grid-template-columns: 8px minmax(160px, 1fr) auto; gap: 12px; align-items: center; border: 0; border-bottom: 1px solid #e8ebf2; color: inherit; background: #fff; text-align: left; }
.risk-item:hover { background: #fafbff; }
.risk-item .severity { width: 8px; height: 38px; border-radius: 5px; background: var(--amber); }
.risk-item.high .severity { background: var(--coral); }
.risk-item.low .severity { background: var(--cyan); }
.risk-item strong, .risk-item small, .risk-meta { display: block; }
.risk-item strong { font-size: 14px; }
.risk-item small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.risk-meta { margin-bottom: 2px; color: #7b8497; font-size: 11px; font-weight: 650; }
.risk-count { min-width: 38px; color: #353e52; text-align: right; font-size: 22px; font-weight: 800; }
.view-all-risk { width: calc(100% - 24px); height: 44px; margin: 10px 12px 12px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #ff8d82; border-radius: 6px; color: var(--coral); background: #fff; font-weight: 700; }
.view-all-risk span { font-size: 12px; font-weight: 500; }
.view-all-risk:hover { background: var(--coral-soft); }

.product-panel, .plan-panel { min-height: 305px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 9px 11px; color: #667085; background: #f7f8fb; text-align: left; font-size: 12px; font-weight: 650; white-space: nowrap; }
td { padding: 10px 11px; border-bottom: 1px solid #eceff5; vertical-align: middle; }
tbody tr:hover { background: #f8f9ff; }
td.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank { color: var(--primary); font-weight: 850; }
.product-cell small, .product-label small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.plan-summary { min-height: 57px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; border-top: 1px solid var(--line); }
.plan-summary span { padding: 0 8px; color: var(--muted); border-right: 1px solid var(--line); text-align: center; font-size: 12px; }
.plan-summary span:last-child { border-right: 0; }
.plan-summary b { display: block; margin-top: 2px; color: var(--ink); font-size: 14px; }
.plan-summary .coral { color: var(--coral); }

.detail-grid { padding: 0 20px 12px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; background: var(--page); }
body[data-page="inventory"] .dashboard-grid,
body[data-page="risks"] .dashboard-grid,
body[data-page="inventory"] .detail-grid,
body[data-page="compliance"] .detail-grid { grid-template-columns: minmax(0, 1fr); }
body[data-page="risks"] .risk-panel { min-height: 560px; }
body[data-page="risks"] .risk-list { min-height: 385px; }
body[data-page="sync"] .sync-diagnostics { margin-top: 16px; }
.rank-list { padding: 15px 17px; display: grid; gap: 13px; }
.rank-row { display: grid; grid-template-columns: minmax(130px, 1fr) 1.8fr auto; gap: 13px; align-items: center; font-size: 12px; }
.product-label { min-width: 0; }
.product-label b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 8px; overflow: hidden; border-radius: 5px; background: #e8ebfb; }
.rank-bar svg { width: 100%; height: 100%; display: block; }
.rank-bar rect { fill: var(--primary); }
.rank-row > strong { white-space: nowrap; }
.quality-note { margin: 0 17px 16px; padding: 11px 13px; color: #8b5b1f; border-radius: 6px; background: var(--amber-soft); font-size: 12px; }
.compliance-grid { padding: 15px 17px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.compliance-grid > div { min-height: 97px; padding: 12px; border: 1px solid #e8ebf2; border-radius: 7px; background: #fafbfe; }
.compliance-grid span, .compliance-grid strong, .compliance-grid small { display: block; }
.compliance-grid span { color: var(--muted); font-size: 12px; }
.compliance-grid strong { margin: 8px 0 3px; color: var(--primary); font-size: 24px; }
.compliance-grid small { color: #596178; font-size: 11px; }
.compliance-grid .danger strong { color: var(--coral); }
.coverage-row { padding: 0 17px 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.coverage-row span { padding: 7px 9px; color: var(--muted); border-radius: 5px; background: var(--primary-soft); font-size: 11px; }
.coverage-row b { margin-left: 4px; color: var(--primary-strong); }
.coverage-row .coverage-missing { color: #9a5c16; background: var(--amber-soft); }
.coverage-row .coverage-missing b { color: var(--coral); }
.coverage-row .coverage-missing::after { content: " · 未采集"; font-weight: 700; }
.coverage-row .coverage-complete { background: #edf9f5; }
.coverage-row .coverage-complete b { color: var(--green); }

.source-browser { min-height: calc(100vh - 160px); padding: 14px 20px 20px; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 12px; background: var(--page); }
.source-catalog { overflow: hidden; align-self: start; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.source-catalog-heading { padding: 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.source-catalog-heading span { color: var(--muted); font-size: 12px; }
.source-catalog-heading strong { color: var(--primary); font-size: 12px; }
.source-view-group { padding: 12px 9px 6px; }
.source-view-group + .source-view-group { border-top: 1px solid #edf0f6; }
.source-view-group > span { padding: 0 7px 7px; display: block; color: #8a93a6; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.source-view-button { width: 100%; min-height: 52px; padding: 7px; display: flex; align-items: center; gap: 9px; color: #46506a; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.source-view-button:hover { background: #f7f8fd; }
.source-view-button.active { color: var(--primary-strong); background: var(--primary-soft); }
.source-view-button > i { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); border: 1px solid #cbd5ff; border-radius: 8px; background: #fff; font-size: 11px; font-style: normal; font-weight: 800; }
.source-view-button.active > i { color: #fff; border-color: var(--primary); background: var(--primary); }
.source-view-button b, .source-view-button small { display: block; }
.source-view-button b { font-size: 13px; }
.source-view-button small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.source-workspace { min-height: 680px; display: flex; flex-direction: column; }
.source-workspace-header { min-height: 82px; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.source-workspace-header .eyebrow { margin: 0 0 2px; }
.source-workspace-header h2 { margin: 0; font-size: 22px; }
.source-workspace-header > div > span { color: var(--muted); font-size: 12px; }
.source-total { min-width: 90px; text-align: right; }
.source-total span, .source-total strong { display: block; }
.source-total span { color: var(--muted); font-size: 11px; }
.source-total strong { color: var(--primary); font-size: 24px; }
.source-filters { padding: 12px 14px; display: grid; grid-template-columns: minmax(190px, 1.5fr) repeat(3, minmax(130px, .75fr)) auto auto; gap: 9px; align-items: end; border-bottom: 1px solid var(--line); background: #fafbfe; }
.source-filters label { min-width: 0; display: grid; gap: 4px; }
.source-filters label > span { color: var(--muted); font-size: 11px; }
.source-filters input, .source-filters select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #d9dfeb; border-radius: 7px; color: var(--ink); background-color: #fff; outline: 0; }
.source-filters select { padding-left: 11px; }
.source-filters input:focus, .source-filters select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 91, 219, .1); }
.source-filter-submit, .source-filter-reset { height: 38px; padding: 0 14px; border-radius: 6px; font-weight: 700; }
.source-filter-submit { color: #fff; border: 1px solid var(--primary); background: var(--primary); }
.source-filter-reset { color: var(--muted); border: 1px solid var(--line); background: #fff; }
.source-filters.loading { opacity: .65; pointer-events: none; }
.source-table-wrap { min-height: 470px; overflow: auto; flex: 1; }
.source-table { min-width: 840px; }
.source-table th { position: sticky; top: 0; z-index: 2; }
.source-table tbody tr { cursor: pointer; }
.source-table tbody tr:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--primary-soft); }
.source-primary-cell { color: #27344f; font-weight: 700; }
.source-primary-cell small, .source-line-body small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }
.source-action-column { width: 86px; }
.source-detail-button { padding: 5px 8px; color: var(--primary); border: 1px solid #ccd5fa; border-radius: 5px; background: #fff; font-size: 11px; white-space: nowrap; }
.source-detail-button:hover { color: #fff; border-color: var(--primary); background: var(--primary); }
.source-status-pill { display: inline-flex; padding: 3px 7px; border-radius: 999px; color: #687188; background: #f0f2f6; font-size: 11px; font-weight: 700; white-space: nowrap; }
.source-status-pill.success { color: #08785a; background: #eaf8f3; }
.source-status-pill.warning { color: #9a5c16; background: var(--amber-soft); }
.source-status-pill.danger { color: var(--coral); background: var(--coral-soft); }
.source-status-pill.primary { color: var(--primary); background: var(--primary-soft); }
.source-pagination { min-height: 56px; padding: 9px 14px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.source-pagination > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.source-pagination label { color: var(--muted); font-size: 11px; }
.source-pagination select { height: 32px; margin: 0 4px; padding: 0 28px 0 9px !important; border: 1px solid var(--line); border-radius: 6px; background-position: calc(100% - 12px) calc(50% - 2px), calc(100% - 7px) calc(50% - 2px); }
.source-pagination button { height: 32px; padding: 0 10px; color: #46506a; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.source-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.source-pagination strong { min-width: 58px; color: #46506a; text-align: center; font-size: 12px; }

.source-drawer { position: relative; width: min(900px, 94vw); height: 100%; padding: 30px; overflow-y: auto; background: #fff; box-shadow: -16px 0 46px rgba(31, 43, 91, .18); animation: slide-in .2s ease-out; }
.source-drawer h2 { margin: 0 48px 4px 0; font-size: 27px; }
.source-drawer > p { margin: 0 48px 20px 0; color: var(--muted); font-size: 12px; }
.source-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.source-detail-summary > div { min-height: 74px; padding: 10px; border: 1px solid #e5e9f2; border-radius: 7px; background: #fafbfe; }
.source-detail-summary span, .source-detail-summary strong { display: block; }
.source-detail-summary span { color: var(--muted); font-size: 10px; }
.source-detail-summary strong { margin-top: 7px; overflow-wrap: anywhere; font-size: 13px; }
.source-detail-section { margin-top: 20px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.source-detail-heading { min-height: 52px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.source-detail-heading h3 { margin: 0; font-size: 16px; }
.source-detail-heading span { color: var(--primary); font-size: 12px; }
.source-detail-table-wrap { overflow-x: auto; }
.source-detail-table-wrap table { min-width: 680px; }
.source-raw-fields { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; }
.source-raw-fields summary { padding: 13px; color: #46506a; cursor: pointer; font-size: 13px; font-weight: 700; }
.source-raw-fields > div { padding: 0 13px 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.source-raw-fields > div > div { padding: 8px; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; border-radius: 5px; background: #f7f8fb; font-size: 11px; }
.source-raw-fields span { color: var(--muted); }
.source-raw-fields strong { overflow-wrap: anywhere; font-weight: 600; }

.sync-diagnostics { margin: 0 20px 12px; background: #fff; }
.sync-diagnostics summary { min-height: 67px; padding: 13px 17px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.sync-diagnostics summary::-webkit-details-marker { display: none; }
.sync-diagnostics summary span b, .sync-diagnostics summary span small { display: block; }
.sync-diagnostics summary b { font-size: 17px; }
.sync-diagnostics summary small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.sync-diagnostics summary > i { width: 10px; height: 10px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(45deg); transition: transform .2s; }
.sync-diagnostics[open] summary > i { transform: rotate(225deg); }
.sync-diagnostic-grid { padding: 0 17px 17px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.sync-diagnostic-grid > div { padding: 11px 12px; border-radius: 6px; background: #f7f8fc; }
.sync-diagnostic-grid span, .sync-diagnostic-grid strong { display: block; }
.sync-diagnostic-grid span { color: var(--muted); font-size: 11px; }
.sync-diagnostic-grid strong { margin-top: 4px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.application-workspace { padding: 18px 20px 28px; background: var(--page); }
body[data-page="applications-mine"] .topbar, body[data-page="applications-audit"] .topbar { grid-template-columns: minmax(320px, 1fr) minmax(280px, .8fr); }
.application-mine-grid { display: grid; grid-template-columns: minmax(520px, .9fr) minmax(560px, 1.1fr); gap: 14px; align-items: start; }
.application-form, .application-list-panel, .application-audit-panel { padding: 18px; }
.application-identity { margin: 14px 0; padding: 10px 12px; color: #45506b; border: 1px solid #dfe5f1; border-radius: 7px; background: #f7f9fd; font-size: 12px; }
.application-form-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px; }
.application-form label, .application-action-form label { display: grid; gap: 5px; color: #5a647b; font-size: 11px; }
.application-form label.wide { grid-column: 1 / -1; }
.application-form input, .application-form textarea, .application-form select,
.application-filter-row input, .application-filter-row select,
.application-action-form input, .application-action-form textarea { width: 100%; padding: 9px 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background-color: #fff; font: inherit; }
.application-form select, .application-filter-row select { min-height: 40px; padding-right: 34px; }
.application-items-heading { margin-top: 18px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.application-items-heading h3 { margin: 0; font-size: 15px; }
.application-items-heading span { color: var(--muted); font-size: 10px; }
.application-items-heading button, .application-refresh { padding: 7px 10px; color: var(--primary); border: 1px solid #ccd7f4; border-radius: 6px; background: #f6f8ff; font-size: 12px; font-weight: 700; }
.application-item-inputs { margin-top: 10px; display: grid; gap: 8px; }
.application-item-input { position: relative; padding: 12px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 74px 88px; gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfe; }
.application-item-input .item-remark { grid-column: 1 / -1; }
.application-item-input .remove-application-item { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; padding: 0; color: #9a5360; border: 0; border-radius: 50%; background: #fff0f2; }
.application-submit-row { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.application-submit-row small { color: var(--muted); }
.application-submit-row button, .application-action-form button[type="submit"] { padding: 10px 17px; color: #fff; border: 0; border-radius: 6px; background: var(--primary); font-weight: 750; }
.application-filter-row { margin: 12px 0; display: grid; grid-template-columns: 170px minmax(180px, 1fr) auto; gap: 8px; }
.application-filter-row.audit { grid-template-columns: 170px minmax(220px, 1fr) 160px auto; }
.application-filter-row > button { padding: 0 15px; color: #fff; border: 0; border-radius: 6px; background: #596ac6; }
.application-table tbody tr { cursor: pointer; }
.application-table tbody tr:hover { background: #f7f8fc; }
.application-table td { max-width: 250px; }
.application-table .application-product-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.application-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.application-status.submitted { color: #9a5e05; background: #fff3cf; }
.application-status.purchase_confirmed { color: #3158bd; background: #e9efff; }
.application-status.completed { color: #17724e; background: #e2f7ed; }
.application-status.closed { color: #7c5960; background: #f2edef; }
.application-status-cards { margin-bottom: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.application-status-cards button { min-height: 92px; padding: 14px 17px; display: flex; align-items: flex-start; flex-direction: column; justify-content: center; color: #596178; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: left; }
.application-status-cards button:hover { border-color: #b9c5eb; box-shadow: 0 7px 20px rgba(52, 68, 130, .08); }
.application-status-cards strong { margin-top: 5px; color: var(--ink); font-size: 25px; }
.application-drawer { position: relative; width: min(980px, 96vw); height: 100%; padding: 30px; overflow-y: auto; background: #fff; box-shadow: -16px 0 46px rgba(31, 43, 91, .18); animation: slide-in .2s ease-out; }
.application-drawer h2 { margin: 0 48px 4px 0; font-size: 27px; }
.application-drawer > p { margin: 0 48px 20px 0; color: var(--muted); font-size: 12px; }
.application-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.application-detail-summary > div { padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfe; }
.application-detail-summary span, .application-detail-summary strong { display: block; }
.application-detail-summary span { color: var(--muted); font-size: 10px; }
.application-detail-summary strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 12px; }
.application-detail-section { margin-top: 18px; }
.application-detail-section h3 { margin: 0 0 8px; font-size: 15px; }
.application-event-list { display: grid; gap: 8px; }
.application-event { padding: 10px 12px; border-left: 3px solid #9cabe2; background: #f7f8fc; }
.application-event strong, .application-event span { display: block; }
.application-event span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.application-action-form { margin-top: 20px; padding: 16px; border: 1px solid #d7def2; border-radius: 8px; background: #f8f9fe; }
.application-action-form h3 { margin: 0 0 12px; font-size: 16px; }
.application-action-row { margin-bottom: 9px; padding: 10px; display: grid; grid-template-columns: 1.2fr repeat(4, minmax(95px, 1fr)); gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.application-action-row > strong { align-self: center; font-size: 12px; }
.application-action-row.usage { grid-template-columns: 1.2fr repeat(4, minmax(100px, 1fr)); }
.application-action-note { margin: 9px 0; }
.application-secondary-action { margin-left: 8px; padding: 9px 13px; color: #8f3f50; border: 1px solid #e9c8d0; border-radius: 6px; background: #fff5f6; font-weight: 700; }
.application-action-buttons { margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.application-action-buttons .application-secondary-action { margin-left: 0; }
.application-withdraw-trigger { margin: 20px 0 0; }

footer { min-height: 48px; padding: 0 24px; display: flex; align-items: center; gap: 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
footer span:nth-child(2) { margin-left: auto; }
footer b { color: #46506a; font-weight: 650; }
.empty { padding: 28px 10px; color: var(--muted); text-align: center; font-size: 13px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: flex-end; background: rgba(24, 34, 61, .25); }
.risk-drawer { position: relative; width: min(470px, 92vw); height: 100%; padding: 34px; overflow-y: auto; background: #fff; box-shadow: -16px 0 46px rgba(31, 43, 91, .18); animation: slide-in .2s ease-out; }
@keyframes slide-in { from { opacity: .6; transform: translateX(28px); } }
.drawer-close { position: absolute; top: 20px; right: 20px; width: 38px; height: 38px; display: grid; place-items: center; color: #566077; border: 0; border-radius: 50%; background: #f1f3f8; font-size: 25px; line-height: 1; }
.drawer-label { display: inline-block; margin-bottom: 14px; padding: 4px 8px; color: var(--coral); border-radius: 5px; background: var(--coral-soft); font-size: 12px; font-weight: 700; }
.risk-drawer h2 { margin: 0 45px 10px 0; font-size: 28px; }
.risk-drawer > p { margin: 0; color: #596178; line-height: 1.75; }
.drawer-count { margin: 24px 0 4px; padding: 13px 0; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.drawer-count span { color: var(--muted); font-size: 13px; }
.drawer-count strong { color: var(--primary); font-size: 20px; }
.detail-list { display: grid; }
.detail-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-item strong { display: block; font-size: 14px; }
.detail-item p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.drawer-note { margin-top: 18px; padding: 13px; color: #85551c; border-radius: 6px; background: var(--amber-soft); font-size: 12px; line-height: 1.65; }

.login-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(24, 34, 61, .82); backdrop-filter: blur(10px); }
.login-overlay.hidden { display: none; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.55); border-radius: 18px; background: #fff; box-shadow: 0 32px 90px rgba(16, 25, 62, .32); }
.login-brand { margin-bottom: 20px; color: var(--primary); }
.eyebrow { margin: 0 0 7px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.login-card h2 { margin: 0; font-size: 29px; letter-spacing: -.03em; }
.login-card > p:not(.eyebrow) { margin: 12px 0 23px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.login-card label { margin-top: 13px; display: grid; gap: 7px; color: #596178; font-size: 13px; }
.login-card input { width: 100%; padding: 12px 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.login-card button[type="submit"] { width: 100%; margin-top: 18px; padding: 13px; color: #fff; border: 0; border-radius: 7px; background: var(--primary); font-weight: 750; }
.login-card button[type="submit"]:hover { background: var(--primary-strong); }
.login-card .text-button { width: 100%; margin-top: 10px; padding: 5px; color: var(--muted); border: 0; background: transparent; }
.login-error { min-height: 22px; padding-top: 10px; color: var(--coral); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; padding: 11px 17px; color: #fff; border-radius: 7px; background: #202b55; box-shadow: 0 12px 28px rgba(34, 49, 93, .22); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s; font-size: 14px; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1420px) {
  .topbar { grid-template-columns: 300px 1fr 138px 136px; gap: 10px; }
  .topbar h1 { font-size: 29px; }
  .metric { padding-inline: 12px; }
  .metric-icon { width: 47px; height: 47px; }
  .time-band { grid-template-columns: .9fr 1.25fr 1.6fr .7fr auto; gap: 14px; }
}

@media (max-width: 1180px) {
  body { min-width: 0; }
  .sidebar { width: 88px; }
  .nav-link, .sidebar-logout { justify-content: center; }
  .nav-link span, .sidebar-logout span { display: none; }
  .nav-link b { position: absolute; right: 10px; top: 8px; }
  .main-content { margin-left: 88px; }
  .topbar { grid-template-columns: minmax(260px, 1fr) 150px 170px; }
  .topbar-controls { grid-column: 1 / -1; grid-row: 2; }
  .metrics-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--page); }
  .metric { min-height: 104px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .metric:first-child { padding-left: 12px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .source-browser { grid-template-columns: 205px minmax(0, 1fr); }
  .source-filters { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .source-keyword { grid-column: span 2; }
  .application-mine-grid { grid-template-columns: 1fr; }
  .application-action-row, .application-action-row.usage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .application-action-row > strong { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 66px; flex-direction: row; border: 0; border-top: 1px solid var(--line); }
  .brand-mark { display: none; }
  .sidebar nav { width: calc(100% - 52px); padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .nav-link { min-width: 0; min-height: 65px; padding: 5px 1px; flex-direction: column; justify-content: center; gap: 2px; text-align: center; }
  .nav-link span { display: block; font-size: 9px; line-height: 1.2; }
  .nav-link i { width: 24px; height: 24px; }
  .nav-link::before { inset: auto 5px 0; width: auto; height: 3px; }
  .nav-link b { right: 2px; top: 3px; min-width: 17px; height: 17px; font-size: 9px; }
  .sidebar-logout { width: 52px; min-height: 65px; margin: 0; padding: 5px 1px; flex-direction: column; gap: 2px; border-top: 0; border-left: 1px solid var(--line); }
  .sidebar-logout span { display: block; font-size: 9px; }
  .main-content { margin-left: 0; padding-bottom: 66px; }
  .topbar { grid-template-columns: 1fr 1fr; padding: 18px; }
  .page-heading, .topbar-controls { grid-column: 1 / -1; }
  .topbar-controls { grid-row: auto; }
  .freshness-status, .sync-status { min-height: 54px; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .sync-status { padding-left: 12px; }
  .time-band { margin: 0 18px; grid-template-columns: 1fr 1fr; padding: 15px 0; }
  .time-message { grid-column: 1 / -1; }
  .refresh-button { grid-column: 1 / -1; }
  .metrics-strip { padding: 15px 18px; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .metric { min-height: 90px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
  .metric:first-child { padding-left: 9px; }
  .dashboard-grid, .detail-grid { padding-inline: 12px; }
  .sync-diagnostics { margin-inline: 12px; }
  .source-browser { padding-inline: 12px; display: block; }
  .source-catalog { margin-bottom: 10px; display: flex; overflow-x: auto; }
  .source-catalog-heading { min-width: 116px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .source-view-group { min-width: max-content; display: flex; gap: 4px; border-left: 1px solid #edf0f6; border-top: 0 !important; }
  .source-view-group > span { display: none; }
  .source-view-button { width: 145px; }
  .source-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-keyword { grid-column: 1 / -1; }
  .source-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sync-diagnostic-grid { grid-template-columns: repeat(2, 1fr); }
  .application-workspace { padding-inline: 12px; }
  .application-status-cards { grid-template-columns: repeat(2, 1fr); }
  .application-form-grid, .application-item-input, .application-filter-row, .application-filter-row.audit { grid-template-columns: 1fr; }
  .application-form label.wide, .application-item-input .item-remark { grid-column: auto; }
  .application-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer { align-items: flex-start; flex-direction: column; padding: 14px 18px; gap: 4px; }
  footer span:nth-child(2) { margin-left: 0; }
}

@media (max-width: 560px) {
  .topbar-controls { align-items: stretch; flex-direction: column; }
  .search-control { min-height: 46px; }
  .metrics-strip { grid-template-columns: 1fr; }
  .chart-axis, .bar-chart { height: 245px; }
  .chart-stage { grid-template-columns: 43px minmax(0, 1fr); }
  .chart-insight { grid-template-columns: 1fr auto; }
  .chart-insight p { grid-column: 1 / -1; text-align: left; }
  .trend-comparison { grid-template-columns: 1fr; padding-block: 9px; gap: 5px; }
  .trend-comparison > div { justify-content: space-between; }
  .compliance-grid { grid-template-columns: repeat(2, 1fr); }
  .rank-row { grid-template-columns: 1fr auto; }
  .rank-bar { grid-column: 1 / -1; grid-row: 2; }
  .sync-diagnostic-grid { grid-template-columns: 1fr; }
  .application-action-row, .application-action-row.usage { grid-template-columns: 1fr; }
}
