:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --bg: #07101d;
  --surface: rgba(14, 27, 48, .92);
  --surface-strong: #111f35;
  --line: #263b5b;
  --text: #f3f7ff;
  --muted: #aebbd0;
  --blue: #4f8cff;
  --blue-hover: #6ca0ff;
  --green: #55d6a8;
  --amber: #f1c973;
  --red: #ff7b88;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 0, rgba(58, 114, 214, .22), transparent 34rem),
    radial-gradient(circle at 100% 20%, rgba(126, 84, 255, .14), transparent 30rem),
    var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }
button, input, select { min-width: 0; }
button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  color: #fff;
  background: var(--blue);
  font-weight: 750;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
button:hover:not(:disabled) { background: var(--blue-hover); transform: translateY(-1px); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(105, 160, 255, .36); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .52; }
button.secondary { border-color: #355174; background: #1b3150; }
button.secondary:hover:not(:disabled) { background: #27456d; }
button.danger { border-color: rgba(255, 123, 136, .42); background: #702d3a; }
button.danger:hover:not(:disabled) { background: #8b3645; }
button.compact { min-height: 36px; padding: 0 13px; }

input, select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #365071;
  border-radius: 10px;
  background: #091426;
  color: #fff;
}
input::placeholder { color: #7183a0; }
label { display: grid; gap: 7px; min-width: 0; color: #d9e4f6; font-size: 13px; font-weight: 700; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(61, 83, 119, .68);
  background: rgba(7, 16, 29, .86);
  backdrop-filter: blur(18px);
}
.showcase-banner { padding: 9px 16px; text-align: center; color: #342400; background: #ffd875; font-size: 13px; font-weight: 850; letter-spacing: .03em; }
.brand { display: flex; gap: 12px; align-items: center; color: #fff; text-decoration: none; font-weight: 850; font-size: 18px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; background: linear-gradient(135deg, #327dff, #7e54ff); box-shadow: 0 10px 30px rgba(58, 112, 246, .32); }
.session-summary { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
#operator { color: #fff; font-weight: 800; }
#operator-scope { padding: 6px 10px; border: 1px solid #304869; border-radius: 999px; }

main { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 72px; }
.hero { margin-bottom: 30px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: #86a9e6; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 820px; margin: 0 0 12px; font-size: clamp(31px, 5vw, 56px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin: 0; font-size: clamp(23px, 3vw, 32px); }
h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.lead, .muted { color: var(--muted); line-height: 1.75; }
.lead { max-width: 760px; margin: 0; font-size: 16px; }
.muted { margin: 9px 0 0; }

.panel, .module {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .23);
}
.panel { padding: 22px; }
.login-panel { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(420px, 1.2fr); gap: 28px; align-items: end; }
.form-grid { display: grid; gap: 14px; }
.login-form { grid-template-columns: 1fr 1fr auto; align-items: end; }
.workspace { min-width: 0; }
.cultural-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.cultural-form-grid > :last-child { grid-column: 1 / -1; }
.cultural-form-grid .panel { margin: 0; background: rgba(8, 20, 38, .72); box-shadow: none; }
.cultural-lists { display: grid; gap: 18px; }
.cultural-lists > .panel { min-width: 0; margin: 0; background: rgba(8, 20, 38, .72); box-shadow: none; }
.cultural-lists .card { box-shadow: none; border-color: rgba(94, 126, 174, .24); }
.workspace-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.workspace-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(11, 24, 43, .94);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .2);
}
.workspace-main { min-width: 0; }
.role-card { display: grid; gap: 7px; padding: 15px; border: 1px solid #2f496e; border-radius: 14px; background: #0d1c32; }
.role-card-label { color: #86a9e6; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.role-card strong { font-size: 20px; }
.role-card span:last-child { color: var(--muted); font-size: 12px; }
.workspace-nav { display: grid; gap: 7px; }
.nav-item { width: 100%; min-height: 43px; padding: 0 13px; border-color: transparent; color: #b9c8de; background: transparent; text-align: left; font-size: 13px; }
.nav-item:hover:not(:disabled) { border-color: #355174; background: #142944; transform: none; }
.nav-item[aria-current="page"] { border-color: #467ad0; color: #fff; background: linear-gradient(135deg, #1e4f99, #293a78); box-shadow: 0 10px 24px rgba(45, 102, 191, .22); }
.sidebar-note { margin: 0; padding-top: 14px; border-top: 1px solid #263c5d; color: #8496b0; font-size: 11px; line-height: 1.65; }
.module { padding: clamp(20px, 4vw, 32px); }
.overview-hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.overview-hero .lead { margin-top: 12px; }
.guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px 0 22px; padding: 0; list-style: none; }
.guide-steps li { display: grid; gap: 16px; min-width: 0; padding: 18px; border: 1px solid #2b466d; border-radius: 14px; background: #0c1a30; }
.guide-steps li span { color: #6f9eea; font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.guide-steps li strong { font-size: 15px; line-height: 1.55; }
.readiness-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.readiness-card { display: grid; gap: 7px; min-width: 0; padding: 16px; border: 1px solid #294263; border-radius: 13px; background: rgba(20, 38, 65, .8); }
.readiness-card span, .readiness-card small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.readiness-card strong { font-size: 20px; overflow-wrap: anywhere; }
.module-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.module > .panel { margin-bottom: 18px; background: rgba(8, 20, 38, .72); box-shadow: none; }
.module-note { margin: -9px 0 20px; color: var(--muted); line-height: 1.7; }
.multi-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.multi-form .span-2 { grid-column: span 2; }
.multi-form > button { justify-self: start; }
.form-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.field-summary { display: grid; gap: 7px; align-content: center; min-height: 46px; padding: 8px 13px; border: 1px solid #2f496b; border-radius: 10px; color: #d9e4f6; background: #101f35; }
.field-summary span { color: #8ea2bf; font-size: 11px; font-weight: 700; }
.field-summary strong { font-size: 14px; overflow-wrap: anywhere; }
.upload-progress {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid #2f496b;
  border-radius: 12px;
  background: #0a1729;
}
.upload-progress progress { width: 100%; height: 12px; accent-color: var(--blue); }
.upload-progress > div { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.upload-progress strong { color: #dce9ff; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.media-asset-result {
  padding: 15px;
  border: 1px solid #31517b;
  border-radius: 12px;
  color: var(--muted);
  background: #0c1d34;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.data-list { display: grid; gap: 13px; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.card { min-width: 0; padding: 18px; border: 1px solid #2a4163; border-radius: 14px; background: var(--surface-strong); }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tag, .count-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 11px; font-weight: 800; }
.tag { flex: 0 0 auto; min-height: 26px; padding: 0 9px; border: 1px solid #4d5c79; color: #c9d5e9; background: #25324a; }
.tag[data-tone="success"], .tag[data-tone="published"] { border-color: rgba(85, 214, 168, .32); color: #8ce8c6; background: rgba(23, 99, 77, .32); }
.tag[data-tone="review_pending"], .tag[data-tone="approved"] { border-color: rgba(241, 201, 115, .32); color: #f8d997; background: rgba(121, 83, 22, .32); }
.tag[data-tone="withdrawn"], .tag[data-tone="muted"] { color: #aebbd0; background: #293143; }
.count-badge { min-width: 30px; min-height: 30px; padding: 0 8px; color: #d7e6ff; background: #203a61; vertical-align: middle; }
.meta { margin: 13px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.progress-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 17px 0 4px; padding: 0; list-style: none; }
.progress-track.cultural-progress { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.progress-track li { position: relative; display: grid; justify-items: center; gap: 7px; min-width: 0; color: #72839e; text-align: center; }
.progress-track li::before { position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; content: ""; background: #2b3e5b; transform: translateX(-13px); }
.progress-track li:first-child::before { display: none; }
.progress-track li span { position: relative; z-index: 1; display: grid; place-items: center; width: 27px; height: 27px; border: 2px solid #405372; border-radius: 50%; background: #111f35; font-size: 11px; font-weight: 850; }
.progress-track li small { width: 100%; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.progress-track li[data-state="complete"], .progress-track li[data-state="current"] { color: #bcd6ff; }
.progress-track li[data-state="complete"]::before, .progress-track li[data-state="current"]::before { background: #4f8cff; }
.progress-track li[data-state="complete"] span { border-color: #4f8cff; background: #1c4f99; }
.progress-track li[data-state="current"] span { border-color: #76a6ff; box-shadow: 0 0 0 4px rgba(79, 140, 255, .15); }
.progress-track[data-tone="danger"] li[data-state="current"] span { border-color: var(--red); color: #ffd7dc; box-shadow: 0 0 0 4px rgba(255, 123, 136, .13); }
.progress-track[data-tone="success"] li[data-state="current"] span { border-color: var(--green); color: #b8f5dd; box-shadow: 0 0 0 4px rgba(85, 214, 168, .13); }
.row-actions { display: grid; grid-template-columns: auto minmax(170px, 1fr) auto; gap: 9px; align-items: center; }
.decision-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.audit-row { display: grid; grid-template-columns: minmax(180px, .45fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.audit-row .meta { margin: 0; }
.drama-disclaimer { margin: 0 0 18px; padding: 12px 15px; border: 1px solid rgba(241, 201, 115, .5); border-radius: 12px; color: #2e2100; background: #f6d98e; font-size: 13px; font-weight: 850; text-align: center; }
.drama-overview { margin: 0 0 18px; }
.ledger-panel { min-width: 0; }
.ledger-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 17px; }
.ledger-heading strong { color: #bcd6ff; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid #294263; border-radius: 12px; }
.ledger-table { width: 100%; min-width: 760px; border-collapse: collapse; color: #eaf1fc; font-size: 13px; }
.ledger-table th, .ledger-table td { padding: 13px 14px; border-bottom: 1px solid #263d5d; text-align: right; white-space: nowrap; }
.ledger-table th { color: #9fb4d2; background: #0d1b30; font-size: 11px; letter-spacing: .03em; }
.ledger-table th:first-child, .ledger-table td:first-child, .ledger-table th:nth-child(2), .ledger-table td:nth-child(2) { text-align: left; }
.ledger-table tbody tr:last-child td { border-bottom: 0; }
.ledger-table tbody tr:not(.ledger-total):hover td { background: rgba(42, 74, 119, .18); }
.ledger-total td { color: #fff; background: #182e4c; font-weight: 850; }
.ledger-group td { color: #cfe0f7; background: #10203a; font-weight: 750; letter-spacing: .02em; }
.ledger-subtotal td { color: #d8e4f5; background: rgba(24, 46, 76, .55); font-weight: 700; }
.empty { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed #3d5477; border-radius: 14px; background: rgba(7, 16, 29, .3); }
.status-message { position: sticky; bottom: 18px; z-index: 8; min-height: 0; width: fit-content; max-width: 100%; margin: 18px auto 0; padding: 0; border-radius: 11px; color: var(--amber); background: rgba(10, 22, 40, .94); box-shadow: 0 16px 45px rgba(0, 0, 0, .32); }
.status-message:not(:empty) { padding: 12px 16px; border: 1px solid #435473; }
.status-message[data-tone="success"] { color: var(--green); border-color: rgba(85, 214, 168, .38); }
.status-message[data-tone="error"] { color: #ffafb7; border-color: rgba(255, 123, 136, .42); }
.hidden { display: none !important; }

@media (max-width: 840px) {
  .login-panel { grid-template-columns: 1fr; }
  .login-form { grid-template-columns: 1fr 1fr; }
  .login-form button { grid-column: span 2; }
  .row-actions { grid-template-columns: 1fr 1fr; }
  .row-actions input { grid-column: span 2; }
  .workspace-shell { grid-template-columns: 1fr; }
  .workspace-sidebar { position: static; }
  .workspace-nav { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .sidebar-note { display: none; }
  .guide-steps { grid-template-columns: 1fr; }
  .readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cultural-form-grid { grid-template-columns: 1fr; }
  .cultural-form-grid > :last-child { grid-column: auto; }
}

@media (max-width: 600px) {
  .topbar { position: static; align-items: flex-start; padding: 16px 18px; }
  .brand span:last-child { display: none; }
  .session-summary { align-items: flex-end; flex-direction: column; }
  main { width: min(100% - 28px, 1320px); padding-top: 34px; }
  .login-form, .multi-form { grid-template-columns: 1fr; }
  .login-form button, .multi-form .span-2 { grid-column: auto; }
  .multi-form > button { width: 100%; }
  .upload-actions { display: grid; grid-template-columns: 1fr; }
  .upload-actions button { width: 100%; }
  .upload-progress > div { align-items: flex-start; flex-direction: column; }
  .module-head { align-items: flex-start; flex-direction: column; }
  .module-head > button { width: 100%; }
  .row-actions { grid-template-columns: 1fr; }
  .row-actions input { grid-column: auto; }
  .row-actions button { width: 100%; }
  .decision-actions, .audit-row { grid-template-columns: 1fr; }
  .decision-actions button { width: 100%; }
  .workspace-sidebar { padding: 14px; }
  .workspace-nav { grid-template-columns: 1fr 1fr; }
  .overview-hero { flex-direction: column; }
  .readiness-grid { grid-template-columns: 1fr; }
  .progress-track li small { font-size: 9px; }
  .ledger-heading { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
