/* ==========================================================================
   卡车帝国 · 通用元件
   卡片 / 按钮 / 徽标 / 进度条 / 输入 / 分段控件 / 模态 / 手机壳 / Toast
   ========================================================================== */

/* ==========================================================================
   1. 卡片与面板
   ========================================================================== */
.card-glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card), var(--inset-line);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card), var(--inset-line);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card), var(--inset-line);
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-hairline);
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.panel__title-icon {
  color: var(--amber);
}

.panel__sub {
  font-size: 11.5px;
  color: var(--text-mute);
}

.panel__body {
  padding: 14px 16px;
}

.panel__body--flush {
  padding: 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.section-title__meta {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-mute);
}

.hairline {
  height: 1px;
  background: var(--border-hairline);
}

/* ==========================================================================
   2. 按钮
   ========================================================================== */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: var(--border);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition:
    background var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease),
    box-shadow var(--dur-1) var(--ease),
    transform var(--dur-1) var(--ease),
    filter var(--dur-1) var(--ease);
  user-select: none;
}

.btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  filter: saturate(0.6);
}

.btn__icon {
  display: grid;
  place-items: center;
  color: currentColor;
  opacity: 0.92;
}

.btn--primary {
  --btn-bg: linear-gradient(180deg, var(--amber-2), var(--amber));
  --btn-fg: #201503;
  --btn-border: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-amber), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffc65c, var(--amber-2));
  border-color: rgba(255, 255, 255, 0.24);
  filter: brightness(1.02);
}

.btn--primary:focus-visible {
  box-shadow: var(--focus-ring), var(--shadow-amber);
}

.btn--soft {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: var(--border);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-dim);
  --btn-border: var(--border);
}

.btn--ghost:hover:not(:disabled) {
  --btn-fg: var(--text);
  background: var(--surface-2);
}

.btn--teal {
  --btn-bg: var(--teal-weak);
  --btn-fg: var(--teal-2);
  --btn-border: var(--teal-line);
}

.btn--teal:hover:not(:disabled) {
  background: rgba(45, 212, 191, 0.2);
}

.btn--danger {
  --btn-bg: var(--danger-weak);
  --btn-fg: var(--danger-2);
  --btn-border: var(--danger-line);
}

.btn--danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.2);
}

.btn--solid-danger {
  --btn-bg: var(--danger);
  --btn-fg: #fff;
  --btn-border: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px -14px rgba(244, 63, 94, 0.7);
}

.btn--solid-danger:hover:not(:disabled) {
  background: #ff5571;
}

.btn--sm {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12.5px;
  gap: 5px;
}

.btn--xs {
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11.5px;
  gap: 4px;
}

.btn--lg {
  height: 46px;
  padding: 0 22px;
  border-radius: 13px;
  font-size: 14.5px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
}

.btn--icon.btn--sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.btn--pressed {
  --btn-bg: var(--amber-weak);
  --btn-fg: var(--amber-text);
  --btn-border: var(--amber-line);
}

.btn--link {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--amber-text);
  font-size: 12.5px;
  font-weight: 600;
}

