﻿:root {
  --bg: #eef3f8;
  --surface: rgba(255, 255, 255, 0.9);
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d8e0eb;
  --line-soft: #e9eef5;
  --text: #182230;
  --muted: #667085;
  --primary: #1f5eff;
  --primary-dark: #164bd3;
  --primary-soft: #edf3ff;
  --green: #12805c;
  --amber: #a15c07;
  --red: #b42318;
  --blue-soft: #e8f0ff;
  --morandi-blue: #eef2f5;
  --morandi-blue-head: #f6f8fa;
  --morandi-blue-line: #cfd9e3;
  --morandi-sage: #eef3ef;
  --morandi-sage-head: #f7faf6;
  --morandi-sage-line: #ccd9cf;
  --morandi-oat: #f5f1e9;
  --morandi-oat-head: #fbf8f2;
  --morandi-oat-line: #ddd2c1;
  --morandi-mauve: #f4eff3;
  --morandi-mauve-head: #faf6f9;
  --morandi-mauve-line: #ddcfda;
  --morandi-rose: #f6eeee;
  --morandi-rose-head: #fcf7f6;
  --morandi-rose-line: #e2cfcb;
  --shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 1180px;
  background:
    linear-gradient(180deg, rgba(231, 239, 249, 0.95) 0, rgba(244, 247, 251, 0.96) 280px),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

body.auth-required .topbar,
body.auth-required .boot-notice,
body.auth-required main {
  display: none;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 14px;
  width: 380px;
  max-width: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.session-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.session-box button {
  height: 26px;
  padding: 0 9px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(216, 224, 235, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.boot-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 20px 0;
  padding: 12px 16px;
  border: 1px solid #cfd9e6;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, rgba(236, 242, 250, 0.96) 100%);
  box-shadow: var(--shadow-soft);
}

.boot-notice.hidden {
  display: none;
}

.boot-notice-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.boot-notice-copy strong {
  font-size: 14px;
  line-height: 1.3;
}

.boot-notice-copy span {
  color: var(--muted);
  line-height: 1.45;
}

.boot-notice-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.boot-notice-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.boot-notice.error {
  border-left-color: var(--red);
  background: linear-gradient(180deg, rgba(255, 246, 245, 0.98) 0%, rgba(255, 239, 237, 0.96) 100%);
}

.boot-notice.error .boot-notice-copy strong {
  color: #9f2b21;
}

.eyebrow {
  margin-bottom: 4px;
  color: #52627a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  line-height: 1.2;
  text-transform: none;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  line-height: 1.35;
}

main {
  padding: 16px 20px 28px;
}

button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #263244;
  padding: 0 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

button:hover {
  border-color: #aeb9ca;
  background: #f8fbff;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(31, 94, 255, 0.24);
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary-action {
  color: #475467;
  background: #f8fafc;
}

.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel,
.metric {
  min-width: 0;
  background: var(--module-bg, var(--surface));
  border: 1px solid var(--module-border, rgba(216, 224, 235, 0.9));
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.source-panel {
  --module-bg: var(--morandi-oat);
  --module-head: var(--morandi-oat-head);
  --module-border: var(--morandi-oat-line);
  padding: 0;
  background: linear-gradient(180deg, var(--module-head) 0%, var(--module-bg) 100%);
}

.source-collapsible > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  min-height: 64px;
}

.source-collapsible > summary::-webkit-details-marker {
  display: none;
}

.source-collapsible > summary::after {
  content: "展开设置";
  flex: 0 0 auto;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 26px;
}

.source-collapsible[open] > summary::after {
  content: "收起设置";
}

.source-collapsible:not([open]) {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.source-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-title {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--module-head, #ffffff) 0%, var(--module-bg, #fbfcff) 100%);
  border-radius: 8px 8px 0 0;
}

.section-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.section-kicker {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-strip,
.scheduler-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.account-strip {
  max-width: 720px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(216, 224, 235, 0.68);
  border-radius: 8px;
}

.account-strip span,
.scheduler-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-feedback {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(216, 224, 235, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.config-save-row {
  display: flex;
  justify-content: flex-start;
}

.config-save-row button {
  min-width: 112px;
}

.config-save-row button.pending {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.save-feedback.saving {
  border-color: #c6d7ff;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.save-feedback.saved {
  border-color: #bde7d0;
  background: #e5f7ee;
  color: var(--green);
}

.save-feedback.dirty {
  border-color: #f3d38b;
  background: #fff8e5;
  color: #8a5a00;
}

.save-feedback.error-text {
  border-color: #f0c4bd;
  background: #fff1f0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ok-pill {
  background: #e5f7ee;
  color: var(--green);
}

.muted-pill {
  background: #eef2f7;
  color: #475467;
}

.source-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(420px, 1.35fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: stretch;
  padding: 0 16px 16px;
}

.source-grid > *,
.ops-grid > *,
.dashboard-grid > *,
.daily-metrics > * {
  min-width: 0;
}

.integration-panel {
  display: grid;
  gap: 12px;
  padding: 0 16px 14px;
}

.auth-mode-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr);
  gap: 10px;
}

.integration-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.rail-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-areas:
    "num label"
    "num meta";
  column-gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 224, 235, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.rail-step b {
  grid-area: num;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #edf2f7;
  color: #475467;
  font-size: 13px;
}

.rail-step span {
  grid-area: label;
  color: #1d2939;
  font-weight: 800;
}

.rail-step small {
  grid-area: meta;
  color: var(--muted);
  font-size: 12px;
}

.rail-step.ready {
  border-color: #b8d7c7;
  background: #f2faf6;
}

.rail-step.ready b {
  background: #dff3e9;
  color: var(--green);
}

.rail-step.active {
  border-color: #bccbdf;
  background: #f4f7fb;
}

.rail-step.active b {
  background: #e4ebf5;
  color: #344766;
}

.rail-step.wait {
  border-color: #e7d7bd;
  background: #fffaf0;
}

.rail-step.wait b {
  background: #fff1d5;
  color: var(--amber);
}

.auth-workspace {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(260px, 0.38fr);
  gap: 12px;
  align-items: stretch;
}

.auth-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.auth-panel,
.auth-side {
  border: 1px solid rgba(216, 224, 235, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.auth-panel {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.auth-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.auth-panel-head strong,
.side-title {
  display: block;
  color: #1d2939;
  font-size: 13px;
  font-weight: 800;
}

.auth-panel-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.text-link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #d7e1ef;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #f8fbff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.official-credential-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.2fr);
  gap: 10px;
}

.secret-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.credential-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.credential-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.88);
}

.auth-side {
  display: grid;
  align-content: start;
  gap: 11px;
  padding: 13px;
}

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

.readiness-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.86);
}

.readiness-list span {
  color: var(--muted);
}

.readiness-list strong {
  color: #1d2939;
  font-size: 12px;
}

.workflow-hint {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

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

input,
select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid rgba(31, 94, 255, 0.16);
  border-color: #7da0ff;
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.checkline {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
  font-size: 13px;
}

.checkline input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--primary);
}

.compact-check {
  margin-top: 12px;
}

.folder-field {
  display: grid;
  grid-template-rows: auto minmax(190px, 1fr) auto;
  gap: 9px;
  min-width: 0;
  min-height: 306px;
}

.field-label {
  color: #536176;
  font-size: 12px;
  font-weight: 700;
}

.folder-checklist {
  min-height: 190px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px;
}

.folder-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 4px 7px;
  color: var(--text);
  font-size: 13px;
  border-radius: 6px;
}

.folder-check:hover {
  background: #f3f7fb;
}

.archive-folder-row {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.archive-folder-row:hover {
  background: #ffedd5;
}

.folder-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.folder-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exclude-folder-row input:checked + span {
  color: #9a3412;
}

.exclude-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 700;
}

.archive-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 11px;
  font-weight: 700;
}

.exclude-folder-row input:not(:checked) + span .exclude-tag {
  display: none;
}

.folder-hint {
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.folder-toolbar {
  display: flex;
  gap: 8px;
  min-height: 32px;
  align-items: center;
}

.field-footer {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 76px;
}

.collect-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 306px;
  padding: 14px;
  border: 1px solid rgba(216, 224, 235, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.empty-state {
  color: var(--muted);
  padding: 8px;
}

.advanced {
  margin-top: 14px;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
}

.advanced-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 12px;
  flex-wrap: wrap;
}

.advanced-actions .checkline {
  min-height: 32px;
  margin: 0;
}

.profile-path {
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 12px;
}

.admin-panel {
  --module-bg: #f8fafc;
  --module-head: #ffffff;
  margin-top: 14px;
}

.admin-actions,
.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-actions-strip {
  justify-content: flex-end;
  padding: 12px 16px 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 360px;
  gap: 14px;
  padding: 16px;
}

.admin-user-table {
  max-height: 430px;
}

.admin-user-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-project-list {
  max-height: 180px;
  min-height: 150px;
}

.closeout-panel {
  --module-bg: var(--morandi-oat);
  --module-head: var(--morandi-oat-head);
  --module-border: var(--morandi-oat-line);
  margin-top: 14px;
}

.closeout-toolbar,
.closeout-actions,
.closeout-form-actions,
.closeout-selection-actions,
.closeout-detail-head,
.closeout-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.closeout-toolbar {
  justify-content: space-between;
  padding: 12px 16px 0;
}

.closeout-toolbar .profile-path {
  padding: 0;
}

.closeout-workspace {
  display: grid;
  grid-template-columns: minmax(460px, 0.95fr) minmax(520px, 1.05fr);
  gap: 14px;
  padding: 14px 16px 16px;
}

.closeout-form,
.closeout-preview-area,
.closeout-detail {
  display: grid;
  align-content: start;
  gap: 13px;
}

.closeout-form,
.closeout-preview-area {
  padding: 14px;
  border: 1px solid var(--module-border, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.closeout-form-head,
.closeout-detail-head {
  justify-content: space-between;
}

.closeout-form h3,
.closeout-history-section h3,
.closeout-detail h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.closeout-form-head > div,
.closeout-detail-head > div {
  min-width: 0;
}

.closeout-form-head span,
.closeout-detail-head span,
.closeout-history-section .section-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.closeout-input-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(130px, 1fr) minmax(130px, 1fr);
  gap: 10px;
}

.closeout-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #344054;
  font-weight: 700;
}

.closeout-form textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.closeout-project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 122px;
  max-height: 236px;
}

.closeout-project-list .folder-check {
  gap: 9px;
}

.closeout-project-option {
  grid-template-columns: 18px minmax(0, 1fr) minmax(96px, auto);
  min-height: 43px;
}

.closeout-project-option-blocked {
  background: #fff8f3;
}

.closeout-project-option .closeout-project-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.closeout-project-option small {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.closeout-project-option small b {
  color: #223047;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.closeout-project-option small em {
  color: #65758a;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.closeout-selection-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.closeout-form-actions {
  justify-content: flex-end;
}

.closeout-preview {
  min-height: 310px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
}

.closeout-preview.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
}

.closeout-preview-ok {
  border-color: #9ccbb9;
  background: #f2faf6;
}

.closeout-preview-blocked {
  border-color: #ecc9c4;
  background: #fff8f7;
}

.closeout-preview-result {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.closeout-preview-result strong {
  font-size: 15px;
}

.closeout-preview-result span,
.closeout-warning {
  color: var(--muted);
  line-height: 1.45;
}

.closeout-preview-metrics,
.closeout-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.closeout-metric {
  display: grid;
  align-content: start;
  min-height: 72px;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(216, 224, 235, 0.9);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.84);
}

.closeout-metric:nth-child(3n + 1) { background: #f2f7fc; }
.closeout-metric:nth-child(3n + 2) { background: #f4f8f3; }
.closeout-metric:nth-child(3n) { background: #fbf6ef; }

.closeout-metric span,
.closeout-metric small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.closeout-metric strong {
  overflow-wrap: anywhere;
  color: #223047;
  font-size: 18px;
  line-height: 1.2;
}

.closeout-blocker-list {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  padding: 9px 12px 9px 28px;
  border-left: 3px solid #d85c53;
  background: rgba(255, 241, 240, 0.72);
  color: #8a3028;
  line-height: 1.45;
}

.closeout-warning {
  margin: 10px 0;
  padding: 8px 10px;
  border-left: 3px solid #d69b3f;
  background: #fff8eb;
}

.closeout-preview-projects,
.closeout-samples {
  margin-top: 12px;
}

.closeout-samples > summary,
.closeout-detail-section > summary {
  min-height: 36px;
  padding: 9px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  color: #344054;
  font-weight: 800;
}

.closeout-history-section {
  padding: 0 16px 16px;
}

.closeout-history-section .section-title {
  padding: 0 0 10px;
}

.closeout-history-table td:first-child small,
.closeout-history-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.closeout-history-table th:nth-child(1),
.closeout-history-table td:nth-child(1) { min-width: 180px; }
.closeout-history-table th:nth-child(3),
.closeout-history-table td:nth-child(3) { min-width: 145px; }
.closeout-history-table th:nth-child(4),
.closeout-history-table td:nth-child(4) { min-width: 118px; }
.closeout-history-table th:nth-child(7),
.closeout-history-table td:nth-child(7) { min-width: 150px; }

.closeout-preview-projects th:nth-child(n + 2),
.closeout-preview-projects td:nth-child(n + 2),
.closeout-history-table th:nth-child(4),
.closeout-history-table td:nth-child(4),
.closeout-history-table th:nth-child(5),
.closeout-history-table td:nth-child(5),
#closeoutProjectsTable th:nth-child(n + 2),
#closeoutProjectsTable td:nth-child(n + 2),
#closeoutVersionTable th:nth-child(n + 2),
#closeoutVersionTable td:nth-child(n + 2),
#closeoutDramasTable th:nth-child(n + 3),
#closeoutDramasTable td:nth-child(n + 3),
#closeoutDailyTable th:nth-child(n + 2),
#closeoutDailyTable td:nth-child(n + 2),
#closeoutAttentionTable th:nth-child(n + 4),
#closeoutAttentionTable td:nth-child(n + 4) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.closeout-preview-projects th:nth-child(2),
.closeout-preview-projects td:nth-child(2),
.closeout-history-table th:nth-child(4),
.closeout-history-table td:nth-child(4),
#closeoutProjectsTable th:nth-child(2),
#closeoutProjectsTable td:nth-child(2),
#closeoutDramasTable th:nth-child(3),
#closeoutDramasTable td:nth-child(3),
#closeoutDailyTable th:nth-child(2),
#closeoutDailyTable td:nth-child(2) {
  background: #f2f7fc;
}

.closeout-preview-projects th:nth-child(3),
.closeout-preview-projects td:nth-child(3),
.closeout-history-table th:nth-child(5),
.closeout-history-table td:nth-child(5),
#closeoutProjectsTable th:nth-child(4),
#closeoutProjectsTable td:nth-child(4),
#closeoutVersionTable th:nth-child(3),
#closeoutVersionTable td:nth-child(3),
#closeoutDramasTable th:nth-child(5),
#closeoutDramasTable td:nth-child(5) {
  background: #f3f8f2;
}

.closeout-preview-projects th:nth-child(4),
.closeout-preview-projects td:nth-child(4),
#closeoutProjectsTable th:nth-child(5),
#closeoutProjectsTable td:nth-child(5),
#closeoutProjectsTable th:nth-child(6),
#closeoutProjectsTable td:nth-child(6),
#closeoutDramasTable th:nth-child(6),
#closeoutDramasTable td:nth-child(6),
#closeoutDramasTable th:nth-child(7),
#closeoutDramasTable td:nth-child(7),
#closeoutAttentionTable th:nth-child(6),
#closeoutAttentionTable td:nth-child(6) {
  background: #fbf6ef;
}

.closeout-row-actions {
  justify-content: flex-start;
}

.closeout-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.closeout-status-completed {
  border: 1px solid #aad4c1;
  background: #eef9f3;
  color: #137151;
}

.closeout-status-voided {
  border: 1px solid #dfbbb5;
  background: #fff1f0;
  color: #a13d34;
}

.closeout-detail {
  margin: 0 16px 16px;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border-top: 2px solid var(--morandi-oat-line);
  background: #fffdf9;
}

.closeout-detail-head {
  align-items: start;
}

#closeoutDetailMeta {
  display: block;
  margin-top: 5px;
}

.closeout-notes {
  padding: 10px 12px;
  border-left: 3px solid #8aa5bf;
  background: #f2f7fb;
  white-space: pre-wrap;
  line-height: 1.55;
}

.closeout-detail-grid {
  display: grid;
  grid-template-columns: minmax(580px, 1fr) minmax(280px, 0.42fr);
  gap: 12px;
  min-width: 0;
}

.closeout-detail-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.closeout-detail-grid > .table-wrap,
.closeout-detail-section .table-wrap {
  min-width: 0;
  max-width: 100%;
}

.closeout-detail-section .table-wrap {
  border-radius: 0 0 7px 7px;
}

.closeout-detail table th:nth-child(even),
.closeout-detail table td:nth-child(even) {
  background: rgba(242, 247, 252, 0.65);
}

.closeout-detail table td {
  vertical-align: top;
  line-height: 1.35;
}

.error-text {
  color: var(--red) !important;
}

.hidden {
  display: none;
}

.view-panel {
  --module-bg: var(--morandi-sage);
  --module-head: var(--morandi-sage-head);
  --module-border: var(--morandi-sage-line);
  margin-top: 14px;
  padding: 13px 16px;
}

.view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.drama-view {
  width: min(420px, 45vw);
}

.drama-view-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.scope-reset {
  flex: 0 0 auto;
  margin-bottom: 1px;
}

#projectScopeSummary.scope-active {
  border-color: rgba(31, 94, 255, 0.22);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

.user-project-access {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(204, 217, 207, 0.9);
}

.user-project-access.hidden {
  display: none;
}

.user-project-access-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.user-project-access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.project-chip {
  display: inline-flex;
  align-items: center;
  max-width: 320px;
  min-height: 28px;
  padding: 5px 10px;
  overflow: hidden;
  border: 1px solid rgba(184, 204, 190, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #2f463a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  margin: 12px 0 14px;
}

.metric {
  position: relative;
  min-height: 92px;
  padding: 13px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--metric-head, #ffffff) 0%, var(--metric-bg, #fbfdff) 100%);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: #dfe8f4;
}

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

.metric span {
  font-weight: 700;
}

.metric strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.05;
}

.metric b {
  font: inherit;
}

.metric em {
  color: var(--muted);
  font-size: 18px;
  font-style: normal;
}

.metric small {
  margin-top: 9px;
  line-height: 1.35;
}

.hero-metric {
  --metric-bg: #eef1f7;
  --metric-head: #f8f9fb;
  border-color: #cbd5e7;
  background: linear-gradient(180deg, var(--metric-head) 0%, var(--metric-bg) 100%);
  box-shadow: 0 12px 28px rgba(31, 94, 255, 0.12);
}

.hero-metric::before {
  background: #8395b8;
}

.dashboard-grid .metric:nth-child(1) {
  --metric-bg: #f1f5f1;
  --metric-head: #fbfcfb;
  --module-border: #d1ded4;
}

.dashboard-grid .metric:nth-child(1)::before {
  background: #94a895;
}

.dashboard-grid .metric:nth-child(2) {
  --metric-bg: #eef3f6;
  --metric-head: #f8fafb;
  --module-border: #cfdae3;
}

.dashboard-grid .metric:nth-child(2)::before {
  background: #8fa1ad;
}

.dashboard-grid .metric:nth-child(3) {
  --metric-bg: #f5f1e9;
  --metric-head: #fcfaf6;
  --module-border: #ddd2c1;
}

.dashboard-grid .metric:nth-child(3)::before {
  background: #ae9979;
}

.dashboard-grid .metric:nth-child(4) {
  --metric-bg: #eef4ef;
  --metric-head: #f8faf7;
  --module-border: #cbdacd;
}

.dashboard-grid .metric:nth-child(4)::before {
  background: #8ba58f;
}

.dashboard-grid .metric:nth-child(5) {
  --metric-bg: #f6eeee;
  --metric-head: #fcf7f6;
  --module-border: #e2cfcb;
}

.dashboard-grid .metric:nth-child(5)::before {
  background: #b98a83;
}

.dashboard-grid .metric:nth-child(6) {
  --metric-bg: #eef1f7;
  --metric-head: #f8f9fb;
  --module-border: #cbd5e7;
}

.dashboard-grid .hero-metric {
  --metric-bg: #eef1f7;
  --metric-head: #f8f9fb;
  border-color: #cbd5e7;
  box-shadow: 0 12px 28px rgba(31, 94, 255, 0.12);
}

.dashboard-grid .hero-metric::before {
  background: #526f9e;
}

.ops-health-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
  margin: -2px 0 14px;
}

