:root {
  --bg: #eef4f1;
  --panel: #ffffff;
  --panel-soft: #f8fbf9;
  --text: #13201e;
  --ink: #13201e;
  --muted: #687874;
  --line: #dbe5e1;
  --line-strong: #cbd9d4;
  --teal: #0d7f75;
  --teal-dark: #0a5f58;
  --teal-soft: #dff3ef;
  --teal-glow: #35b6a8;
  --amber: #c47a12;
  --rose: #bd2454;
  --blue: #256f9f;
  --shadow: 0 14px 34px rgba(21, 37, 35, 0.09);
  --shadow-soft: 0 8px 20px rgba(21, 37, 35, 0.06);
  --ring: 0 0 0 3px rgba(13, 127, 117, 0.16);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  background: #202a2a;
  color: #eef5f2;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand, .account { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}
.brand strong, .account strong { display: block; font-size: 15px; }
.brand span, .account span { color: #a9bab5; display: block; font-size: 12px; margin-top: 3px; }
.nav { display: grid; gap: 8px; }
.nav-link, .icon-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d9e6e2;
  border-radius: 8px;
  padding: 11px 12px;
}
.nav-link:hover, .icon-link:hover { background: rgba(255,255,255,0.08); }
.nav-link svg, .icon-link svg, button svg, .secondary-btn svg, .primary-btn svg { width: 18px; height: 18px; flex: none; }
.account { margin-top: auto; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 18px; }
.icon-link { padding: 8px; }
.main { padding: 26px; min-width: 0; }

.page-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0; }
p { color: var(--muted); margin: 0; line-height: 1.5; }

