/* =========================================================
   备件速查 · Parts Finder
   ========================================================= */

:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #0e1a2b;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e9f1;
  --line-strong: #d0d9e6;
  --brand: #0f766e;
  --brand-hover: #0b5f59;
  --brand-ink: #ffffff;
  --brand-soft: rgba(15, 118, 110, 0.09);
  --price: #c2410c;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --header-bg: rgba(244, 247, 251, 0.84);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 14px 34px -18px rgba(16, 24, 40, 0.3);
  --shadow-lg: 0 30px 80px -24px rgba(10, 20, 40, 0.45);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Cascadia Code", "Liberation Mono", Menlo,
    monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a111e;
    --surface: #111b2c;
    --surface-2: #0e1727;
    --ink: #e9eff9;
    --ink-2: #c2cddd;
    --muted: #8b99ae;
    --muted-2: #64748b;
    --line: #1e2c44;
    --line-strong: #2b3d5a;
    --brand: #14b8a6;
    --brand-hover: #2dd4bf;
    --brand-ink: #042521;
    --brand-soft: rgba(45, 212, 191, 0.1);
    --price: #fbbf24;
    --danger: #fda29b;
    --danger-soft: rgba(180, 35, 24, 0.16);
    --header-bg: rgba(10, 17, 30, 0.84);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 16px 40px -18px rgba(0, 0, 0, 0.75);
    --shadow-lg: 0 30px 90px -20px rgba(0, 0, 0, 0.85);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

.page-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(13, 148, 136, 0.11), transparent 62%),
    radial-gradient(760px 460px at 102% -4%, rgba(234, 88, 12, 0.08), transparent 60%);
}

@media (prefers-color-scheme: dark) {
  .page-glow {
    background:
      radial-gradient(900px 520px at 8% -12%, rgba(20, 184, 166, 0.09), transparent 62%),
      radial-gradient(760px 460px at 102% -4%, rgba(251, 191, 36, 0.05), transparent 60%);
  }
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  display: block;
}

::selection {
  background: rgba(15, 118, 110, 0.22);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ---------- Header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
}

.app-header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(140deg, #0b2545 8%, #0f766e 100%);
  box-shadow: 0 8px 18px -10px rgba(15, 118, 110, 0.85);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-copy h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.brand-copy p {
  margin: 3px 0 0;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 560px;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease,
    background 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: var(--muted-2);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--line);
  color: var(--muted);
}

.clear-search svg {
  width: 13px;
  height: 13px;
}

.clear-search:hover {
  background: var(--line-strong);
  color: var(--ink-2);
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 40px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, color 0.16s ease,
    background 0.16s ease;
}

.admin-btn svg {
  width: 17px;
  height: 17px;
}

.admin-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* ---------- Filter / sort ---------- */

.main-body {
  padding-top: 14px;
  padding-bottom: 8px;
}

.filter-bar {
  position: relative;
  margin-bottom: 6px;
}

.chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.chip-count {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted-2);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.chip[aria-pressed="true"] .chip-count {
  color: inherit;
  opacity: 0.6;
}

.list-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
}

.result-meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.result-meta strong {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.list-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.refresh-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease,
    background 0.15s ease;
}

.refresh-btn svg {
  width: 15px;
  height: 15px;
}

.refresh-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sort-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 12px;
  color: var(--muted);
}

.sort-control span {
  display: none;
}

.sort-control select {
  height: 32px;
  padding: 0 28px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 550;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.sort-control::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ---------- Part cards ---------- */

.part-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-bottom: 22px;
}

.part-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.part-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.part-card:active {
  transform: translateY(0) scale(0.995);
}

.part-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.part-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.005em;
  overflow-wrap: break-word;
}

.model-code {
  display: inline-block;
  max-width: 100%;
  margin-top: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.model-empty {
  border-style: dashed;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--font);
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.equip-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 7px;
  border-radius: 999px;
  background: #eef2f7;
  background: hsl(var(--h, 190) 55% 50% / 0.11);
  color: #344054;
  color: hsl(var(--h, 190) 45% 31%);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.equip-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0f766e;
  background: hsl(var(--h, 190) 55% 44%);
}

@media (prefers-color-scheme: dark) {
  .equip-tag {
    color: hsl(var(--h, 190) 68% 72%);
  }
}

.meta-sep {
  color: var(--line-strong);
}

.price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  flex: none;
  gap: 4px;
  min-width: 72px;
  padding-top: 1px;
  text-align: right;
}

.price {
  color: var(--price);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price .cur {
  margin-right: 1px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: 2px;
}

.price-unit {
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
}

mark {
  padding: 0 1px;
  border-radius: 3px;
  background: rgba(251, 191, 36, 0.38);
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  mark {
    background: rgba(251, 191, 36, 0.26);
  }
}

/* ---------- Empty / footer ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 54px 20px 60px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--muted-2);
}

.empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty-state h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.empty-state p {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.empty-state.small {
  padding: 36px 16px;
}

.empty-state.small h2 {
  font-size: 15px;
}

.empty-state.small p {
  margin-bottom: 0;
}

.page-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 18px 0 30px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.foot-dot {
  opacity: 0.6;
}

.foot-mode {
  color: var(--muted-2);
}

.foot-mode.offline {
  color: var(--danger);
}

.foot-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease,
    color 0.16s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 10px 22px -12px rgba(15, 118, 110, 0.9);
}

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

.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-2);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.btn-sm {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px;
}

.btn-sm svg {
  width: 15px;
  height: 15px;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  transition: border-color 0.16s ease, color 0.16s ease,
    background 0.16s ease;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---------- Admin ---------- */

.admin-view {
  min-height: 100vh;
}

.admin-header-inner {
  flex-wrap: nowrap;
  gap: 12px;
}

.admin-title {
  flex: 1;
  min-width: 0;
}

.admin-title h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.25;
}