.ops-health-strip span {
  min-height: 34px;
  padding: 9px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #344054;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-panel,
.daily-panel,
.risk-panel,
.log-panel {
  margin-top: 14px;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(760px, 1.55fr) minmax(360px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.ops-grid .daily-panel,
.ops-grid .overview-panel {
  margin-top: 0;
}

.daily-panel {
  --module-bg: var(--morandi-mauve);
  --module-head: var(--morandi-mauve-head);
  --module-border: var(--morandi-mauve-line);
}

.overview-panel {
  --module-bg: var(--morandi-blue);
  --module-head: var(--morandi-blue-head);
  --module-border: var(--morandi-blue-line);
}

.summary-section {
  --module-bg: var(--morandi-oat);
  --module-head: var(--morandi-oat-head);
  --module-border: var(--morandi-oat-line);
}

.risk-panel {
  --module-bg: var(--morandi-rose);
  --module-head: var(--morandi-rose-head);
  --module-border: var(--morandi-rose-line);
}

.log-panel {
  --module-bg: #edf1f1;
  --module-head: #f7f9f8;
  --module-border: #cedbd9;
}

.daily-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 11px 16px 4px;
}

.daily-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid rgba(221, 207, 218, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
}

.daily-date-chip span {
  margin: 0 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.daily-date-chip strong {
  font-size: 13px;
}

.daily-date-chip button {
  height: 28px;
  border-radius: 999px;
}

.daily-metrics div {
  min-height: 68px;
  padding: 11px 14px;
  border: 1px solid rgba(216, 224, 235, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.daily-metrics span,
.daily-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.daily-metrics strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
  line-height: 1;
}

.daily-metrics small {
  margin-top: 8px;
}

.daily-detail-wrap {
  margin-top: 10px;
}

.collapse-panel {
  overflow: hidden;
  margin: 12px 16px 16px;
  border: 1px solid rgba(216, 224, 235, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.collapse-section {
  overflow: visible;
  margin-top: 14px;
}

.summary-section > .table-wrap {
  border-top: 1px solid var(--line-soft);
}

.collapse-panel > summary,
.collapse-title {
  cursor: pointer;
  user-select: none;
}

.collapse-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 0 14px;
  color: var(--text);
  font-weight: 800;
  list-style: none;
}

.collapse-panel > summary::-webkit-details-marker,
.collapse-title::-webkit-details-marker {
  display: none;
}

.collapse-panel > summary::after,
.collapse-title::after {
  content: "展开";
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.collapse-panel[open] > summary::after,
.collapse-section[open] > .collapse-title::after {
  content: "收起";
}

.collapse-panel small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.collapse-panel[open] > .table-wrap {
  border-top: 1px solid var(--line-soft);
}

.collapse-title {
  margin: 0;
}

.collapse-body {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line-soft);
}

.detail-filters {
  grid-template-columns: minmax(220px, 1.15fr) minmax(180px, 0.8fr) minmax(260px, 1.1fr) minmax(190px, 0.8fr);
  width: 100%;
  margin: 0 0 12px;
  align-items: center;
}

.history-status-hit {
  color: #9a3412;
  font-weight: 800;
}

.history-status-pass {
  color: var(--green);
  font-weight: 800;
}

.history-status-none {
  color: var(--muted);
}

.detail-filters input {
  min-width: 260px;
}

.detail-filters select {
  min-width: 160px;
}

.multi-filter {
  position: relative;
  min-width: 160px;
}

.multi-filter-toggle {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 12px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #ffffff;
}

.multi-filter-toggle::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #667085;
  border-bottom: 1.5px solid #667085;
  transform: translateY(-65%) rotate(45deg);
}

.multi-filter-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  width: max-content;
  min-width: 210px;
  max-width: 360px;
  max-height: 260px;
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.multi-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #263244;
  cursor: pointer;
}

.multi-filter-option:hover {
  background: var(--primary-soft);
}

.multi-filter-option input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-width: 0;
}

.multi-filter-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drama-filter .multi-filter-menu {
  min-width: 320px;
  max-width: min(560px, calc(100vw - 40px));
}

.drama-filter {
  min-width: 260px;
}

#episodeProjectFilter {
  min-width: 180px;
}

#episodeRangeFilter {
  min-width: 230px;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(178, 190, 181, 0.55);
  border-radius: 999px;
  background: #eef3ef;
  color: #4d6257;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 12px 14px;
}

