/* 鞋库 — Blaze 黑橙。强调色只有橙，不混玫红。 */

[data-theme="blaze"] {
  --bg: #14110d;
  --surface: #1c1814;
  --surface2: #261f18;
  --surface3: #32281e;
  --border: rgba(232,137,45,.16);
  --border-light: rgba(232,137,45,.32);
  --text: #f3ebe3;
  --text-muted: #c4b09a;
  --text-dim: #8a7764;
  --accent: #e8892d;
  --accent-glow: #f4a24e;
  --accent-2: #c46d1f;
  --green: #6db87a;
  --red: #d4745c;
  --orange: #e8892d;
  --yellow: #e0b35a;
  --gray: #8a7764;
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-body: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  --font-mono: 'Bebas Neue', Impact, sans-serif;
}

[data-theme="dark-roast"] {
  --bg: #15110d; --surface: #1e1812; --surface2: #261d16; --surface3: #2f241b;
  --border: rgba(216,180,120,0.13); --border-light: rgba(216,180,120,0.24);
  --text: #f2e8db; --text-muted: #b6a48e; --text-dim: #857260;
  --accent: #e6b85f; --accent-glow: #f0c876; --accent-2: #c0813f;
  --green: #6db87a; --red: #cd6b5a; --orange: #d4956a; --yellow: #d4b86a; --gray: #857260;
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-body: 'Noto Sans SC', -apple-system, sans-serif;
  --font-mono: 'Bebas Neue', Impact, sans-serif;
}

[data-theme="frost"] {
  --bg: #eef1f6; --surface: #ffffff; --surface2: #f4f7fb; --surface3: #eaeff6;
  --border: #e4e9f1; --border-light: #d3dbe7;
  --text: #1b2330; --text-muted: #5b6777; --text-dim: #94a1b3;
  --accent: #c46d1f; --accent-glow: #e8892d; --accent-2: #a85a16;
  --green: #16a34a; --red: #dc2626; --orange: #ea580c; --yellow: #ca8a04; --gray: #8b90a0;
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-body: 'Noto Sans SC', -apple-system, sans-serif;
  --font-mono: 'Bebas Neue', Impact, sans-serif;
}

[data-theme="obsidian"] {
  --bg: #0f1117; --surface: #171a22; --surface2: #1e222e; --surface3: #262b3a;
  --border: rgba(160,172,210,.12); --border-light: rgba(160,172,210,.2);
  --text: #e4e6ed; --text-muted: #99a1b6; --text-dim: #6a7289;
  --accent: #e8892d; --accent-glow: #f4a24e; --accent-2: #c46d1f;
  --green: #1f9d6b; --red: #e07a64; --orange: #e0a23a; --yellow: #e0a23a; --gray: #5a6378;
  --font-display: 'Bebas Neue', Impact, sans-serif;
  --font-body: 'Noto Sans SC', -apple-system, sans-serif;
  --font-mono: 'Bebas Neue', Impact, sans-serif;
}

