
:root {
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --bg: #f3f5f9;
  --card: #ffffff;
  --card-alt: #eef1f6;
  --border: #e3e7ef;
  --text: #1f2733;
  --dim: #6b7280;
  --ok: #10b981;
  --wa: #25d366;
  --footer: #1f2733;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB",
               system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.num { font-variant-numeric: tabular-nums; }
.ta-center { text-align: center; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

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

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--primary), #4f8cf7);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  font-size: 19px;
  letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small { color: var(--dim); font-size: 12.5px; line-height: 1.3; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 10px 8px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--dim);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lang-switch:hover { border-color: #d5dbe6; }
.lang-switch:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.lang-globe { flex: 0 0 auto; }

.lang-switch select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding-inline-end: 18px;
  cursor: pointer;
  max-width: 130px;
}
.lang-switch::after {
  content: "";
  position: absolute;
  inset-inline-end: 10px;
  top: 50%;
  width: 7px; height: 7px;
  margin-top: -5px;
  border-right: 2px solid var(--dim);
  border-bottom: 2px solid var(--dim);
  transform: rotate(45deg);
  pointer-events: none;
}
.lang-switch option { color: var(--text); background: var(--card); }

.main { padding-top: 24px; padding-bottom: 32px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}
.stat-label { color: var(--dim); font-size: 13px; }
.stat-value {
  font-size: clamp(20px, 3.4vw, 27px);
  font-weight: 800;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0 12px;
  color: var(--dim);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.search-box input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 11px 0;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
}
.search-box input::-webkit-search-cancel-button { cursor: pointer; }

.hint { color: var(--dim); font-size: 13px; flex: 1 1 auto; }

.btn-ghost {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 11px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-ghost:hover { background: var(--card-alt); border-color: #d5dbe6; }

.list-area {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.list { width: 100%; border-collapse: collapse; }
.list col.c-name { width: auto; }
.list col.c-box { width: 130px; }
.list col.c-stick { width: 130px; }
.list col.c-act { width: 110px; }

.list thead th {
  background: var(--card-alt);
  color: var(--dim);
  font-size: 13px;
  font-weight: 700;
  text-align: start;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.list tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.list tbody tr.row:hover { background: #fafbfe; }
.list tbody tr.row.is-open { background: #f7f9ff; }
.list tbody tr.row:last-child td { border-bottom: 0; }

.cell-name { font-weight: 700; word-break: break-word; }
.cell-box, .cell-stick { font-weight: 700; font-size: 15.5px; }

.unit { color: var(--dim); font-size: 12.5px; font-weight: 500; margin-inline-start: 3px; }

.val { display: inline-flex; align-items: baseline; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.toggle:hover { background: #f0f5ff; border-color: #c7d8fb; }
.toggle .chev { transition: transform .2s ease; display: inline-block; }
.toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.toggle[disabled] {
  color: var(--dim);
  cursor: default;
  background: var(--card-alt);
  border-color: var(--border);
  font-weight: 600;
}

tr.detail-row > td { padding: 0; background: #f7f9ff; border-bottom: 1px solid var(--border); }

.detail-wrap { padding: 6px 18px 16px; }

.detail { width: 100%; border-collapse: collapse; }
.detail th {
  text-align: start;
  font-size: 12.5px;
  color: var(--dim);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.detail td {
  padding: 11px 12px;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.detail tr:last-child td { border-bottom: 0; }
.detail td.num { font-weight: 700; }
.detail .d-spec { font-weight: 600; }
.detail .d-cat { color: var(--dim); }
.detail .d-empty { color: var(--dim); text-align: center; padding: 14px; }

.notice {
  padding: 34px 22px;
  text-align: center;
  color: var(--dim);
}
.notice strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.notice p { margin: 0 0 14px; font-size: 14px; }
.notice--error strong { color: #dc2626; }

.skeleton { padding: 18px; }
.sk-row {
  height: 46px;
  border-radius: 10px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fc 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease-in-out infinite;
}
@keyframes sk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.site-footer {
  background: var(--footer);
  color: #e5e7eb;
  margin-top: 8px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 22px;
}
.footer-brand strong { font-size: 15px; }

.noscript { color: #dc2626; padding-top: 20px; }

.wa-float {
  display: flex;
  position: fixed;
  inset-inline-end: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  width: 56px; height: 56px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--wa);
  color: #fff;
  box-shadow: 0 8px 22px rgba(37, 211, 102, .45);
  transition: transform .15s ease;
}
.wa-float:active { transform: scale(.94); }

@media (max-width: 900px) {
  .wrap { padding: 0 14px; }

  .header-inner { min-height: 60px; gap: 10px; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
  .brand-text strong { font-size: 16.5px; }
  .brand-text small { font-size: 11.5px; }

  .header-actions { gap: 8px; }
  .lang-switch { height: 36px; padding-inline: 8px 6px; gap: 4px; }
  .lang-switch select { font-size: 13px; max-width: 92px; padding-inline-end: 15px; }
  .lang-switch::after { inset-inline-end: 8px; }

  .main { padding-top: 16px; }

  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat { padding: 12px 12px; border-radius: 12px; }

  .toolbar { flex-wrap: wrap; gap: 10px; }
  .search-box { max-width: none; flex: 1 1 100%; order: 1; }
  .search-box input { padding: 12px 0; }
  .hint { order: 3; flex: 1 1 auto; }
  .btn-ghost { order: 2; padding: 12px 18px; }

  .list-area { border-radius: 12px; overflow: visible; background: transparent; border: 0; box-shadow: none; }

  .list, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list colgroup, .list thead { display: none; }

  .list tbody tr.row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 6px 14px 10px;
    margin-bottom: 10px;
  }
  .list tbody tr.row.is-open {
    background: #f7f9ff;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    border-bottom-color: transparent;
  }
  .list tbody tr.row:last-child td { border-bottom: 1px solid var(--border); }
  .list tbody td { padding: 7px 0; border-bottom: 0; }

  .cell-name {
    font-size: 16px;
    padding-bottom: 10px !important;
    border-bottom: 1px dashed var(--border) !important;
    margin-bottom: 6px;
  }

  .cell-box, .cell-stick {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 15px;
  }
  .cell-box::before, .cell-stick::before {
    content: attr(data-label);
    color: var(--dim);
    font-size: 13px;
    font-weight: 500;
  }

  .cell-act { padding-top: 10px !important; }
  .toggle {
    width: 100%;
    justify-content: center;
    padding: 11px 12px;
    font-size: 14px;
  }

  tr.detail-row > td {
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    padding: 0;
  }
  .list tbody tr.row.is-open + tr.detail-row > td { background: #f7f9ff; }

  .detail-wrap { padding: 4px 14px 12px; }
  .detail, .detail tbody, .detail tr, .detail td { display: block; width: 100%; }
  .detail thead { display: none; }

  .detail tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--border);
  }
  .detail tr:last-child { border-bottom: 0; }
  .detail td { padding: 0; border: 0; }
  .detail td.d-spec { grid-column: 1 / -1; font-size: 14.5px; }
  .detail td.d-cat {
    grid-column: 1 / -1;
    font-size: 12.5px;
    margin-bottom: 4px;
    word-break: break-word;
  }
  .detail td.num { display: flex; align-items: baseline; gap: 6px; }
  .detail td.num::before {
    content: attr(data-label);
    color: var(--dim);
    font-size: 12.5px;
    font-weight: 500;
  }
  .detail td.num .unit { display: none; }

  .site-footer { padding-bottom: 66px; }
  .footer-inner { padding-top: 18px; padding-bottom: 18px; }
}

@media (max-width: 380px) {
  .stats { gap: 8px; }
  .stat { padding: 10px 10px; }
  .stat-label { font-size: 11.5px; }
  .lang-switch select { max-width: 74px; }
  .brand-text small { display: none; }
}

[dir="rtl"] .brand-text strong,
[dir="rtl"] .stat-value { letter-spacing: 0; }

[dir="rtl"] .unit { margin-inline-start: 4px; }