.status-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.scope-note {
  padding: 8px 11px;
  border: 1px solid rgba(207, 217, 227, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  color: #475467;
  font-size: 12px;
  line-height: 1.45;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  align-content: start;
  max-height: 430px;
  overflow: auto;
}

.status-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px;
  border: 1px solid rgba(216, 224, 235, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.status-tile strong {
  font-size: 20px;
}

.filters {
  display: grid;
  grid-template-columns: 280px 170px;
  gap: 10px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  overflow: auto;
  max-height: 500px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table-wrap.compact {
  max-height: 320px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

#dramasTable {
  min-width: 1860px;
}

#dramasTable th:nth-child(1),
#dramasTable td:nth-child(1) {
  min-width: 140px;
  max-width: 260px;
}

#dramasTable th:nth-child(2),
#dramasTable td:nth-child(2) {
  min-width: 180px;
  max-width: 360px;
}

#dramasTable th:nth-child(4),
#dramasTable td:nth-child(4),
#dramasTable th:nth-child(5),
#dramasTable td:nth-child(5) {
  width: 165px;
  min-width: 150px;
}

#dramasTable th:nth-child(n + 3):nth-child(-n + 19),
#dramasTable td:nth-child(n + 3):nth-child(-n + 19) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#dramasTable th:nth-child(20),
#dramasTable td:nth-child(20) {
  min-width: 76px;
  text-align: center;
}

