/* =============================================================
   安达万车 · 手机端样式（移动优先，无需构建工具）
   ============================================================= */

:root {
  --brand:        #0b4cc4;
  --brand-deep:   #06327f;
  --brand-light:  #1668ff;
  --ink:          #16202e;
  --ink-2:        #4c5a6b;
  --ink-3:        #8592a2;
  --line:         #e6eaf0;
  --bg:           #f2f5f9;
  --card:         #ffffff;
  --ok:           #0f9d58;
  --ok-bg:        #e8f6ee;
  --warn:         #d97c06;
  --warn-bg:      #fdf3e3;
  --bad:          #d93025;
  --bad-bg:       #fdecea;
  --hold:         #5a6c8b;
  --hold-bg:      #edf1f7;
  --radius:       14px;
  --shadow:       0 2px 10px rgba(16, 34, 68, .06);
}

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部 ---------- */
.hero {
  background: linear-gradient(160deg, var(--brand-deep) 0%, var(--brand) 52%, var(--brand-light) 100%);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 18px 30px;
  border-radius: 0 0 22px 22px;
}

.hero-inner { max-width: 460px; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 9px; }

.brand-mark {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, .16);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 17px; letter-spacing: 1px; }
.brand-text small { font-size: 11.5px; opacity: .82; }

.hero-title {
  margin: 20px 0 6px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.32;
}
.hero-title span { opacity: .92; }

.hero-desc {
  margin: 0;
  font-size: 13px;
  opacity: .85;
  line-height: 1.6;
}

/* ---------- 主体 ---------- */
.wrap {
  max-width: 460px;
  margin: -16px auto 0;
  padding: 0 14px 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.notice {
  background: #fff8e6;
  border: 1px solid #f2d391;
  color: #7a5200;
  font-size: 12.5px;
  line-height: 1.6;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.notice code { font-size: 12px; }

/* ---------- 车牌输入 ---------- */
.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.plate-field {
  position: relative;
  display: flex;
  align-items: center;
  background: #f7f9fc;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  transition: border-color .18s, background .18s;
}

.plate-field.is-focus {
  border-color: var(--brand-light);
  background: #fff;
}

.plate-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  /* 右侧预留「清空 + 选省」两个按钮的位置，避免文字被遮挡 */
  padding: 14px 118px 14px 14px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--ink);
  text-transform: uppercase;
  font-family: inherit;
}
.plate-field input::placeholder {
  color: #b3bdca;
  font-weight: 500;
  letter-spacing: 1px;
}

.btn-clear,
.btn-prov {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
}

.btn-clear { right: 82px; width: 30px; height: 30px; z-index: 2; }
.btn-clear:active { color: var(--ink-2); }