.btn--link:hover:not(:disabled) {
  background: none;
  color: var(--amber-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

/* ==========================================================================
   3. 徽标 / 标签
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  color: var(--text-dim);
  background: var(--surface-2);
}

.badge--amber {
  color: var(--amber-text);
  background: var(--amber-weak);
  border-color: var(--amber-line);
}

.badge--teal {
  color: var(--teal-2);
  background: var(--teal-weak);
  border-color: var(--teal-line);
}

.badge--danger {
  color: var(--danger-2);
  background: var(--danger-weak);
  border-color: var(--danger-line);
}

.badge--warn {
  color: #fbbf24;
  background: var(--warn-weak);
  border-color: rgba(245, 158, 11, 0.4);
}

.badge--ok {
  color: var(--ok);
  background: var(--ok-weak);
  border-color: rgba(52, 211, 153, 0.36);
}

.badge--muted {
  color: var(--text-mute);
  background: var(--surface);
  border-color: var(--border);
}

.badge--solid {
  color: #1b1204;
  background: var(--amber);
  border-color: rgba(255, 255, 255, 0.2);
}

.badge--lg {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

.badge__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.badge--loan {
  height: 26px;
  gap: 6px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--amber-text);
  background: var(--amber-weak);
  border-color: var(--amber-line);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}

.badge--loan:hover {
  background: var(--amber-weak-2);
  border-color: var(--amber);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ==========================================================================
   4. 进度条 / 仪表
   ========================================================================== */
.progress {
  position: relative;
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.progress__fill {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber), var(--amber-2));
  box-shadow: 0 0 12px -2px var(--amber-glow);
  transition: width 420ms var(--ease-out), background var(--dur-2) var(--ease);
}

.progress--teal .progress__fill {
  background: linear-gradient(90deg, #0f766e, var(--teal));
  box-shadow: 0 0 12px -2px rgba(45, 212, 191, 0.5);
}

.progress--danger .progress__fill {
  background: linear-gradient(90deg, #9f1239, var(--danger));
  box-shadow: 0 0 12px -2px rgba(244, 63, 94, 0.5);
}

.progress--thick {
  height: 9px;
}

.progress--thin {
  height: 4px;
}

.progress__label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 6px;
}

/* 耐久 / 疲劳 条 */
.meter {
  display: grid;
  gap: 5px;
}

.meter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.meter__name {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meter__value {
  color: var(--text-soft);
  font-size: 11.5px;
}

.meter__track {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.meter__fill {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.55), var(--teal));
  transition: width 380ms var(--ease-out), background 200ms var(--ease);
}

.meter[data-level="warn"] .meter__fill {
  background: linear-gradient(90deg, rgba(245, 165, 36, 0.5), var(--amber));
}

.meter[data-level="danger"] .meter__fill {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.5), var(--danger));
  box-shadow: 0 0 14px -3px rgba(244, 63, 94, 0.8);
}

.meter[data-level="danger"] .meter__value {
  color: var(--danger-2);
}

.meter[data-level="warn"] .meter__value {
  color: var(--amber-text);
}

.meter[data-level="danger"] .meter__name {
  animation: danger-blink 1.1s steps(2, jump-none) infinite;
}

@keyframes danger-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}

/* 环形成分（油量） */
.gauge {
  --p: 0;
  --gauge-size: 96px;
  position: relative;
  width: var(--gauge-size);
  height: var(--gauge-size);
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--amber) calc(var(--p) * 1%), rgba(255, 255, 255, 0.07) 0);
  transition: background 400ms var(--ease-out);
}

.gauge::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #16203300, #0d1524 70%), var(--bg-elevated);
  border: 1px solid var(--border-hairline);
}

.gauge__content {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1px;
  text-align: center;
  z-index: 1;
}

.gauge__value {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}

.gauge__unit {
  font-size: 10.5px;
  color: var(--text-mute);
}

.gauge--low {
  background: conic-gradient(var(--danger) calc(var(--p) * 1%), rgba(255, 255, 255, 0.07) 0);
}

/* ==========================================================================
   5. 表单
   ========================================================================== */
.field {
  display: grid;
  gap: 6px;
}

.field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.field__optional {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-mute);
}

.field__hint {
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.45;
}

.field__error {
  font-size: 11.5px;
  color: var(--danger-2);
  line-height: 1.45;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  background: rgba(5, 10, 19, 0.55);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  transition:
    border-color var(--dur-1) var(--ease),
    box-shadow var(--dur-1) var(--ease),
    background var(--dur-1) var(--ease);
  min-width: 0;
}

.input::placeholder {
  color: var(--text-mute);
}

.input:hover,
.select:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--amber-line);
  background: rgba(5, 10, 19, 0.75);
  box-shadow: 0 0 0 3px var(--amber-weak);
}

.input[aria-invalid="true"] {
  border-color: var(--danger-line);
  box-shadow: 0 0 0 3px var(--danger-weak);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap .input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 5px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-mute);
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}

.password-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.password-toggle[aria-pressed="true"] {
  color: var(--amber-text);
}

.input:disabled {
  opacity: 0.55;
}

.input--num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2393a1b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  appearance: none;
  cursor: pointer;
}

.select option {
  background: var(--bg-elevated);
  color: var(--text);
}