#dramasTable th:nth-child(n + 3):nth-child(-n + 5),
#dramasTable td:nth-child(n + 3):nth-child(-n + 5) {
  background: #f0f6ff;
}

#dramasTable th:nth-child(n + 6):nth-child(-n + 7),
#dramasTable td:nth-child(n + 6):nth-child(-n + 7) {
  background: #f1f8f4;
}

#dramasTable th:nth-child(n + 8):nth-child(-n + 13),
#dramasTable td:nth-child(n + 8):nth-child(-n + 13) {
  background: #f8f6f0;
}

#dramasTable th:nth-child(n + 14):nth-child(-n + 17),
#dramasTable td:nth-child(n + 14):nth-child(-n + 17) {
  background: #fff6ed;
}

#dramasTable th:nth-child(n + 18):nth-child(-n + 19),
#dramasTable td:nth-child(n + 18):nth-child(-n + 19) {
  background: #fff5f5;
}

#dramasTable th:nth-child(20),
#dramasTable td:nth-child(20) {
  background: #f5f7fa;
}

#dramasTable th:nth-child(3),
#dramasTable td:nth-child(3),
#dramasTable th:nth-child(6),
#dramasTable td:nth-child(6),
#dramasTable th:nth-child(8),
#dramasTable td:nth-child(8),
#dramasTable th:nth-child(14),
#dramasTable td:nth-child(14),
#dramasTable th:nth-child(18),
#dramasTable td:nth-child(18),
#dramasTable th:nth-child(20),
#dramasTable td:nth-child(20) {
  border-left: 1px solid #dce4ed;
}