.btn-prov {
  position: absolute;
  right: 8px;
  z-index: 2;
  height: 34px;
  padding: 0 10px;
  gap: 4px;
  border-radius: 8px;
  background: #eaf0fb;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}
.btn-prov[aria-expanded="true"] { background: var(--brand); color: #fff; }

/* 省份快捷选择 */
.province-panel { margin-top: 10px; }
.province-tip { margin: 0 0 8px; font-size: 12px; color: var(--ink-3); }

.province-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
}

.prov {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafd;
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .1s, background .1s;
}
.prov:active { background: var(--brand); color: #fff; transform: scale(.94); }

.field-help {
  margin: 9px 2px 14px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.55;
}

/* ---------- 查询按钮 ---------- */
.form-error {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bad-bg);
  color: var(--bad);
  font-size: 13px;
  line-height: 1.5;
}

.btn-submit {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .12s, opacity .18s;
}
.btn-submit:active { transform: scale(.985); }
.btn-submit[disabled] { opacity: .72; cursor: default; }

.spinner {
  display: none;
  width: 17px; height: 17px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-submit.is-loading .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 最近查询 ---------- */
.history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.history-label { font-size: 12px; color: var(--ink-3); }
.history-list { display: flex; gap: 7px; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--line);
  background: #f7f9fc;
  color: var(--ink-2);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.chip:active { background: #e8effc; color: var(--brand); }

/* ---------- 结果区 ---------- */
.result-zone { margin-bottom: 12px; }

.empty-card { text-align: center; padding: 26px 18px; }
.empty-ico { color: #cdd7e4; margin-bottom: 6px; }
.empty-card h2 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.empty-card p { margin: 0 auto; font-size: 13px; color: var(--ink-3); max-width: 300px; }

.demo { margin-top: 16px; }
.demo > span { font-size: 12px; color: var(--ink-3); }
.demo-list { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 8px; }
.demo-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--brand);
  font-family: inherit;
  cursor: pointer;
}
.demo-item:active { background: #eaf1fd; }

/* 结果卡片 */
.result-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .28s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.result-head {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.plate-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #1e4fa0;
  color: #fff;
  border: 1px solid #16407f;
}

.status-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 20px;
}
.status-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.s-valid    { background: var(--ok-bg);   color: var(--ok); }
.s-expiring { background: var(--warn-bg); color: var(--warn); }
.s-expired  { background: var(--bad-bg);  color: var(--bad); }
.s-pending  { background: var(--hold-bg); color: var(--hold); }
.s-none     { background: var(--hold-bg); color: var(--hold); }

/* 剩余天数主视觉 */
.result-main { padding: 0 16px 6px; text-align: center; }

.big-num { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.big-num b { font-size: 46px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; }
.big-num i { font-style: normal; font-size: 15px; color: var(--ink-2); }
.result-main .cap { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.c-valid    b { color: var(--ok); }
.c-expiring b { color: var(--warn); }
.c-expired  b { color: var(--bad); }
.c-pending  b { color: var(--hold); }
.c-none     b { color: var(--ink-2); }

/* 进度条 */
.progress { margin: 14px 16px 4px; }
.progress-bar {
  height: 7px;
  border-radius: 6px;
  background: #eef1f6;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  transition: width .6s cubic-bezier(.22, .61, .36, 1);
}
.f-valid    { background: linear-gradient(90deg, #16a86a, #0f9d58); }
.f-expiring { background: linear-gradient(90deg, #f0a52a, #d97c06); }
.f-expired  { background: linear-gradient(90deg, #ea5a4d, #d93025); }
.f-pending,
.f-none     { background: #9fabbd; }
.progress-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 6px;
}

/* 日期明细 */
.date-rows { margin: 10px 16px 0; border-top: 1px solid var(--line); }
.date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.date-row:last-child { border-bottom: 0; }
.date-row span { color: var(--ink-2); }
.date-row b { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .3px; }

/* 提示条 */
.result-tip {
  margin: 12px 16px 16px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  gap: 8px;
}
.result-tip svg { flex-shrink: 0; margin-top: 2px; }
.t-valid    { background: var(--ok-bg);   color: #0a7040; }
.t-expiring { background: var(--warn-bg); color: #8a5204; }
.t-expired  { background: var(--bad-bg);  color: #a3231b; }
.t-pending,
.t-none     { background: var(--hold-bg); color: #43536e; }

/* 结果卡片底部操作区：支持两个并排按钮 */
.result-actions {
  display: flex;
  border-top: 1px solid var(--line);
}
.result-actions .btn-again {
  flex: 1;
  border-top: 0;
  border-radius: 0;
}
.result-actions .btn-again + .btn-again { border-left: 1px solid var(--line); }
.btn-again {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn-again:active { background: #eef3fb; }

/* 骨架屏 */
.skeleton { padding: 16px; }
.sk-line {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #eef1f6 25%, #e2e8f1 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- 说明与页脚 ---------- */
.info-title { margin: 0 0 8px; font-size: 15px; }
.info-list { margin: 0; padding: 0; list-style: none; }
.info-list li {
  position: relative;
  padding-left: 14px;
  font-size: 12.8px;
  color: var(--ink-2);
  line-height: 1.75;
}
.info-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #c3cede;
}
.info-list strong { color: var(--ink); }

.footer {
  max-width: 460px;
  margin: 0 auto;
  padding: 6px 16px calc(26px + env(safe-area-inset-bottom));
  text-align: center;
}

.btn-tel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 22px;
  background: #fff;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.btn-tel:active { background: #eef3fb; }

.copyright { margin: 12px 0 0; font-size: 11.5px; color: var(--ink-3); }

/* 小屏适配（iPhone SE 等） */
@media (max-width: 340px) {
  .province-grid { grid-template-columns: repeat(6, 1fr); }
  .hero-title { font-size: 22px; }
  .big-num b { font-size: 40px; }
}

/* 平板 / PC 上居中显示，保持手机版式 */
@media (min-width: 768px) {
  .hero { border-radius: 0 0 26px 26px; }
  body { background: #e9edf3; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
