/* ============================================================
   内蒙古税务 · 数据支撑平台教学演示套件  统一主题
   ============================================================ */
:root {
  --navy: #0E3A62;
  --blue: #005DA2;
  --blue-mid: #2E7CB8;
  --blue-light: #5B9BD5;
  --pale: #E9F1F8;
  --amber: #E0912C;
  --amber-l: #F7E9CE;
  --teal: #12807A;
  --teal-l: #DEF0EE;
  --red: #C0392B;
  --red-l: #FBE9E7;
  --ink: #1F2933;
  --grey: #5A6472;
  --line: #D6DEE7;
  --soft: #F5F7FA;
  --white: #ffffff;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 2px 10px rgba(14, 58, 98, .08);
  --shadow-lg: 0 8px 28px rgba(14, 58, 98, .16);

  --fs-body: 15px;
  --maxw: 1240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 投影模式：整体放大 */
body.projection { --fs-body: 18px; }
body.projection .page-title { font-size: 34px; }
body.projection .card { padding: 22px 24px; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 64px; }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  background: linear-gradient(100deg, var(--navy) 0%, var(--blue) 62%, var(--blue-mid) 100%);
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 2px 12px rgba(14, 58, 98, .22);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .38);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: -.5px;
}
.brand-txt strong { display: block; font-size: 15px; line-height: 1.35; font-weight: 600; }
.brand-txt span { font-size: 12px; opacity: .78; }
.topnav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a {
  color: rgba(255, 255, 255, .88);
  font-size: 13.5px;
  padding: 6px 11px;
  border-radius: 7px;
  transition: .15s;
  white-space: nowrap;
}
.topnav a:hover { background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; }
.topnav a.active { background: rgba(255, 255, 255, .24); color: #fff; font-weight: 600; }
.btn-proj {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .40);
  color: #fff; font-size: 12.5px; padding: 6px 12px;
  border-radius: 7px; cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.btn-proj:hover { background: rgba(255, 255, 255, .28); }

/* ---------------------------------------------------------- 页头 */
.page-head { padding: 30px 0 22px; }
.eyebrow {
  display: inline-block;
  font-size: 12.5px; letter-spacing: 2px; font-weight: 700;
  color: var(--blue); background: var(--pale);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 12px;
}
.page-title {
  font-size: 29px; font-weight: 700; color: var(--navy);
  margin: 0 0 8px; line-height: 1.35; letter-spacing: -.3px;
}
.page-desc { color: var(--grey); font-size: 15px; margin: 0; max-width: 860px; }

/* ---------------------------------------------------------- 通用件 */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

.sec-title {
  font-size: 19px; font-weight: 700; color: var(--navy);
  margin: 30px 0 14px; padding-left: 12px;
  border-left: 4px solid var(--amber);
  line-height: 1.4;
}
.sec-title small { font-weight: 400; font-size: 13.5px; color: var(--grey); margin-left: 10px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .g3, .g4 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .g2 { grid-template-columns: 1fr; } }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 9px;
  border-radius: 20px; font-weight: 600; line-height: 1.7;
}
.tag-blue { background: var(--pale); color: var(--blue); }
.tag-teal { background: var(--teal-l); color: var(--teal); }
.tag-amber { background: var(--amber-l); color: #9c6417; }
.tag-red { background: var(--red-l); color: var(--red); }
.tag-grey { background: #EEF1F5; color: var(--grey); }

.muted { color: var(--grey); }
.small { font-size: 13px; }
.mono { font-family: "Cascadia Mono", Consolas, "Courier New", monospace; }

/* 提示条 */
.note {
  background: var(--pale); border-left: 4px solid var(--blue);
  padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 14px;
  margin-top: 14px;
}
.note.warn { background: var(--amber-l); border-left-color: var(--amber); }
.note.danger { background: var(--red-l); border-left-color: var(--red); }
.note.ok { background: var(--teal-l); border-left-color: var(--teal); }
.note b { color: var(--navy); }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  background: var(--navy); color: #fff; font-weight: 600;
  padding: 9px 12px; text-align: left; font-size: 13.5px;
}
table.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tbody tr:nth-child(even) { background: #FAFCFE; }
table.tbl tbody tr:hover { background: var(--pale); }

/* 按钮 */
.btn {
  display: inline-block; border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  padding: 7px 15px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-family: inherit; transition: .15s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--navy); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* 代码 */
pre.code {
  background: #10243A; color: #DCE8F5;
  padding: 13px 16px; border-radius: 9px;
  font-size: 13px; line-height: 1.65; overflow-x: auto;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  margin: 10px 0 0;
}
pre.code .kw { color: #7FB3E0; font-weight: 600; }
pre.code .str { color: #9BD3A8; }
pre.code .cm { color: #6B7F96; font-style: italic; }
pre.code .bad { color: #FF9B8E; font-weight: 600; }
pre.code .good { color: #7EE0B8; font-weight: 600; }

/* 页脚 */
.footer {
  text-align: center; color: var(--grey); font-size: 12.5px;
  padding: 26px 0 10px; border-top: 1px solid var(--line); margin-top: 40px;
}

.hide { display: none !important; }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.mt8 { margin-top: 8px; }
.mb0 { margin-bottom: 0; }

/* 键盘提示 */
.kbd {
  display: inline-block; background: #fff; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px;
  font-size: 12px; font-family: inherit; color: var(--grey);
}

/* ============ AI 智能助手（全局悬浮） ============ */
.ai-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 9999;
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff; border: none; border-radius: 30px;
  padding: 11px 18px 11px 14px; font-size: 14.5px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,93,162,.40);
  transition: transform .18s, box-shadow .18s;
}
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,93,162,.52); }
.ai-fab .ico { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 15px; }
.ai-fab .pulse { width: 9px; height: 9px; border-radius: 50%; background: #7EE0B8;
  box-shadow: 0 0 0 0 rgba(126,224,184,.7); animation: aipulse 1.8s infinite; margin-left: 2px; }
@keyframes aipulse { 0% { box-shadow: 0 0 0 0 rgba(126,224,184,.7); } 70% { box-shadow: 0 0 0 9px rgba(126,224,184,0); } 100% { box-shadow: 0 0 0 0 rgba(126,224,184,0); } }

.ai-panel {
  position: fixed; right: 22px; bottom: 80px; z-index: 9998;
  width: 360px; max-width: calc(100vw - 36px); max-height: 70vh;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(14,27,43,.32); border: 1px solid var(--line);
  display: flex; flex-direction: column; transform: translateY(16px) scale(.98);
  opacity: 0; pointer-events: none; transition: .22s ease;
}
.ai-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.ai-head { background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff;
  padding: 13px 16px; display: flex; align-items: center; gap: 10px; }
.ai-head .av { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-size: 16px; }
.ai-head .ti { font-weight: 700; font-size: 14.5px; line-height: 1.15; }
.ai-head .sub { font-size: 11px; opacity: .82; }
.ai-head .x { margin-left: auto; background: rgba(255,255,255,.16); border: none; color: #fff;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px;
  background: #F4F7FB; }
.ai-msg { max-width: 86%; font-size: 13.3px; line-height: 1.55; padding: 9px 12px; border-radius: 12px; }
.ai-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-top-left-radius: 3px; }
.ai-msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-top-right-radius: 3px; }
.ai-msg b { color: #c0392b; }
.ai-msg.bot b { color: var(--blue); }
.ai-msg .lnk { color: var(--blue); text-decoration: underline; cursor: pointer; }
.ai-typing { align-self: flex-start; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; display: flex; gap: 5px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9bb3cc; animation: aiblink 1.2s infinite; }
.ai-typing i:nth-child(2){ animation-delay: .2s; } .ai-typing i:nth-child(3){ animation-delay: .4s; }
@keyframes aiblink { 0%,60%,100%{ opacity:.3; transform: translateY(0);} 30%{ opacity:1; transform: translateY(-3px);} }
.ai-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 14px 0; background: #F4F7FB; }
.ai-chip { font-size: 12px; padding: 6px 11px; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); cursor: pointer; font-family: inherit; transition: .15s; }
.ai-chip:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.ai-input { display: flex; gap: 8px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid var(--line); }
.ai-input input { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  font-size: 13px; font-family: inherit; color: var(--navy); }
.ai-input input:focus { outline: 2px solid var(--blue); }
.ai-input button { background: var(--blue); color: #fff; border: none; border-radius: 9px;
  padding: 0 16px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 13px; }
.ai-input button:hover { background: var(--navy); }
.ai-foot { font-size: 10.5px; color: var(--grey); text-align: center; padding: 0 12px 9px; background: #fff; }
@media (max-width: 640px) { .ai-panel { right: 10px; bottom: 74px; } .ai-fab { right: 14px; bottom: 14px; } }


/* ============================================================
   响应式适配：PC / 平板 / 手机   ——  手机采用抽屉式导航（不同样式）
   ============================================================ */

/* 汉堡按钮（默认隐藏，平板/手机显示） */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 36px; margin-left: auto;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.4);
  border-radius: 8px; cursor: pointer; padding: 0;
}
.nav-toggle .bar { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; margin: 0 auto; transition: .22s; }
.topbar.open .nav-toggle .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topbar.open .nav-toggle .bar:nth-child(2) { opacity: 0; }
.topbar.open .nav-toggle .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 平板及以下：10 个导航项改为抽屉式下拉，避免挤在一行 */
@media (max-width: 1024px) {
  .topbar-inner { flex-wrap: nowrap; gap: 10px; padding: 0 14px; }
  .nav-toggle { display: flex; }
  .brand-txt strong { font-size: 14px; }
  .brand-txt span { display: none; }
  .topnav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: linear-gradient(160deg, var(--navy), #0A2C4C);
    max-height: 0; overflow: hidden; padding: 0; margin: 0;
    box-shadow: 0 14px 26px rgba(0,0,0,.30);
    transition: max-height .26s ease;
  }
  .topbar.open .topnav { max-height: 80vh; overflow-y: auto; }
  .topnav a {
    padding: 13px 20px; border-radius: 0; font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,.08); white-space: normal;
  }
  .topnav a.active { background: rgba(255,255,255,.18); }
}