:root { --radius: 14px; --radius-sm: 8px; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo { color: var(--accent); display: grid; place-items: center; }
.topbar h1 {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 400;
  color: var(--accent);
  letter-spacing: .06em;
  line-height: 1;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.count { font-size: 13px; color: var(--text-dim); }
.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
}

.menu-dropdown {
  display: none;
  position: absolute; right: 16px; top: 56px; z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 200px;
}
.menu-dropdown.open { display: flex; flex-direction: column; }
.menu-dropdown button, .menu-item {
  padding: 12px 16px;
  background: none; border: none;
  color: var(--text);
  font-size: 14px; font-family: var(--font-body);
  text-align: left; cursor: pointer;
}
.menu-dropdown button:hover, .menu-item:hover { background: var(--surface2); }

.overview {
  margin: 4px 16px 10px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.overview-kicker {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim);
}
.overview-km {
  font-family: var(--font-mono);
  font-size: 42px; line-height: 1;
  color: var(--accent);
  margin: 6px 0 4px;
}
.overview-sub { font-size: 13px; color: var(--text-muted); }

.filters { padding: 4px 16px 8px; }
.chips {
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 5px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px; font-family: var(--font-body);
  cursor: pointer;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 500;
}

.cards {
  padding: 6px 16px 120px;
  display: flex; flex-direction: column; gap: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px 18px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeUp .35s ease both;
}
.card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.card.s-active::before { background: var(--accent); }
.card.s-reserve::before { background: var(--yellow); }
.card.s-retired::before { background: var(--gray); }
.card:active { transform: scale(.985); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-name {
  font-size: 17px; font-weight: 500;
  color: var(--text); line-height: 1.3;
}
.card-status {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.card.s-active .card-status { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.card.s-reserve .card-status { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--yellow); }
.card.s-retired .card-status { background: var(--surface3); color: var(--text-dim); }

.card-km {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 28px; letter-spacing: .04em;
  color: var(--accent);
  line-height: 1;
}
.card-km span {
  font-size: 14px; color: var(--text-dim); letter-spacing: 0;
  font-family: var(--font-body);
  margin-left: 4px;
}

.life {
  margin-top: 10px;
  height: 6px;
  background: var(--surface3);
  border-radius: 999px;
  overflow: hidden;
}
.life > i {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.life.warn > i { background: var(--yellow); }
.life.hot > i { background: var(--red); }

.card-footer {
  margin-top: 10px;
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-dim);
}

.empty { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

.fab {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 20;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  background: var(--accent);
  border: none; border-radius: 50%;
  color: var(--bg); cursor: pointer;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
.fab:active { transform: scale(.95); }

dialog {
  border: none; border-radius: 16px;
  max-width: 520px; width: 94vw;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  padding: 0;
  margin: auto; inset: 0;
  max-height: 90vh; overflow-y: auto;
}
dialog::backdrop { background: rgba(0,0,0,.65); }
.editor-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px 0;
}
.editor-header h3 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 400; color: var(--accent);
  letter-spacing: .04em;
}
.close-btn {
  background: none; border: none;
  color: var(--text-dim); font-size: 18px; cursor: pointer;
  padding: 4px 8px;
}
.editor-body {
  padding: 16px 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.editor-body label { display: flex; flex-direction: column; gap: 4px; }
.editor-body label.full { grid-column: 1 / -1; }
.editor-body span { font-size: 12px; color: var(--text-dim); }
.editor-body input, .editor-body select, .editor-body textarea {
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px;
  font-family: var(--font-body);
}
.editor-body input:focus, .editor-body select:focus, .editor-body textarea:focus {
  outline: none; border-color: var(--accent);
}
.editor-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--border);
}
.spacer { flex: 1; }
.ghost-btn, .primary-btn, .danger-btn {
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-body); cursor: pointer;
}
.ghost-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); }
.primary-btn { background: var(--accent); border: none; color: var(--bg); font-weight: 500; }
.danger-btn { background: none; border: 1px solid var(--red); color: var(--red); }

.smart-select-wrap { display: flex; gap: 6px; align-items: center; }
.smart-select-wrap select { flex: 1; min-width: 0; }
.smart-manage-btn {
  flex-shrink: 0; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text-dim); cursor: pointer;
}
.smart-input {
  margin-top: 6px; padding: 9px 12px; width: 100%;
  background: var(--surface2); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
}
.smart-manager-body { padding: 12px 16px; max-height: 50vh; overflow-y: auto; }
.smart-manager-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.smart-manager-name { flex: 1; font-size: 15px; }
.smart-manager-count { font-size: 12px; color: var(--text-dim); }
.smart-manager-actions { display: flex; gap: 4px; }
.smart-manager-action {
  width: 32px; height: 32px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); cursor: pointer;
}
.smart-manager-empty { text-align: center; color: var(--text-dim); padding: 24px 0; }

.detail-meta { padding: 8px 20px 4px; font-size: 13px; color: var(--text-muted); }
.run-list { padding: 8px 16px 4px; max-height: 50vh; overflow-y: auto; }
.run-row {
  display: grid;
  grid-template-columns: 88px 1fr auto 28px;
  gap: 8px; align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.run-row .d { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.run-row .n { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-row .k {
  font-family: var(--font-mono); color: var(--accent);
  letter-spacing: .04em;
}
.row-x {
  width: 28px; height: 28px;
  border: none; background: none;
  color: var(--text-dim); cursor: pointer; font-size: 18px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.cards .card:nth-child(1) { animation-delay: 0s; }
.cards .card:nth-child(2) { animation-delay: .03s; }
.cards .card:nth-child(3) { animation-delay: .06s; }

@media (max-width: 520px) {
  .editor-body { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
}
@media (display-mode: standalone) {
  .topbar { padding-top: 56px; }
  .editor-header { padding-top: 56px; }
}
