:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --ink: #18211f;
  --muted: #69706a;
  --panel: #ffffff;
  --line: #dfe5dc;
  --green: #1f7a55;
  --teal: #0e8a88;
  --yellow: #e7ae34;
  --red: #c84d3a;
  --blue: #315a8c;
  --shadow: 0 18px 45px rgba(35, 46, 40, 0.1);
  font-family: "Microsoft YaHei", "PingFang SC", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(31, 122, 85, 0.08), transparent 36%),
    linear-gradient(220deg, rgba(49, 90, 140, 0.08), transparent 42%),
    var(--bg);
  color: var(--ink);
}

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

button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.brand small,
.side-card span,
.eyebrow,
.kpi-grid span,
.kpi-grid small {
  color: var(--muted);
}

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

.upload-entry,
.room-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 11px 12px;
  border-radius: 7px;
  text-align: left;
}

.upload-entry {
  width: 100%;
  margin-bottom: 16px;
  border-color: #cfdccd;
  background: #18211f;
  color: #fff;
}

.upload-entry small {
  color: rgba(255, 255, 255, 0.72);
}

.upload-entry.active {
  background: var(--green);
}

.room-link small {
  color: var(--muted);
}

.room-link.active,
.room-link:hover {
  background: #e9efe8;
}

.room-link.active {
  border-color: #cfdccd;
}

.side-card {
  margin-top: 32px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf6;
}

.side-card strong {
  display: block;
  margin: 8px 0;
  font-size: 18px;
}

.side-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.workspace {
  width: min(1500px, 100%);
  padding: 28px;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.15;
}

.subtitle {
  max-width: 820px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

h2 {
  font-size: 20px;
}

.mode-switch,
.review-tabs {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.period,
.review-tab {
  min-width: 46px;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
}

.period.active,
.review-tab.active {
  background: var(--green);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.room-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.room-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  min-height: 70px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 28px rgba(35, 46, 40, 0.07);
}

.room-mini strong {
  font-size: 22px;
}

.room-mini small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.room-mini.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 85, 0.11);
}

.kpi-grid article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.kpi-grid article {
  padding: 18px;
}

.kpi-grid strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.82fr);
  gap: 14px;
  margin-bottom: 14px;
}

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

.upload-hero {
  align-items: center;
}

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

.panel {
  padding: 18px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.video-upload-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.excel-import-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(180px, 0.6fr) minmax(180px, 0.6fr);
  gap: 12px;
}

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

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

input[type="file"] {
  padding: 8px;
}

.file-field {
  min-width: 0;
}

.potential-field {
  align-content: start;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 10px 11px;
}

.checkbox-line input {
  width: auto;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 85, 0.12);
}

.wide {
  margin-top: 12px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(22px, 1fr));
  align-items: end;
  gap: 9px;
  height: 220px;
  padding: 14px 14px 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(#f9fbf6 49%, #edf3ec 50%, #f9fbf6 51%);
  overflow: hidden;
}

.chart-summary {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.5;
  padding: 12px 14px;
}

.line-chart {
  position: relative;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#f9fbf6 24%, transparent 25%),
    linear-gradient(#edf3ec 49%, transparent 50%),
    linear-gradient(#f9fbf6 74%, transparent 75%),
    #fbfcfa;
  overflow: hidden;
  padding: 14px;
}

.line-chart svg {
  width: 100%;
  height: 168px;
}

.line-path {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.line-area {
  fill: rgba(31, 122, 85, 0.14);
}

.line-dot {
  fill: #fff;
  stroke: var(--green);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.line-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.bar {
  position: relative;
  min-height: 8px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--teal), var(--green));
}

.bar span {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.insight-list {
  display: grid;
  gap: 9px;
  margin-top: 34px;
}

.insight {
  border-left: 4px solid var(--green);
  padding: 10px 12px;
  background: #f6faf5;
  border-radius: 4px 7px 7px 4px;
  line-height: 1.55;
}

.insight.warn {
  border-color: var(--yellow);
}

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

.video-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.video-card {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fbfcfa;
  overflow: hidden;
}

.video-card strong {
  display: block;
  margin-bottom: 8px;
}

.video-player,
.video-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  background: #17201d;
}

.video-player {
  object-fit: contain;
}

.video-placeholder {
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.video-meta {
  padding: 14px;
}

.tag {
  display: inline-block;
  margin-bottom: 10px;
  border-radius: 99px;
  padding: 4px 9px;
  background: #e8f3ee;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag-row .tag {
  margin-bottom: 0;
}

.tag.scale {
  background: #e9f0fa;
  color: var(--blue);
}

.tag.stop {
  background: #faece9;
  color: var(--red);
}

.tag.recut {
  background: #fbf3df;
  color: #8a650c;
}

.tag.hot {
  background: #fff0d9;
  color: #9a5b00;
}

.video-card p,
.review-output p {
  color: var(--muted);
  line-height: 1.65;
}

.video-card .room-label {
  margin: -2px 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.review-output {
  min-height: 260px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.review-output ul {
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.upload-note {
  margin-top: 12px;
  border-left: 4px solid var(--teal);
  border-radius: 4px 7px 7px 4px;
  background: #eef7f6;
  color: var(--muted);
  line-height: 1.6;
  padding: 10px 12px;
}

.excel-status {
  margin-top: 12px;
  border-radius: 7px;
  background: #f6faf5;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.6;
  padding: 10px 12px;
}

.excel-preview {
  margin-top: 12px;
}

.excel-preview-table {
  min-width: 860px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
}

dialog::backdrop {
  background: rgba(24, 33, 31, 0.3);
}

.dialog-card {
  display: grid;
  gap: 14px;
  width: min(460px, calc(100vw - 32px));
  padding: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button:first-child,
#clearData {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

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

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

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

  .content-grid,
  .lower,
  .kpi-grid,
  .room-strip,
  .video-upload-grid,
  .excel-import-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-head {
    flex-direction: column;
  }

  .room-nav,
  .content-grid,
  .lower,
  .kpi-grid,
  .room-strip,
  .form-grid,
  .video-upload-grid,
  .excel-import-grid {
    grid-template-columns: 1fr;
  }

  .mode-switch,
  .review-tabs {
    width: 100%;
  }

  .period,
  .review-tab {
    flex: 1;
  }
}
