:root {
  --ink: #18201f;
  --muted: #68716d;
  --paper: #eef2f1;
  --surface: #ffffff;
  --surface-strong: #f7f8f2;
  --line: #d5ddd9;
  --teal: #0f766e;
  --teal-soft: #d9efea;
  --rust: #b9543f;
  --amber: #c28b20;
  --blue: #315f9b;
  --budget-used: #0f766e;
  --budget-free: #dfe5e1;
  --shadow: 0 18px 50px rgba(24, 32, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), transparent 34%),
    linear-gradient(225deg, rgba(194, 139, 32, 0.12), transparent 36%),
    var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

button:hover {
  background: #263231;
}

button.secondary,
.actions-cell button {
  background: var(--surface-strong);
  color: var(--ink);
  border: 1px solid var(--line);
}

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

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

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

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "Songti SC", "STSong", "PingFang SC", serif;
  font-size: 34px;
  line-height: 1.12;
}

h2 {
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
}

.muted,
.empty {
  color: var(--muted);
}

.mode-switch,
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(213, 221, 217, 0.82);
  border-radius: 8px;
}

.mode-button,
.nav-tab {
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 0 12px;
}

.mode-button.active,
.nav-tab.active {
  background: var(--ink);
  color: white;
}

.nav-tabs {
  justify-content: flex-start;
  margin-bottom: 20px;
  overflow-x: auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 170px;
  margin-bottom: 18px;
  padding: 28px;
  color: white;
  background:
    linear-gradient(120deg, rgba(24, 32, 31, 0.96), rgba(15, 118, 110, 0.88)),
    var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel .eyebrow,
.hero-panel .muted {
  color: rgba(255, 255, 255, 0.74);
}

.hero-panel h2 {
  font-size: 40px;
  overflow-wrap: anywhere;
}

.clock-box {
  display: grid;
  justify-items: end;
  min-width: 220px;
}

.clock-box span {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 700;
}

.clock-box strong {
  font-size: 64px;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.panel,
.editor-form,
.table-wrap,
.backup-tools {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(213, 221, 217, 0.9);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(24, 32, 31, 0.07);
}

.panel {
  padding: 22px;
}

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

.panel-head > strong {
  color: var(--teal);
  font-size: 30px;
  line-height: 1;
}

.large-progress {
  height: 18px;
  overflow: hidden;
  background: #dce4df;
  border-radius: 999px;
}

.large-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 220ms ease;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.metric-row div {
  min-height: 74px;
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-row span,
.budget-numbers span,
.category-row span,
.today-line span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-row strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.budget-visual {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.donut {
  position: relative;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--budget-used) 0 0%, var(--budget-free) 0% 100%);
}

.donut::after {
  position: absolute;
  inset: 20px;
  content: "";
  background: var(--surface);
  border-radius: 50%;
}

.budget-numbers {
  display: grid;
  gap: 6px;
}

.budget-numbers strong {
  font-size: 22px;
}

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

.today-summary {
  display: grid;
  gap: 12px;
}

.today-line {
  padding-left: 14px;
  border-left: 4px solid var(--amber);
}

.today-line p {
  margin: 6px 0;
  color: var(--ink);
}

.today-line small {
  display: block;
  color: var(--muted);
}

.category-bars {
  display: grid;
  gap: 14px;
}

.category-row {
  display: grid;
  gap: 8px;
}

.category-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.small-bar {
  height: 9px;
  overflow: hidden;
  background: #dde4df;
  border-radius: 999px;
}

.small-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rust), var(--amber));
}

.section-head {
  margin-top: 10px;
}

.editor-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
}

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

.editor-form .wide {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  grid-column: 1 / -1;
}

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

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
}

.difficulty-高难,
.difficulty-极难 {
  background: #f4dfd8;
  color: var(--rust);
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell button {
  min-height: 32px;
  padding: 0 10px;
}

.photo-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 18px;
}

.map-panel {
  min-height: 620px;
}

.photo-map {
  width: 100%;
  height: 560px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), transparent 42%),
    linear-gradient(225deg, rgba(194, 139, 32, 0.14), transparent 44%),
    #dfe8e4;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-status {
  margin: 12px 0 0;
}

.map-photo-list {
  display: grid;
  gap: 12px;
  max-height: 600px;
  overflow: auto;
  padding-right: 4px;
}

.map-photo-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-photo-card img {
  width: 104px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  background: #dfe5e1;
}

.map-photo-card p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
}

.map-photo-card a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.map-popup {
  min-width: 170px;
}

.map-popup p {
  margin: 6px 0;
}

.backup-tools {
  display: flex;
  gap: 10px;
  padding: 16px;
}

.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.import-button input {
  display: none;
}

body[data-mode="director"] .producer-only,
body[data-mode="director"] .producer-column {
  display: none;
}

body[data-mode="director"] .nav-tab:not([data-view="dashboard"]) {
  display: none;
}

.mobile-page {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.12), transparent 260px),
    var(--paper);
}

.mobile-shell {
  width: min(760px, calc(100% - 24px));
}

.mobile-hero {
  margin: 0 0 16px;
  padding: 24px 4px 6px;
}

.mobile-hero h1 {
  font-size: 32px;
}

.mobile-stack {
  display: grid;
  gap: 16px;
}

.compact-head {
  margin-bottom: 12px;
}

.mobile-list {
  display: grid;
  gap: 12px;
}

.mobile-item {
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mobile-item.is-today {
  border-color: var(--amber);
  box-shadow: inset 4px 0 0 var(--amber);
}

.mobile-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mobile-item-head span,
.mobile-item small {
  color: var(--muted);
}

.mobile-item h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.mobile-item p {
  margin: 6px 0;
}

.mobile-progress {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mobile-progress > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mobile-progress strong {
  color: var(--teal);
  font-size: 28px;
}

.mobile-progress span {
  color: var(--muted);
}

.upload-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.upload-card button {
  min-height: 52px;
  font-size: 17px;
}

.location-status,
.form-message {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .topbar,
  .hero-panel,
  .dashboard-grid,
  .budget-visual,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .mode-switch {
    justify-content: stretch;
  }

  .mode-button {
    flex: 1;
  }

  .clock-box {
    justify-items: start;
    min-width: 0;
  }

  .hero-panel h2 {
    font-size: 32px;
  }

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

  .editor-form .wide {
    grid-column: span 1;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: auto;
  }

  .photo-map {
    height: 420px;
  }

  .map-photo-list {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 14px;
  }

  .hero-panel,
  .panel,
  .editor-form {
    padding: 16px;
  }

  .hero-panel h2 {
    font-size: 26px;
  }

  .clock-box strong {
    font-size: 48px;
  }

  .map-photo-card {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .map-photo-card img {
    width: 86px;
    height: 76px;
  }
}
