:root {
  --ink: #1c2228;
  --muted: #5d6872;
  --line: #c8d1da;
  --paper: #fffdf4;
  --panel: #ffffff;
  --soft: #eef4f7;
  --head: #116ea7;
  --accent: #0f8fba;
  --accent-2: #d38a13;
  --danger: #b94d3d;
  --ok: #177245;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
  background: #e8eef2;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.quote-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #0b2f3b;
  background: var(--panel);
}

.brand-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 58px;
  padding: 0 18px;
  background: var(--head);
  color: #fff;
}

.brand,
.brand-strip nav,
.ticker,
.status-row,
.estimate-head,
.total-box div,
.estimate-actions,
.bundle-grid {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 900;
  white-space: nowrap;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: #fff;
}

.brand-strip nav {
  gap: 4px;
  justify-content: center;
}

.brand-strip nav a {
  padding: 9px 13px;
  border-radius: 4px;
  color: #d8eef1;
  font-weight: 750;
}

.brand-strip nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.service-line {
  color: #f6d58c;
  font-weight: 800;
  white-space: nowrap;
}

.ticker {
  gap: 10px;
  min-height: 38px;
  padding: 7px 18px;
  color: #512f05;
  background: #fff4ce;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.ticker strong {
  padding: 3px 8px;
  color: #fff;
  background: var(--accent-2);
  border-radius: 4px;
}

.app-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
}

.category-panel,
.estimate-panel,
.price-board,
.bundle-section {
  border: 1px solid var(--line);
  background: var(--panel);
}

.panel-title {
  padding: 11px 12px;
  color: #fff;
  background: var(--head);
  font-weight: 900;
}

.category-button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  text-align: left;
  color: var(--ink);
  background: #f8fbfc;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-weight: 750;
}

.category-button:hover,
.category-button.active {
  color: #fff;
  background: var(--accent);
}

.price-board {
  min-width: 0;
}

.board-toolbar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#ffffff, #f3f7f9);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  white-space: nowrap;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1rem;
}

.toolbar-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: end;
  flex: 1 1 460px;
}

.search-box {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  flex: 1 1 260px;
}

.search-box input {
  width: 100%;
  max-width: 420px;
  min-height: 37px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.status-row {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  color: #37505b;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 800;
}

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

.price-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--paper);
}

.price-table th,
.price-table td {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.price-table th {
  color: #fff;
  background: #214c58;
  font-size: 0.82rem;
  text-align: left;
}

.price-table tr:hover td {
  background: #fff9dc;
}

.category-cell {
  width: 92px;
  color: #fff;
  background: #56707a;
  font-weight: 850;
  white-space: nowrap;
}

.product-title {
  font-weight: 850;
}

.spec-line {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.component-summary {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: #31464f;
  font-size: 0.82rem;
  line-height: 1.45;
}

.component-summary li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px dashed rgba(200, 209, 218, 0.75);
}

.component-summary strong {
  color: var(--head);
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: #e4f4f5;
  color: #056a71;
  font-size: 0.75rem;
  font-weight: 850;
}

.price-cell {
  color: #9a2f1f;
  font-size: 1.02rem;
  font-weight: 950;
  white-space: nowrap;
}

.price-cell span {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-size: 0.78rem;
}

.original-cell {
  color: var(--muted);
  font-weight: 850;
  text-decoration: line-through;
  white-space: nowrap;
}

.price-table th:nth-child(3),
.price-table td:nth-child(3),
.price-table th:nth-child(4),
.price-table td:nth-child(4),
.price-table th:nth-child(5),
.price-table td:nth-child(5) {
  width: 92px;
  white-space: nowrap;
}

.price-table th:nth-child(5),
.price-table td:nth-child(5) {
  width: 76px;
  text-align: center;
}

.choose-button,
.estimate-actions button,
.bundle-grid button,
.small-button {
  min-height: 32px;
  border: 1px solid #0d6168;
  border-radius: 4px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

.choose-button {
  width: 70px;
}

.choose-button[disabled] {
  cursor: not-allowed;
  border-color: #b9c3ca;
  color: #707b84;
  background: #e2e8ec;
}

.estimate-panel {
  grid-column: 2;
  padding: 14px;
}

.estimate-head {
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.small-button {
  padding: 0 10px;
  border-color: #8b382f;
  background: var(--danger);
}

.selected-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 8px;
  min-height: 180px;
  padding: 12px 0;
}

.empty-list {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  background: #f8fafb;
}

.selected-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #fffdf4;
}

.selected-build {
  align-items: start;
}

.selected-item strong {
  display: block;
  line-height: 1.35;
}

.selected-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.build-parts {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.build-parts li {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px dashed var(--line);
  color: #2c3d45;
  font-size: 0.84rem;
  line-height: 1.45;
}

.build-parts li strong,
.build-parts li span {
  display: block;
  margin: 0;
}

.build-parts li strong {
  color: var(--head);
}

.remove-button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--danger);
  font-weight: 900;
}

.total-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
}

.total-box div {
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.total-box div:last-child {
  border-bottom: 0;
}

.total-box dt {
  color: var(--muted);
  font-weight: 850;
}

.total-box dd {
  margin: 0;
  font-weight: 950;
}

.grand-total {
  color: #fff;
  background: var(--head);
}

.grand-total dt {
  color: #d9eef1;
}

.grand-total dd {
  font-size: 1.45rem;
}

.estimate-actions {
  gap: 8px;
  margin-top: 12px;
}

.estimate-actions button {
  flex: 1;
}

.fine-print {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.bundle-section {
  margin: 0 14px 14px;
  padding: 18px;
}

.bundle-heading {
  margin-bottom: 14px;
}

.bundle-grid {
  gap: 12px;
  align-items: stretch;
}

.bundle-grid article {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fbfc;
}

.bundle-grid p {
  min-height: 58px;
  margin: 8px 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.bundle-grid button {
  min-width: 84px;
  padding: 0 12px;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px;
  color: #d8eef1;
  background: var(--head);
  font-size: 0.9rem;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .estimate-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .brand-strip {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .brand-strip nav {
    justify-content: start;
    flex-wrap: wrap;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .category-panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-title {
    grid-column: 1 / -1;
  }

  .board-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-controls {
    justify-content: start;
  }

  .search-box input {
    max-width: none;
  }

  h1 {
    white-space: normal;
  }

  .bundle-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .estimate-panel {
    grid-column: 1;
  }

  .total-box {
    grid-template-columns: 1fr;
  }
}
