/* 升学智汇 · 公开门户 */
:root {
  --p-bg: #f0f4f8;
  --p-card: #fff;
  --p-text: #0f172a;
  --p-muted: #64748b;
  --p-border: #e2e8f0;
  --p-blue: #2563eb;
  --p-blue-dark: #1d4ed8;
  --p-blue-soft: #eff6ff;
  --p-green: #16a34a;
  --p-green-soft: #ecfdf5;
  --p-orange: #ea580c;
  --p-orange-soft: #ffedd5;
  --p-purple: #7c3aed;
  --p-purple-soft: #ede9fe;
  --p-radius: 16px;
  --p-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --p-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--p-bg);
  color: var(--p-text);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--p-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.p-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
  padding: 0 20px;
  box-shadow: 0 8px 32px rgba(29, 78, 216, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.p-header-inner {
  max-width: var(--p-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}

.p-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}
.p-brand:hover { text-decoration: none; opacity: 0.95; }
.p-brand-logo { font-size: 32px; line-height: 1; }
.p-brand h1 { font-size: 20px; font-weight: 800; }
.p-brand span { font-size: 12px; opacity: 0.85; display: block; margin-top: 2px; }

.p-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  align-items: center;
}
.p-nav a {
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.p-nav a:hover, .p-nav a.active {
  background: rgba(255,255,255,0.18);
  text-decoration: none;
}

.p-btn-miniapp {
  background: #fff;
  color: var(--p-blue-dark) !important;
  font-weight: 700;
  padding: 8px 14px !important;
  border-radius: 999px !important;
}
.p-btn-miniapp:hover { background: #f8fafc !important; }

/* Hero */
.p-hero {
  background: linear-gradient(180deg, #1e40af 0%, #2563eb 40%, transparent 100%);
  padding: 48px 20px 32px;
  color: #fff;
  text-align: center;
}
.p-hero h2 {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 900;
  line-height: 1.25;
  max-width: 720px;
  margin: 0 auto 16px;
}
.p-hero p {
  font-size: clamp(15px, 2.5vw, 18px);
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto 28px;
}
.p-hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.p-hero-tag {
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  backdrop-filter: blur(4px);
}

.p-hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.p-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  transition: transform 0.15s;
}
.p-cta:hover { transform: translateY(-1px); }
.p-cta-primary { background: #fff; color: var(--p-blue-dark); }
.p-cta-ghost { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.35); }

/* Main */
.p-main {
  max-width: var(--p-max);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.p-section-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}
.p-section-desc {
  color: var(--p-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Menu grid */
.p-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
@media (min-width: 768px) {
  .p-menu-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.p-menu-card {
  background: var(--p-card);
  border-radius: var(--p-radius);
  padding: 20px 16px;
  box-shadow: var(--p-shadow);
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.p-menu-card:hover {
  border-color: var(--p-blue);
  transform: translateY(-2px);
  text-decoration: none;
}
.p-menu-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.p-menu-card h3 { font-size: 15px; font-weight: 700; }
.p-menu-card p { font-size: 12px; color: var(--p-muted); line-height: 1.45; }
.tone-blue { background: #dbeafe; }
.tone-green { background: #dcfce7; }
.tone-purple { background: #ede9fe; }
.tone-orange { background: #ffedd5; }
.tone-cyan { background: #cffafe; }
.tone-pink { background: #fce7f3; }
.tone-red { background: #fee2e2; }
.tone-mint { background: #d1fae5; }
.tone-lavender { background: #e0e7ff; }

/* Cards list */
.p-card {
  background: var(--p-card);
  border-radius: var(--p-radius);
  padding: 20px;
  box-shadow: var(--p-shadow);
  margin-bottom: 14px;
  border: 1px solid var(--p-border);
}
.p-card h3 { font-size: 17px; margin-bottom: 8px; }
.p-card-meta { font-size: 12px; color: var(--p-muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 12px; }
.p-card p { font-size: 14px; color: #475569; }
.p-card-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }

.p-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
}
.p-btn-blue { background: var(--p-blue); color: #fff; }
.p-btn-green { background: var(--p-green); color: #fff; }
.p-btn-ghost { background: var(--p-blue-soft); color: var(--p-blue); }

/* Filters */
.p-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}
.p-filters select, .p-filters input {
  padding: 10px 12px;
  border: 1px solid var(--p-border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}
.p-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.p-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--p-border);
  cursor: pointer;
  color: var(--p-muted);
}
.p-tab.on { background: var(--p-blue); color: #fff; border-color: var(--p-blue); }

/* Static content */
.p-timeline { border-left: 3px solid var(--p-blue); padding-left: 20px; margin: 16px 0; }
.p-timeline-item { margin-bottom: 20px; position: relative; }
.p-timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--p-blue);
}
.p-timeline-item h4 { font-size: 15px; margin-bottom: 6px; }
.p-timeline-item .year { font-size: 12px; color: var(--p-blue); font-weight: 700; margin-bottom: 4px; }

.p-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.p-path-card {
  background: var(--p-card);
  border-radius: var(--p-radius);
  padding: 18px;
  border: 1px solid var(--p-border);
}
.p-path-card h4 { font-size: 16px; margin-bottom: 8px; color: var(--p-blue-dark); }
.p-path-card ul { padding-left: 18px; font-size: 13px; color: #475569; }
.p-path-card li { margin-bottom: 6px; }

/* Miniapp promo */
.p-miniapp-banner {
  background: linear-gradient(135deg, #0f766e 0%, #16a34a 100%);
  color: #fff;
  border-radius: var(--p-radius);
  padding: 28px 24px;
  margin: 32px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.p-miniapp-banner h3 { font-size: 20px; margin-bottom: 8px; }
.p-miniapp-banner p { font-size: 14px; opacity: 0.92; max-width: 520px; }
.p-miniapp-steps { font-size: 13px; margin-top: 12px; opacity: 0.9; }
.p-miniapp-qr {
  background: #fff;
  color: var(--p-text);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
  min-width: 140px;
}
.p-miniapp-qr .ico { font-size: 48px; }
.p-miniapp-qr p { font-size: 12px; color: var(--p-muted); margin-top: 6px; }

/* Footer */
.p-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 32px 20px;
  font-size: 13px;
  margin-top: 40px;
}
.p-footer-inner {
  max-width: var(--p-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
.p-footer a { color: #cbd5e1; }
.p-footer-beian {
  max-width: var(--p-max);
  margin: 16px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  text-align: center;
  font-size: 12px;
}
.p-footer-beian a {
  color: #94a3b8;
  text-decoration: none;
}
.p-footer-beian a:hover { color: #e2e8f0; }

.p-loading, .p-empty { text-align: center; padding: 40px; color: var(--p-muted); }
.p-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--p-green-soft);
  color: #15803d;
  font-weight: 600;
}

.p-page-head { margin-bottom: 24px; }
.p-page-head h2 { font-size: 26px; font-weight: 800; }
.p-page-head p { color: var(--p-muted); margin-top: 8px; }

/* Article detail */
.p-article { max-width: 820px; margin: 0 auto; }
.p-article-head { margin-bottom: 24px; }
.p-article-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.35;
  color: #0f172a;
}
.p-article-meta {
  margin-top: 12px;
  font-size: 14px;
  color: var(--p-muted);
  line-height: 1.6;
}
.p-article-lead {
  margin-top: 16px;
  padding: 16px 18px;
  background: linear-gradient(90deg, #eff6ff, #f8fafc);
  border-left: 4px solid #2563eb;
  border-radius: 0 10px 10px 0;
  font-size: 16px;
  line-height: 1.75;
  color: #1e3a5f;
}
.p-article-body {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px 32px;
  font-size: 16px;
  line-height: 1.85;
  color: #334155;
}
.p-article-body h3 {
  margin: 28px 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}
.p-article-body h3:first-child { margin-top: 0; }
.p-article-body p { margin: 0 0 14px; }
.p-article-body ul, .p-article-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.p-article-body li { margin-bottom: 8px; }
.p-article-body em { color: #64748b; font-size: 14px; }
.p-article-body .article-lead { margin-bottom: 8px; }
.p-article-download {
  margin-bottom: 20px;
  padding: 18px 20px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 12px;
}
.p-article-download h3 { margin: 0 0 8px; font-size: 17px; }
.p-article-source {
  margin-top: 28px;
  padding: 20px 22px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
}
.p-article-source h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.p-article-source p { margin: 0 0 8px; }
.p-article-source a { color: #2563eb; word-break: break-all; }
.p-article-source-note { font-size: 13px; color: #94a3b8; margin-top: 10px !important; }

.p-disclaimer {
  font-size: 12px;
  color: var(--p-muted);
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  margin-top: 24px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .p-nav { display: none; }
}

/* Region bar */
#portalRegionBar { padding: 0 20px; }
.p-region-bar {
  max-width: var(--p-max);
  margin: 0 auto 12px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #eff6ff, #f8fafc);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.p-region-bar:hover { box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12); }
.p-region-pin { font-size: 16px; }
.p-region-text {
  flex: 1;
  font-size: 14px;
  color: #1e40af;
  font-weight: 600;
}
.p-region-switch { font-size: 13px; color: #2563eb; white-space: nowrap; }

.p-region-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.p-region-modal.open { display: flex; }
.p-region-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.p-region-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(80vh, 680px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.p-region-modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--p-border);
}
.p-region-modal-head h3 { flex: 1; font-size: 18px; font-weight: 800; }
.p-region-back,
.p-region-close {
  border: none;
  background: #f1f5f9;
  color: #334155;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
}
.p-region-close { font-size: 18px; line-height: 1; padding: 4px 10px; }
.p-region-modal-desc { padding: 0 16px 10px; font-size: 13px; color: var(--p-muted); }
.p-region-search-wrap { padding: 0 16px 12px; }
.p-region-search-wrap input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--p-border);
  border-radius: 10px;
  font-size: 14px;
}
.p-region-modal-body { overflow: auto; padding: 0 16px 16px; flex: 1; }
.p-region-block { margin-bottom: 16px; }
.p-region-label { font-size: 12px; font-weight: 700; color: var(--p-muted); margin-bottom: 8px; }
.p-region-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.p-region-chip {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.p-region-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--p-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.p-region-row:hover { border-color: #93c5fd; background: #f8fafc; }
.p-region-row-name { font-size: 15px; font-weight: 600; color: var(--p-text); }
.p-region-row-arrow { font-size: 13px; color: var(--p-muted); }

.p-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1100;
}
.p-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* P0: search, persona, carousel, mobile, FAB, AI */
.p-hero-tools {
  max-width: 640px;
  margin: 0 auto 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.p-region-bar-hero {
  margin: 0 !important;
  background: rgba(255,255,255,0.14) !important;
  border-color: rgba(255,255,255,0.25) !important;
}
.p-region-bar-hero .p-region-text { color: #fff !important; }
.p-region-bar-hero .p-region-switch { color: rgba(255,255,255,0.9) !important; }

.p-search-bar {
  display: flex;
  gap: 8px;
  width: 100%;
}
.p-search-bar input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
}
.p-search-bar .p-btn { white-space: nowrap; padding: 12px 18px; }

.p-carousel { position: relative; max-width: 720px; margin: 0 auto 20px; }
.p-carousel-slide {
  display: none;
  text-align: left;
  padding: 20px 22px;
  border-radius: var(--p-radius);
  color: #fff;
  text-decoration: none !important;
  min-height: 120px;
}
.p-carousel-slide.active { display: block; }
.p-carousel-slide.tone-blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.p-carousel-slide.tone-green { background: linear-gradient(135deg, #047857, #10b981); }
.p-carousel-slide.tone-orange { background: linear-gradient(135deg, #c2410c, #f97316); }
.p-carousel-slide.tone-purple { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.p-carousel-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.p-carousel-slide h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; color: #fff; }
.p-carousel-slide p { font-size: 13px; opacity: 0.92; line-height: 1.5; color: #fff; }
.p-carousel-more { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 700; color: #fff; }
.p-carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.p-carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.35); cursor: pointer;
}
.p-carousel-dot.on { background: #fff; }
.p-carousel-loading { color: rgba(255,255,255,0.8); font-size: 14px; padding: 20px; }

.p-persona-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--p-border);
}
.p-persona-label { font-size: 13px; color: var(--p-muted); font-weight: 600; }
.p-persona-chip {
  border: 1px solid var(--p-border);
  background: #f8fafc;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--p-text);
}
.p-persona-chip.on {
  background: var(--p-blue-soft);
  border-color: #93c5fd;
  color: var(--p-blue-dark);
  font-weight: 700;
}

.p-filter-hint { font-size: 12px; color: var(--p-muted); margin: -8px 0 16px; }
.p-result-count { font-size: 14px; font-weight: 500; color: var(--p-muted); }
.p-smart-panel {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.p-smart-desc, .p-smart-note { font-size: 13px; color: #475569; margin-bottom: 10px; }

.p-menu-btn {
  display: none;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.p-bottom-tabs {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: #fff;
  border-top: 1px solid var(--p-border);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(15,23,42,0.06);
}
.p-bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  font-size: 10px;
  color: var(--p-muted);
  text-decoration: none !important;
}
.p-bottom-tab .ico { font-size: 20px; }
.p-bottom-tab.active { color: var(--p-blue); font-weight: 700; }

.p-mobile-drawer {
  position: fixed; inset: 0; z-index: 200;
  display: none; pointer-events: none;
}
.p-mobile-drawer.open { display: block; pointer-events: auto; }
.p-mobile-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.45);
}
.p-mobile-drawer-panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(300px, 85vw);
  background: #fff;
  padding: 16px;
  overflow: auto;
  box-shadow: 4px 0 24px rgba(15,23,42,0.12);
}
.p-mobile-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--p-border);
}
.p-mobile-drawer-head button {
  border: none; background: #f1f5f9; border-radius: 8px;
  width: 32px; height: 32px; font-size: 20px; cursor: pointer;
}
.p-mobile-drawer-nav a {
  display: block; padding: 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--p-text); text-decoration: none !important;
  font-size: 15px;
}
.p-mobile-drawer-nav a.active { color: var(--p-blue); font-weight: 700; }
.p-mobile-drawer-guide {
  display: block; margin-top: 16px; padding: 12px;
  background: var(--p-green-soft); border-radius: 10px;
  text-align: center; font-weight: 600; text-decoration: none !important;
}

.p-fab {
  position: fixed;
  z-index: 85;
  border: none;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15,23,42,0.18);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.p-fab span { font-size: 22px; }
.p-fab-miniapp {
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
}
.p-fab-ai {
  right: 16px;
  bottom: calc(140px + env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #4338ca, #6366f1);
  color: #fff;
}

.p-modal, .p-ai-panel {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.p-modal.open, .p-ai-panel.open { display: flex; }
.p-modal-backdrop, .p-ai-panel-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.5);
}
.p-modal-panel, .p-ai-panel-box {
  position: relative;
  width: min(420px, 100%);
  max-height: min(85vh, 640px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.p-modal-close {
  position: absolute; top: 12px; right: 12px;
  border: none; background: #f1f5f9; border-radius: 8px;
  width: 32px; height: 32px; font-size: 20px; cursor: pointer;
}
.p-miniapp-modal { padding: 24px 20px; text-align: center; }
.p-miniapp-modal h3 { font-size: 18px; margin-bottom: 8px; }
.p-modal-desc { font-size: 13px; color: var(--p-muted); margin-bottom: 12px; }
.p-miniapp-qr-lg { margin: 0 auto; }

.p-ai-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--p-border);
}
.p-ai-panel-head h3 { font-size: 16px; }
.p-ai-panel-head button {
  border: none; background: #f1f5f9; border-radius: 8px;
  width: 32px; height: 32px; font-size: 20px; cursor: pointer;
}
.p-ai-messages {
  flex: 1; overflow: auto; padding: 14px 16px;
  min-height: 200px; max-height: 360px;
  background: #f8fafc;
}
.p-ai-msg {
  max-width: 92%; padding: 10px 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.55; margin-bottom: 10px;
}
.p-ai-msg.bot { background: #fff; border: 1px solid var(--p-border); margin-right: auto; }
.p-ai-msg.user { background: var(--p-blue); color: #fff; margin-left: auto; }
.p-ai-msg.err { background: #fef2f2; color: #b91c1c; }
.p-ai-form {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--p-border);
}
.p-ai-form input {
  flex: 1; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--p-border); border-radius: 10px;
}

body.has-portal-chrome { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

@media (max-width: 768px) {
  .p-menu-btn { display: flex; align-items: center; justify-content: center; }
  .p-header-inner { justify-content: flex-start; }
  .p-brand { flex: 1; }
  .p-nav { display: none; }
  .p-bottom-tabs { display: flex; }
  .p-menu-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .p-menu-card { padding: 16px 12px; }
  .p-fab-miniapp { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .p-fab-ai { bottom: calc(132px + env(safe-area-inset-bottom)); }
  .p-policy-filters { flex-direction: column; align-items: stretch; }
  .p-policy-filters input, .p-policy-filters select { width: 100%; }
  .p-toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (min-width: 769px) {
  .p-fab-miniapp { bottom: 24px; }
  .p-fab-ai { bottom: 96px; }
  body.has-portal-chrome { padding-bottom: 0; }
}

/* ===== 综合服务门户风格（首页 + 白顶栏） ===== */
body.p-layout-portal { background: #eef1f6; }

.p-topbar {
  background: #1e3a5f;
  color: rgba(255,255,255,0.88);
  font-size: 12px;
}
.p-topbar-inner {
  max-width: var(--p-max);
  margin: 0 auto;
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.p-topbar-links { display: flex; gap: 16px; }
.p-topbar-links a { color: rgba(255,255,255,0.9); text-decoration: none; }
.p-topbar-links a:hover { color: #fff; text-decoration: underline; }

.p-header-light {
  background: #fff !important;
  box-shadow: 0 1px 0 #e5e7eb, 0 4px 20px rgba(15,23,42,0.04) !important;
  color: #0f172a;
  position: sticky;
  top: 0;
  z-index: 100;
}
.p-header-light .p-header-inner { min-height: 72px; }
.p-brand-light { color: #0f172a !important; }
.p-brand-light h1 { color: #0f172a; font-size: 22px; }
.p-brand-light span { color: #64748b; opacity: 1; }
.p-nav-light a {
  color: #475569 !important;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}
.p-nav-light a:hover { background: transparent !important; color: #2563eb !important; }
.p-nav-light a.active {
  background: transparent !important;
  color: #2563eb !important;
  font-weight: 700;
  border-bottom-color: #2563eb;
}
.p-header-light .p-menu-btn {
  background: #f1f5f9;
  color: #334155;
}
.p-header-search {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  min-width: 200px;
}
.p-header-search input {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  width: 160px;
  outline: none;
}
.p-header-search button {
  border: none;
  background: transparent;
  padding: 8px 12px;
  cursor: pointer;
}
.p-header-search-home {
  flex: 1;
  max-width: 360px;
  min-width: 0;
}
.p-header-search-home input { flex: 1; width: auto; }
.p-btn-miniapp-light {
  background: #2563eb !important;
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
}

.p-region-strip { padding: 0 20px 12px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.p-region-strip .p-region-bar { margin: 0 auto; max-width: var(--p-max); }

.p-portal-body {
  max-width: var(--p-max);
  margin: 0 auto;
  padding: 20px;
}

.p-hero-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin-bottom: 20px;
}
.p-hero-banner { min-height: 300px; border-radius: 8px; overflow: hidden; }

.p-banner { position: relative; height: 100%; min-height: 300px; }
.p-banner-slide {
  display: none;
  position: absolute;
  inset: 0;
  text-decoration: none !important;
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.p-banner-slide.active { display: block; }
.p-banner-slide.tone-blue { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.p-banner-slide.tone-indigo { background: linear-gradient(135deg, #3730a3, #6366f1); }
.p-banner-slide.tone-teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.p-banner-slide.tone-violet { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.p-banner-slide.tone-slate { background: linear-gradient(135deg, #334155, #64748b); }
.p-banner-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, transparent 55%);
}
.p-banner-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px 28px;
  z-index: 1;
}
.p-banner-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.p-banner-text h3 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.3;
}
.p-banner-text p { font-size: 14px; color: rgba(255,255,255,0.9); margin: 0; }
.p-banner-dots {
  position: absolute;
  bottom: 12px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.p-banner-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 0;
}
.p-banner-dots button.on { background: #fff; width: 20px; border-radius: 4px; }

.p-side-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(15,23,42,0.04);
}
.p-side-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.p-side-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.p-side-card-head strong { font-size: 15px; display: block; }
.p-side-card-head p { font-size: 12px; color: #64748b; margin: 2px 0 0; }
.p-region-bar-inline {
  margin: 0 !important;
  padding: 10px 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px;
}
.p-side-card .p-persona-bar {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  flex-wrap: wrap;
}
.p-side-card .p-persona-chip { font-size: 11px; padding: 5px 10px; }
.p-btn-primary-block {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  cursor: pointer;
}
.p-side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.p-side-stats b { display: block; font-size: 18px; color: #2563eb; }
.p-side-stats span { font-size: 11px; color: #64748b; }

.p-block {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(15,23,42,0.04);
}
.p-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.p-block-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.p-block-icon { font-size: 20px; }
.p-block-more { font-size: 13px; color: #64748b; text-decoration: none !important; }
.p-block-more:hover { color: #2563eb; }

.p-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.p-tag-red { background: #fef2f2; color: #dc2626; }
.p-tag-blue { background: #eff6ff; color: #2563eb; }
.p-tag-light { background: rgba(255,255,255,0.25); color: #fff; }

.p-announce-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed #e2e8f0;
  text-decoration: none !important;
  color: inherit;
}
.p-announce-row:last-child { border-bottom: none; }
.p-announce-row:hover .p-announce-title { color: #2563eb; }
.p-announce-title {
  flex: 1;
  font-size: 14px;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-announce-row time { font-size: 12px; color: #94a3b8; flex-shrink: 0; }

.p-service-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.p-service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  text-decoration: none !important;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.p-service-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 8px 24px rgba(37,99,235,0.08);
}
.p-service-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
}
.p-service-item strong { font-size: 14px; margin-bottom: 4px; }
.p-service-item small { font-size: 11px; color: #94a3b8; line-height: 1.4; }

.p-columns {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.p-inline-tabs { display: flex; gap: 4px; }
.p-inline-tabs button {
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: #64748b;
}
.p-inline-tabs button.on {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 600;
}

.p-news-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.p-news-featured {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  min-height: 220px;
  position: relative;
  text-decoration: none !important;
  color: #fff;
}
.p-news-featured.tone-blue { background: linear-gradient(145deg, #1e3a8a, #3b82f6); }
.p-news-featured.tone-green { background: linear-gradient(145deg, #047857, #10b981); }
.p-news-featured-body { padding: 24px; }
.p-news-featured h3 { font-size: 18px; font-weight: 800; margin: 8px 0; color: #fff; line-height: 1.35; }
.p-news-featured p { font-size: 13px; opacity: 0.92; line-height: 1.55; color: #fff; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.p-news-more { font-size: 13px; font-weight: 700; margin-top: 12px; display: inline-block; color: #fff; }

.p-news-list { list-style: none; margin: 0; padding: 0; }
.p-news-list li { border-bottom: 1px dashed #e2e8f0; }
.p-news-list li:last-child { border-bottom: none; }
.p-news-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  text-decoration: none !important;
  color: #334155;
  font-size: 14px;
}
.p-news-list a:hover .p-news-list-title { color: #2563eb; }
.p-news-list-title { flex: 1; line-height: 1.45; }
.p-news-list time { font-size: 12px; color: #94a3b8; white-space: nowrap; }

.p-widget {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(15,23,42,0.04);
}
.p-widget-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}
.p-region-info { font-size: 14px; color: #2563eb; font-weight: 600; }

.p-feature-links { display: flex; flex-direction: column; gap: 8px; }
.p-feature-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  color: #fff;
}
.p-feature-link.tone-indigo { background: #4f46e5; }
.p-feature-link.tone-blue { background: #2563eb; }
.p-feature-link.tone-orange { background: #ea580c; }
.p-feature-link.tone-green { background: #059669; }

.p-link-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.p-link-tags a {
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #475569;
  text-decoration: none !important;
  background: #f8fafc;
}
.p-link-tags a:hover { border-color: #93c5fd; color: #2563eb; }

.p-footer-portal {
  background: #1a2332 !important;
  margin-top: 32px;
  padding: 40px 20px 24px !important;
}
.p-footer-grid {
  max-width: var(--p-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
}
.p-footer-brand { font-size: 18px; color: #fff; display: block; margin-bottom: 8px; }
.p-footer-col p { font-size: 13px; color: #94a3b8; line-height: 1.6; margin: 0 0 8px; }
.p-footer-col h4 { color: #e2e8f0; font-size: 14px; margin: 0 0 12px; }
.p-footer-col a {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 8px;
  text-decoration: none;
}
.p-footer-col a:hover { color: #fff; }
.p-footer-copy {
  max-width: var(--p-max);
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 960px) {
  .p-hero-row { grid-template-columns: 1fr; }
  .p-hero-banner { min-height: 220px; }
  .p-service-grid { grid-template-columns: repeat(3, 1fr); }
  .p-columns { grid-template-columns: 1fr; }
  .p-news-layout { grid-template-columns: 1fr; }
  .p-footer-grid { grid-template-columns: 1fr 1fr; }
  .p-header-search-home { display: none; }
  .p-nav-light { display: none; }
}
@media (max-width: 640px) {
  .p-service-grid { grid-template-columns: repeat(2, 1fr); }
  .p-footer-grid { grid-template-columns: 1fr; }
  .p-portal-body { padding: 12px; }
}
