/* 昌平区AI智能体平台 · 门户设计系统
   视觉识别：浅底「青绿 · 墨蓝 · 砂金」，区域生态型政务科技风。
   说明：门户自身采用独立视觉规范，不再沿用算力调度平台的深色蓝调；
        养老陪伴模块沿用 warm.css / elderly.css 的适老化暖色规范。 */

:root {
  /* 画布与表面 */
  --bg: #F5F8F7;
  --bg-2: #FFFFFF;
  --bg-3: #EDF3F1;
  --surface: #FFFFFF;
  --surface-2: #F1F6F4;
  --surface-3: #E5EEEA;
  --line: rgba(17, 63, 53, 0.10);
  --line-strong: rgba(17, 63, 53, 0.20);

  /* 文本 */
  --text: #14251F;
  --text-2: #52675F;
  --text-3: #5F736C; /* 提示文字：白底对比度 5.0:1，满足 WCAG AA */

  /* 品牌色：青绿主色 + 墨蓝辅色 + 砂金点缀 */
  --brand: #0F766E;
  --brand-2: #14B8A6;
  --brand-deep: #0B5A56;
  --ink: #16324F;
  --gold: #C08A2E;

  /* 语义色 */
  --ok: #15803D;
  --warn: #B45309;
  --err: #B91C1C;
  --info: #1D4ED8;

  /* 渐变 */
  --grad-brand: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
  --grad-ink: linear-gradient(135deg, #16324F 0%, #0F766E 100%);
  --grad-warm: linear-gradient(135deg, #C08A2E 0%, #E0A94A 100%);
  --hero-wash:
    radial-gradient(900px 420px at 8% -18%, rgba(15, 118, 110, 0.16), transparent 62%),
    radial-gradient(720px 360px at 92% -6%, rgba(22, 50, 79, 0.12), transparent 64%),
    linear-gradient(180deg, #FFFFFF 0%, #F5F8F7 100%);

  /* 尺寸 */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1240px;
  --maxw-wide: 1800px;
  --nav-h: 68px;

  /* 统一间距体系（全站共用，避免逐页边距不一致） */
  --gutter: 20px;          /* 页面左右留白 */
  --space-section: 64px;   /* 区块上下间距 */
  --gap-grid: 16px;        /* 栅格 / 卡片间距 */
  --gap-tight: 10px;       /* 密集列表间距 */
  --pad-card: 20px;        /* 面板 / 卡片内边距 */
  --pad-card-sm: 16px;     /* 小卡片内边距 */

  /* 阴影 */
  --shadow-sm: 0 6px 18px rgba(17, 63, 53, 0.06);
  --shadow: 0 18px 42px rgba(17, 63, 53, 0.12);
  --shadow-brand: 0 12px 28px rgba(15, 118, 110, 0.22);

  /* 字体 */
  --font-sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC",
    "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.cp-page-bg {
  background-image: radial-gradient(880px 420px at 50% -16%, rgba(15, 118, 110, 0.10), transparent 64%);
  background-repeat: no-repeat;
  background-color: var(--bg);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

::selection { background: rgba(15, 118, 110, 0.18); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #EDF3F1; }
::-webkit-scrollbar-thumb { background: #C4D6D0; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #A9C2BB; }

.cp-container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
/* 全站页头 / 页脚统一使用宽容器：品牌标识与页脚信息的左边缘在任意页面完全对齐 */
.cp-nav .cp-container, .cp-footer .cp-container { max-width: var(--maxw-wide); }

/* 加载 / 空状态占位 */
.cp-loading { padding: calc(var(--space-section) * 0.7) var(--gutter); text-align: center; color: var(--text-2); }

/* 代码 / 地址等等宽展示框（统一内边距与观感） */
.cp-codebox {
  font-family: var(--font-mono);
  font-size: 12.6px;
  line-height: 1.7;
  word-break: break-all;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
}
.cp-codebox--inline { display: inline-block; max-width: 100%; }

.cp-mono { font-family: var(--font-mono); }
.cp-dim { color: var(--text-2); }
.cp-muted { color: var(--text-3); }
.cp-hide { display: none !important; }

/* ---------------- 顶部导航 ---------------- */
.cp-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.cp-nav-inner {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
}
.cp-brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.cp-brand img, .cp-brand svg { width: 34px; height: 34px; }
.cp-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.cp-brand-title { font-size: 15.5px; font-weight: 700; letter-spacing: 0.3px; color: var(--text); }
.cp-brand-sub { font-size: 10px; color: var(--text-3); letter-spacing: 1.6px; text-transform: uppercase; }

.cp-nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.cp-nav-link {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  transition: background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
  font-weight: 500;
}
.cp-nav-link:hover { color: var(--text); background: var(--surface-2); }
.cp-nav-link.is-active {
  color: var(--brand-deep);
  background: rgba(15, 118, 110, 0.10);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.22);
  font-weight: 600;
}

.cp-nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px; height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

/* ---------------- 按钮 ---------------- */
.cp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}
.cp-btn:active { transform: translateY(1px); }
.cp-btn--primary { background: var(--brand); color: #FFFFFF; box-shadow: var(--shadow-brand); }
.cp-btn--primary:hover { background: var(--brand-deep); box-shadow: 0 16px 34px rgba(15, 118, 110, 0.28); }
.cp-btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.cp-btn--ghost:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand-deep); }
.cp-btn--sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.cp-btn--block { width: 100%; }
.cp-btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ---------------- 区块与标题 ---------------- */
/* 注意：区块只设置上下内边距，避免 padding 简写覆盖 .cp-container 的左右留白 */
.cp-section { padding-top: var(--space-section); padding-bottom: var(--space-section); }
.cp-section--tight { padding-top: calc(var(--space-section) * 0.62); padding-bottom: calc(var(--space-section) * 0.62); }
.cp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--brand); font-weight: 700;
}
.cp-eyebrow::before {
  content: '';
  width: 18px; height: 2px; border-radius: 2px;
  background: var(--grad-brand);
}
.cp-title { margin: 12px 0 10px; font-size: 30px; line-height: 1.35; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
.cp-subtitle { margin: 0; color: var(--text-2); font-size: 15.5px; max-width: 860px; }

/* ---------------- 卡片 ---------------- */
.cp-card {
  position: relative;
  padding: var(--pad-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.cp-card--hover:hover { transform: translateY(-4px); border-color: rgba(15, 118, 110, 0.35); box-shadow: var(--shadow); }
.cp-card--flat { background: var(--surface-2); box-shadow: none; border-color: var(--line); }

.cp-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.10);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: var(--brand-deep);
}
.cp-icon svg { width: 22px; height: 22px; }
.cp-icon--violet { background: rgba(22, 50, 79, 0.09); border-color: rgba(22, 50, 79, 0.20); color: var(--ink); }
.cp-icon--gold { background: rgba(192, 138, 46, 0.12); border-color: rgba(192, 138, 46, 0.28); color: #96681C; }
.cp-icon--ok { background: rgba(21, 128, 61, 0.10); border-color: rgba(21, 128, 61, 0.24); color: var(--ok); }

/* ---------------- 网格 ---------------- */
.cp-grid { display: grid; gap: var(--gap-grid); }
.cp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cp-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------------- 徽标 / 状态 ---------------- */
.cp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 25px; padding: 0 11px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.cp-badge--ok { color: #10643A; border-color: rgba(21, 128, 61, 0.28); background: rgba(21, 128, 61, 0.10); }
.cp-badge--warn { color: #8A4A08; border-color: rgba(180, 83, 9, 0.28); background: rgba(180, 83, 9, 0.10); }
.cp-badge--info { color: #1B3E9E; border-color: rgba(29, 78, 216, 0.26); background: rgba(29, 78, 216, 0.09); }
.cp-badge--dev { color: #5B21B6; border-color: rgba(109, 40, 217, 0.26); background: rgba(109, 40, 217, 0.09); }

.cp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.14); }
.cp-dot--warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.14); }
.cp-dot--dev { background: #6D28D9; box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.14); }

/* ---------------- 表单 ---------------- */
.cp-label { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 7px; font-weight: 600; }
.cp-input, .cp-select, .cp-textarea {
  width: 100%;
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.cp-textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.cp-input:focus, .cp-select:focus, .cp-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}
.cp-input::placeholder, .cp-textarea::placeholder { color: var(--text-3); }
.cp-field { margin-bottom: 16px; }
.cp-hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

/* ---------------- 表格 ---------------- */
.cp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.cp-table th, .cp-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.cp-table th {
  font-size: 12.5px; color: var(--text-3); font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; background: var(--surface-2);
}
.cp-table tbody tr:hover { background: rgba(15, 118, 110, 0.045); }
.cp-table td:last-child, .cp-table th:last-child { text-align: right; }
.cp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ---------------- 标签页 ---------------- */
.cp-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; padding: 4px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.cp-tab {
  padding: 8px 15px; border-radius: 9px; cursor: pointer; font-size: 13.5px;
  color: var(--text-2); border: none; background: transparent; transition: all 0.16s ease; font-weight: 600;
}
.cp-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.7); }
.cp-tab.is-active { color: var(--brand-deep); background: var(--surface); box-shadow: 0 2px 8px rgba(17, 63, 53, 0.10); }

/* ---------------- 进度条 ---------------- */
.cp-progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.cp-progress > i { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); transition: width 0.4s ease; }

/* ---------------- 弹窗 ---------------- */
.cp-modal-mask {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(16, 37, 31, 0.42);
  backdrop-filter: blur(4px);
}
.cp-modal {
  width: 100%; max-width: 560px;
  max-height: 84vh; overflow: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(17, 63, 53, 0.22);
  animation: cp-pop 0.2s ease;
}
.cp-modal--wide { max-width: 760px; }
.cp-modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.cp-modal-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.cp-modal-close {
  margin-left: auto; width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 8px; border: 1px solid var(--line); background: transparent;
  color: var(--text-2); cursor: pointer; font-size: 17px; line-height: 1;
}
.cp-modal-close:hover { background: var(--surface-2); color: var(--text); }
.cp-modal-body { color: var(--text-2); font-size: 14.2px; }
.cp-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

@keyframes cp-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------------- 轻提示 ---------------- */
.cp-toast-wrap { position: fixed; top: 84px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.cp-toast {
  min-width: 220px; max-width: 380px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--text);
  animation: cp-slide 0.22s ease;
}
.cp-toast--ok { border-color: rgba(21, 128, 61, 0.35); background: #F3FBF6; color: #10643A; }
.cp-toast--err { border-color: rgba(185, 28, 28, 0.32); background: #FEF4F4; color: #8F1D1D; }
.cp-toast--warn { border-color: rgba(180, 83, 9, 0.32); background: #FFF8F0; color: #8A4A08; }
@keyframes cp-slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------------- 页脚 ---------------- */
.cp-footer { border-top: 1px solid var(--line); background: var(--bg-3); padding: calc(var(--space-section) * 0.55) 0 calc(var(--space-section) * 0.42); }
.cp-footer-grid { display: flex; flex-wrap: wrap; gap: 26px; justify-content: space-between; align-items: flex-start; }
.cp-footer-title { font-size: 14.5px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.cp-footer-text { color: var(--text-2); font-size: 13px; margin: 0; line-height: 1.9; }
.cp-footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.cp-footer-links a:hover { color: var(--brand); }

/* ---------------- 页面头（模块页） ---------------- */
.cp-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.cp-breadcrumb a:hover { color: var(--brand); }
.cp-page-title { font-size: 27px; font-weight: 700; margin: 12px 0 8px; letter-spacing: -0.2px; color: var(--text); }
.cp-page-desc { color: var(--text-2); font-size: 14.8px; max-width: 900px; margin: 0; }

/* ---------------- 统计 ---------------- */
.cp-stat-value { font-size: 26px; font-weight: 700; font-family: var(--font-mono); letter-spacing: -0.5px; color: var(--text); }
.cp-stat-label { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ---------------- 通用工具类 ---------------- */
.cp-row { display: flex; align-items: center; gap: 12px; }
.cp-row--between { justify-content: space-between; }
.cp-row--wrap { flex-wrap: wrap; }
.cp-col { display: flex; flex-direction: column; gap: 10px; }
.cp-mt-0 { margin-top: 0; } .cp-mt-8 { margin-top: 8px; } .cp-mt-16 { margin-top: 16px; }
.cp-mt-24 { margin-top: 24px; } .cp-mt-32 { margin-top: 32px; }
.cp-mb-0 { margin-bottom: 0; } .cp-mb-16 { margin-bottom: 16px; }
.cp-gap-8 { gap: 8px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  :root { --gutter: 16px; --space-section: 46px; --gap-grid: 14px; --pad-card: 18px; }
  .cp-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-grid--3, .cp-grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .cp-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .cp-nav-links {
    display: none;
    position: absolute; left: 16px; right: 16px; top: var(--nav-h);
    flex-direction: column; align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .cp-nav-links.is-open { display: flex; }
  .cp-title { font-size: 24px; }
}

@media (max-width: 640px) {
  :root { --gutter: 14px; --space-section: 34px; --gap-grid: 12px; --pad-card: 16px; --pad-card-sm: 14px; }
  .cp-grid--2, .cp-grid--3, .cp-grid--4, .cp-grid--6 { grid-template-columns: minmax(0, 1fr); }
  .cp-toast-wrap { left: 16px; right: 16px; top: 78px; }
  .cp-modal { padding: 20px; max-height: 88vh; }
}