th,
td {
  height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7fb;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

td {
  background: rgba(255, 255, 255, 0.72);
}

tr:hover td {
  background: #f7fbff;
}

tr.selected-row td {
  background: #eef6ff;
  border-bottom-color: #bfdbfe;
}

tr.selected-row:hover td {
  background: #e5f1ff;
}

tr.risk-critical td {
  background: #fff1f0;
  border-bottom-color: #ffd1cc;
}

tr.risk-critical:hover td {
  background: #ffe8e5;
}

tr.risk-critical td:first-child {
  position: relative;
  color: #b42318;
  font-weight: 800;
}

tr.risk-critical td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 4px;
  border-radius: 999px;
  background: #f04438;
}

tr.risk-critical .badge {
  background: #ffe4e0;
  color: #b42318;
}

#dramasTable tr:hover td {
  background: #f7fbff;
}

#dramasTable tr.selected-row td {
  background: #eef6ff;
  border-bottom-color: #bfdbfe;
}

#dramasTable tr.selected-row:hover td {
  background: #e5f1ff;
}

#dramasTable tr.risk-critical td {
  background: #fff1f0;
  border-bottom-color: #ffd1cc;
}

#dramasTable tr.risk-critical:hover td {
  background: #ffe8e5;
}

tr.risk-warning td:first-child {
  color: #b54708;
  font-weight: 800;
}

