:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --ink: #1d2521;
  --muted: #64706a;
  --line: #d8dfd7;
  --panel: #ffffff;
  --panel-soft: #f0f5f1;
  --accent: #0d7663;
  --accent-strong: #055343;
  --danger: #b42318;
  --warn: #a15c07;
  --shadow: 0 18px 42px rgba(24, 39, 33, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(13, 118, 99, .08), transparent 270px),
    var(--bg);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

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

.headline { display: grid; gap: 6px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.18; letter-spacing: 0; }
h2 { font-size: 18px; line-height: 1.25; }
h3 { font-size: 15px; line-height: 1.25; }
.muted { color: var(--muted); font-size: 13px; }

.price-badge {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(13, 118, 99, .22);
  border-radius: 10px;
  background: rgba(13, 118, 99, .08);
  color: var(--accent-strong);
  white-space: nowrap;
}
.price-badge strong { font-size: 24px; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel + .panel { margin-top: 18px; }
.sub-panel {
  box-shadow: none;
  margin-top: 14px;
  padding: 14px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  background: #fbfcfa;
  white-space: nowrap;
}

form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
  outline: none;
}
textarea { min-height: 136px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 118, 99, .13);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.drop {
  border: 1px dashed #aebbb4;
  border-radius: 12px;
  padding: 16px;
  background: #fbfcfa;
}

.files, .metrics, .docs {
  display: grid;
  gap: 9px;
}
.files { margin-top: 10px; }

.period-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.period-tab {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 12px;
}
.period-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.stat-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fbfcfa;
}
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { font-size: 20px; line-height: 1.15; }

.file-line, .task-line, .metric, .doc-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfcfa;
  font-size: 13px;
}
.file-line span, .task-line span, .doc-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

code {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
  color: var(--accent-strong);
  background: var(--panel-soft);
  border: 1px solid rgba(13, 118, 99, .16);
  border-radius: 8px;
  padding: 3px 6px;
  word-break: break-all;
}

pre {
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101814;
  color: #ecfff8;
  padding: 12px;
  font-size: 12px;
  line-height: 1.55;
}
pre code {
  display: block;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  white-space: pre;
}

button, .link-button {
  border: 0;
  border-radius: 10px;
  min-height: 42px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-strong); }
.secondary { color: var(--ink); background: #eef3ef; border: 1px solid var(--line); }
.ghost { color: var(--accent-strong); background: transparent; border: 1px solid var(--line); }
button:disabled { opacity: .55; cursor: not-allowed; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.estimate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #edf7f3;
  color: var(--accent-strong);
  border: 1px solid rgba(13, 118, 99, .18);
  font-size: 14px;
}
.estimate strong { font-size: 22px; }

.hidden { display: none !important; }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  border-radius: 12px;
  padding: 13px 15px;
  background: #1d2521;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  z-index: 20;
}
.error { color: var(--danger); }
.ok { color: var(--accent-strong); }
.warn { color: var(--warn); }
video {
  width: 100%;
  max-height: 320px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #111;
}

@media (max-width: 920px) {
  header { align-items: flex-start; flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .price-badge { width: 100%; justify-content: space-between; }
}