/* 平板竖屏：内容留白稍减 */
@media (max-width: 1024px) {
  .wrap { padding: 0 18px 56px; }
  .hero { padding: 30px 26px; }
}

/* 手机：更紧凑、字体略小、表格可横向滚动 */
@media (max-width: 768px) {
  :root { --fs-body: 14px; }
  .wrap { padding: 0 14px 44px; }
  .hero { padding: 24px 18px; border-radius: 14px; margin-top: 16px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13.5px; }
  .hero-meta { gap: 14px 20px; }
  .hero-meta b { font-size: 20px; }
  .page-head { padding: 20px 0 14px; }
  .page-title { font-size: 22px; }
  body.projection .page-title { font-size: 26px; }
  .page-desc { font-size: 14px; }
  .sec-title { font-size: 17px; margin: 22px 0 12px; }
  .card { padding: 15px; }
  body.projection .card { padding: 16px 18px; }
  .flow-row { flex-direction: column; }
  .flow-step { min-width: 0; }
  .grid { gap: 12px; }
  .note { padding: 11px 13px; font-size: 13px; }

  .stage-canvas { padding: 14px; min-height: 0; }
  .pipeline { gap: 5px; }
  .pipeline .stage { flex: 1 1 44%; min-width: 0; padding: 8px 9px; }
  .pipeline .stage .st { font-size: 12px; }
  .pipeline .stage .sd { font-size: 10px; }
  .dyn-wrap { grid-template-columns: 1fr; }
  .gauge-box { max-width: 220px; margin: 0 auto; }
  .metric-row { gap: 10px; }
  .metric { padding: 9px 12px; }
  .metric b { font-size: 21px; }
  .kpi { min-width: 0; flex: 1 1 42%; }
  .kpi .v { font-size: 20px; }
  .bar-name { width: 76px; font-size: 11.5px; }
  .bar-val { width: 52px; }

  .console { gap: 10px; padding: 12px 14px; }
  .console .spacer { display: none; }
  .console .ask { min-width: 0; width: 100%; order: 3; }
  .trap-head { padding: 12px 14px; }
  .trap-head h4 { font-size: 15px; }
  .trap-body { padding: 14px; }
  .sql-bar { padding: 9px 12px; }
  .sql-bar .t { font-size: 12px; }
  .sql-code { padding: 12px 14px; font-size: 12px; min-height: 120px; }
  .sql-actions { gap: 8px; }

  /* 表格在手机上缩小字号、避免挤压变形 */
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 7px 9px; }
  .r-tbl, .scan, .map { font-size: 12px; }
  .r-tbl th, .r-tbl td, .scan th, .scan td, .map th, .map td { padding: 6px 8px; }
}

/* 超小屏（≤560）：字号再收一档，关键操作按钮全宽 */
@media (max-width: 560px) {
  .hero h1 { font-size: 20px; }
  .page-title { font-size: 20px; }
  .console .btn-l, .console .btn-l.ghost { flex: 1; text-align: center; }
  .sql-actions .btn { flex: 1; text-align: center; }
  .entry h3 { font-size: 17px; }
  .kpi { flex: 1 1 100%; }
  .calc label { font-size: 12.5px; }
}