.project-name,
.name {
  max-width: 360px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-name {
  max-width: 260px;
}

.progress-cell {
  width: 150px;
  min-width: 150px;
}

#dramasTable th:nth-child(n + 8):nth-child(-n + 19),
#dramasTable td:nth-child(n + 8):nth-child(-n + 19) {
  min-width: 102px;
}

#dramasTable th:nth-child(18),
#dramasTable td:nth-child(18) {
  min-width: 92px;
}

#dramasTable th:nth-child(19),
#dramasTable td:nth-child(19) {
  min-width: 148px;
}

.pass-rate-cell {
  width: 230px;
  min-width: 230px;
}

.mini-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  color: #1d2939;
  font-size: 12px;
  line-height: 1;
}

.mini-progress-meta strong {
  font-weight: 800;
}

.mini-progress-meta span {
  color: var(--muted);
  font-weight: 700;
}

.mini-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4eaf2;
}

.mini-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f8f6b;
}

.approval-progress-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: #344054;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.approval-progress-meta strong {
  color: #1d2939;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.approval-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-weight: 700;
}

.approval-count i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 2px;
  background: #3367d6;
}

.approval-count.platform i {
  background: #1f8f6b;
}

.approval-progress-track {
  display: flex;
}

.approval-progress-track span {
  flex: 0 0 auto;
  border-radius: 0;
}