/* 搜索框 */
.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search__icon {
  position: absolute;
  left: 12px;
  color: var(--text-mute);
  pointer-events: none;
}

.search .input {
  padding-left: 34px;
}

/* 滑块 */
.range {
  width: 100%;
  height: 22px;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(
    90deg,
    var(--amber) 0 var(--p, 50%),
    rgba(255, 255, 255, 0.08) var(--p, 50%) 100%
  );
}

.range::-moz-range-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
}

.range::-moz-range-progress {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--amber);
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff8ec;
  border: 4px solid var(--amber);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}

.range:hover::-webkit-slider-thumb {
  transform: scale(1.06);
}

.range:focus-visible::-webkit-slider-thumb,
.range:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px var(--amber-weak), 0 2px 10px rgba(0, 0, 0, 0.5);
}

.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff8ec;
  border: 4px solid var(--amber);
}

.range:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-dim);
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch__track {
  width: 34px;
  height: 20px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
  flex: none;
}

.switch__track::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: 2px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}

.switch input:checked + .switch__track {
  background: var(--amber-weak);
  border-color: var(--amber-line);
}

.switch input:checked + .switch__track::after {
  transform: translateX(14px);
  background: var(--amber);
}

.switch input:focus-visible + .switch__track {
  box-shadow: var(--focus-ring);
}

/* 内联错误 */
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-weak);
  border: 1px solid var(--danger-line);
  color: var(--danger-2);
  font-size: 12.5px;
  line-height: 1.45;
  animation: shake-in 240ms var(--ease);
}

@keyframes shake-in {
  0% { transform: translateX(-4px); opacity: 0; }
  40% { transform: translateX(3px); }
  70% { transform: translateX(-2px); }
  100% { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   6. 分段控件 / Tabs / Chips
   ========================================================================== */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(5, 10, 19, 0.45);
  border: 1px solid var(--border);
}

.segmented__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.segmented__item:hover {
  color: var(--text);
  background: var(--surface-2);
}

.segmented__item[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 2px 8px -4px rgba(0, 0, 0, 0.8);
}

.segmented--amber .segmented__item[aria-pressed="true"] {
  color: #1b1204;
  background: linear-gradient(180deg, var(--amber-2), var(--amber));
  box-shadow: var(--shadow-amber);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--dur-1) var(--ease);
  white-space: nowrap;
}

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

.chip[aria-pressed="true"] {
  color: var(--amber-text);
  background: var(--amber-weak);
  border-color: var(--amber-line);
}

.chip__count {
  font-size: 10.5px;
  color: var(--text-mute);
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-hairline);
}

.tab {
  position: relative;
  height: 40px;
  padding: 0 14px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
}

.tab[aria-selected="true"] {
  color: var(--text);
}

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber-glow);
}

/* ==========================================================================
   7. 信息行 / 统计
   ========================================================================== */
.kv {
  display: grid;
  gap: 7px;
}

.kv__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}

.kv__k {
  color: var(--text-mute);
  flex: none;
}

.kv__v {
  color: var(--text-soft);
  text-align: right;
}

.kv__v--strong {
  color: var(--text);
  font-weight: 600;
}

.kv__v--amber {
  color: var(--amber-text);
  font-weight: 600;
}

.kv__v--danger {
  color: var(--danger-2);
}

.stat {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-hairline);
}

.stat__k {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}

.stat__v {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.stat__v--amber {
  color: var(--amber-text);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* ==========================================================================
   8. 警告 / 提示
   ========================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-soft);
}

.alert__icon {
  flex: none;
  margin-top: 1px;
}

.alert__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.alert__title {
  font-weight: 600;
  color: var(--text);
}

.alert--danger {
  background: var(--danger-weak);
  border-color: var(--danger-line);
  color: #ffd7de;
}

.alert--danger .alert__title {
  color: #fff;
}

.alert--warn {
  background: var(--warn-weak);
  border-color: rgba(245, 158, 11, 0.38);
  color: #ffe6b8;
}

.alert--info {
  background: var(--info-weak);
  border-color: rgba(96, 165, 250, 0.32);
  color: #d5e4ff;
}

