:root {
  color-scheme: light;
  --ink: #18211e;
  --muted: #64716c;
  --line: #d9e0dc;
  --surface: #ffffff;
  --soft: #f3f6f4;
  --green: #176b52;
  --green-dark: #10513e;
  --amber: #9a5b05;
  --red: #b33a3a;
  --blue: #315b8a;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

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

.shell { width: min(100% - 32px, 1040px); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-size: 20px; font-weight: 700; }
.subtle { color: var(--muted); font-size: 13px; }
.header-actions, .button-row { display: flex; align-items: center; gap: 10px; }
.quiet-link, .text-button { color: var(--green); text-decoration: none; background: transparent; border: 0; padding: 8px; }
.main-space { padding-block: 28px 56px; }
.hidden { display: none !important; }

h1 { margin: 0 0 18px; font-size: 24px; letter-spacing: 0; }
h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
p { margin: 8px 0; }

.state-panel {
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
}

.deadline-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #e9f3ef;
  border-left: 4px solid var(--green);
  margin-bottom: 24px;
}

.form-stack { display: grid; gap: 18px; max-width: 620px; }
label { display: grid; gap: 7px; font-weight: 600; }
input, select {
  width: 100%;
  min-height: 44px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid #b8c3bd;
  border-radius: 6px;
  padding: 9px 11px;
  outline: none;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,82,.12); }
.date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.count-field { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }

.primary-button, .secondary-button, .small-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 16px;
  font-weight: 650;
}
.primary-button { background: var(--green); color: white; }
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { background: var(--surface); border-color: #9aaba3; color: var(--ink); }
.small-button { min-height: 34px; padding: 5px 10px; background: var(--surface); border-color: #9aaba3; }
.danger-button { color: var(--red); border-color: #d7a5a5; }
.fit-button { width: auto; }
.form-message { min-height: 24px; }

.progress-section { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.status-chip { color: var(--blue); background: #eaf0f7; padding: 4px 8px; border-radius: 6px; font-size: 13px; }
.progress-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf0ee; }
.done-text, .success-text { color: var(--green); }
.pending-text { color: var(--amber); }
.error-text, .error-state { color: var(--red); }

.narrow-section { max-width: 440px; margin: 24px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.admin-sections { display: grid; gap: 44px; }
.admin-sections > section { padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 12px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 4px; }
.metric span { color: var(--muted); }
.metric strong { font-size: 26px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide-field { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 960px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #e8ecea; vertical-align: middle; }
th { color: var(--muted); background: #f8faf9; font-size: 13px; font-weight: 650; }
tr:last-child td { border-bottom: 0; }
.compact-input { min-width: 150px; min-height: 36px; padding-block: 5px; }
.empty-cell { color: var(--muted); text-align: center; padding: 28px; }
.log-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.log-row { display: grid; grid-template-columns: 90px 150px minmax(0, 1fr); gap: 12px; align-items: start; padding: 11px 14px; border-bottom: 1px solid #e8ecea; }
.log-row:last-child { border-bottom: 0; }
.log-row code { overflow-wrap: anywhere; color: var(--muted); }

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1040px); }
  .main-space { padding-top: 20px; }
  .date-grid, .progress-list, .settings-grid, .metric-row { grid-template-columns: 1fr; }
  .wide-field { grid-column: auto; }
  .progress-list { gap: 0; }
  .section-heading { align-items: flex-start; }
  .button-row { flex-wrap: wrap; justify-content: flex-end; }
  .log-row { grid-template-columns: 1fr 1fr; }
  .log-row code { grid-column: 1 / -1; }
}
