:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dce3ea;
  --text: #17202a;
  --muted: #617080;
  --blue: #2563eb;
  --green: #0f8a5f;
  --amber: #b45309;
  --red: #c2410c;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #eef4ff 0%, #f6f7f9 46%, #edf7f3 100%);
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  font-weight: 800;
  margin-bottom: 18px;
}

.login-panel h1,
.workspace-head h1,
.content-band h2 {
  margin: 0;
}

.login-panel p {
  margin: 10px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form,
.admin-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.primary-button,
.ghost-button,
.text-button {
  border-radius: 6px;
  border: 1px solid transparent;
  min-height: 38px;
  padding: 8px 13px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--blue);
}

.ghost-button {
  color: var(--text);
  background: #fff;
  border-color: var(--line);
}

.ghost-button:hover,
.primary-button:hover {
  filter: brightness(0.97);
}

.text-button {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  padding: 6px 0;
  min-height: 0;
  text-align: left;
}

.danger-text {
  color: var(--red);
}

.form-error {
  min-height: 20px;
  color: var(--red);
  margin: 0;
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: #101820;
  color: #fff;
}

.sidebar-brand {
  padding: 8px 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand strong {
  display: block;
  font-size: 18px;
}

.sidebar-brand span,
.sidebar-user small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.module-nav {
  display: grid;
  gap: 8px;
}

.module-nav button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  padding: 11px 12px;
}

.module-nav button.active,
.module-nav button:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.module-nav span {
  display: block;
  font-weight: 800;
}

.module-nav small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.56);
  line-height: 1.35;
}