.approval-progress-track .internal-segment {
  background: #3367d6;
}

.approval-progress-track .platform-segment {
  background: #1f8f6b;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.raw-only-hidden {
  display: none !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  height: 23px;
  border-radius: 999px;
  padding: 0 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #eef2f7;
  color: #344054;
  font-weight: 700;
}

.badge.platform {
  background: #e5f7ee;
  color: var(--green);
}

.badge.pass {
  background: var(--blue-soft);
  color: var(--primary-dark);
}

.badge.source {
  background: #f2f4f7;
  color: #475467;
}

.badge.repair {
  background: #fff4e5;
  color: var(--amber);
}

.badge.review {
  background: #fff8db;
  color: #7a5b00;
}

.icon-link {
  height: 28px;
  padding: 0 9px;
  color: var(--primary-dark);
  background: #f4f7ff;
  border-color: #dce6ff;
}

.history-date-btn {
  min-width: 96px;
  justify-content: center;
  font-weight: 800;
}

.history-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
  padding: 0 4px;
}

.history-detail-head strong {
  display: block;
  color: #182230;
  font-size: 14px;
}

.history-detail-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.history-detail-table table {
  min-width: 1280px;
}

.range-toolbar {
  display: grid;
  grid-template-columns: 210px 210px 100px 128px minmax(300px, 1fr);
  align-items: end;
  gap: 12px;
  margin: 14px 0 10px;
  padding: 14px;
  background: #eef3f1;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
}

.range-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.range-toolbar input {
  height: 34px;
}

.range-toolbar button {
  height: 34px;
}

.range-summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  color: #334155;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #dce5eb;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

#dailyDramaTable {
  min-width: 820px;
}

#uploadHistoryTable {
  min-width: 900px;
}

#riskTable {
  min-width: 920px;
}

