/* ========================================
   数字政府文档 SaaS — v2-uxpromax
   Skill: ui-ux-pro-max 资产驱动
   调色板: SaaS General (Primary #2563EB)
   字体: Lexend + Source Sans 3
   风格: Glassmorphism + Flat Design — 科技感政务
   ======================================== */

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

:root {
  --c-primary: #2563EB;
  --c-primary-dark: #1D4ED8;
  --c-primary-light: #EFF6FF;
  --c-secondary: #3B82F6;
  --c-success: #10B981;
  --c-success-bg: #D1FAE5;
  --c-cta: #F97316;
  --c-cta-bg: #FFF7ED;
  --c-bg: #F8FAFC;
  --c-surface: #FFFFFF;
  --c-border: #E2E8F0;
  --c-border-strong: #CBD5E1;
  --c-text: #1E293B;
  --c-text-secondary: #475569;
  --c-text-muted: #94A3B8;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
  --shadow-glass: 0 8px 32px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.5);

  --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-head: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;

  --tr: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --tr-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

  --c-500: #2563EB;
  --c-400: #3B82F6;
  --c-600: #1D4ED8;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--c-bg); color: var(--c-text); line-height: 1.65; min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(37,99,235,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(37,99,235,0.05) 0%, transparent 50%);
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ── Layout ─────────────────────────────────────── */
.container { max-width: 720px; margin: 0 auto; padding: 0 var(--sp-4); }
.page-main { padding: var(--sp-8) 0 var(--sp-12); }

/* ── Header ─────────────────────────────────────── */
.header { background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--glass-border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.header-brand { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.9375rem; font-weight: 700; font-family: var(--font-head); color: var(--c-text); }
.header-brand .icon { width: 22px; height: 22px; color: var(--c-primary); flex-shrink: 0; }
.header-back { display: flex; align-items: center; gap: 4px; font-size: 0.875rem; color: var(--c-text-secondary); text-decoration: none; padding: 7px 12px; border-radius: var(--radius-sm); transition: background var(--tr), color var(--tr); font-weight: 500; }
.header-back:hover { background: var(--c-primary-light); color: var(--c-primary); }

/* ── Footer ─────────────────────────────────────── */
.footer { border-top: 1px solid var(--c-border); padding: var(--sp-6) 0; text-align: center; font-size: 0.8125rem; color: var(--c-text-muted); }
.footer a { color: var(--c-text-secondary); text-decoration: none; }
.footer a:hover { color: var(--c-primary); }

/* ── Card ────────────────────────────────────────── */
.card { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-glass); padding: var(--sp-6); }
.card p { color: var(--c-text-secondary); font-size: 0.9375rem; }

