:root {
  --blue: #205ea6;
  --blue-deep: #123a68;
  --blue-2: #3b7dd8;
  --blue-soft: #eef4fc;
  --blue-tint: #dbe8f8;
  --orange: #e07e34;
  --orange-soft: #fdefe2;
  --green: #2c8c62;
  --green-soft: #e6f3ec;
  --ink: #14212e;
  --muted: #5f6d7c;
  --line: #e5eaf1;
  --paper: #ffffff;
  --page: #eef2f7;
  --danger: #b42318;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18,45,90,.05), 0 10px 30px rgba(18,45,90,.06);
  --shadow-hover: 0 2px 6px rgba(18,45,90,.09), 0 18px 44px rgba(18,45,90,.12);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; }
button { border: 0; border-radius: 12px; padding: 10px 16px; color: white; background: var(--blue); cursor: pointer; font-weight: 700; font-size: 14px; transition: transform .12s, box-shadow .12s, background .12s; }
button:hover { background: var(--blue-deep); }
button:active { transform: scale(.98); }
button:disabled { cursor: not-allowed; opacity: .45; }
.ghost { color: var(--blue-deep); background: white; border: 1px solid var(--line); }
.ghost:hover { background: var(--blue-soft); }
.danger { background: var(--danger); }
.danger:hover { background: #8f1c13; }

/* 顶栏 */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px max(24px, calc((100vw - 1180px) / 2)); background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 22px; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: white; font-size: 22px; font-weight: 800; background: linear-gradient(135deg, var(--blue-2), var(--blue-deep)); }
.brand-line { display: flex; align-items: center; gap: 8px; }
.demo-badge { padding: 5px 9px; color: #9a4d10; background: var(--orange-soft); border-radius: 8px; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.linkbtn { display: inline-block; padding: 9px 16px; border-radius: 11px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--blue-deep); background: white; border: 1px solid var(--line); transition: background .12s; }
.linkbtn:hover { background: var(--blue-soft); }

main { max-width: 1180px; margin: auto; padding: 30px 20px 70px; }

/* 门户 Hero */
.portal-hero { display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; align-items: stretch; margin-bottom: 28px; }
.hero-copy { align-self: center; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.portal-hero h2 { font-size: clamp(28px, 4vw, 46px); line-height: 1.12; letter-spacing: -.01em; }
.hl { background: linear-gradient(120deg, var(--blue-2), var(--blue-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 640px; margin: 14px 0 16px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags span { padding: 6px 12px; background: white; border: 1px solid var(--line); border-radius: 20px; font-size: 13px; font-weight: 700; color: var(--blue-deep); box-shadow: var(--shadow); }
.enter-panel { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: 18px; color: white; background: linear-gradient(155deg, #24629f, var(--blue-deep)); box-shadow: var(--shadow); }
.enter-title { font-size: 13px; opacity: .85; letter-spacing: .06em; }
.rolepills { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rolepill { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: white; background: rgba(255,255,255,.12); font-weight: 700; font-size: 14px; transition: background .12s; }
.rolepill:hover { background: rgba(255,255,255,.22); }
.rolepill .ava { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: white; color: var(--blue-deep); font-size: 13px; font-weight: 800; }
.enter-cta { margin-top: 4px; color: #dfeaf7; text-decoration: none; font-size: 13px; font-weight: 700; }
.enter-cta:hover { color: white; }

/* 分节标题 */
.section-head { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.section-head .bar { width: 4px; height: 20px; border-radius: 3px; background: var(--blue); }
.section-head .bar.green { background: var(--green); }
.section-head h3 { font-size: 20px; }
.section-head small { color: var(--muted); font-size: 13px; margin-left: auto; }

/* 数据汇总卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto; }
.stat-ico svg { width: 22px; height: 22px; }
.stat-ico.blue { color: var(--blue); background: var(--blue-soft); }
.stat-ico.green { color: var(--green); background: var(--green-soft); }
.stat-ico.orange { color: var(--orange); background: var(--orange-soft); }
.stat-body { min-width: 0; }
.stat-label { display: block; color: var(--muted); font-size: 12px; }
.stat-val { display: block; margin: 2px 0; font-size: 24px; letter-spacing: -.01em; color: var(--ink); }
.stat-note { display: block; color: var(--muted); font-size: 11px; }

/* 端口卡 */
.port-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.port-card { display: flex; flex-direction: column; gap: 5px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s; }
.port-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.port-card.core { border: 1.5px solid var(--blue); background: linear-gradient(180deg, var(--blue-soft), var(--paper)); }
.port-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.port-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--blue); background: var(--blue-soft); }
.port-card.core .port-ico { color: white; background: var(--blue); }
.port-ico svg { width: 24px; height: 24px; }
.port-persona { color: var(--muted); font-size: 12px; }
.port-card h4 { font-size: 18px; }
.role-tag { align-self: flex-start; padding: 3px 9px; border-radius: 7px; background: var(--blue-tint); color: var(--blue-deep); font-size: 12px; font-weight: 700; }
.port-card .desc { margin: 6px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.6; flex: 1; }
.badge { font-style: normal; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 8px; }
.badge.core { color: white; background: var(--blue); }
.badge.soft { color: var(--muted); background: #eef1f5; }
.go { display: block; padding: 10px; border-radius: 11px; text-align: center; text-decoration: none; color: white; background: var(--blue); font-weight: 700; font-size: 14px; transition: background .12s; }
.go:hover { background: var(--blue-deep); }
.port-card.core .go { background: var(--blue-deep); }
.soft-note { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* 城乡循环带 */
.band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.band-card { padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.band-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; margin-bottom: 8px; }
.band-ico svg { width: 22px; height: 22px; }
.band-ico.green { color: var(--green); background: var(--green-soft); }
.band-ico.orange { color: var(--orange); background: var(--orange-soft); }
.band-ico.blue { color: var(--blue); background: var(--blue-soft); }
.band-card b { display: block; font-size: 15px; }
.band-card p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.band-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.band-actions .muted { font-size: 13px; }

/* 通用 */
.notice { margin-top: 22px; padding: 14px 16px; color: #8a4413; background: var(--orange-soft); border-radius: 12px; font-size: 13px; line-height: 1.6; }
.muted { color: var(--muted); }

/* 工作台（city.html）共用样式 */
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: end; margin-bottom: 24px; }
.hero h2 { max-width: 760px; margin: 6px 0 10px; font-size: clamp(26px, 3.6vw, 42px); line-height: 1.15; }
.hero p { color: var(--muted); }
.role-panel { padding: 18px; background: linear-gradient(155deg, #24629f, var(--blue-deep)); color: white; border-radius: 18px; box-shadow: var(--shadow); }
.role-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.role-buttons button { background: rgba(255,255,255,.16); }
.role-buttons button.active { background: white; color: var(--blue-deep); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metrics article { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.metrics .m-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto; }
.metrics .m-ico svg { width: 22px; height: 22px; }
.metrics .m-ico.blue { color: var(--blue); background: var(--blue-soft); }
.metrics .m-ico.green { color: var(--green); background: var(--green-soft); }
.metrics .m-ico.orange { color: var(--orange); background: var(--orange-soft); }
.metrics .m-body span, .metrics .m-body small { display: block; color: var(--muted); font-size: 12px; }
.metrics .m-body small { font-size: 11px; }
.metrics .m-body strong { display: block; margin: 2px 0; font-size: 24px; color: var(--blue-deep); }
.section-title > span:first-child { position: relative; padding-left: 12px; }
.section-title > span:first-child::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 3px; background: var(--blue); }
.workspace { display: grid; grid-template-columns: 1.6fr .9fr; gap: 20px; }
.story-card, .status-card, .risk-card, .report-card, .audit-card, .repair-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.repair-card { margin-top: 20px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-weight: 800; }
.timeline { padding: 0; margin: 0 0 14px; list-style: none; }
.timeline li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline li > span { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: var(--orange); border-radius: 50%; font-weight: 800; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.bill-box { padding: 14px; background: var(--blue-soft); border-radius: 12px; color: var(--blue-deep); font-size: 14px; line-height: 1.6; }
.bill-box .pay { font-weight: 800; }
.sign-row { display: flex; gap: 10px; margin: 12px 0; }
.expense-list { display: grid; gap: 8px; }
.expense-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; background: #f5f8fb; border-radius: 10px; font-size: 13px; }
.expense-item span { text-align: right; font-weight: 800; }
.expense-item i { font-style: normal; font-size: 12px; }
.expense-item i.ok { color: var(--green); }
.expense-item i.wait { color: var(--orange); }
.expense-item small { grid-column: 1 / -1; color: var(--muted); }
.status-card dl { margin: 0; }
.risk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.risk-card h3, .report-card h3 { margin: 8px 0; }
.risk-card > p, .report-card > p { color: var(--muted); line-height: 1.6; font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
#limitStatus, #ruralOutput { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.audit-card { margin-top: 20px; }
.audit-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.audit-item { display: grid; grid-template-columns: 190px 1fr 120px; gap: 12px; padding: 10px 12px; background: #f5f8fb; border-radius: 10px; font-size: 13px; }

#toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 18px; color: white; background: var(--ink); border-radius: 12px; opacity: 0; transform: translateY(12px); transition: .2s; pointer-events: none; box-shadow: var(--shadow-hover); }
#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .topbar { align-items: center; }
  .topbar p { display: none; }
  .portal-hero, .hero, .workspace, .risk-grid { grid-template-columns: 1fr; }
  .stat-grid, .metrics { grid-template-columns: 1fr 1fr; }
  .port-grid, .band { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 32px 1fr; }
  .timeline button { grid-column: 2; width: 100%; }
  .audit-item { grid-template-columns: 1fr; }
}
