:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e3e8ef;
  --brand: #0e7490;
  --brand-2: #0891b2;
  --accent: #2563eb;
  --ok: #16a34a;
  --warn: #d97706;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .06);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Microsoft YaHei", "Malgun Gothic", "Noto Sans CJK", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 22px; color: var(--brand); }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.lang-select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn-home { background: var(--brand); color: #fff; }
.btn-mail { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-ghost { background: #fff; color: var(--muted); border-color: var(--line); }
.btn:hover { filter: brightness(.96); }

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero h1 { font-size: 24px; margin: 0 0 6px; }
.hero-note { color: var(--muted); margin: 0; max-width: 760px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 16px; font-size: 18px; }

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field select, .field input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.field select:focus, .field input:focus {
  outline: 2px solid var(--brand-2);
  outline-offset: 1px;
  border-color: var(--brand-2);
}
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit .unit {
  position: absolute;
  right: 12px;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Results */
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.results-head h2 { margin: 0; }
.results-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-count { color: var(--brand); font-weight: 700; }
.results-body { overflow-x: auto; }
.empty-hint { color: var(--muted); margin: 8px 0; }

table.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.results-table th, .results-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.results-table th { color: var(--muted); font-weight: 700; background: #f8fafc; position: sticky; top: 0; }
.results-table tbody tr:hover { background: #f1f5f9; cursor: pointer; }
.results-table .model-cell { font-weight: 700; color: var(--brand); }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}
.no-results { color: var(--warn); padding: 12px 0; }

/* Detail */
.detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.detail-head h2 { margin: 0; }
.detail-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-col { min-width: 0; }
.detail-col h3 { font-size: 15px; margin: 0 0 10px; color: var(--brand); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table th, .spec-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.spec-table th { color: var(--muted); width: 45%; font-weight: 600; }

canvas { width: 100%; height: 240px; display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.dim-wrap { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.dim-wrap svg { width: 100%; height: auto; display: block; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 20px 40px; }

@media (max-width: 820px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-body { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .form-grid { grid-template-columns: 1fr; }
  .top-actions .btn { padding: 7px 10px; font-size: 13px; }
  .brand-name { display: none; }
}