.sidebar-user {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user .text-button {
  color: rgba(255, 255, 255, 0.72);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.module-content {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.metric-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card,
.content-band {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.metric-card {
  padding: 16px;
}

.metric-card span,
.task-row span,
.task-row em,
.content-band p,
.user-row p {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 7px 0;
  font-size: 24px;
}

.metric-card em {
  font-style: normal;
  color: var(--green);
  font-size: 13px;
}

.content-band {
  padding: 18px;
}

.band-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.band-head p {
  margin: 6px 0 0;
}

.task-list,
.user-list {
  display: grid;
  gap: 10px;
}

.task-row,
.user-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-row h3,
.user-row h3 {
  margin: 0;
  font-size: 15px;
}

.task-row p,
.user-row p {
  margin: 5px 0;
  line-height: 1.45;
}

.priority {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 30px;
  border-radius: 6px;
  background: #e8eef6;
  color: #394656;
  font-size: 13px;
}

.priority.p0 {
  background: #fee2e2;
  color: #b91c1c;
}

.priority.p1 {
  background: #ffedd5;
  color: var(--amber);
}

.priority.p2 {
  background: #dbeafe;
  color: #1d4ed8;
}

.ads-overview,
.ads-split {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: var(--green);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-list,
.api-scope-list,
.keyword-list,
.suggestion-list,
.sync-list,
.plain-list {
  display: grid;
  gap: 10px;
}

.status-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-row span,
.api-scope-row p,
.keyword-row p,
.keyword-row strong,
.suggestion-row p,
.sync-row p,
.sync-row em,
.plain-list,
.ads-table-row p,
.ads-table-row small {
  color: var(--muted);
}

.status-row strong,
.keyword-bid,
.sync-row span {
  min-width: 0;
  color: var(--text);
}

.api-scope-row,
.keyword-row,
.suggestion-row,
.sync-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.api-scope-row {
  display: grid;
  gap: 10px;
}

.api-scope-row h3,
.keyword-row h3,
.sync-row h3 {
  margin: 0;
  font-size: 15px;
}

.api-scope-row p,
.keyword-row p,
.suggestion-row p,
.sync-row p {
  margin: 5px 0 0;
  line-height: 1.45;
}

.endpoint-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.endpoint-line em {
  display: inline-flex;
  max-width: 100%;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 4px 8px;
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.ads-table {
  min-width: 0;
  max-width: 100%;
  display: grid;
  overflow-x: auto;
}

.ads-table-row {
  min-width: 980px;
  display: grid;
  grid-template-columns: 70px minmax(210px, 1.25fr) 120px 110px 120px minmax(260px, 1.5fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 4px;
}

.ads-table-row:last-child {
  border-bottom: 0;
}

.ads-table-head {
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ads-table-row h3 {
  margin: 0;
  font-size: 15px;
}

.ads-table-row p {
  margin: 5px 0;
  line-height: 1.45;
}

.ads-table-row small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.keyword-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px minmax(180px, 0.85fr);
  gap: 12px;
  align-items: center;
}

.keyword-bid {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.keyword-row strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.suggestion-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
}

.suggestion-row span {
  color: var(--muted);
}

.suggestion-row strong {
  color: var(--blue);
}

.suggestion-row p {
  grid-column: 1 / -1;
}

.sync-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(150px, 0.65fr);
  gap: 12px;
  align-items: center;
}

.sync-row span {
  font-weight: 800;
}

.sync-row em {
  font-style: normal;
  overflow-wrap: anywhere;
}

.mini-metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mini-metric {
  border-bottom: 3px solid #dbeafe;
  background: var(--surface-soft);
  padding: 10px;
}

.mini-metric span,
.mini-metric em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.mini-metric strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: 18px;
}

.admin-overview {
  display: grid;
  gap: 16px;
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-module-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-module-card .mini-metric-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-mini-tasks {
  margin-top: 12px;
}

.admin-mini-tasks .task-row {
  grid-template-columns: auto minmax(0, 1fr);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  padding: 0 4px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--text);
}

.check-line input {
  width: 16px;
  height: 16px;
}

.user-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.user-row h3 span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-line em {
  display: inline-flex;
  border-radius: 999px;
  background: #e8eef6;
  color: #394656;
  padding: 3px 8px;
  font-size: 12px;
  font-style: normal;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: #17202a;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  transition: 0.18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.compact-button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.after-sales-desk {
  display: grid;
  gap: 10px;
}

.after-sales-desk h2,
.after-sales-desk h3,
.after-sales-desk p {
  margin: 0;
}

.after-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.55fr);
  gap: 10px;
}

.after-hero-panel,
.after-pulse-panel,
.after-portal-card,
.after-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.after-hero-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.58fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.after-hero-copy {
  display: grid;
  align-content: center;
  gap: 6px;
}

.after-hero-copy h2 {
  font-size: 20px;
  line-height: 1.15;
}

.after-hero-copy p,
.after-pulse-panel p,
.after-portal-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.after-state-pill {
  width: fit-content;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #def1ed;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.after-hero-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.after-big-action {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 72px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.after-big-action:hover,
.after-big-action.active {
  border-color: var(--green);
  background: #f1faf7;
}

.after-big-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.after-big-action strong {
  font-size: 28px;
  line-height: 1;
}

.after-big-action.danger {
  border-color: #f0b8b1;
  background: #fee4e2;
}

.after-big-action.red {
  border-color: #e9aaa2;
  background: #ffe9e6;
}

.after-big-action.amber {
  border-color: #efd8a5;
  background: #fff3d6;
}

.after-pulse-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.after-ring {
  display: grid;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#b42318 var(--risk), #e6ecef 0);
}

.after-ring span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: inherit;
  background: var(--surface);
  font-weight: 900;
}

.after-portal-card {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
}

.after-portal-card span,
.after-panel-head span,
.after-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.after-portal-card strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.after-source-badges,
.after-case-meta,
.after-case-card footer,
.after-case-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.after-source-badges em,
.after-case-card footer em {
  padding: 3px 8px;
  border-radius: 999px;
  background: #def1ed;
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.after-source-badges em.warn {
  background: #fff3d6;
  color: var(--amber);
}

.auth-status-panel {
  overflow: visible;
}

.auth-platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.auth-platform-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-platform-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.auth-platform-head h3 {
  margin: 0;
  font-size: 15px;
}

.auth-platform-head span,
.auth-shop-main p,
.auth-shop-times span,
.auth-shop-times em,
.auth-empty,
.auth-status-error {
  color: var(--muted);
}

.auth-shop-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.auth-shop-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.6fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #8aa0ad;
  border-radius: 8px;
  background: var(--surface);
}

.auth-shop-row.ok {
  border-left-color: var(--green);
}

.auth-shop-row.warning,
.auth-shop-row.refresh_due {
  border-left-color: var(--amber);
}

.auth-shop-row.reauthorize {
  border-left-color: var(--red);
}

.auth-shop-main,
.auth-shop-times > div {
  min-width: 0;
}

.auth-shop-main {
  display: grid;
  align-content: start;
  gap: 6px;
}

.auth-shop-main strong,
.auth-shop-times strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.auth-shop-main p {
  font-size: 12px;
  line-height: 1.4;
}

.auth-status-badge {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #def1ed;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.auth-status-badge.warning,
.auth-status-badge.refresh_due {
  background: #fff3d6;
  color: var(--amber);
}

.auth-status-badge.reauthorize {
  background: #fee2e2;
  color: var(--red);
}

.auth-shop-times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-shop-times > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.auth-shop-times span,
.auth-shop-times em {
  font-size: 12px;
  font-style: normal;
}

.auth-shop-times em.warn {
  color: var(--red);
}

.auth-empty,
.auth-status-error {
  padding: 14px;
  font-size: 13px;
}

.after-visual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 10px;
}

.after-panel {
  min-width: 0;
  overflow: hidden;
}

.after-panel-head,
.after-queue-head,
.after-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.after-section-title {
  padding: 0;
  border-bottom: 0;
}

.after-flow-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.after-flow-card {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.after-flow-card:hover,
.after-flow-card.active {
  border-color: var(--green);
  background: #f1faf7;
}

.after-flow-card span,
.after-flow-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.after-flow-card strong {
  font-size: 22px;
}

.after-flow-card.danger {
  border-left: 4px solid #b42318;
}

.after-flow-card.red {
  border-left: 4px solid #8f1b13;
}

.after-flow-card.amber {
  border-left: 4px solid var(--amber);
}

.after-flow-card.blue {
  border-left: 4px solid var(--blue);
}

.after-flow-card.green {
  border-left: 4px solid var(--green);
}

.after-heat-grid {
  display: grid;
  grid-template-columns: 108px repeat(3, 1fr);
  gap: 5px;
  padding: 10px;
}

.after-heat-head,
.after-heat-label {
  min-height: 24px;
  padding: 5px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.after-heat-cell {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f8;
  color: var(--text);
  font-weight: 800;
}

.after-heat-cell.level-1 {
  background: #fff0ed;
}

.after-heat-cell.level-2 {
  background: #ffd6cf;
}

.after-heat-cell.level-3,
.after-heat-cell.level-4 {
  background: #cf4b3f;
  color: #fff;
}

.after-shift-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.after-shift-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.after-shift-item strong,
.after-shift-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.after-shift-item span {
  color: var(--muted);
  font-size: 12px;
}

.after-shift-item em {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--green);
  font-size: 22px;
  font-style: normal;
  font-weight: 900;
}

.after-workbench-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(520px, 1.28fr);
  gap: 12px;
  align-items: start;
}

.after-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.after-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.after-tab.active {
  border-color: var(--green);
  background: #def1ed;
  color: var(--green);
}

.after-tab span {
  font-weight: 900;
}

.after-queue-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding: 10px;
}

.after-case-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.after-case-card:hover,
.after-case-card.selected {
  border-color: var(--green);
  background: #f1faf7;
}

.after-case-card strong,
.after-case-card p,
.after-case-card footer span {
  overflow-wrap: anywhere;
}

.after-case-card p {
  color: #34444d;
  font-size: 13px;
  line-height: 1.45;
}

.after-case-card footer {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.af-priority,
.after-lane-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.af-priority.p0 {
  background: #fee4e2;
  color: #b42318;
}

.af-priority.p1 {
  background: #fff3d6;
  color: var(--amber);
}

.af-priority.p2,
.af-priority.p3 {
  background: #def1ed;
  color: var(--green);
}

.after-lane-tag {
  background: #edf1f3;
  color: #34444d;
}

.after-lane-tag.danger {
  background: #fee4e2;
  color: #b42318;
}

.after-lane-tag.red {
  background: #ffe9e6;
  color: #8f1b13;
}

.after-lane-tag.amber {
  background: #fff3d6;
  color: var(--amber);
}

.after-lane-tag.blue {
  background: #e0edf9;
  color: var(--blue);
}

.after-lane-tag.green {
  background: #def1ed;
  color: var(--green);
}

.after-mini-progress {
  display: grid;
  gap: 5px;
}

.after-mini-progress > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.after-progress-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--steps), minmax(0, 1fr));
  align-items: center;
  width: 100%;
}