.filters, .kpi-grid, .dashboard-grid, .upload-layout, .settings-grid { display: grid; gap: 14px; }
.filters {
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  align-items: end;
  margin-bottom: 16px;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
.primary-btn, .secondary-btn {
  height: 40px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}
.primary-btn { background: var(--teal); color: #fff; }
.primary-btn:hover { background: #0b625c; }
.secondary-btn { background: #fff; color: var(--teal); border: 1px solid var(--line); }
.secondary-btn:hover { border-color: var(--teal); }
.header-actions { display: flex; gap: 10px; }

.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 16px; }
.metric, .panel, .upload-box, .login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.metric { padding: 15px; min-height: 86px; display: grid; gap: 8px; align-content: center; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.metric:nth-child(2) strong { color: var(--teal); }
.metric:nth-child(4) strong { color: var(--amber); }
.metric:nth-child(6) strong { color: var(--rose); }

.dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr); }
.panel { min-width: 0; padding: 16px; }
.panel.wide { grid-column: span 1; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chart { height: 318px; width: 100%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #fbfcfa; }
td:last-child { font-weight: 700; color: var(--teal); }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #edf2ef; }
.login-panel { width: min(430px, 100%); padding: 28px; }
.login-title { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-title h1 { font-size: 22px; margin: 0 0 4px; }
.login-title p { font-size: 13px; }
.form-stack { display: grid; gap: 14px; }
.demo-users { display: grid; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 12px; }
code { background: #eef2ef; border: 1px solid var(--line); padding: 4px 7px; border-radius: 6px; color: #2c3a39; }
.alert { border-radius: 8px; padding: 11px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.alert.error { background: #fff0f2; color: #a11236; border: 1px solid #ffd1d9; }
.alert.warning { background: #fff7e6; color: #8a4b05; border: 1px solid #ffe1a3; }
.alert.info { background: var(--teal-soft); color: #09524c; border: 1px solid #b8ddd6; }

.upload-layout { grid-template-columns: minmax(300px, 0.75fr) minmax(320px, 1fr); align-items: start; }
.upload-box { padding: 18px; display: grid; gap: 14px; }
.file-drop {
  min-height: 190px;
  border: 1px dashed #a9bbb5;
  border-radius: 8px;
  background: #fbfcfa;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text);
  padding: 20px;
}
.file-drop svg { width: 38px; height: 38px; color: var(--teal); }
.file-drop input { border: 0; height: auto; padding: 12px 0 0; width: 100%; }
.field-list { display: flex; flex-wrap: wrap; gap: 8px; }
.result-panel { margin-top: 16px; }
.settings-grid { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .nav { grid-auto-flow: column; }
  .account { margin-top: 0; margin-left: auto; border-top: 0; padding-top: 0; }
  .filters { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .dashboard-grid, .upload-layout, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main { padding: 18px; }
  .page-header { display: grid; }
  .filters, .kpi-grid { grid-template-columns: 1fr; }
  .sidebar { padding: 16px; }
  .brand { width: 100%; }
  .nav { width: 100%; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
  .nav-link { justify-content: center; padding: 10px 6px; }
  .account { width: 100%; justify-content: space-between; }
  h1 { font-size: 24px; }
  .metric strong { font-size: 20px; }
  .chart { height: 280px; }
}


.shop-admin-grid { margin-bottom: 16px; }
.field-group { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}
.check-row input { width: 16px; height: 16px; margin: 1px 0 0; padding: 0; }
.scope-cell { max-width: 360px; white-space: normal; line-height: 1.45; }
.assign-panel { margin-top: 16px; }
.assign-form { display: grid; grid-template-columns: 320px 1fr auto; gap: 14px; align-items: end; }
.wide-checkbox-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.compact-table table { min-width: 680px; }
@media (max-width: 1080px) {
  .assign-form { grid-template-columns: 1fr; }
  .wide-checkbox-grid { grid-template-columns: 1fr; }
}


.cost-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
button:disabled, input:disabled, select:disabled { opacity: 0.62; cursor: not-allowed; }
@media (max-width: 1080px) {
  .cost-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { grid-template-columns: repeat(2, 1fr); }
}


.rule-list { display: grid; gap: 10px; }
.rule-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.rule-item strong { color: var(--text); font-size: 13px; }
.rule-item span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.rule-item code { white-space: normal; line-height: 1.45; overflow-wrap: anywhere; }
.upload-note { margin: 12px 0 0; }
.rule-panel { align-self: start; }
.cost-grid { grid-template-columns: minmax(0, 1fr) 330px 360px; }
@media (max-width: 1280px) {
  .cost-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .rule-panel { grid-column: 1 / -1; }
}
@media (max-width: 1080px) {
  .cost-grid { grid-template-columns: 1fr; }
  .rule-panel { grid-column: auto; }
}


.template-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.template-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  font-size: 12px;
}
.template-links a:hover { border-color: var(--teal); }


.ads-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
.ads-grid .fee-table-panel { grid-column: 1 / -1; }
.compact-drop { min-height: 138px; }
.muted-text { color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 900px) {
  .ads-grid { grid-template-columns: 1fr; }
  .ads-grid .fee-table-panel { grid-column: auto; }
}
.ads-grid .compact-table table { min-width: 760px; }
.amount-cell { color: var(--amber); font-weight: 700; }
.note-cell { max-width: 260px; white-space: normal; line-height: 1.45; }

select[multiple] {
  height: 94px;
  padding: 6px 8px;
}
.shop-filter { min-width: 220px; }
.trend-panel .panel-title { align-items: flex-start; gap: 12px; }
.trend-title h2 { padding-top: 3px; }
.trend-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  max-width: 760px;
}
.metric-toggle {
  display: inline-grid;
  grid-template-columns: 16px auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.metric-toggle input { width: 16px; height: 16px; margin: 0; padding: 0; }
@media (max-width: 1080px) {
  .trend-panel .panel-title { display: grid; }
  .trend-controls { justify-content: flex-start; }
}

.operator-table table { min-width: 620px; }
.operator-table td:nth-child(5), .operator-table td:nth-child(6) { font-weight: 700; color: var(--teal); }

.product-filters { grid-template-columns: repeat(4, minmax(140px, 1fr)) auto; }
.sku-filter { min-width: 180px; }
.product-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr); gap: 14px; align-items: start; }
.product-grid .wide { grid-column: span 1; }
.product-table-panel { grid-column: 1 / -1; }
.product-table-panel table { min-width: 980px; }
.product-table-panel td:nth-child(7), .product-table-panel td:nth-child(9) { font-weight: 700; color: var(--teal); }
@media (max-width: 1280px) {
  .product-filters { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-grid .wide, .product-table-panel { grid-column: auto; }
}
@media (max-width: 640px) {
  .product-filters { grid-template-columns: 1fr; }
}

.field-block { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.multi-check {
  min-height: 40px;
  max-height: 118px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.check-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-height: 24px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}
.check-option + .check-option { margin-top: 6px; }
.check-option input { width: 16px; height: 16px; margin: 1px 0 0; padding: 0; }
.check-option span { overflow-wrap: anywhere; }
.muted-empty { color: var(--muted); font-size: 12px; padding: 4px 2px; }

.shop-filter-panel {
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}
.filter-panel-title {
  color: var(--muted);
  font-size: 13px;
}
.shop-filter-panel .multi-check {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 12px;
  max-height: 152px;
}
.shop-filter-panel .check-option {
  margin-top: 0;
  min-height: 22px;
}
.table-link { color: var(--teal); font-weight: 700; }
.table-link:hover { text-decoration: underline; }
@media (max-width: 1280px) {
  .product-filters { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
  .shop-filter-panel .multi-check { grid-template-columns: 1fr; }
}

/* Keep tall shop checkbox filters out of the compact date/platform row. */
.filters > .shop-filter,
.filters > .field-block.shop-filter {
  grid-column: 1 / -1;
  width: 100%;
}
.filters > .shop-filter .multi-check,
.filters > .field-block.shop-filter .multi-check {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 12px;
  max-height: 152px;
}
.filters .shop-filter select[multiple] {
  height: 40px;
}
.shop-filter-panel {
  width: 100%;
  padding: 0;
  margin: -4px 0 16px;
}
.shop-filter-panel .multi-check {
  width: 100%;
  align-items: start;
}


.cost-filter-bar {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
}
.cost-log-panel { margin-top: 14px; }
.cost-log-detail {
  white-space: normal;
  min-width: 360px;
  max-width: 720px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 400;
}
@media (max-width: 1080px) {
  .cost-filter-bar { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
  .cost-filter-bar { grid-template-columns: 1fr; }
}

.distribution-title { gap: 12px; }
.distribution-select {
  width: min(210px, 46%);
  height: 34px;
  padding: 0 9px;
  font-size: 13px;
}
@media (max-width: 640px) {
  .distribution-title { align-items: stretch; }
  .distribution-select { width: 100%; }
}

.order-pulse-panel {
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
  overflow: hidden;
}
.order-pulse-title { gap: 16px; align-items: flex-start; }
.order-pulse-title p { font-size: 12px; margin-top: 4px; }
.order-window-controls {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f1;
}
.order-window-controls button {
  height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.order-window-controls button.active {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.18);
}
.order-pulse-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 1px;
  margin: 4px 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}
.order-pulse-strip span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.82);
}
.order-pulse-strip small { color: var(--muted); font-size: 12px; }
.order-pulse-strip strong { color: var(--text); font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.order-bar-chart { height: 286px; }
@media (max-width: 900px) {
  .order-pulse-title { display: grid; }
  .order-window-controls { width: 100%; justify-content: stretch; }
  .order-window-controls button { flex: 1; }
  .order-pulse-strip { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
@media (max-width: 520px) {
  .order-pulse-strip { grid-template-columns: 1fr; }
  .order-bar-chart { height: 260px; }
}

.anchor-panel { scroll-margin-top: 18px; }
.anchor-panel:target {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft), var(--shadow);
}

.account-management-grid { grid-template-columns: 320px minmax(0, 1fr); }
.small-btn { height: 32px; min-width: 96px; padding: 0 10px; border-radius: 6px; font-size: 12px; }
.small-btn svg { width: 15px; height: 15px; }
.selected-row td { background: #eef8f6; }
.user-editor-panel { margin-top: 16px; scroll-margin-top: 18px; }
.user-permission-form { display: grid; gap: 14px; }
.permission-summary { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 1080px) {
  .account-management-grid, .permission-summary { grid-template-columns: 1fr; }
  .form-actions { justify-content: stretch; flex-wrap: wrap; }
  .form-actions .primary-btn, .form-actions .secondary-btn { flex: 1 1 180px; }
}

/* Visual polish pass 20260524 */
html { background: var(--bg); }
body {
  background: linear-gradient(180deg, #f9fbfa 0%, #f0f5f2 44%, #edf3f1 100%);
}
::selection { background: rgba(13, 127, 117, 0.18); }
.shell { grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #172622 0%, #111b19 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: 14px 0 34px rgba(16, 30, 28, 0.10);
  padding: 24px 16px;
  gap: 22px;
}
.brand { padding: 0 2px 8px; }
.brand-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0f8a7f 0%, #0f5d74 100%);
  box-shadow: 0 12px 24px rgba(13, 127, 117, 0.26);
}
.brand strong, .account strong { font-weight: 800; letter-spacing: 0; }
.brand span, .account span { color: #a8bbb5; }
.nav { gap: 6px; }
.nav-link, .icon-link {
  color: #d9e6e2;
  font-weight: 650;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link svg, .icon-link svg { color: #a9d5ce; }
.nav-link:hover, .nav-link.active, .icon-link:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--teal-glow);
}
.nav-link:hover { transform: translateX(2px); }
.account {
  border-top-color: rgba(255,255,255,0.14);
  padding: 18px 4px 0;
}
.main {
  min-width: 0;
  padding: 30px 34px 48px;
}
.page-header {
  align-items: center;
  margin-bottom: 18px;
}
.page-header > div:first-child { min-width: 0; }
h1 {
  color: #101b19;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: 0;
}
h2 { color: #152321; font-weight: 800; }
p { color: var(--muted); }
.header-actions { align-items: center; }
.filters {
  padding: 12px;
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}
label, .field-block, .field-group, .filter-panel-title {
  color: #60726d;
  font-weight: 650;
}
input, select, textarea {
  border-color: #d5e1dd;
  background-color: #fff;
  box-shadow: inset 0 1px 0 rgba(18, 32, 30, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--teal);
  box-shadow: var(--ring), inset 0 1px 0 rgba(18, 32, 30, 0.03);
}
input[type="checkbox"] { accent-color: var(--teal); box-shadow: none; }
select:not([multiple]) {
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #63746f 50%), linear-gradient(135deg, #63746f 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.primary-btn, .secondary-btn, .small-btn {
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}
.primary-btn {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  box-shadow: 0 10px 20px rgba(13, 127, 117, 0.18);
}
.primary-btn:hover {
  background: linear-gradient(135deg, #0f8b80 0%, #07554f 100%);
  box-shadow: 0 12px 24px rgba(13, 127, 117, 0.24);
  transform: translateY(-1px);
}
.secondary-btn {
  background: rgba(255,255,255,0.92);
  border-color: #d7e2de;
  color: var(--teal-dark);
  box-shadow: 0 6px 16px rgba(21, 37, 35, 0.05);
}
.secondary-btn:hover {
  border-color: var(--teal);
  background: #f7fbfa;
  transform: translateY(-1px);
}
.metric, .panel, .upload-box, .login-panel {
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.metric {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 17px 18px 15px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}
.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(13,127,117,0.95), rgba(37,111,159,0.72));
}
.metric:nth-child(2)::before { background: linear-gradient(90deg, var(--teal), #38a169); }
.metric:nth-child(4)::before { background: linear-gradient(90deg, var(--amber), #e1a33d); }
.metric:nth-child(6)::before { background: linear-gradient(90deg, var(--rose), #d94772); }
.metric span { color: #697b76; font-weight: 700; }
.metric strong {
  color: #142321;
  font-size: 24px;
  font-weight: 850;
}
.metric:nth-child(2) strong { color: var(--teal); }
.metric:nth-child(4) strong { color: var(--amber); }
.metric:nth-child(6) strong { color: var(--rose); }
.panel, .upload-box {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}
.panel { padding: 18px; }
.panel-title {
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2ef;
  margin-bottom: 14px;
}
.panel-title h2 { font-size: 16px; line-height: 1.35; }
.chart { height: 320px; }
.table-wrap {
  border: 1px solid #edf2ef;
  border-radius: 8px;
  background: #fff;
}
table { border-collapse: separate; border-spacing: 0; }
th, td {
  border-bottom-color: #e7eeeb;
  padding: 12px 12px;
}
th {
  color: #657670;
  font-weight: 800;
  background: #f5f8f7;
}
tbody tr:hover td { background: #f7fbfa; }
tbody tr:last-child td { border-bottom: 0; }
.compact-table th, .compact-table td { padding: 11px 12px; }
.table-link { color: var(--teal-dark); }
.table-link:hover { color: var(--teal); }
.shop-filter-panel {
  width: 100%;
  padding: 12px;
  margin: 0 0 16px;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}
.filter-panel-title { margin-bottom: 2px; }
.multi-check, .checkbox-grid {
  background: #fbfdfc;
  border-color: #d8e4df;
}
.shop-filter-panel .multi-check,
.filters > .shop-filter .multi-check,
.filters > .field-block.shop-filter .multi-check {
  padding: 10px;
  max-height: 142px;
}
.check-option, .check-row {
  border-radius: 6px;
  padding: 3px 4px;
}
.check-option:hover, .check-row:hover { background: #eef8f6; }
.check-option input, .check-row input, .metric-toggle input { accent-color: var(--teal); }
.metric-toggle {
  padding: 4px 7px;
  border-radius: 6px;
  color: #60726d;
}
.metric-toggle:hover { background: #eef8f6; color: var(--teal-dark); }
.distribution-select { background-color: #fff; }
.order-pulse-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
}
.order-pulse-strip {
  border-color: #dbe7e2;
  background: #dbe7e2;
}
.order-pulse-strip span { background: rgba(255,255,255,0.90); }
.order-window-controls {
  background: #edf5f2;
  border-color: #d7e4df;
}
.order-window-controls button { font-weight: 750; }
.order-window-controls button.active { box-shadow: 0 8px 18px rgba(13, 127, 117, 0.20); }
.file-drop {
  background: linear-gradient(180deg, #fbfdfc 0%, #f4f8f6 100%);
  border-color: #b7cbc4;
}
.rule-item {
  background: #fbfdfc;
  border-color: #dce7e2;
}
.alert.info { background: #e5f5f1; color: #07554f; border-color: #bee3dc; }
.alert.warning { background: #fff8e9; }
.alert.error { background: #fff2f5; }
.login-body {
  background: linear-gradient(180deg, #f7faf8 0%, #e9f2ef 100%);
}
.login-panel {
  position: relative;
  overflow: hidden;
  padding: 30px;
  background: rgba(255,255,255,0.94);
}
.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--amber));
}
.demo-users code { background: #f2f7f5; }
.selected-row td { background: #eef8f6; }
.anchor-panel:target, .user-editor-panel:target {
  border-color: var(--teal);
  box-shadow: var(--ring), var(--shadow);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #b8c9c3; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    box-shadow: none;
  }
  .main { padding: 24px; }
  .filters { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
  .main { padding: 18px; }
  .page-header { align-items: stretch; }
  .filters, .kpi-grid { grid-template-columns: 1fr; }
  .panel, .metric, .shop-filter-panel { box-shadow: var(--shadow-soft); }
  .chart { height: 280px; }
}

/* Mobile UX pass 20260524 */
@media (max-width: 760px) {
  body {
    background: #f1f6f4;
    -webkit-text-size-adjust: 100%;
  }
  .shell {
    display: block;
    min-height: 100vh;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 10px 24px rgba(16, 30, 28, 0.16);
  }
  .brand {
    width: auto;
    min-width: 0;
    padding: 0;
    gap: 9px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 16px;
  }
  .brand strong { font-size: 14px; }
  .brand span { font-size: 11px; margin-top: 1px; }
  .account {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    justify-content: end;
    gap: 8px;
  }
  .account div {
    max-width: 86px;
    overflow: hidden;
    text-align: right;
  }
  .account strong {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .account span { display: none; }
  .icon-link {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    background: rgba(255,255,255,0.07);
  }
  .nav {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    grid-auto-flow: initial;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link {
    flex: 0 0 auto;
    min-width: 82px;
    height: 40px;
    justify-content: center;
    padding: 0 10px;
    gap: 6px;
    font-size: 13px;
    background: rgba(255,255,255,0.06);
    scroll-snap-align: start;
  }
  .nav-link svg { width: 16px; height: 16px; }
  .nav-link span { max-width: 70px; }
  .nav-link:hover { transform: none; }
  .nav-link.active {
    background: rgba(53, 182, 168, 0.18);
    box-shadow: inset 0 -2px 0 var(--teal-glow);
  }
  .main {
    padding: 14px 12px 28px;
  }
  .page-header {
    display: grid;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }
  h1 { font-size: 24px; }
  h2 { font-size: 15px; }
  p { font-size: 13px; }
  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .header-actions .primary-btn,
  .header-actions .secondary-btn {
    width: 100%;
  }
  input,
  select,
  .primary-btn,
  .secondary-btn {
    min-height: 44px;
  }
  .primary-btn,
  .secondary-btn {
    width: 100%;
    padding: 0 12px;
  }
  .filters,
  .product-filters,
  .cost-filter-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    margin-bottom: 12px;
  }
  .filters > *,
  .product-filters > *,
  .cost-filter-bar > * {
    min-width: 0;
  }
  .filters .primary-btn,
  .filters .secondary-btn,
  .product-filters .primary-btn,
  .product-filters .secondary-btn,
  .cost-filter-bar .primary-btn,
  .cost-filter-bar .secondary-btn {
    grid-column: 1 / -1;
  }
  .shop-filter-panel {
    padding: 10px;
    margin: 0 0 12px;
  }
  .shop-filter-panel .multi-check,
  .filters > .shop-filter .multi-check,
  .filters > .field-block.shop-filter .multi-check {
    grid-template-columns: 1fr;
    max-height: 174px;
    padding: 8px;
  }
  .check-option,
  .check-row {
    min-height: 34px;
    align-items: center;
    font-size: 12.5px;
  }
  .check-option input,
  .check-row input,
  .metric-toggle input {
    width: 18px;
    height: 18px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }
  .metric {
    min-height: 78px;
    padding: 13px 12px 12px;
  }
  .metric span { font-size: 12px; }
  .metric strong { font-size: 20px; }
  .dashboard-grid,
  .product-grid,
  .upload-layout,
  .settings-grid,
  .cost-grid,
  .account-management-grid,
  .permission-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .panel,
  .upload-box,
  .login-panel {
    padding: 13px;
    box-shadow: var(--shadow-soft);
  }
  .panel-title {
    display: grid;
    align-items: stretch;
    gap: 8px;
    padding-bottom: 9px;
    margin-bottom: 10px;
  }
  .trend-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
    justify-content: stretch;
    gap: 6px;
  }
  .metric-toggle {
    min-height: 34px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    background: #fff;
  }
  .chart { height: 292px; }
  .trend-panel,
  .order-pulse-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .trend-panel .chart,
  .order-bar-chart {
    min-width: 620px;
  }
  .distribution-panel .chart,
  #platformChart,
  #skuRankChart {
    min-width: 0;
  }
  .order-pulse-title {
    display: grid;
    gap: 10px;
  }
  .order-window-controls {
    width: 100%;
    display: flex;
  }
  .order-window-controls button {
    flex: 1;
    height: 36px;
  }
  .order-pulse-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .order-pulse-strip span { padding: 9px 10px; }
  .order-pulse-strip strong { font-size: 16px; }
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 640px; }
  .compact-table table { min-width: 620px; }
  .product-table-panel table { min-width: 760px; }
  th,
  td {
    padding: 10px 10px;
    font-size: 12px;
  }
  .scope-cell,
  .note-cell,
  .cost-log-detail {
    min-width: 240px;
    max-width: 420px;
    white-space: normal;
  }
  .file-drop {
    min-height: 150px;
    padding: 16px;
  }
  .template-links,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .form-actions .primary-btn,
  .form-actions .secondary-btn {
    flex: none;
  }
  .checkbox-grid,
  .wide-checkbox-grid {
    grid-template-columns: 1fr;
    max-height: 240px;
  }
  .distribution-title { align-items: stretch; }
  .distribution-select { width: 100%; min-height: 40px; }
  .login-body { padding: 14px; align-items: start; }
  .login-panel { width: 100%; margin-top: 24px; }
}
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .nav-link { min-width: 76px; }
  .metric strong { font-size: 19px; }
  .trend-controls { grid-template-columns: 1fr; }
}


/* Mobile dashboard upload action refinement 20260524 */
@media (max-width: 760px) {
  .dashboard-upload-action {
    display: none;
  }
}


/* Mobile nav collapse and chart spacing refinement 20260524 */
.mobile-nav-toggle { display: none; }
@media (max-width: 760px) {
  .sidebar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .mobile-nav-toggle {
    grid-column: 2;
    grid-row: 1;
    width: 42px;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #eaf5f1;
    background: rgba(255,255,255,0.08);
    padding: 0;
  }
  .mobile-nav-toggle span { display: none; }
  .mobile-nav-toggle svg { width: 18px; height: 18px; }
  .account { grid-column: 3; grid-row: 1; }
  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    overflow-x: hidden;
    padding: 0;
    pointer-events: none;
    transition: max-height 180ms ease, opacity 140ms ease, padding 180ms ease;
  }
  .sidebar.mobile-nav-open .nav {
    max-height: 560px;
    opacity: 1;
    padding-top: 8px;
    pointer-events: auto;
    overflow-y: auto;
  }
  .nav-link {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding: 0 11px;
  }
  .nav-link span { max-width: none; }
  .trend-panel,
  .order-pulse-panel {
    overflow-x: visible;
  }
  .trend-panel .chart,
  .order-bar-chart {
    width: 100%;
    min-width: 0;
  }
  .trend-panel .chart { height: 238px; }
  .order-bar-chart { height: 238px; }
  .distribution-panel .chart { height: 250px; }
}


/* Creator management module styles 20260526 */
.creator-admin-grid { grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
.creator-ledger-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 0.65fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}
.form-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.creator-analysis-grid { grid-template-columns: minmax(0, 1fr) minmax(420px, 0.7fr); }
.creator-chart { height: 360px; }
.creator-admin-grid .panel,
.creator-ledger-grid .panel,
.creator-analysis-grid .panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}
.creator-admin-grid .form-stack,
.creator-ledger-grid .form-stack { align-content: start; }
.creator-admin-grid textarea,
.creator-ledger-grid textarea { min-height: 82px; resize: vertical; }
@media (max-width: 1180px) {
  .creator-admin-grid,
  .creator-ledger-grid,
  .creator-analysis-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .creator-admin-grid,
  .creator-ledger-grid,
  .creator-analysis-grid { gap: 12px; }
  .form-mini-grid { grid-template-columns: 1fr; }
  .creator-chart { height: 280px; }
}


/* Data edit module styles 20260526 */
.data-edit-filters { grid-template-columns: 210px repeat(2, minmax(150px, 1fr)) minmax(220px, 1.2fr) auto; }
.data-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
  align-items: start;
}
.data-edit-table table { min-width: 1180px; }
.data-edit-panel { position: sticky; top: 18px; }
.readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.data-edit-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-checkbox-grid { max-height: 120px; }
@media (max-width: 1280px) {
  .data-edit-grid { grid-template-columns: 1fr; }
  .data-edit-panel { position: static; }
}
@media (max-width: 900px) {
  .data-edit-filters { grid-template-columns: 1fr; }
  .readonly-grid,
  .data-edit-fields { grid-template-columns: 1fr; }
}
.action-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-delete-form { margin: 0; }
.danger-btn { color: #b42318; border-color: #f0c7c0; }
.danger-btn:hover { color: #981b12; border-color: #ea9a8d; background: #fff7f5; }
.creator-section-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
  margin: -6px 0 14px;
}
.creator-section-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #38524d;
  font-weight: 750;
  text-decoration: none;
}
.creator-section-link.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: 0 10px 22px rgba(13, 127, 117, 0.16);
}
.creator-upload-grid { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); }
@media (max-width: 980px) {
  .creator-upload-grid { grid-template-columns: 1fr; }
  .creator-section-nav { margin-top: 0; padding-bottom: 10px; }
}
.export-panel { max-width: 1100px; }
.export-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.export-option-card {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.export-option-card strong { display: block; color: var(--ink); margin-bottom: 5px; }
.export-option-card em { display: block; color: var(--muted); font-style: normal; line-height: 1.45; }
@media (max-width: 900px) { .export-option-grid { grid-template-columns: 1fr; } }


.data-batch-panel { margin-bottom: 16px; }
.batch-table table { min-width: 860px; }
.batch-table form { margin: 0; }
.danger-btn {
  border: 1px solid rgba(188, 51, 77, 0.25);
  background: #fff6f7;
  color: #bc334d;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  cursor: pointer;
}
.danger-btn:hover { background: #ffe8eb; border-color: rgba(188, 51, 77, 0.45); }
.danger-btn svg { width: 15px; height: 15px; }

.collector-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.collector-shop-grid { max-height: 300px; }
.secret-alert {
  display: grid;
  gap: 8px;
  align-items: start;
  margin-bottom: 14px;
}
.secret-alert code {
  display: block;
  padding: 12px;
  border: 1px solid rgba(194, 126, 31, 0.28);
  border-radius: 8px;
  background: #fffaf0;
  color: #9b6416;
  font-weight: 800;
  word-break: break-all;
}
.api-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.api-note div {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.api-note span { color: var(--muted); font-size: 12px; font-weight: 700; }
.api-note code { color: var(--ink); white-space: normal; word-break: break-word; }
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.table-actions form { margin: 0; }
.small-btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
.note-cell { max-width: 360px; white-space: normal; line-height: 1.45; }
@media (max-width: 1080px) {
  .collector-grid { grid-template-columns: 1fr; }
  .api-note { grid-template-columns: 1fr; }
}



.tiktok-oauth-grid {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.oauth-note { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.oauth-help {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(20, 132, 118, 0.18);
  border-radius: 8px;
  background: #f4fbf8;
  color: var(--text);
  line-height: 1.55;
}
.oauth-help strong { color: var(--ink); }
.oauth-help span { color: var(--muted); }
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.button-row form { margin: 0; }
.oauth-callback-panel { max-width: 880px; margin: 40px auto; }
.oauth-callback-status {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #f4fbf8;
  border: 1px solid rgba(20, 132, 118, 0.18);
}
.oauth-callback-status svg { width: 26px; height: 26px; color: var(--teal); grid-row: span 2; }
.oauth-callback-status strong { color: var(--ink); font-size: 18px; }
.oauth-callback-status span { color: var(--muted); }
.oauth-callback-status.failed { background: #fff8e8; border-color: rgba(194, 126, 31, 0.28); }
.oauth-callback-status.failed svg { color: #c27e1f; }
.oauth-callback-status.warning { background: #fff8e8; border-color: rgba(194, 126, 31, 0.28); }
.oauth-callback-status.warning svg { color: #c27e1f; }
@media (max-width: 1080px) {
  .tiktok-oauth-grid { grid-template-columns: 1fr; }
  .copy-field { grid-template-columns: 1fr; }
  .oauth-note { grid-template-columns: 1fr; }
  .button-row { flex-direction: column; align-items: stretch; }
  .button-row .secondary-btn { width: 100%; justify-content: center; }
}


.compact-header { margin-bottom: 14px; }
.collector-entry-grid.clean {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: stretch;
}
.collector-entry-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(18, 132, 118, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(20, 40, 36, 0.08);
}
.collector-entry-card.recommended {
  border-color: rgba(18, 132, 118, 0.32);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf9 100%);
}
.entry-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.entry-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8f5f1;
  color: var(--teal);
}
.entry-icon svg { width: 24px; height: 24px; }
.entry-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.collector-entry-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}
.collector-entry-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  min-height: 54px;
}
.entry-stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.entry-stat-row div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.entry-stat-row span,
.entry-url span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}
.entry-stat-row strong {
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.entry-url {
  padding: 12px;
  border: 1px solid rgba(18, 132, 118, 0.14);
  border-radius: 8px;
  background: #f4fbf8;
}
.entry-url code {
  color: var(--teal);
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}
.collector-entry-card .primary-btn {
  margin-top: auto;
  width: 100%;
  min-height: 42px;
}
@media (max-width: 1080px) {
  .collector-entry-grid.clean { grid-template-columns: 1fr; }
  .collector-entry-card p { min-height: 0; }
}
@media (max-width: 640px) {
  .collector-entry-card { padding: 16px; }
  .entry-stat-row { grid-template-columns: 1fr; }
}


.tiktok-binding-panel { margin-top: 16px; }
.tiktok-binding-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.tiktok-binding-form .primary-btn { min-height: 42px; }
.tiktok-binding-table table { min-width: 980px; }
.tiktok-sync-panel,
.tiktok-log-panel {
  margin-top: 16px;
}
.tiktok-sync-panel .panel-title p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.tiktok-sync-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.tiktok-sync-form .primary-btn {
  min-height: 42px;
  white-space: nowrap;
}
.sync-hint {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(194, 126, 31, 0.24);
  border-radius: 8px;
  background: #fff8eb;
  color: #785411;
  line-height: 1.55;
}
.sync-running-note {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(18, 132, 118, 0.24);
  border-radius: 8px;
  background: #effaf6;
  color: var(--teal-dark);
}
.sync-running-note[hidden] { display: none; }
.sync-running-note span {
  color: var(--muted);
  line-height: 1.55;
}
.sync-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.sync-result-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.sync-result-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}
.sync-result-grid strong {
  color: var(--ink);
  font-size: 20px;
}
.sync-limit-warning {
  margin-top: 12px;
}
.warning-text {
  color: #8a540d;
  font-weight: 800;
}
.tiktok-sync-log-table table { min-width: 980px; }
@media (max-width: 1080px) {
  .tiktok-binding-form,
  .tiktok-sync-form {
    grid-template-columns: 1fr;
  }
  .sync-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .sync-result-grid {
    grid-template-columns: 1fr;
  }
}


.data-source-header {
  align-items: center;
}
.source-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.source-status-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  box-shadow: var(--shadow-soft);
}
.source-status-card span,
.source-status-card small,
.subtle-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.source-status-card strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.source-shop-panel {
  margin-bottom: 16px;
  box-shadow: 0 18px 42px rgba(18, 37, 34, 0.08);
}
.source-panel-title {
  align-items: flex-start;
  gap: 16px;
}
.source-panel-title p {
  margin-top: 5px;
  max-width: 900px;
}
.source-shop-table table {
  min-width: 1160px;
}
.source-shop-table td {
  vertical-align: middle;
}
.source-shop-table td strong {
  display: block;
  color: var(--text);
}
.subtle-line {
  display: block;
  margin-top: 4px;
  white-space: normal;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f5f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.status-pill.ok {
  border-color: rgba(13, 127, 117, 0.22);
  background: #e7f6f2;
  color: var(--teal-dark);
}
.status-pill.warning {
  border-color: rgba(196, 122, 18, 0.28);
  background: #fff6e6;
  color: #8a540d;
}
.status-pill.muted {
  background: #f0f3f2;
  color: #7b8582;
}
.switch-btn {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px 0 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.switch-btn span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #aeb9b5;
}
.switch-btn.on {
  border-color: rgba(13, 127, 117, 0.24);
  background: #eef9f6;
  color: var(--teal-dark);
}
.switch-btn.on span {
  background: var(--teal);
}
.source-advanced {
  margin-top: 16px;
}
.source-advanced summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
  list-style: none;
}
.source-advanced summary::-webkit-details-marker {
  display: none;
}
.source-advanced summary::after {
  content: "展开";
  float: right;
  color: var(--teal);
  font-size: 12px;
}
.source-advanced[open] summary::after {
  content: "收起";
}
.source-advanced-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}
.manual-binding-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.source-shop-table .table-actions {
  min-width: 196px;
}
.source-shop-table .primary-btn,
.source-shop-table .secondary-btn {
  box-shadow: none;
}
.source-shop-table .primary-btn[disabled],
.tiktok-sync-form .primary-btn[disabled] {
  opacity: 0.7;
  cursor: wait;
}
@media (max-width: 1180px) {
  .source-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .source-advanced-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .data-source-header {
    align-items: stretch;
  }
  .source-status-grid {
    grid-template-columns: 1fr;
  }
  .source-panel-title {
    display: grid;
  }
  .source-panel-title .secondary-btn {
    width: 100%;
  }
  .source-shop-table table,
  .tiktok-sync-log-table table {
    min-width: 900px;
  }
  .source-advanced {
    padding: 14px;
  }
}
