:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #687684;
  --line: #d8dee6;
  --soft: #eef2f6;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --good: #15803d;
  --bad: #b91c1c;
  --warn: #b7791f;
  --accent-soft: #dff5f1;
  --blue-soft: #e7efff;
  --green-soft: #dcfce7;
  --red-soft: #fee2e2;
  --warn-soft: #fff3cf;
  --shadow: 0 16px 38px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

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

.brand-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.page {
  padding: 28px 0 44px;
}

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

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

h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  letter-spacing: 0;
}

.subtle {
  color: var(--muted);
}

.good-text {
  color: var(--good);
}

.bad-text {
  color: var(--bad);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-pad {
  padding: 20px;
}

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

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

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

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

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #40505f;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  padding: 9px 14px;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn.blue {
  border-color: #b7c9ff;
  background: var(--blue-soft);
  color: var(--accent-2);
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.search {
  flex: 1 1 320px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid #edf0f3;
  padding: 14px 12px;
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

.avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.customer-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric strong {
  font-size: 27px;
  line-height: 1.15;
}

.metric.good {
  border-color: #8fd19e;
  background: var(--green-soft);
}

.metric.bad {
  border-color: #f3aaaa;
  background: var(--red-soft);
}

.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--soft);
  color: #44515f;
  font-size: 13px;
  font-weight: 700;
}

.pill.good {
  background: var(--green-soft);
  color: var(--good);
}

.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.blue {
  background: var(--blue-soft);
  color: var(--accent-2);
}

.step-list {
  display: grid;
  gap: 14px;
}

.step-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
}

.dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--line);
}

.dot.active {
  background: var(--accent);
}

.split-card {
  min-height: 314px;
}

.calc-box {
  padding: 14px;
  border: 1px solid #b7c9ff;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--accent-2);
  font-weight: 800;
}

.warn-box {
  padding: 14px;
  border: 1px solid #f2d27a;
  border-radius: 8px;
  background: var(--warn-soft);
  color: #8a5a0a;
}

.summary-box {
  min-height: 118px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  white-space: pre-wrap;
}

.upload-zone {
  display: grid;
  min-height: 188px;
  place-items: center;
  border: 1px dashed #9aa7b4;
  border-radius: 8px;
  background: #f9fafb;
  text-align: center;
}

.mic {
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  border: 1px solid #95d7ce;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 42px;
}

.status {
  min-height: 26px;
  color: var(--muted);
  font-size: 14px;
}

.footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.link-list {
  display: grid;
  gap: 10px;
}

.link-list a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.login-card {
  width: min(460px, 100%);
}

.account-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  color: #44515f;
  font-size: 14px;
}

@media (max-width: 900px) {
  .grid.two,
  .grid.three,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-head,
  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .panel-pad {
    padding: 15px;
  }

  .table {
    min-width: 760px;
  }

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

.grid.even-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  min-width: 0;
}

.metric strong {
  overflow-wrap: anywhere;
}

.btn.danger {
  border-color: #f3aaaa;
  background: var(--red-soft);
  color: var(--bad);
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.step-progress a {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf0f3;
  color: #687684;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.step-progress a.done {
  border-color: #95d7ce;
  background: var(--accent-soft);
  color: var(--accent);
}

.step-progress a.current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  font-weight: 700;
}

.check-grid input {
  width: auto;
  min-height: auto;
}

.assist-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}

.assist-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
}

.assist-panel[open] summary {
  margin-bottom: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.history-item + .history-item {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .grid.even-two,
  .step-progress,
  .check-grid {
    grid-template-columns: 1fr;
  }
}