.after-progress-track::before,
.after-progress-track::after {
  position: absolute;
  right: 8px;
  left: 8px;
  height: 3px;
  border-radius: 999px;
  content: "";
}

.after-progress-track::before {
  background: #dfe7eb;
}

.after-progress-track::after {
  width: calc(var(--progress) * 1%);
  background: var(--green);
}

.after-progress-node {
  position: relative;
  z-index: 1;
  justify-self: center;
  border: 2px solid #c9d4da;
  border-radius: 999px;
  background: var(--surface);
}

.after-mini-track {
  height: 16px;
}

.after-mini-track .after-progress-node {
  width: 10px;
  height: 10px;
}

.after-case-track {
  height: 28px;
}

.after-case-track .after-progress-node {
  width: 16px;
  height: 16px;
}

.after-progress-node.done {
  border-color: var(--green);
  background: var(--green);
}

.after-progress-node.current {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 4px #def1ed;
}

.after-case-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.after-case-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.after-case-head h2 {
  overflow-wrap: anywhere;
}

.after-case-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.after-next-box,
.after-progress-section {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #b8ded6;
  border-radius: 8px;
  background: #f1faf7;
}

.after-next-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.after-next-box strong {
  line-height: 1.45;
}

.after-next-box em,
.after-progress-line > strong {
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.after-progress-line {
  display: grid;
  gap: 8px;
}

.after-progress-labels {
  display: grid;
  grid-template-columns: repeat(var(--steps), minmax(0, 1fr));
  gap: 4px;
}

.after-progress-labels span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.after-progress-labels span.done {
  color: var(--green);
}

.after-progress-labels span.current {
  color: #b42318;
}

.after-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.after-detail-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.after-detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.after-detail-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.after-fact-section,
.after-buyer-section,
.after-action-section,
.after-evidence-section,
.after-check-section,
.after-note-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.after-fact-section {
  border-top: 0;
  padding-top: 0;
}

.after-evidence-form {
  display: grid;
  gap: 10px;
}

.after-api-note,
.after-api-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.after-api-note strong,
.after-api-head strong {
  font-size: 13px;
}

.after-api-note span,
.after-api-head span,
.after-detail-error {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.after-api-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.after-api-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.after-api-actions,
.after-reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.after-api-actions em {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9f3ff;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.after-action-requirements {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.after-evidence-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.after-dynamic-fields {
  display: grid;
  gap: 8px;
}

.after-field-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.45fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.after-icon-button {
  width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.after-evidence-actions,
.after-note-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.after-note-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.after-note-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.after-evidence-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.after-platform-detail {
  gap: 12px;
}

.after-buyer-media {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.after-buyer-media a {
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.after-buyer-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.after-buyer-media p,
.after-history-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.after-history-list {
  display: grid;
  gap: 8px;
}

.after-history-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.after-history-list article span,
.after-history-list article a {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.after-history-list article p {
  color: var(--text);
}

.after-reason-list button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.after-check-section ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.after-check-section li {
  color: #34444d;
  font-size: 13px;
  line-height: 1.45;
}

.after-chat-panel {
  min-height: 530px;
}

.after-chat-log {
  display: grid;
  align-content: start;
  gap: 10px;
  height: 420px;
  overflow: auto;
  padding: 14px;
  background: var(--surface-soft);
}

.after-chat-message {
  display: flex;
}

.after-chat-message p {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.after-chat-message.assistant p {
  border: 1px solid var(--line);
  background: var(--surface);
}

.after-chat-message.user {
  justify-content: flex-end;
}

.after-chat-message.user p {
  background: var(--green);
  color: #fff;
}

.after-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.after-empty-case {
  display: grid;
  gap: 12px;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .module-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .admin-grid,
  .admin-module-grid,
  .ads-overview,
  .ads-split,
  .mini-metric-list,
  .after-hero-grid,
  .after-visual-row,
  .after-workbench-grid,
  .after-hero-panel,
  .after-hero-actions,
  .after-flow-board,
  .auth-platform-grid,
  .auth-shop-row,
  .auth-shop-times,
  .after-detail-grid,
  .after-api-grid,
  .after-field-row,
  .after-evidence-actions,
  .after-note-actions {
    grid-template-columns: 1fr;
  }

  .workspace-head,
  .band-head,
  .task-row,
  .keyword-row,
  .sync-row,
  .after-case-head,
  .after-queue-head {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .status-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .after-pulse-panel {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

  .module-nav {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 24px;
  }

  .after-heat-grid {
    grid-template-columns: 100px repeat(3, 72px);
    overflow: auto;
  }

  .after-tabs {
    justify-content: flex-start;
  }

  .after-buyer-media {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .after-chat-form {
    grid-template-columns: 1fr;
  }
}