/* ── Buttons ─────────────────────────────────────── */
button { cursor: pointer; font-family: var(--font); border: none; outline: none; }
button:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 22px; font-size: 0.9375rem; font-weight: 600; border-radius: var(--radius); transition: all var(--tr); min-height: 46px; white-space: nowrap; }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.30); }
.btn-primary:hover { background: var(--c-primary-dark); box-shadow: 0 4px 16px rgba(37,99,235,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.975) translateY(0); }
.btn-primary:disabled { background: var(--c-border-strong); color: var(--c-text-muted); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border: 1.5px solid var(--c-border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--c-secondary); background: var(--c-primary-light); }
.btn-cta { background: linear-gradient(135deg, #F97316, #EA580C); color: #fff; box-shadow: 0 2px 8px rgba(249,115,22,0.35); font-family: var(--font-head); }
.btn-cta:hover { box-shadow: 0 6px 20px rgba(249,115,22,0.40); transform: translateY(-1px); }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.8125rem; min-height: 36px; border-radius: var(--radius-sm); }
.btn-lg { padding: 15px 32px; font-size: 1.0625rem; min-height: 54px; border-radius: var(--radius); font-family: var(--font-head); }

/* ── Form ────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-5); }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--c-text); margin-bottom: var(--sp-2); font-family: var(--font-head); }
.form-hint { font-size: 0.8125rem; color: var(--c-text-muted); margin-top: var(--sp-1); }
.form-textarea { width: 100%; padding: var(--sp-4); font-size: 0.9375rem; font-family: var(--font); color: var(--c-text); background: rgba(255,255,255,0.8); border: 1.5px solid var(--c-border); border-radius: var(--radius); resize: vertical; min-height: 150px; transition: border-color var(--tr), box-shadow var(--tr), background var(--tr); line-height: 1.75; backdrop-filter: blur(8px); }
.form-textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(37,99,235,0.12); outline: none; background: rgba(255,255,255,0.95); }
.form-textarea::placeholder { color: var(--c-text-muted); }

/* ── Badges ──────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; font-size: 0.75rem; font-weight: 700; border-radius: 99px; letter-spacing: 0.02em; }
.badge-primary { background: var(--c-primary-light); color: var(--c-primary); }
.badge-success { background: var(--c-success-bg); color: var(--c-success); }
.badge-paid { background: var(--c-cta-bg); color: var(--c-cta); }
.badge-free { background: var(--c-success-bg); color: var(--c-success); }

/* ── Progress Ring ───────────────────────────────── */
.progress-wrap { display: flex; align-items: center; gap: var(--sp-6); }
.progress-ring { position: relative; flex-shrink: 0; }
.progress-track { fill: none; stroke: var(--c-border); stroke-width: 9; }
.progress-arc { fill: none; stroke: url(#arcGrad); stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 700ms cubic-bezier(0.4, 0, 0.2, 1); }
.progress-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.progress-pct { font-size: 1.625rem; font-weight: 700; font-family: var(--font-head); color: var(--c-primary); line-height: 1; }
.progress-status { font-size: 1rem; font-weight: 600; font-family: var(--font-head); color: var(--c-text); margin-bottom: 3px; }
.progress-sub { font-size: 0.875rem; color: var(--c-text-secondary); }

/* ── Section Label ───────────────────────────────── */
.section-label { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 700; color: var(--c-text-secondary); text-transform: uppercase; letter-spacing: 0.07em; font-family: var(--font-head); }

/* ── Doc List ────────────────────────────────────── */
.doc-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.doc-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4); background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr); }
.doc-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: rgba(37,99,235,0.15); }
.doc-item-icon { flex-shrink: 0; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--c-primary-light); border-radius: var(--radius-sm); }
.doc-item-info { flex: 1; min-width: 0; }
.doc-item-name { font-size: 0.9375rem; font-weight: 500; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-item-meta { font-size: 0.8125rem; color: var(--c-text-muted); margin-top: 2px; }
.doc-item-check { width: 18px; height: 18px; accent-color: var(--c-primary); flex-shrink: 0; cursor: pointer; }

/* ── Doc item states ─────────────────────────────── */
.doc-item-done { border-left: 3px solid var(--c-success); }
.doc-item-generating { border-left: 3px solid var(--c-primary); }
.doc-item-pending { border-left: 3px solid var(--c-border-strong); opacity: 0.55; }
.doc-item-locked { border-left: 3px solid var(--c-cta); opacity: 0.7; background: rgba(255,247,237,0.5); }

/* ── Bottom Bar ─────────────────────────────────── */
.bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--glass-border); box-shadow: 0 -4px 24px rgba(0,0,0,0.08); padding: var(--sp-4) 0; z-index: 200; }
.bottom-bar-inner { max-width: 720px; margin: 0 auto; padding: 0 var(--sp-4); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.bottom-bar-info { font-size: 0.9375rem; color: var(--c-text-secondary); }
.bottom-bar-info strong { color: var(--c-text); }
.page-main { padding-bottom: 100px; }

/* ── Stats Bar ───────────────────────────────────── */
.stats-bar { display: flex; align-items: center; background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: var(--sp-4) var(--sp-6); box-shadow: var(--shadow); }
.stat-item { flex: 1; text-align: center; }
.stat-num { font-size: 1.625rem; font-weight: 700; font-family: var(--font-head); line-height: 1; }
.stat-num.p { color: var(--c-primary); }
.stat-num.s { color: var(--c-success); }
.stat-num.a { color: var(--c-cta); }
.stat-label { font-size: 0.8125rem; color: var(--c-text-muted); margin-top: 4px; font-weight: 500; }
.stat-div { width: 1px; height: 40px; background: var(--c-border); }

/* ── Pay Methods ─────────────────────────────────── */
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.pay-method { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-5) var(--sp-3); background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1.5px solid var(--c-border); border-radius: var(--radius); cursor: pointer; transition: all var(--tr-spring); font-size: 0.875rem; font-weight: 600; color: var(--c-text-secondary); font-family: var(--font-head); }
.pay-method:hover { border-color: var(--c-secondary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pay-method.selected { border-color: var(--c-primary); background: var(--c-primary-light); color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); transform: translateY(-2px); }
.pay-method-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }

/* ── Order Summary ───────────────────────────────── */
.order-summary { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: var(--sp-5); box-shadow: var(--shadow); }
.order-row { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-2) 0; font-size: 0.9375rem; color: var(--c-text-secondary); border-bottom: 1px solid var(--c-border); }
.order-row:last-child { border-bottom: none; }
.order-row.tot { font-size: 1rem; font-weight: 700; color: var(--c-text); padding-top: var(--sp-3); margin-top: var(--sp-2); border-top: 2px solid var(--c-border); border-bottom: none; font-family: var(--font-head); }
.order-val { font-size: 1.25rem; color: var(--c-cta); font-weight: 700; font-family: var(--font-head); }

/* ── Info Alert ─────────────────────────────────── */
.info-alert { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4); background: var(--c-primary-light); border: 1px solid rgba(37,99,235,0.15); border-radius: var(--radius); font-size: 0.8125rem; color: var(--c-text-secondary); line-height: 1.65; border-left: 3px solid var(--c-primary); }
.info-alert .icon { flex-shrink: 0; color: var(--c-primary); margin-top: 1px; }

/* ── Loading ──────────────────────────────────────── */
.center-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-4); padding: var(--sp-12); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: spin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-loading p { font-size: 0.9375rem; color: var(--c-text-muted); font-weight: 500; }

/* ── Toast ────────────────────────────────────────── */
.toast-container { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); background: var(--c-text); color: white; border-radius: var(--radius); font-size: 0.875rem; box-shadow: var(--shadow-md); pointer-events: auto; white-space: nowrap; animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.toast-success { background: var(--c-success); }
.toast-warning { background: var(--c-cta); }
.toast-info { background: var(--c-primary); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.9); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* ── Utility ─────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--c-text-muted); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.mt-6 { margin-top: var(--sp-6); }

/* ── Icon ─────────────────────────────────────────── */
.icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.icon-16 { width: 16px; height: 16px; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }

/* ── SVG Gradient defs (for progress arc) ─────────── */
svg defs style { }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 var(--sp-3); }
  .page-main { padding: var(--sp-5) 0 var(--sp-10); }
  .header-inner { height: 52px; }
  .card { padding: var(--sp-4); border-radius: var(--radius); }
  .progress-wrap { flex-direction: column; text-align: center; }
  .progress-wrap > div { text-align: center; }
  .stats-bar { padding: var(--sp-3) var(--sp-4); }
  .stat-num { font-size: 1.375rem; }
  .pay-methods { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
  .pay-method { padding: var(--sp-4) var(--sp-2); font-size: 0.8125rem; }
  .pay-method-icon { width: 34px; height: 34px; }
  .bottom-bar-inner { flex-direction: column; gap: var(--sp-3); }
  .bottom-bar-info { text-align: center; font-size: 0.875rem; }
}