.alert--ok {
  background: var(--ok-weak);
  border-color: rgba(52, 211, 153, 0.32);
  color: #c9f7e5;
}

.eyebrow-amber {
  color: var(--amber-text);
}

/* ==========================================================================
   9. 时间线
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 18px;
  display: grid;
  overflow-y: auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, var(--border-strong), transparent);
}

.timeline__item {
  position: relative;
  padding: 0 0 13px 4px;
  animation: fade-up 240ms var(--ease-out);
}

.timeline__item:last-child {
  padding-bottom: 2px;
}

.timeline__dot {
  position: absolute;
  left: -17px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-mute);
  box-shadow: 0 0 0 3px var(--bg);
}

.timeline__item[data-severity="warn"] .timeline__dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--bg), 0 0 12px rgba(245, 165, 36, 0.7);
}

.timeline__item[data-severity="danger"] .timeline__dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--bg), 0 0 12px rgba(244, 63, 94, 0.8);
}

.timeline__item[data-severity="success"] .timeline__dot {
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--bg), 0 0 12px rgba(45, 212, 191, 0.7);
}

.timeline__time {
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

.timeline__title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.4;
}

.timeline__detail {
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.5;
}

.timeline__meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-mute);
}

/* ==========================================================================
   10. 模态
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 11, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade-in var(--dur-2) var(--ease);
}

.modal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(540px, 100%);
  max-height: min(88dvh, 940px);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(24, 34, 52, 0.98), rgba(11, 18, 31, 0.99));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
  animation: modal-in 230ms var(--ease-out);
  overflow: hidden;
}

.modal--wide .modal__dialog {
  width: min(760px, 100%);
}

.modal--sm .modal__dialog {
  width: min(400px, 100%);
}

.modal__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  padding: 18px 20px 13px;
  border-bottom: 1px solid var(--border-hairline);
}

.modal__heading {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 180px;
}

.modal__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.modal__sub {
  font-size: 12px;
  color: var(--text-mute);
}

.modal__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--text-mute);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--dur-1) var(--ease);
}

.modal__close:hover {
  color: var(--text);
  background: var(--surface-3);
}

.modal__body {
  padding: 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 20px 17px;
  border-top: 1px solid var(--border-hairline);
  background: rgba(5, 10, 18, 0.25);
}

.modal__foot--split {
  justify-content: space-between;
}

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

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

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .modal {
    padding: 0;
    align-items: end;
  }

  .modal__dialog,
  .modal--wide .modal__dialog,
  .modal--sm .modal__dialog {
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0;
    animation: sheet-in 250ms var(--ease-out);
  }

  .modal__foot {
    padding-bottom: calc(17px + env(safe-area-inset-bottom, 0px));
  }
}

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

/* ==========================================================================
   11. Toast
   ========================================================================== */
.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-toast);
  display: grid;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px 11px 15px;
  border-radius: 12px;
  background: rgba(19, 29, 47, 0.94);
  border: 1px solid var(--border-strong);
  box-shadow: 0 22px 50px -22px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
  pointer-events: auto;
  animation: toast-in 210ms var(--ease-out);
  overflow: hidden;
}

.toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--info);
}

.toast--success::before { background: var(--teal); }
.toast--error::before { background: var(--danger); }
.toast--warn::before { background: var(--amber); }

.toast__icon {
  flex: none;
  margin-top: 1px;
  color: var(--info);
}

.toast--success .toast__icon { color: var(--teal); }
.toast--error .toast__icon { color: var(--danger-2); }
.toast--warn .toast__icon { color: var(--amber); }

.toast__body {
  min-width: 0;
  flex: 1;
}

.toast__title {
  font-weight: 600;
  color: var(--text);
  font-size: 12.5px;
}

.toast__text {
  font-size: 12px;
  color: var(--text-dim);
}

.toast.is-leaving {
  animation: toast-out 180ms var(--ease) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(4px) scale(0.98); }
}

@media (max-width: 959px) {
  .toast-host {
    right: 12px;
    left: 12px;
    bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}

/* ==========================================================================
   12. 手机壳（订单卡的呈现容器）
   ========================================================================== */
.phone {
  position: relative;
  padding: 7px;
  border-radius: var(--r-phone);
  background: linear-gradient(165deg, #202c42 0%, #131d2e 42%, #0b1320 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 24px 48px -30px rgba(0, 0, 0, 0.95);
}

.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.14), transparent 34%, transparent 72%, rgba(255, 255, 255, 0.05));
  opacity: 0.55;
}