.admin-title p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-body {
  padding-top: 18px;
  padding-bottom: 50px;
}

.admin-search {
  position: relative;
  margin-bottom: 14px;
}

.admin-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.admin-search input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13.5px;
}

.admin-search input::placeholder {
  color: var(--muted-2);
}

.admin-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.admin-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.admin-row:hover {
  border-color: var(--line-strong);
}

.admin-row-main {
  flex: 1;
  min-width: 0;
}

.admin-row-name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-row-sub {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-row-price {
  flex: none;
  color: var(--price);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

.mini-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease,
    background 0.15s ease;
}

.mini-btn svg {
  width: 15px;
  height: 15px;
}

.mini-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.mini-btn.danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-actions-wrap {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.admin-actions-wrap h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 9px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease,
    color 0.15s ease;
}

.action-btn svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--muted);
}

.action-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.action-btn.danger {
  color: var(--danger);
}

.action-btn.danger svg {
  color: var(--danger);
}

.action-btn.danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.admin-tip {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.7;
}

/* ---------- Overlay / sheet / modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(7, 14, 26, 0.52);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: overlay-in 0.18s ease;
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: auto;
  padding: 10px 22px 24px;
  padding: 10px 22px calc(24px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.26s cubic-bezier(0.22, 0.9, 0.3, 1);
}

@keyframes sheet-up {
  from {
    opacity: 0.6;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sheet-grab {
  width: 40px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.sheet-close svg {
  width: 15px;
  height: 15px;
}

.sheet-close:hover {
  background: var(--line);
  color: var(--ink-2);
}

.detail-content {
  padding-top: 8px;
}

.detail-head {
  padding-right: 36px;
}

.detail-name {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.32;
  overflow-wrap: break-word;
}

.detail-model-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.detail-model-label {
  color: var(--muted);
  font-size: 11.5px;
}

.detail-model {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
  word-break: break-all;
}

.detail-price-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-soft), transparent 78%);
}

.detail-price-label {
  align-self: center;
  color: var(--muted);
  font-size: 11.5px;
  writing-mode: vertical-rl;
  letter-spacing: 0.12em;
}

.detail-price {
  color: var(--price);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.detail-price .cur {
  margin-right: 2px;
  font-size: 17px;
  font-weight: 700;
  vertical-align: 4px;
}

.detail-price-unit {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 0;
}

.detail-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.detail-item.wide {
  grid-column: 1 / -1;
}

.detail-item dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.detail-item dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: break-word;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.detail-actions .btn {
  flex: 1;
  min-width: 110px;
  min-height: 42px;
  font-size: 13px;
}

.detail-id {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s cubic-bezier(0.22, 0.9, 0.3, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.modal-icon svg {
  width: 22px;
  height: 22px;
}

.modal h2 {
  margin: 14px 0 6px;
  font-size: 19px;
  font-weight: 750;
}

.modal-desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.editor-modal {
  max-width: 560px;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.editor-head h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.span-2 {
  grid-column: span 2;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-grid .field {
  margin-bottom: 0;
}

.field-label {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.field-label em {
  color: var(--danger);
  font-style: normal;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

.field input::placeholder {
  color: var(--muted-2);
}

.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-error {
  margin: 2px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
}

.form-hint {
  margin: 0 0 14px;
  color: var(--muted-2);
  font-size: 11.5px;
}

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

.modal-actions .btn {
  min-width: 88px;
}

.shake {
  animation: shake 0.36s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  top: 14px;
  top: calc(14px + env(safe-area-inset-top));
  z-index: 300;
  max-width: 88vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */

@media (min-width: 900px) {
  .chips {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 4px;
  }
}

@media (min-width: 780px) {
  .part-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .sort-control span {
    display: inline;
  }

  .overlay {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    border-radius: 22px;
    max-height: 86vh;
  }

  .modal {
    border-radius: 20px;
  }
}

@media (max-width: 720px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-header-inner {
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand {
    flex: 1;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 20px;
    height: 20px;
  }

  .brand-copy h1 {
    font-size: 17px;
  }

  .brand-copy p {
    display: none;
  }

  .search-box {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .admin-btn {
    margin-left: 0;
    height: 38px;
    padding: 0 12px;
  }

  .main-body {
    padding-top: 10px;
  }

  .part-card {
    padding: 14px;
    border-radius: 14px;
  }

  .price {
    font-size: 19px;
  }

  .admin-row {
    padding: 10px 10px 10px 12px;
  }

  .admin-row-price {
    font-size: 12.5px;
  }

  .sheet {
    padding-left: 18px;
    padding-right: 18px;
  }

  .modal {
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding: 22px 18px 20px;
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
  }

  .toast {
    top: 12px;
    top: calc(12px + env(safe-area-inset-top));
  }
}

@media (max-width: 380px) {
  .admin-btn span {
    display: none;
  }

  .admin-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .detail-price {
    font-size: 29px;
  }
}

@media (max-width: 340px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-item.wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