#log {
  height: 140px;
  margin: 0;
  padding: 12px 16px;
  overflow: auto;
  background: #111827;
  color: #d7e8ff;
  border-radius: 0 0 8px 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  body {
    min-width: 980px;
  }

  .source-grid,
  .overview-grid,
  .ops-grid,
  .auth-workspace {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  main {
    padding: 14px 12px 22px;
    overflow-x: hidden;
  }

  .login-view {
    padding: 16px;
  }

  .login-card {
    width: 100%;
    padding: 20px;
  }

  button {
    min-height: 40px;
    height: auto;
    padding: 8px 12px;
    line-height: 1.25;
  }

  input,
  select {
    min-height: 42px;
    height: 42px;
    font-size: 16px;
  }

  .topbar {
    position: static;
    gap: 14px;
    padding: 16px 14px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar,
  .source-head,
  .section-title {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .actions > * {
    min-width: 0;
  }

  .actions button,
  .actions .session-box {
    width: 100%;
  }

  .session-box {
    justify-content: space-between;
  }

  #sessionBox,
  #collectBtn {
    grid-column: 1 / -1;
  }

  .actions,
  .account-strip,
  .scheduler-meta,
  .daily-date-chip {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .account-strip {
    max-width: none;
    width: 100%;
  }

  .source-collapsible > summary {
    padding: 14px 12px;
  }

  .source-collapsible > summary::after,
  .collapse-panel > summary::after,
  .collapse-title::after {
    width: 100%;
    justify-content: center;
  }

  .account-strip span,
  .scheduler-meta span,
  .ops-health-strip span {
    white-space: normal;
  }

  .source-grid,
  .auth-mode-grid,
  .official-credential-grid,
  .integration-rail,
  .auth-workspace,
  .secret-field,
  .inline-field,
  .overview-grid,
  .ops-grid,
  .advanced-grid,
  .range-toolbar,
  .detail-filters,
  .ops-health-strip {
    grid-template-columns: 1fr;
  }

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

  .secret-field button {
    min-width: 70px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .daily-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 12px 4px;
  }

  .daily-metrics div {
    min-width: 0;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .detail-filters input,
  .detail-filters select,
  .multi-filter,
  .drama-filter,
  #episodeRangeFilter {
    min-width: 0;
  }

  .drama-view {
    width: 100%;
  }

  .view-row,
  .drama-view-actions,
  .auth-panel-head,
  .user-project-access-head,
  .history-detail-head {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-panel-head .text-link,
  .section-title > button {
    align-self: flex-start;
  }

  .folder-toolbar,
  .admin-form-actions {
    flex-wrap: wrap;
  }

  .folder-toolbar button,
  .admin-form-actions button,
  .config-save-row button {
    flex: 1 1 120px;
    min-width: 0;
  }

  .config-save-row,
  .config-save-row button,
  .filter-count {
    width: 100%;
  }

  .admin-actions-strip {
    justify-content: flex-start;
    padding: 12px 12px 0;
  }

  .admin-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .closeout-toolbar,
  .closeout-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .closeout-toolbar {
    padding: 12px 12px 0;
  }

  .closeout-actions,
  .closeout-form-actions,
  .closeout-selection-actions {
    flex-wrap: wrap;
  }

  .closeout-actions button,
  .closeout-form-actions button {
    flex: 1 1 148px;
    min-width: 0;
  }

  .closeout-workspace,
  .closeout-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .closeout-input-grid,
  .closeout-project-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .closeout-preview-metrics,
  .closeout-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .closeout-detail {
    margin: 0 12px 12px;
    padding: 12px;
  }

  .closeout-history-section {
    padding: 0 12px 12px;
  }

  .admin-user-table {
    width: 100%;
    max-height: 360px;
  }

  .admin-user-form {
    padding: 12px;
  }

  .daily-date-chip {
    width: 100%;
    border-radius: 8px;
  }

  .daily-date-chip button {
    flex: 1 1 120px;
  }

  .collapse-panel > summary {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
  }

  .collapse-panel small {
    line-height: 1.45;
  }

  .detail-filters {
    align-items: stretch;
  }

  .multi-filter-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 14px;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(55vh, 360px);
  }

  .drama-filter .multi-filter-menu {
    min-width: 0;
    max-width: none;
  }

  .multi-filter-option {
    min-height: 40px;
  }

  .collapse-panel {
    margin: 10px 10px 14px;
  }

  .range-toolbar {
    margin: 12px 0 10px;
  }

  #log {
    white-space: pre-wrap;
    word-break: break-word;
  }
}

@media (max-width: 520px) {
  main {
    padding: 12px 8px 18px;
  }

  .topbar {
    padding: 14px 12px;
  }

  .daily-metrics {
    grid-template-columns: 1fr;
  }

  .source-grid,
  .integration-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .advanced-grid,
  .collapse-body {
    padding: 12px;
  }

  .metric {
    padding: 12px;
  }

  .metric strong {
    font-size: 24px;
  }

  .table-wrap {
    max-height: 420px;
  }

  .badge {
    max-width: 150px;
  }
}

@media (max-width: 360px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

