:root {
  --bg: #f7f2ec;
  --bg-deep: #efe7dc;
  --surface: #ffffff;
  --surface-soft: #fffaf5;
  --line: #e8dfd4;
  --line-strong: #d8cec1;
  --text: #1f2a38;
  --muted: #8e867d;
  --accent: #f55b02;
  --accent-dark: #df5100;
  --accent-soft: rgba(245, 91, 2, 0.11);
  --success: #238561;
  --danger: #c44d2f;
  --shadow-lg: 0 18px 40px rgba(132, 101, 67, 0.12);
  --shadow-md: 0 10px 24px rgba(132, 101, 67, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.65), transparent 34%),
    linear-gradient(180deg, #faf7f2 0%, #f5efe6 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.12)),
    radial-gradient(circle at 15% 15%, rgba(245, 91, 2, 0.045), transparent 20%),
    radial-gradient(circle at 85% 20%, rgba(245, 91, 2, 0.03), transparent 18%);
}

.page-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1.2;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.hero-divider {
  display: block;
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  margin: 16px auto 18px;
}

.hero p {
  margin: 0;
  color: #b1815f;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  letter-spacing: 0.28em;
  font-size: 0.92rem;
}

.mode-switch,
.service-type-switch,
.action-row,
.filter-group,
.table-toolbar,
.stats-grid {
  display: flex;
}

.mode-switch {
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
}

.mode-btn,
.service-type-btn,
.chip,
.primary-btn,
.ghost-btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mode-btn,
.service-type-btn,
.chip,
.ghost-btn {
  background: var(--surface);
  color: #4d4842;
  border-color: var(--line-strong);
}

.mode-btn {
  min-width: 96px;
  height: 42px;
  padding: 0 20px;
}

.mode-btn.active,
.primary-btn,
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(245, 91, 2, 0.18);
}

.mode-btn:hover,
.service-type-btn:hover,
.chip:hover,
.ghost-btn:hover {
  border-color: #cabdaa;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.workspace {
  margin-top: 38px;
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

.service-type-switch {
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}

.service-type-btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
}

.service-type-btn.active {
  background: var(--surface-soft);
  color: var(--accent);
  border-color: rgba(245, 91, 2, 0.18);
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto 28px;
  max-width: 860px;
}

.step {
  position: relative;
  width: 90px;
  text-align: center;
  flex: 0 0 auto;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: #fff;
  color: #b2a79a;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.step-label {
  display: block;
  margin-top: 12px;
  color: #b0a79e;
  font-size: 0.92rem;
  white-space: nowrap;
}

.step.active .step-dot,
.step.completed .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(245, 91, 2, 0.1);
}

.step.active .step-label,
.step.completed .step-label {
  color: var(--accent);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--line-strong);
  margin: 0 4px;
}

.step-line.completed {
  background: var(--accent);
}

.main-card,
.stats-card,
.table-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.main-card {
  padding: 34px 36px 32px;
}

.card-header {
  text-align: left;
  margin-bottom: 28px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
}

.card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-size: 1rem;
  font-weight: 600;
}

.field input,
.field textarea,
.search-box input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input {
  height: 52px;
  padding: 0 16px;
}

.field textarea {
  min-height: 198px;
  padding: 15px 16px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.search-box input:focus {
  outline: none;
  border-color: rgba(245, 91, 2, 0.35);
  box-shadow: 0 0 0 4px rgba(245, 91, 2, 0.08);
}

.field-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.action-row {
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
  flex-wrap: wrap;
}

.action-row.single {
  justify-content: center;
}

.primary-btn,
.ghost-btn {
  min-height: 48px;
  padding: 0 24px;
  font-weight: 600;
}

.primary-btn {
  min-width: 160px;
}

.primary-btn.wide {
  width: 100%;
  max-width: 100%;
}

.ghost-btn {
  background: #fff;
}

.confirm-box {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fffaf5 0%, #fff 100%);
  border: 1px solid var(--line);
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f0e8de;
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-row span {
  color: var(--muted);
}

.confirm-row strong {
  text-align: right;
  word-break: break-all;
}

.result-box {
  text-align: center;
  padding: 6px 0 10px;
}

.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  background: rgba(35, 133, 97, 0.12);
  color: var(--success);
  font-size: 1.9rem;
  font-weight: 700;
}

.result-icon.fail {
  background: rgba(196, 77, 47, 0.1);
  color: var(--danger);
}

.result-box h3 {
  margin: 0;
  font-size: 1.5rem;
}

.result-box p {
  margin: 10px auto 0;
  max-width: 480px;
  color: var(--muted);
}

.result-note {
  margin-top: 16px;
  color: #a29280;
  font-size: 0.92rem;
}

.stats-grid {
  margin-top: 18px;
  gap: 14px;
  flex-wrap: wrap;
}

.stats-card {
  flex: 1 1 180px;
  padding: 22px 24px;
}

.stats-card span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.stats-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.active-card strong {
  color: var(--success);
}

.warm-card strong {
  color: var(--accent);
}

.muted-card strong {
  color: #8c8378;
}

.table-card {
  margin-top: 18px;
  padding: 24px;
}

.table-toolbar {
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
}

.search-box {
  display: grid;
  gap: 8px;
  min-width: min(100%, 260px);
}

.search-box span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.search-box input {
  height: 46px;
  padding: 0 14px;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #f0e7dc;
  font-size: 0.94rem;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #fcf8f3;
}

tbody tr:hover td {
  background: #fffaf4;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.unused {
  background: rgba(35, 133, 97, 0.11);
  color: var(--success);
}

.status-badge.used {
  background: rgba(245, 91, 2, 0.12);
  color: var(--accent);
}

.status-badge.unknown {
  background: rgba(142, 134, 125, 0.14);
  color: #7d756c;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100% - 32px));
  z-index: 20;
}

.toast {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.toast.ok {
  border-color: rgba(35, 133, 97, 0.18);
}

.toast.fail {
  border-color: rgba(196, 77, 47, 0.18);
}

.toast strong {
  display: block;
  font-size: 0.95rem;
}

.toast p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 22px, 980px);
    padding-top: 28px;
  }

  .main-card,
  .table-card {
    padding: 22px 18px;
  }

  .stepper {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 6px;
  }

  .step {
    min-width: 88px;
  }

  .step-line {
    min-width: 72px;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 0.82rem;
    letter-spacing: 0.2em;
  }

  .mode-switch,
  .service-type-switch,
  .action-row {
    flex-direction: column;
  }

  .mode-btn,
  .primary-btn,
  .ghost-btn {
    width: 100%;
  }

  .confirm-row {
    flex-direction: column;
    gap: 6px;
  }

  .confirm-row strong {
    text-align: left;
  }
}