.phone__screen {
  position: relative;
  border-radius: 22px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(37, 55, 84, 0.55), transparent 62%),
    linear-gradient(180deg, #0d1626 0%, #0a1220 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  isolation: isolate;
}

.phone__notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 20px;
  border-radius: 999px;
  background: #060b13;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.phone__speaker {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.phone__status {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 14px 0;
  font-size: 11px;
  color: var(--text-soft);
}

.phone__time {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-soft);
}

.phone__indicators {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
}

.signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.signal i {
  width: 2px;
  border-radius: 1px;
  background: currentColor;
}

.signal i:nth-child(1) { height: 3px; }
.signal i:nth-child(2) { height: 5px; }
.signal i:nth-child(3) { height: 7px; }
.signal i:nth-child(4) { height: 9px; }

.phone__net {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.phone__battery {
  position: relative;
  width: 18px;
  height: 9px;
  border-radius: 2.5px;
  border: 1px solid currentColor;
  opacity: 0.8;
}

.phone__battery::after {
  content: "";
  position: absolute;
  inset: 1px;
  right: 4px;
  border-radius: 1px;
  background: currentColor;
}

/* ==========================================================================
   13. 星级 / 小图标 / 杂项
   ========================================================================== */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--amber);
  line-height: 1;
}

.stars__off {
  color: rgba(255, 255, 255, 0.14);
}

.stars__label {
  margin-left: 4px;
  color: var(--text-mute);
  font-size: 10.5px;
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--amber);
  animation: spin 0.75s linear infinite;
}

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

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 13px;
  transition: opacity 260ms var(--ease), visibility 260ms;
}

.boot.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--amber);
  animation: spin 0.8s linear infinite;
}

/* 加载按钮态 */
.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}

.btn--soft.is-loading::after,
.btn--ghost.is-loading::after,
.btn--danger.is-loading::after {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: var(--text);
}

/* 数据表 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  padding: 0 8px 8px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.data-table td {
  padding: 9px 8px 9px 0;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table .num {
  text-align: right;
}

.data-table th.num {
  text-align: right;
}

/* ==========================================================================
   14. 城市选择器
   ========================================================================== */
.city-picker {
  display: grid;
  gap: 12px;
}

.city-picker__filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 8px;
}

.city-picker__filters .select {
  height: 42px;
  font-size: 12.5px;
}

.city-picker__scroll {
  min-height: 220px;
  max-height: min(46dvh, 380px);
  overflow-y: auto;
  border-radius: 12px;
  background: rgba(5, 10, 19, 0.35);
  border: 1px solid var(--border-hairline);
  padding: 6px;
}

.city-picker__list {
  display: grid;
  gap: 2px;
}

.city-picker__list.is-loading {
  opacity: 0.55;
}

.city-picker__status {
  padding: 8px 6px;
}

.city-picker__hint {
  margin: 0;
  padding-top: 9px;
  border-top: 1px solid var(--border-hairline);
  line-height: 1.55;
  color: var(--text-dim);
}

.city-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.city-option:hover {
  background: var(--surface-2);
}

.city-option:focus-visible {
  background: var(--surface-2);
  box-shadow: var(--focus-ring);
}

.city-option__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--text-mute);
  background: var(--surface);
  flex: none;
}

.city-option__body {
  display: grid;
  gap: 0;
  min-width: 0;
  flex: 1;
}

.city-option__name {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}

.city-option__meta {
  font-size: 10.5px;
  color: var(--text-mute);
}

.city-option__check {
  color: var(--amber);
  flex: none;
}

.city-option[aria-selected="true"] {
  background: var(--amber-weak);
}

.city-option[aria-selected="true"] .city-option__icon {
  color: var(--amber);
}

.city-option[aria-selected="true"] .city-option__name {
  color: var(--amber-text);
}

@media (max-width: 520px) {
  .city-picker__filters {
    grid-template-columns: 1fr;
  }
}

