/* R130 车险到期提醒H5 · style.css */

:root {
  --color-primary: #1A73E8;
  --color-accent: #FF6D00;
  --color-success: #34A853;
  --color-warning: #FBBC04;
  --color-danger: #EA4335;
  --bg-page: #F0F4F8;
  --bg-card: #FFFFFF;
  --text-primary: #202124;
  --text-secondary: #5F6368;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --contact-footer-h: 72px;
  --font-stack: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-stack);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
body.has-contact-footer { padding-bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom)); }
body.has-contact-footer .zw-root .zw-fab { bottom: calc(var(--contact-footer-h) + 12px + env(safe-area-inset-bottom)); }
button, input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--text-secondary); font-size: 0.9rem; }
.hint { font-size: 0.85rem; color: var(--text-secondary); margin-top: 12px; }

.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; color: var(--text-secondary);
}
.loading-spinner {
  width: 36px; height: 36px; border: 3px solid #ddd; border-top-color: var(--color-primary);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-card); border-bottom: 1px solid #e8eaed;
  position: sticky; top: 0; z-index: 50;
}
.app-header h1 { font-size: 1rem; font-weight: 700; flex: 1; text-align: center; }
.btn-back {
  width: 36px; height: 36px; border: none; background: none; font-size: 1.2rem; cursor: pointer;
}
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn, .bell-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #ddd;
  background: var(--bg-card); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; font-size: 1rem;
}
.bell-btn.bell-alert { animation: bellShake 0.5s ease 2; }
.bell-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  background: var(--color-danger); color: #fff; font-size: 0.65rem; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
@keyframes bellShake { 0%,100%{transform:rotate(0)} 25%{transform:rotate(15deg)} 75%{transform:rotate(-15deg)} }

.hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 24px 20px; margin: 0 0 8px;
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 72%, #000));
  color: #fff; border-radius: 0 0 var(--radius) var(--radius);
}
.hero-empty { flex-direction: column; text-align: center; }
.hero.pulse-urgent { animation: urgentPulse 2s ease infinite; }
@keyframes urgentPulse { 0%,100%{box-shadow:inset 0 0 0 0 rgba(234,67,53,0.3)} 50%{box-shadow:inset 0 0 0 8px rgba(234,67,53,0.15)} }
.hero-ring { flex-shrink: 0; }
.hero-text { flex: 1; min-width: 140px; }
.hero-plate { font-size: 1.4rem; font-weight: 700; letter-spacing: 0.05em; }
.hero-status { font-size: 1.1rem; margin: 4px 0; }
.hero-sub { opacity: 0.9; font-size: 0.85rem; }
.hero-dots { width: 100%; display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.hero-dots .dot {
  width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,0.4); cursor: pointer;
}
.hero-dots .dot.active { background: #fff; transform: scale(1.2); }

.countdown-ring { display: block; }
.countdown-ring__bg { fill: none; stroke: rgba(255,255,255,0.25); stroke-width: 8; }
.countdown-ring__progress {
  fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 60px 60px; transition: stroke-dashoffset 0.8s ease;
}
.countdown-ring__progress.urgent { stroke: var(--color-warning); }
.countdown-ring__progress.expired { stroke: var(--color-danger); }
.ring-num { fill: #fff; font-size: 28px; font-weight: 700; font-family: var(--font-stack); }
.ring-label { fill: rgba(255,255,255,0.85); font-size: 12px; font-family: var(--font-stack); }
.mini-ring { vertical-align: middle; margin-right: 6px; }
.mini-ring circle { fill: none; stroke-width: 4; }
.mini-ring .bg { stroke: #e8eaed; }
.mini-ring .fg { stroke: var(--color-primary); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 24px 24px; }

.section { padding: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.section-head__actions { display: flex; align-items: center; gap: 8px; }
.btn-text {
  padding: 6px 10px; border: none; background: none; color: var(--color-primary);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.section-head h2, .section h2 { font-size: 1.05rem; font-weight: 700; }
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
.view-toggle { display: flex; gap: 4px; background: #e8eaed; border-radius: 999px; padding: 2px; }
.vt-btn {
  padding: 6px 12px; border: none; background: transparent; border-radius: 999px;
  font-size: 0.75rem; cursor: pointer; color: var(--text-secondary);
}
.vt-btn.active { background: var(--bg-card); color: var(--color-primary); font-weight: 600; box-shadow: var(--shadow); }

.vehicle-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.vehicle-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  animation: cardIn 0.4s ease both;
}
.vehicle-card:active { transform: scale(0.98); }
.vehicle-card--urgent { border-left: 4px solid var(--color-warning); }
.vehicle-card--expired { border-left: 4px solid var(--color-danger); }
.vehicle-card--warning { border-left: 4px solid var(--color-accent); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.vc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.vc-icon { font-size: 1.5rem; }
.vc-tag { font-size: 0.65rem; }
.vehicle-card h3 { font-size: 1rem; font-weight: 700; letter-spacing: 0.04em; }
.vc-brand, .vc-company { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.vc-bottom { display: flex; align-items: center; margin-top: 10px; font-size: 0.8rem; color: var(--text-secondary); }

.empty-state { text-align: center; padding: 32px 16px; color: var(--text-secondary); }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }

.detail-page .policy-list { margin: 16px 0; }
.policy-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: 12px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow);
}
.policy-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.policy-actions button {
  padding: 4px 8px; font-size: 0.7rem; border: 1px solid #ddd; background: var(--bg-card);
  border-radius: 6px; cursor: pointer;
}
.status-pill { font-size: 0.75rem; font-weight: 600; white-space: nowrap; }

.channel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.channel-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 12px;
  background: var(--bg-card); border: 1px solid #e8eaed; border-radius: var(--radius);
  cursor: pointer; transition: transform 0.2s, border-color 0.2s;
}
.channel-card:active { transform: scale(0.97); border-color: var(--color-primary); }
.ch-icon { font-size: 1.8rem; }

.tip-card { background: var(--bg-card); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; box-shadow: var(--shadow); }
.tip-q {
  width: 100%; text-align: left; padding: 14px 16px; background: none; border: none;
  font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
.tip-card__answer {
  max-height: 0; overflow: hidden; transition: max-height 0.35s ease;
  padding: 0 16px; color: var(--text-secondary); font-size: 0.85rem;
}
.tip-card.open .tip-card__answer { max-height: 200px; padding-bottom: 14px; }

.timeline { border-left: 3px solid var(--color-primary); margin-left: 12px; padding-left: 20px; }
.timeline-node {
  position: relative; margin-bottom: 20px; opacity: 0; transform: translateX(-8px);
  transition: opacity 0.4s, transform 0.4s;
}
.timeline-node.visible { opacity: 1; transform: translateX(0); }
.timeline-node::before {
  content: ''; position: absolute; left: -27px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--color-primary);
}
.timeline-node--urgent::before, .timeline-node--expired::before { background: var(--color-danger); }
.timeline-node--warning::before { background: var(--color-warning); }
.timeline-node time { font-size: 0.75rem; color: var(--text-secondary); }
.timeline-node strong { display: block; margin: 4px 0; font-size: 0.95rem; }
.timeline-node p { font-size: 0.85rem; color: var(--text-secondary); }

.node-row { display: block; padding: 10px 0; border-bottom: 1px solid #eee; cursor: pointer; }
.theme-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.theme-chip {
  padding: 8px 14px; border: 1px solid #ddd; border-radius: 999px; background: var(--bg-card);
  cursor: pointer; font-size: 0.8rem; text-transform: capitalize;
}
.theme-chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: var(--radius); font-weight: 600;
  cursor: pointer; border: none; font-size: 0.95rem; text-align: center;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-outline { background: var(--bg-card); color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-renew {
  margin-top: 12px; padding: 10px 20px; background: var(--color-accent); color: #fff;
  border: none; border-radius: 999px; font-weight: 700; cursor: pointer;
}
.detail-page .btn { width: 100%; margin-top: 8px; }
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.detail-icon { font-size: 2.5rem; }
.detail-actions { display: flex; gap: 8px; margin-top: 16px; }
.detail-actions .btn { flex: 1; margin-top: 0; }
.btn-danger { background: var(--bg-card); color: var(--color-danger); border: 1px solid var(--color-danger); }

.manage-summary { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.manage-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.manage-item {
  display: flex; align-items: stretch; background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.manage-item__main {
  flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px;
  border: none; background: none; text-align: left; cursor: pointer; min-width: 0;
}
.manage-item__main:active { background: rgba(0,0,0,0.03); }
.manage-icon { font-size: 1.8rem; flex-shrink: 0; }
.manage-item__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.manage-item__text strong { font-size: 1rem; letter-spacing: 0.04em; }
.manage-item__sub { font-size: 0.75rem; color: var(--text-secondary); }
.manage-item__sub--warn { color: var(--color-danger); font-weight: 600; }
.manage-item__actions { display: flex; flex-direction: column; border-left: 1px solid #eee; }
.manage-act {
  flex: 1; padding: 0 14px; border: none; background: var(--bg-card);
  font-size: 0.75rem; color: var(--color-primary); cursor: pointer; min-width: 52px;
}
.manage-act + .manage-act { border-top: 1px solid #eee; }
.manage-act--danger { color: var(--color-danger); }
.manage-add { width: 100%; }

.fab {
  position: fixed; left: 20px; right: auto; bottom: calc(var(--contact-footer-h) + 20px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--color-primary); color: #fff; font-size: 1.8rem; font-weight: 300;
  box-shadow: 0 4px 16px rgba(26,115,232,0.4); cursor: pointer; z-index: 80;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.import-label { display: inline-block; margin-left: 8px; cursor: pointer; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--bg-card); width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border: none; background: #f0f0f0; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
}
.modal h3 { margin-bottom: 16px; font-size: 1.1rem; }
.modal label { display: block; margin-bottom: 12px; font-size: 0.85rem; color: var(--text-secondary); }
.field-input, .modal select {
  width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 1rem; background: var(--bg-card); color: var(--text-primary);
}
.form-steps { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; }
.form-steps span {
  width: 28px; height: 28px; border-radius: 50%; background: #e8eaed; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 600;
}
.form-steps span.on { background: var(--color-primary); color: #fff; }
.form-nav { display: flex; gap: 8px; margin-top: 16px; }
.form-nav .btn { flex: 1; }

#toast-container {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 300; pointer-events: none;
}
.toast {
  background: rgba(32,33,36,0.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 0.85rem; margin-bottom: 8px; animation: toastIn 0.3s ease;
}
.toast--success { background: rgba(52,168,83,0.95); }
.toast--warning { background: rgba(251,188,4,0.95); color: #202124; }
.toast--error { background: rgba(234,67,53,0.95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.contact-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: #fff; border-top: 1px solid #eee; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.contact-footer__btns {
  display: grid; grid-template-columns: repeat(3, minmax(0, 88px)); gap: 8px;
  max-width: 320px; margin: 0 auto; justify-content: center;
}
.contact-footer__cta, .contact-footer__btn {
  text-align: center; padding: 0.48rem 0.2rem; border-radius: 8px; font-size: 0.72rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.contact-footer__cta { background: #c41e1e !important; color: #fff !important; }
.contact-footer__btn { background: #f5f5f5; color: #333; border: none; cursor: pointer; }
.contact-footer__brand { margin: 6px 0 0; text-align: center; font-size: 0.65rem; color: #999; }

.share-page .share-main { max-width: 480px; margin: 0 auto; padding: 24px 16px; }
.share-hero {
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 75%, #000));
  color: #fff; border-radius: var(--radius); padding: 24px; margin-bottom: 16px; text-align: center;
}
.share-hero h1 { font-size: 1.2rem; margin: 8px 0; }
.share-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-align: center;
}
.share-card canvas { display: block; margin: 0 auto 16px; }
.share-open { display: block; margin-top: 12px; color: var(--color-primary); font-weight: 600; }

@media (min-width: 768px) {
  .section, .hero { max-width: 720px; margin-left: auto; margin-right: auto; }
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius); max-height: 80vh; }
}

@media (max-width: 374px) {
  .vehicle-list { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
}
