/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #2b6ff2;
  --blue-deep: #1e5fe0;
  --blue-light: #eaf1ff;
  --text: #1f2329;
  --text-2: #51565e;
  --text-3: #8a9099;
  --line: #e6e9ef;
  --bg: #f2f4f8;
  --card: #ffffff;
  --red: #e34d59;
  --green: #21a675;
  --orange: #ff8f1f;
  --purple: #7b5cf0;
}
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; }
.app { display: flex; flex-direction: column; height: 100vh; min-width: 1080px; }

/* ========== 顶部栏 ========== */
.topbar {
  height: 52px; flex: 0 0 52px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px;
  padding: 0 12px 0 12px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.03);
  z-index: 20;
}
/* 品牌区固定宽度与左侧导航（150px）对齐，企业框从侧栏右边界之后开始 */
.brand { display: flex; align-items: center; gap: 7px; flex: 0 0 150px; }
.brand-icon { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#4d9bff,#2359d6); color: #fff; display: grid; place-items: center; font-size: 20px; box-shadow: 0 2px 6px rgba(43,111,242,.28); }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; color: #14366f; }
.ico-xs { width: 12px; height: 12px; }
.top-divider { width: 1px; height: 18px; background: var(--line); flex: 0 0 auto; }

/* 企业选择下拉（真实平台样式） */
.company-select { position: relative; flex: 0 0 auto; margin-left: 6px; }
.company-picker { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 262px; max-width: 300px; height: 32px; color: var(--text); background: #fff; border: 1px solid #4f7cff; border-radius: 5px; padding: 0 10px; font-size: 12px; box-shadow: 0 1px 3px rgba(43,111,242,.10); transition: border-color .15s, box-shadow .15s; }
.company-picker:hover { border-color: #2f5fe0; box-shadow: 0 2px 8px rgba(43,111,242,.18); }
.company-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-caret { color: #8a94a6; transition: transform .18s; }
.company-select.open .company-caret { transform: rotate(180deg); }
.company-menu { position: absolute; top: calc(100% + 4px); left: 0; min-width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 8px 24px rgba(20,45,90,.16); z-index: 60; overflow: hidden; }
.company-menu[hidden] { display: none; }
.company-menu-list { max-height: 260px; overflow-y: auto; }
.company-option { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; border: none; background: #fff; padding: 9px 13px; font-size: 12px; color: #454c5c; }
.company-option:hover { background: #f5f8ff; }
.company-option.selected { color: #2f6bff; font-weight: 600; background: #f0f5ff; }
.company-option .co-check { width: 14px; height: 14px; color: #2f6bff; flex: 0 0 auto; }
.company-option .co-check svg { width: 14px; height: 14px; }
.company-add { width: 100%; display: flex; align-items: center; justify-content: center; gap: 5px; border: none; border-top: 1px solid var(--line); background: #fff; padding: 9px; font-size: 12px; color: #606a7d; cursor: pointer; }
.company-add:hover { background: #f5f8ff; color: var(--blue); }
.company-add svg { width: 13px; height: 13px; }

/* AI开票按钮（真实平台样式：白底紫字） */
.ai-entry { display: flex; align-items: center; gap: 5px; color: #6b47e6; background: #fff; border: 1px solid #d8cdfb; padding: 6px 11px; border-radius: 5px; font-weight: 600; font-size: 12px; }
.ai-entry svg { width: 15px; height: 15px; color: #8a63f2; }
.ai-entry:hover { background: #f7f3ff; border-color: #b99ff5; }
/* 当前企业常驻标识：纯展示、不参与选择，完整显示企业全称 */
.current-company-chip { display: flex; align-items: center; gap: 7px; max-width: 360px; min-height: 36px; padding: 5px 14px; border: 1px solid rgba(255,255,255,.38); border-radius: 10px; background: linear-gradient(135deg,#2f6bff,#4d9bff); color: #fff; font-size: 12px; line-height: 1.3; font-weight: 600; flex: 0 1 auto; min-width: 0; box-shadow: 0 3px 10px rgba(47,107,255,.28); cursor: default; }
.current-company-chip[hidden] { display: none; }
.current-company-chip .cc-ico { width: 16px; height: 16px; flex: 0 0 auto; }
.current-company-chip .cc-label { color: rgba(255,255,255,.82); font-weight: 500; flex: 0 0 auto; }
.current-company-chip b { font-weight: 700; white-space: normal; word-break: break-all; }
.topbar-right { margin-left: auto; margin-right: 26px; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
/* 税局登录状态做成独立胶囊，整体左移并增强可读性 */
.tax-login { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 5px 12px; background: #f5f8ff; border: 1px solid #d7e3ff; border-radius: 16px; box-shadow: 0 1px 3px rgba(43,111,242,.08); }
.tax-label { color: #3d4759; font-weight: 600; }
.tax-label-auth { margin-left: 4px; }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 3px; }
.tax-login .tag { font-size: 12px; padding: 3px 9px; font-weight: 600; }
.tag-warn { color: #b96905; background: #fff3e0; border: 1px solid #ffd899; }
.tag-green { color: #1d7a46; background: #eefaf2; border: 1px solid #b7e4c7; }
.link-btn { color: var(--blue); font-size: 12px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.top-link { display: flex; align-items: center; gap: 3px; color: var(--text-2); font-size: 11px; }
.top-link svg { font-size: 15px; }
.top-link:hover { color: var(--blue); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#7fb0ff,#3f74e0); color: #fff; display: grid; place-items: center; font-weight: 600; box-shadow: 0 0 0 2px #eef3ff; }
.avatar span { font-size: 13px; }

/* ========== 主体布局 ========== */
.body-wrap { flex: 1; display: flex; min-height: 0; position: relative; }

/* ========== 左侧导航 ========== */
.sidebar { width: 150px; flex: 0 0 150px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; padding: 8px 0 20px; z-index: 10; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #d5d9e0; border-radius: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item { width: 100%; min-height: 38px; display: flex; flex-direction: row; align-items: center; gap: 9px; color: #525b6d; font-size: 13px; padding: 7px 16px; position: relative; transition: background .15s, color .15s; text-align: left; }
.side-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.side-item:hover { color: var(--blue); background: #f5f8ff; }
.side-item.active { color: var(--blue); font-weight: 600; background: #eef4ff; }
.side-item.active::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.side-item.mobile-highlight { color: var(--blue); background: var(--blue-light); border-radius: 0; margin: 0; width: 100%; font-weight: 600; }
.side-item.mobile-highlight::before { display: none; }

/* ========== 主内容 ========== */
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 10px 16px 30px; }
.main::-webkit-scrollbar { width: 7px; }
.main::-webkit-scrollbar-thumb { background: #cfd5de; border-radius: 4px; }
.main::-webkit-scrollbar-track { background: transparent; }

/* 面包屑 */
.breadcrumb { display: flex; align-items: center; justify-content: space-between; height: 30px; margin-bottom: 8px; }
.crumb-left { display: flex; align-items: center; gap: 8px; }
.crumb-home { color: var(--blue); font-size: 15px; display: grid; place-items: center; }
.crumb-sep { color: #c4c9d1; }
.crumb-current { color: var(--blue); font-weight: 600; }
.crumb-right { display: flex; align-items: center; gap: 14px; }
.crumb-action { display: flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 12px; }
.crumb-action svg { font-size: 14px; }
.crumb-action:hover { color: var(--blue); }
.crumb-action.icon-only { font-size: 15px; }

/* ========== 卡片通用 ========== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 7px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(20,40,80,.03); }
.card-title { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; padding: 13px 16px 10px; }
.card-title::before { content: ""; width: 3px; height: 14px; background: var(--blue); border-radius: 2px; margin-right: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 16px; }
.card-head .card-title { padding-bottom: 10px; }
.head-tools { display: flex; align-items: center; gap: 8px; }
.text-link { color: var(--blue); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.text-link:hover { text-decoration: underline; }
.ico-sm { font-size: 14px; }
.muted { color: var(--text-3); }
.icon-btn { width: 26px; height: 26px; display: grid; place-items: center; color: var(--blue); border-radius: 4px; font-size: 15px; }
.icon-btn:hover { background: var(--blue-light); }

/* ========== 常用功能 ========== */
.quick-card { padding-bottom: 14px; }
.quick-grid { display: grid; grid-template-columns: repeat(8, 1fr); padding: 4px 16px 0; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 10px 2px 8px; position: relative; }
.quick-item:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 12px; bottom: 16px; width: 1px; background: #eef0f4; }
.quick-icon { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 22px; box-shadow: 0 3px 8px rgba(0,0,0,.08); transition: transform .15s; }
.quick-item:hover .quick-icon { transform: translateY(-3px); }
.qi-purple { background: linear-gradient(135deg,#a07bf7,#6f4de4); }
.qi-green { background: linear-gradient(135deg,#4bd39a,#12a870); }
.qi-orange { background: linear-gradient(135deg,#ffb55c,#f58a1f); }
.qi-blue { background: linear-gradient(135deg,#5fb0ff,#2c7bf0); }
.qi-blue2 { background: linear-gradient(135deg,#69a9ff,#2f6fe6); }
.qi-orange2 { background: linear-gradient(135deg,#ffae52,#f2871e); }
.qi-amber { background: linear-gradient(135deg,#ffc35c,#f59a14); }
.qi-blue3 { background: linear-gradient(135deg,#6ab4ff,#2e7de8); }
.quick-label { color: var(--text-2); font-size: 12px; }
.quick-item:hover .quick-label { color: var(--blue); }

/* ========== 开票预警 ========== */
.alert-card { padding-bottom: 16px; }
.alert-grid { display: grid; grid-template-columns: 1fr 1fr; padding: 6px 26px 0; }
.alert-item { padding: 6px 0 2px; }
.alert-label { color: var(--text-2); font-size: 12px; margin-bottom: 10px; }
.alert-value { font-size: 22px; font-weight: 700; color: var(--text); font-family: "Arial", "Microsoft YaHei", sans-serif; letter-spacing: .3px; }

/* ========== 视图切换 ========== */
.view-tabs { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 4px; }
.view-tab { font-size: 13px; color: var(--text-2); padding: 6px 4px; position: relative; }
.view-tab.active { color: var(--blue); font-weight: 700; }
.view-tab.active::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 2px; background: var(--blue); border-radius: 2px; }
.view-tabs-right { margin-left: auto; }

/* ========== 开票概览 ========== */
.overview-card { padding-bottom: 6px; }
.overview-controls { display: flex; align-items: center; gap: 14px; }
.seg-tabs { display: flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.seg-tab { padding: 5px 12px; font-size: 12px; color: var(--text-2); background: #fff; border-right: 1px solid var(--line); }
.seg-tab:last-child { border-right: 0; }
.seg-tab.active { color: var(--blue); font-weight: 600; background: var(--blue-light); }
.seg-tab:hover:not(.active) { background: #f7f9fc; }
.date-range { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12px; }
.date-box { border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; color: var(--text-2); background: #fff; font-family: Arial, sans-serif; }
.date-to { color: var(--text-3); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 12px 26px 18px; }
.metric { padding: 4px 20px; border-right: 1px solid #eef0f4; }
.metric:last-child { border-right: 0; }
.metric-label { color: var(--text-2); font-size: 12px; margin-bottom: 12px; display: flex; align-items: center; gap: 4px; }
.metric-hint { color: var(--text-3); }
.metric-value { font-size: 22px; font-weight: 700; color: var(--text); font-family: "Arial", "Microsoft YaHei", sans-serif; letter-spacing: .3px; }
.metric-accent { background: linear-gradient(180deg,#f4f8ff,#fff); border-radius: 6px; }
.metric-accent .metric-label { color: var(--blue); font-weight: 600; }
.accent { color: var(--blue); }
.accent-text { color: var(--blue); font-size: 24px; }
.metric-sub { color: var(--text-3); font-size: 11px; margin-top: 8px; }

/* ========== 表格 ========== */
.summary-card { padding-bottom: 8px; }
.table-wrap { padding: 4px 16px 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { border: 1px solid #e8ebf1; padding: 9px 10px; text-align: right; font-family: "Arial", "Microsoft YaHei", sans-serif; }
.data-table thead th { background: #f5f7fa; color: var(--text-2); font-weight: 600; text-align: center; }
.data-table thead tr:first-child th { color: var(--text); font-weight: 700; }
.data-table .type-col { text-align: left; width: 150px; }
.data-table .type-cell { text-align: left; color: var(--text); font-weight: 500; }
.tree-toggle { display: inline-block; width: 16px; color: var(--text-3); font-size: 11px; }
.data-table tbody td { color: var(--text-2); }
.data-table .red-num { color: var(--red); }
.data-table .total-row td { background: #fafbfd; font-weight: 600; }

/* ========== 趋势分析 ========== */
.trend-card { min-height: 170px; }
.trend-controls { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.trend-placeholder { position: relative; margin: 4px 16px 16px; height: 120px; border: 1px dashed #e8ebf1; border-radius: 5px; overflow: hidden; }
.chart-grid { position: absolute; inset: 0; background-image: linear-gradient(#f1f3f7 1px, transparent 1px), linear-gradient(90deg,#f1f3f7 1px, transparent 1px); background-size: 100% 30px, 80px 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #b6bcc6; font-size: 12px; }

/* ========== 提示 ========== */
.toast { position: fixed; left: 50%; top: 70px; transform: translate(-50%, -12px); background: rgba(31,35,41,.92); color: #fff; padding: 9px 18px; border-radius: 6px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ========== 页面切换 ========== */
.page { display: none; }
.page.active { display: block; animation: pageIn .18s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.page-title { font-size: 18px; font-weight: 700; color: var(--text); display: flex; align-items: center; }
.page-title::before { content: ""; width: 3px; height: 17px; background: var(--blue); border-radius: 2px; margin-right: 9px; }
.page-actions { display: flex; gap: 8px; }

/* ========== 按钮 ========== */
.btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--text-2); font-size: 12px; white-space: nowrap; transition: all .15s; }
.btn svg { font-size: 14px; }
.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(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.btn-danger { color: var(--red); border-color: #f3c2c7; }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 11px; }
.btn-text { border: 0; background: none; color: var(--blue); padding: 0 4px; }
.btn-text:hover { text-decoration: underline; }
.btn-text.danger { color: var(--red); }

/* ========== 筛选栏 ========== */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filter-item { display: flex; flex-direction: column; gap: 5px; }
.filter-item label { font-size: 11px; color: var(--text-3); }
.filter-item input, .filter-item select { height: 30px; border: 1px solid var(--line); border-radius: 4px; padding: 0 9px; font-size: 12px; color: var(--text); background: #fff; min-width: 130px; }
.filter-item input[type="date"] { min-width: 130px; }
.filter-item input:focus, .filter-item select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-light); }

.filter-spacer { flex: 1; }
.filter-item.grow { flex: 1; min-width: 220px; }
.filter-item.grow input { width: 100%; min-width: 0; }
input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--blue); cursor: pointer; }

/* ========== 子标签 ========== */
.sub-tabs { display: flex; gap: 0; padding: 0 16px; border-bottom: 1px solid var(--line); }
.sub-tab { padding: 12px 16px; font-size: 13px; color: var(--text-2); position: relative; }
.sub-tab.active { color: var(--blue); font-weight: 600; }
.sub-tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--blue); }

/* ========== 列表表格 ========== */
.list-table thead th { text-align: left; white-space: nowrap; }
.list-table tbody td { text-align: left; color: var(--text-2); }
.list-table tbody tr:hover { background: #f7faff; }
.list-table .num { text-align: right; font-family: Arial, sans-serif; }
.list-table .ops { white-space: nowrap; }
.empty-row td { text-align: center !important; color: var(--text-3) !important; padding: 36px 10px !important; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.st-normal { color: var(--green); background: #e7f7f0; }
.st-red { color: var(--red); background: #fdecee; }
.st-void { color: var(--text-3); background: #f0f1f3; }
.tag-blue { color: var(--blue); background: var(--blue-light); border: 1px solid #c8daff; padding: 2px 7px; border-radius: 3px; }
.red-text { color: var(--red) !important; }

/* ========== 分页 ========== */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px 16px; font-size: 12px; color: var(--text-3); }
.pagination .pg-info { margin-right: auto; }
.pg-btn { min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text-2); font-size: 12px; }
.pg-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pg-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pg-ellipsis { padding: 0 2px; color: var(--text-3); }
.pg-size { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px; white-space: nowrap; }
.pg-size select { height: 28px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text-2); font-size: 12px; }
.company-pager { flex-wrap: wrap; gap: 5px; }

/* ========== 提示条 ========== */
.tip-bar { display: flex; align-items: center; gap: 7px; margin: 14px 16px 0; padding: 9px 12px; background: #f0f7ff; border: 1px solid #d7e8ff; border-radius: 5px; color: #4a72b8; font-size: 12px; }
.tip-bar svg { flex: 0 0 auto; font-size: 15px; }
.tip-bar.warn { align-items: flex-start; background: #fff8e6; border-color: #ffe0a3; color: #8a5a08; line-height: 1.7; }
.tip-bar.warn svg { color: #e89a12; margin-top: 2px; }
.tip-bar.warn strong { color: #c2471b; }
.license-check { display: flex; align-items: flex-start; gap: 8px; margin: 0 16px 16px; padding: 10px 12px; background: #fafbfd; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; color: #5b6472; line-height: 1.7; cursor: pointer; }
.license-check input { margin-top: 3px; accent-color: var(--blue); flex: 0 0 auto; }
.license-check strong { color: #c2471b; }
/* 创建企业：企业名称联想下拉 */
.suggest-field { position: relative; }
.company-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 80; max-height: 168px; overflow-y: auto; background: #fff; border: 1px solid #cfd9ee; border-radius: 5px; box-shadow: 0 10px 28px rgba(20,45,90,.18); }
.company-suggest[hidden] { display: none; }
.company-suggest-item { width: 100%; display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; text-align: left; border-bottom: 1px solid #f0f2f6; }
.company-suggest-item:last-child { border-bottom: none; }
.company-suggest-item:hover, .company-suggest-item.active { background: #f0f5ff; }
.company-suggest-item b { font-size: 12px; color: var(--text); font-weight: 600; }
.company-suggest-item span { font-size: 11px; color: #7a8494; }
.company-suggest-item em { font-style: normal; color: #2b6ff2; background: #eaf1ff; border-radius: 3px; padding: 1px 5px; margin-left: 6px; }
.company-suggest-empty { padding: 11px 12px; font-size: 12px; color: var(--text-3); }
.escid-chip { display: inline-block; max-width: 150px; padding: 2px 7px; border: 1px solid #d7e3f7; border-radius: 4px; background: #f5f9ff; color: #4a6fa8; font-size: 11px; font-family: Consolas, Monaco, monospace; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.escid-chip:hover { background: #e8f1ff; border-color: #9dbcf0; }
.company-suggest-head { padding: 7px 12px; font-size: 11px; font-weight: 600; color: #4a72b8; background: #f0f7ff; border-bottom: 1px solid #d7e8ff; }
.company-suggest-err { padding: 7px 12px; font-size: 11px; color: #a35a08; background: #fff8e6; border-bottom: 1px solid #ffe0a3; }

/* ========== 统计卡片 ========== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(20,40,80,.03); }
.stat-label { font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text); font-family: Arial, sans-serif; }
.stat-sub { font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ========== 图表 ========== */
.chart-wrap { position: relative; margin: 8px 16px 18px; height: 150px; }
.chart-large { height: 240px; }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 6px; padding: 18px 4px 22px; border-bottom: 1px solid var(--line); background-image: repeating-linear-gradient(to top, #f2f4f8 0, #f2f4f8 1px, transparent 1px, transparent 25%); }
.chart-col { flex: 1; min-width: 14px; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.chart-bar { width: 62%; max-width: 34px; min-height: 2px; background: linear-gradient(180deg,#5b9bff,#2b6ff2); border-radius: 3px 3px 0 0; transition: height .4s ease; position: relative; }
.chart-bar:hover { filter: brightness(1.1); }
.chart-bar::after { content: attr(data-val); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-2); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.chart-bar:hover::after { opacity: 1; }
.chart-xlabel { position: absolute; bottom: -19px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-3); white-space: nowrap; }
.chart-empty-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #b6bcc6; font-size: 12px; }

/* ========== 表单 ========== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; padding: 16px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12px; color: var(--text-2); }
.form-item label .req { color: var(--red); margin-right: 2px; }
.form-item input, .form-item select, .form-item textarea { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; font-size: 12px; color: var(--text); font-family: inherit; background: #fff; }
.form-item textarea { resize: vertical; line-height: 1.6; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-light); }
.form-item .err { color: var(--red); font-size: 11px; min-height: 0; }
.setting-actions { display: flex; gap: 10px; padding: 16px 16px 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-3); }
.empty-state svg { font-size: 48px; color: #c9d2e0; margin-bottom: 14px; }
.empty-state p { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.empty-state span { font-size: 12px; }

/* ========== 弹窗 ========== */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.modal-mask[hidden] { display: none; }
.modal { width: 620px; max-width: 100%; max-height: 90vh; background: #fff; border-radius: 9px; box-shadow: 0 18px 50px rgba(0,0,0,.22); display: flex; flex-direction: column; animation: modalIn .18s ease; }
.modal.wide { width: 880px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-close { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; color: var(--text-3); font-size: 16px; }
.modal-close:hover { background: #f2f4f8; color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 20px; border-top: 1px solid var(--line); }

/* 开票表单 */
.inv-section { margin-bottom: 18px; }
.inv-section-title { font-size: 13px; font-weight: 700; color: var(--text); padding-left: 8px; border-left: 3px solid var(--blue); margin-bottom: 12px; }
.inv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.inv-form-grid .full { grid-column: 1 / -1; }
.inv-items-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inv-items-table th, .inv-items-table td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.inv-items-table th { background: #f5f7fa; color: var(--text-2); font-weight: 600; }
.inv-items-table input, .inv-items-table select { width: 100%; border: 1px solid transparent; border-radius: 3px; padding: 5px 6px; font-size: 12px; background: #fff; color: var(--text); }
.inv-items-table input:focus, .inv-items-table select:focus { outline: none; border-color: var(--blue); }
.inv-items-table input[type="number"] { text-align: right; }
.inv-total-row { display: flex; justify-content: flex-end; gap: 26px; margin-top: 12px; font-size: 13px; }
.inv-total-row .t-item { color: var(--text-2); }
.inv-total-row .t-item b { color: var(--text); font-family: Arial, sans-serif; font-size: 15px; margin-left: 6px; }
.inv-total-row .t-grand b { color: var(--blue); }
.add-item-btn { margin-top: 8px; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; font-size: 12px; }
.detail-list .dl-item { display: flex; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.detail-list .dl-label { color: var(--text-3); min-width: 84px; }
.detail-list .dl-val { color: var(--text); font-weight: 500; word-break: break-all; }
.confirm-tip { font-size: 13px; color: var(--text-2); line-height: 1.8; }

/* ========== 响应式 ========== */
@media (max-width: 1180px) {
  .top-link:nth-of-type(2) { display: none; }
}

/* ========== 开票表单（真实平台完整版） ========== */
.modal.extra-wide { width: 1180px; }
.inv-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 14px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 5px; margin-bottom: 16px; }
.inv-top-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.inv-top-field > label:first-of-type { font-weight: 600; color: var(--text); }
.inv-top-field select { height: 26px; border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; font-size: 12px; color: var(--text); background: #fff; }
.radio-inline { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; color: var(--text-2); }
.radio-inline input[type=radio] { accent-color: var(--blue); }
.req { color: #e64340; margin-right: 2px; }
.lnk { color: var(--blue); font-size: 12px; text-decoration: none; margin-left: 8px; font-weight: 400; cursor: pointer; }
.lnk svg { width: 11px; height: 11px; vertical-align: -1px; }
.inv-party-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 16px; }
.inv-party { border: 1px solid var(--line); border-radius: 5px; padding: 12px 14px; }
.inv-party .inv-section-title { margin-bottom: 10px; }
.inv-party-type { display: flex; gap: 16px; margin-bottom: 10px; font-size: 12px; }
.inv-quota { font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.inv-quota b { color: #e64340; font-size: 13px; }
.inv-detail-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar-spacer { flex: 1; }
.btn-text { border: none; background: transparent; color: var(--blue); font-size: 12px; cursor: pointer; padding: 3px 6px; border-radius: 3px; }
.btn-text:hover { background: #eef4ff; }
.btn-text.danger { color: #e64340; }
.inv-detail-table input, .inv-detail-table select { padding: 4px 5px; }
.inv-detail-table .it-seq { color: var(--text-3); }
.inv-total-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; background: #fafbfc; border: 1px solid var(--line); border-top: none; padding: 9px 12px; font-size: 12px; }
.inv-total-row .t-item b { color: var(--text); font-size: 13px; margin: 0 4px; }
.inv-total-row .t-grand { color: var(--text-2); }
.upper-amt, .lower-amt { margin-left: 10px; color: var(--text-2); }
.upper-amt b { color: #e64340; }
.lower-amt b { color: #e64340; font-size: 13px; }
.inv-subtitle { font-size: 12px; font-weight: 600; color: var(--text); margin: 12px 0 8px; padding-left: 8px; border-left: 3px solid var(--blue); }
.inv-section-title.collapsible { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.inv-section-title.collapsible svg { width: 12px; height: 12px; }
.inv-form-grid textarea { width: 100%; border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; font-size: 12px; resize: vertical; color: var(--text); font-family: inherit; }
.inv-foot-left { margin-right: auto; display: flex; gap: 4px; }
.empty-row td { color: var(--text-3); text-align: center; padding: 14px !important; }

/* ========== 税局登录认证 ========== */
.tax-status-banner { display: flex; align-items: center; gap: 14px; background: linear-gradient(90deg,#fff9ec,#fffdf8); border: 1px solid #f4d89a; border-left: 4px solid #f0a826; border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; }
.tax-status-banner.ok { background: linear-gradient(90deg,#effaf3,#fbfffc); border-color: #bfe6cd; border-left-color: var(--green); }
.tax-status-banner.warn { background: linear-gradient(90deg,#fff8e6,#fffdf7); border-color: #ffe0a3; border-left-color: var(--orange); }
.tsb-icon { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: #e89a12; flex: 0 0 auto; box-shadow: 0 1px 4px rgba(180,120,20,.12); }
.tax-status-banner.ok .tsb-icon { color: #2e9e5b; }
.tsb-icon svg { width: 19px; height: 19px; }
.tsb-text { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.tsb-text b { font-size: 15px; color: #7a4e05; }
.tax-status-banner.ok .tsb-text b { color: #1d7a46; }
.tsb-text span { font-size: 13px; color: #5f533c; line-height: 1.7; font-weight: 500; }
.tax-status-banner.ok .tsb-text span { color: #3f6b51; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.tax-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.tax-card .card-title { margin-bottom: 0; padding: 14px 18px 12px; font-size: 15px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg,#f8faff,#fff); border-radius: 7px 7px 0 0; }
.tax-info-list { display: flex; flex-direction: column; padding: 6px 18px 12px; }
.tax-info-row { display: grid; grid-template-columns: 96px minmax(0,1fr); align-items: center; column-gap: 14px; min-height: 42px; padding: 10px 4px; border-bottom: 1px solid #eff1f5; font-size: 13px; }
.tax-info-row:last-child { border-bottom: none; }
.tax-info-row > span { color: #5b6472; font-weight: 500; }
.tax-info-row > b { color: var(--text); font-weight: 600; text-align: left; word-break: break-all; line-height: 1.6; }
.tax-info-row .tag { font-size: 12px; padding: 3px 9px; }
.tax-card-actions { margin: 0; padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; background: #fcfdff; border-radius: 0 0 7px 7px; }
/* 数电认证卡片独占整行，内部两列，避免右侧留白 */
.tax-grid > .tax-card:nth-child(3) { grid-column: 1 / -1; }
.tax-grid > .tax-card:nth-child(3) .tax-info-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 32px; padding-bottom: 4px; }
.tax-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.tax-feature { background: #f8faff; border: 1px solid #e9eefb; border-radius: 7px; padding: 14px 16px; display: flex; flex-direction: column; gap: 7px; }
.tax-feature b { font-size: 14px; color: #1f3f7d; }
.tax-feature span { font-size: 13px; color: #4d5666; line-height: 1.75; }
@media (max-width: 900px) {
  .tax-grid { grid-template-columns: minmax(0,1fr); }
  .tax-grid > .tax-card:nth-child(3) { grid-column: auto; }
  .tax-grid > .tax-card:nth-child(3) .tax-info-list { grid-template-columns: minmax(0,1fr); }
  .tax-feature-grid { grid-template-columns: minmax(0,1fr); }
}
.tax-login-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tax-login-tab { border: none; background: transparent; padding: 9px 18px; font-size: 13px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; }
.tax-login-tab.active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }
.qr-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 190px; color: var(--text-3); font-size: 12px; }
.qr-spinner { width: 28px; height: 28px; border: 3px solid #e5e9f0; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.qr-mock { width: 170px; height: 170px; border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: center; }
.progress-box { margin-top: 16px; padding: 12px 14px; background: #f7f9fc; border-radius: 5px; }
.progress-bar { height: 7px; background: #e5e9f0; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #4f7cff, #6ee7b7); border-radius: 4px; transition: width .3s ease; }
.progress-msg { font-size: 12px; color: var(--text-2); margin-top: 7px; }
.verify-result { margin-top: 14px; }
.verify-ok { display: flex; align-items: center; gap: 10px; background: #eefaf2; border: 1px solid #b7e4c7; border-radius: 5px; padding: 12px 14px; }
.verify-ok svg { width: 22px; height: 22px; color: #2e9e5b; }
.verify-ok div { display: flex; flex-direction: column; gap: 2px; }
.verify-ok b { font-size: 13px; color: #1d7a46; }
.verify-ok span { font-size: 12px; color: #4a7a5c; }

/* ========== 开票前置查询 ========== */
.precheck-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.precheck-item { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 12px 13px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.precheck-item:hover { border-color: #9db9f5; background: #f8faff; box-shadow: 0 2px 8px rgba(43,111,242,.08); }
.precheck-item.active { border-color: var(--blue); background: #f0f5ff; box-shadow: inset 3px 0 0 var(--blue); }
.precheck-item b { font-size: 13px; color: var(--text); }
.precheck-item span { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.precheck-item code { font-size: 10px; color: #8a94a6; background: transparent; padding: 0; }
.precheck-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.precheck-source { font-size: 11px; color: #8a94a6; background: #f0f2f6; border-radius: 3px; padding: 3px 8px; }
.precheck-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; margin-top: 10px; }
.precheck-form .form-item { display: flex; flex-direction: column; gap: 5px; }
.precheck-form label { font-size: 12px; color: var(--text-2); }
.precheck-form label em { color: #e54545; font-style: normal; }
.precheck-form input, .precheck-form select { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; font-size: 12px; color: var(--text); background: #fff; }
.precheck-form input:focus, .precheck-form select:focus { outline: none; border-color: var(--blue); }
.precheck-form .full { grid-column: 1 / -1; }
.precheck-actions { display: flex; gap: 10px; margin-top: 14px; }
.precheck-output { margin-top: 14px; }
.precheck-msg { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 4px; font-size: 12px; margin-bottom: 10px; }
.precheck-msg.ok { background: #eefaf2; border: 1px solid #b7e4c7; color: #1d7a46; }
.precheck-msg.err { background: #fff1f0; border: 1px solid #ffc9c4; color: #c0392b; }
.precheck-empty { color: var(--text-3); font-size: 12px; padding: 18px; text-align: center; background: #fafbfd; border: 1px dashed var(--line); border-radius: 5px; }

/* ========== 数电平台同步 ========== */
.sync-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sync-icon { width: 40px; height: 40px; border-radius: 8px; background: #eef4ff; color: var(--blue); display: grid; place-items: center; flex: 0 0 auto; }
.sync-icon svg { width: 20px; height: 20px; }
.sync-head > div:last-child { display: flex; flex-direction: column; gap: 3px; }
.sync-head b { font-size: 14px; color: var(--text); }
.sync-head span { font-size: 12px; color: var(--text-3); }
.sync-log { background: #1e2430; border-radius: 5px; padding: 10px 12px; max-height: 170px; overflow-y: auto; font-family: Consolas, Monaco, monospace; font-size: 11px; line-height: 1.9; }
.sync-log-line { display: flex; gap: 10px; color: #b8c2d4; }
.sync-log-line .sl-time { color: #6b7a94; flex: 0 0 auto; }
.sync-log-line.ok { color: #6ee7a8; }
.sync-log-line.err { color: #ff8a8a; }
.sync-invoice-result { margin-top: 14px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 5px; }
.sync-result-title { padding: 9px 12px; font-size: 12px; font-weight: 600; color: #1f3f7d; background: #f0f7ff; border-bottom: 1px solid #d7e8ff; }
.sync-invoice-result .data-table { margin: 0; }
.sync-invoice-result .tag { white-space: nowrap; }
.sync-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.ss-item { background: #f7f9fc; border-radius: 5px; padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.ss-item b { font-size: 18px; color: var(--text); }
.ss-item span { font-size: 11px; color: var(--text-3); }
.ss-item.add b { color: #2e9e5b; }
.ss-item.upd b { color: var(--blue); }
.ss-item.skip b { color: #e89a12; }
.api-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.api-config-item { display: flex; flex-direction: column; gap: 5px; }
.api-config-item.full { grid-column: 1 / -1; }
.api-config-item label { font-size: 12px; color: var(--text-3); }
.api-config-item b { font-size: 13px; color: var(--text); }
.api-config-item input { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; font-size: 12px; color: var(--text); }
.api-config-item input:focus { outline: none; border-color: var(--blue); }
.api-config-item select { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; font-size: 12px; color: var(--text); background: #fff; }
.api-config-item select:focus { outline: none; border-color: var(--blue); }
.api-config-actions { flex-direction: row; gap: 10px; align-items: center; padding-top: 4px; flex-wrap: wrap; }
.token-detail { background: #f7f9fc; border: 1px dashed var(--line); border-radius: 5px; padding: 8px 11px; font-size: 12px; color: var(--text-2); line-height: 1.7; }
code { background: #f0f2f6; padding: 1px 5px; border-radius: 3px; font-size: 11px; }

/* 认证接口契约（openapi.nmy.cn） */
.auth-contract-block { margin: 16px 16px 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 6px; background: #fcfdff; }
.auth-contract-block .sub-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.auth-contract-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.auth-contract-card { border: 1px solid #e4ecf7; border-radius: 5px; background: #fff; padding: 11px 12px; }
.auth-endpoint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auth-endpoint code { background: #eef3fb; color: #2b5fa8; font-size: 12px; padding: 3px 6px; }
.method-post { display: inline-block; background: #2e9e5b; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 6px; border-radius: 3px; letter-spacing: .4px; }
.auth-desc { font-size: 11px; color: var(--text-3); margin: 8px 0; line-height: 1.6; }
.auth-param-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.auth-param-table th, .auth-param-table td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; }
.auth-param-table thead th { background: #f2f5fa; color: var(--text-2); font-weight: 600; }
.auth-param-table .req { color: #c2471b; font-weight: 700; }
.auth-model-wrap { margin-top: 10px; border: 1px solid #e4ecf7; border-radius: 4px; overflow: hidden; }
.auth-model-label { background: #f2f5fa; color: var(--text-2); font-size: 10px; font-weight: 700; padding: 4px 8px; letter-spacing: .3px; }
.auth-model-code { margin: 0; padding: 8px 10px; background: #1e2430; color: #d6e2f0; font-family: Consolas, Monaco, monospace; font-size: 10.5px; line-height: 1.55; overflow-x: auto; white-space: pre; }
@media (max-width: 900px) { .auth-contract-grid { grid-template-columns: 1fr; } }

/* ========== AI 识别开票 ========== */
.ai-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ai-tab { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; padding: 9px 14px; font-size: 13px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; }
.ai-tab svg { width: 15px; height: 15px; }
.ai-tab.active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }
.ai-examples { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ai-examples > span { font-size: 12px; color: var(--text-3); }
.ai-chip { border: 1px solid #d9e2f5; background: #f4f7ff; color: #3f68c4; border-radius: 12px; padding: 3px 10px; font-size: 11px; cursor: pointer; }
.ai-chip:hover { background: #e8efff; }
.ai-dropzone { border: 2px dashed #c9d5ea; border-radius: 8px; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; background: #fafcff; transition: border-color .15s, background .15s; }
.ai-dropzone:hover, .ai-dropzone.drag { border-color: var(--blue); background: #f0f5ff; }
.ai-dropzone svg { width: 32px; height: 32px; color: #9db4e0; }
.ai-dropzone b { font-size: 13px; color: var(--text); }
.ai-dropzone span { font-size: 11px; color: var(--text-3); }
.ai-file-info { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; background: #f7f9fc; border-radius: 5px; }
.afi-icon { width: 30px; height: 30px; border-radius: 5px; background: #eef4ff; color: var(--blue); display: grid; place-items: center; }
.afi-icon svg { width: 16px; height: 16px; }
.ai-file-info > div { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ai-file-info b { font-size: 12px; color: var(--text); }
.ai-file-info span { font-size: 11px; color: var(--text-3); }
.ai-result { border: 1px solid #cfe3d6; border-radius: 7px; padding: 14px; background: #fbfefc; margin-bottom: 14px; }
.ai-result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ai-result-head > div { display: flex; align-items: center; gap: 6px; }
.ai-result-head svg { width: 17px; height: 17px; color: #7c5cd6; }
.ai-result-head b { font-size: 13px; color: var(--text); }
.ai-confidence { font-size: 11px; color: #2e9e5b; background: #eaf8f0; padding: 2px 8px; border-radius: 10px; }
.ai-result-summary { font-size: 12px; color: var(--text-2); background: #f0f5ff; padding: 7px 10px; border-radius: 4px; margin-bottom: 12px; }
.ai-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ai-result-grid .form-item.full { grid-column: 1 / -1; }
.ai-result .tip-bar { margin-top: 12px; }
.ai-history-box { border-top: 1px solid var(--line); padding-top: 12px; }
.ai-history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.ai-history-list { display: flex; flex-direction: column; gap: 4px; }
.ai-history-item { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: #f7f9fc; border-radius: 4px; padding: 6px 9px; cursor: pointer; text-align: left; }
.ai-history-item:hover { border-color: #c9d5ea; background: #f0f5ff; }
.ahi-icon { width: 20px; height: 20px; color: var(--blue); display: grid; place-items: center; flex: 0 0 auto; }
.ahi-icon svg { width: 14px; height: 14px; }
.ahi-text { flex: 1; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ahi-time { font-size: 11px; color: var(--text-3); flex: 0 0 auto; }
.ai-history-empty { font-size: 12px; color: var(--text-3); padding: 6px; }

/* ========== 顶部多标签栏（真实平台） ========== */
.tab-bar { display: flex; align-items: center; height: 36px; background: #f4f6fa; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.tab-scroll { flex: 1; display: flex; align-items: center; gap: 3px; overflow-x: auto; padding: 0 4px; height: 100%; scrollbar-width: none; }
.tab-scroll::-webkit-scrollbar { display: none; }
.tab-item { display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 9px; background: #e9edf3; border-radius: 4px 4px 0 0; font-size: 12px; color: #606a7d; cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.tab-item:hover { background: #e2e8f1; }
.tab-item.active { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 -1px 3px rgba(0,0,0,.04); }
.tab-item .tab-close { width: 14px; height: 14px; display: grid; place-items: center; border-radius: 3px; color: #a0a9b8; }
.tab-item .tab-close:hover { background: #d5dbe5; color: #e64340; }
.tab-item .tab-close svg { width: 10px; height: 10px; }
.tab-tools { display: flex; align-items: center; gap: 2px; padding: 0 6px; flex: 0 0 auto; }
.tab-tool { width: 24px; height: 24px; display: grid; place-items: center; border: none; background: transparent; color: #8a94a6; border-radius: 3px; cursor: pointer; }
.tab-tool:hover { background: #e5eaf2; color: var(--blue); }
.tab-tool svg { width: 14px; height: 14px; }
/* 隐藏各页面原有面包屑，改用标签栏 */
.main > .page > .breadcrumb { display: none; }

/* ========== AI 开票助手抽屉（真实平台常驻侧栏） ========== */
.ai-drawer { width: 330px; flex: 0 0 330px; background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; position: relative; z-index: 15; }
.ai-drawer.collapsed { display: none; }
.ai-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ai-dw-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--text); }
.ai-dw-title svg { width: 18px; height: 18px; color: #7c5cd6; }
.ai-dw-close { border: none; background: transparent; color: #9aa3b2; cursor: pointer; }
.ai-dw-close svg { width: 16px; height: 16px; }
.ai-dw-tabs { display: flex; gap: 3px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ai-dw-tab { display: inline-flex; align-items: center; gap: 4px; border: none; background: transparent; padding: 6px 9px; font-size: 12px; color: #6b7280; border-radius: 4px; cursor: pointer; }
.ai-dw-tab svg { width: 13px; height: 13px; }
.ai-dw-tab:hover { background: #f5f8ff; }
.ai-dw-tab.active { background: #f0f5ff; color: var(--blue); font-weight: 600; }
.ai-dw-body { flex: 1; overflow-y: auto; padding: 16px 14px; }
.ai-welcome { display: flex; flex-direction: column; gap: 10px; }
.ai-welcome-avatar { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg,#9b7bf0,#6b47e6); color: #fff; display: grid; place-items: center; }
.ai-welcome-avatar svg { width: 20px; height: 20px; }
.ai-welcome b { font-size: 13px; color: var(--text); }
.ai-welcome p { font-size: 12px; color: #6b7280; line-height: 1.8; margin: 0; }
.ai-msg { background: #f0f5ff; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--text-2); line-height: 1.7; margin-bottom: 10px; }
.ai-msg.user { background: #eef4ff; margin-left: 24px; }
.ai-dw-input-wrap { border-top: 1px solid var(--line); padding: 10px 12px 8px; }
.ai-dw-input { min-height: 52px; max-height: 120px; overflow-y: auto; font-size: 12px; color: var(--text); line-height: 1.6; outline: none; }
.ai-dw-input:empty::before { content: attr(data-ph); color: #a8b0bd; font-size: 11px; }
.ai-dw-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.ai-dw-toolgroup { display: flex; align-items: center; gap: 5px; }
.ai-dw-chip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); background: #fff; color: #6b7280; border-radius: 12px; padding: 3px 8px; font-size: 11px; cursor: pointer; }
.ai-dw-chip svg { width: 12px; height: 12px; }
.ai-dw-chip.on { border-color: var(--blue); color: var(--blue); background: #f0f5ff; }
.ai-dw-icon-btn { border: none; background: transparent; color: #9aa3b2; cursor: pointer; padding: 3px; }
.ai-dw-icon-btn svg { width: 15px; height: 15px; }
.ai-dw-send { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ai-dw-send svg { width: 15px; height: 15px; }
.ai-dw-foot { text-align: center; font-size: 10px; color: #b0b7c3; margin-top: 6px; }

/* ========== 开票表单：前置提示 + 更多菜单 + 发票预览 ========== */
.inv-pre-tip { margin-bottom: 10px; background: #f4f7ff; border-color: #d6e2ff; color: #4a6bb5; }
.inv-pre-tip .radio-inline { margin-left: 6px; }
.inv-more-wrap { position: relative; display: inline-flex; }
.inv-more-menu { position: absolute; bottom: calc(100% + 4px); left: 0; min-width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 6px 20px rgba(20,45,90,.14); z-index: 30; overflow: hidden; }
.inv-more-menu[hidden] { display: none; }
.inv-more-menu button { display: block; width: 100%; border: none; background: #fff; text-align: left; padding: 8px 13px; font-size: 12px; color: #454c5c; cursor: pointer; }
.inv-more-menu button:hover { background: #f0f5ff; color: var(--blue); }
.preview-invoice { border: 2px solid #d93b3b; padding: 18px 20px; border-radius: 4px; max-width: 620px; margin: 0 auto; }
.preview-head { text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 3px; color: #d93b3b; padding-bottom: 14px; border-bottom: 2px solid #d93b3b; }
.preview-grid { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; padding-top: 16px; font-size: 13px; }
.preview-grid > div:nth-child(odd) { color: #8a94a6; text-align: right; }
.preview-grid > div:nth-child(even) { color: var(--text); }
.preview-grid b { font-size: 16px; color: #d93026; }
.preview-foot { text-align: center; font-size: 11px; color: #a8b0bd; margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ========== AI 识别面板：识别结果 / 直连税局开票（真实平台样式） ========== */
.ai-welcome-note { color: #7c5cd6 !important; font-size: 11px !important; }
.ai-dw-body { padding: 12px 12px 16px; }
.ai-dw-input-wrap.drag { background: #f0f5ff; outline: 1px dashed var(--blue); }
.ai-thinking { font-size: 12px; color: #6b7280; line-height: 1.7; }
.ai-thinking b { display: block; color: var(--text); margin-bottom: 8px; }

/* 识别结果卡片 */
.ai-invoice-card { font-size: 12px; color: var(--text); line-height: 1.75; }
.ai-card-title { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12px; margin-bottom: 7px; }
.ai-card-title svg { width: 14px; height: 14px; color: #7c5cd6; }
.ai-card-title .ai-confidence { margin-left: auto; }
.ai-kv { display: flex; align-items: baseline; gap: 6px; min-height: 22px; }
.ai-kv > span:first-child { flex: 0 0 72px; color: #8a94a6; white-space: nowrap; }
.ai-kv > b, .ai-kv > span.ai-kv-val { flex: 1; font-weight: 500; word-break: break-all; }
.ai-kv input { flex: 1; width: 0; min-width: 0; border: none; border-bottom: 1px dashed #d5dbe5; background: transparent; font-size: 12px; color: var(--text); padding: 1px 0; outline: none; }
.ai-kv input:focus { border-bottom-color: var(--blue); }
.ai-kv .ai-muted { color: #a8b0bd; }
.ai-item-block { background: #f7f9fc; border-radius: 5px; padding: 8px 10px; margin-top: 9px; }
.ai-item-title { font-weight: 600; margin-bottom: 5px; word-break: break-all; }
.ai-item-block .ai-kv > span:first-child { flex-basis: 86px; }
.ai-rate-sel { border: 1px solid #d5dbe5; border-radius: 3px; background: #fff; color: var(--text); font-size: 11px; padding: 1px 3px; }
.ai-card-actions { display: flex; gap: 6px; margin-top: 12px; }
.ai-act { flex: 1; padding: 7px 2px; border: 1px solid #bcd3f8; background: #fff; color: var(--blue); border-radius: 4px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.ai-act:hover { background: #f0f5ff; }
.ai-act.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.ai-act.primary:hover { filter: brightness(1.06); }
.ai-act:disabled { opacity: .55; cursor: not-allowed; }
.ai-issue-progress { margin-top: 10px; }
.ai-tool-row { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.ai-tool-row button { border: none; background: transparent; color: #9aa3b2; cursor: pointer; padding: 2px; display: grid; place-items: center; }
.ai-tool-row button:hover { color: var(--blue); }
.ai-tool-row svg { width: 15px; height: 15px; }
.ai-card-tip { font-size: 10px; color: #a8b0bd; text-align: center; margin-top: 7px; }
.ai-issue-result { margin-top: 9px; border: 1px solid #b7e4c9; background: #f0fbf4; border-radius: 5px; padding: 8px 10px; font-size: 11px; color: #1c7a4b; line-height: 1.7; }
.ai-issue-result b { color: #12613b; }
.ai-history-card { border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; margin-bottom: 8px; cursor: pointer; font-size: 12px; background: #fff; }
.ai-history-card:hover { border-color: var(--blue); background: #f0f5ff; }
.ai-history-card .ai-kv > span:first-child { flex-basis: 56px; }
.ai-guide-card { font-size: 12px; color: var(--text-2); line-height: 1.9; }
.ai-guide-card b { color: var(--text); }
.ai-guide-card ol { padding-left: 18px; margin: 6px 0; }

/* ========== 官方帮助文档补齐：企业/认证/开票方式/单据/红票 ========== */
.data-source-tip { font-size: 11px; color: #8a94a6; padding: 0 2px 10px; }
.invoice-subtabs { flex-wrap: wrap; }
.guide-text { font-size: 12px; color: var(--text-2); line-height: 1.9; margin: 0 0 14px; }
.step-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.step-item { flex: 1; min-width: 132px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fafcff; }
.step-item b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px; margin-right: 6px; }
.step-item span { font-size: 13px; font-weight: 600; color: var(--text); }
.step-item small { display: block; color: #8a94a6; font-size: 11px; margin-top: 6px; }
.step-arrow { color: #b8c1cf; font-size: 16px; }
.status-badge.st-issuing { background: #fff4e5; color: #c47a13; }
.status-badge.st-failed { background: #fdecec; color: #d93b3b; }
.source-tag { font-size: 11px; color: #7c5cd6; background: #f3efff; padding: 2px 6px; border-radius: 3px; }

/* 税局登录步骤 / 扫脸认证 */
.login-step-bar { display: flex; gap: 8px; margin-bottom: 14px; font-size: 12px; color: #9aa3b2; }
.login-step-bar b { color: var(--blue); }
.login-step-bar .done { color: #1c9a63; }

/* 税局登录弹窗：步骤条 / 温馨提示 / 登录方式 / 验证码行（对齐税局界面） */
.tax-login-stepbar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0 20px; font-size: 13px; }
.tax-login-stepbar .tls-node { color: #9aa3b2; white-space: nowrap; }
.tax-login-stepbar .tls-node::before { content: ''; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: #dfe4ec; color: #fff; font-size: 12px; font-weight: 700; vertical-align: -4px; }
.tax-login-stepbar .tls-node[data-s="1"]::before { content: '1'; }
.tax-login-stepbar .tls-node[data-s="2"]::before { content: '2'; }
.tax-login-stepbar .tls-node.on { color: #1c9a63; font-weight: 700; }
.tax-login-stepbar .tls-node.on::before { background: #1cba76; }
.tax-login-stepbar .tls-arrow { color: #c4cbd6; font-size: 17px; line-height: 1; }
.tax-tip-blue { display: flex; align-items: center; gap: 7px; padding: 11px 13px; background: #f0f7ff; border: 1px solid #d7e8ff; border-radius: 5px; color: #3d6fb5; font-size: 12px; line-height: 1.6; }
.tax-tip-blue svg { width: 15px; height: 15px; flex: 0 0 auto; }
.tax-warm-tip { padding: 12px 14px; background: #f7f8fa; border: 1px solid #eceff4; border-radius: 5px; color: #5b6472; font-size: 12px; line-height: 1.9; margin-bottom: 6px; }
.tax-warm-tip > b { display: block; color: #4a5261; margin-bottom: 2px; }
.tax-warm-tip em { color: #e64340; font-style: normal; font-weight: 600; }
.tax-warm-tip a { color: #2f6bff; margin: 0 2px; }
.tax-warm-tip a:hover { text-decoration: underline; }
.tax-radio-row { display: flex; align-items: center; gap: 26px; height: 34px; }
.tlm-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tlm-radio input { width: 14px; height: 14px; accent-color: #2f6bff; cursor: pointer; margin: 0; }
.tlm-help { display: inline-grid; place-items: center; width: 15px; height: 15px; border: 1px solid #2f6bff; border-radius: 50%; color: #2f6bff; font-size: 11px; font-weight: 700; cursor: help; }
.tax-login-mode { display: flex; align-items: center; gap: 22px; margin: 0 auto 16px; font-size: 13px; color: #3d4553; max-width: 560px; }
.tax-login-mode .tlm-label { min-width: 56px; font-weight: 500; }
.tax-login-mode .tlm-help { margin-left: -14px; }
.tax-form-grid { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 0 auto; }
.tax-form-grid .tax-f { display: grid; grid-template-columns: 118px minmax(0,1fr); align-items: center; gap: 10px; font-size: 13px; }
.tax-form-grid .tax-f > label { text-align: right; color: #3d4553; white-space: nowrap; }
.tax-form-grid .tax-f .req { color: #e64340; margin-right: 2px; }
.tax-form-grid .tax-f input:not([type="radio"]):not([type="checkbox"]), .tax-form-grid .tax-f select { width: 100%; height: 34px; border: 1px solid #dfe4ec; border-radius: 4px; padding: 0 10px; font-size: 13px; color: var(--text); background: #fff; font-family: inherit; outline: none; }
.tax-form-grid .tax-f input:not([type="radio"]):not([type="checkbox"]):focus, .tax-form-grid .tax-f select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-light); }
.tax-form-grid .tax-f select { color: #9aa3b2; }
.tax-form-grid .tax-f select option { color: var(--text); }
.tax-agree { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; color: #5b6472; font-size: 12px; cursor: pointer; }
.tax-agree input { width: 14px; height: 14px; accent-color: #2f6bff; margin: 0; }
.tax-agree a { color: #2f6bff; }
.tax-pwd-wrap { position: relative; }
.tax-pwd-wrap input { padding-right: 36px !important; }
.tax-pwd-eye { position: absolute; right: 3px; top: 4px; width: 28px; height: 26px; border: none; background: transparent; color: #9aa3b2; cursor: pointer; display: grid; place-items: center; }
.tax-pwd-eye:hover { color: var(--blue); }
.tax-pwd-eye svg { width: 16px; height: 16px; }
.tax-code-row { display: flex; gap: 8px; }
.tax-code-row input { flex: 1; min-width: 0; }
.tax-code-row .btn { flex: 0 0 auto; height: 34px; white-space: nowrap; }
.tax-sms-tip { max-width: 560px; margin: 0 auto 16px; padding: 10px 12px; background: #f0f7ff; border: 1px solid #d7e8ff; border-radius: 5px; color: #3d6fb5; font-size: 12px; line-height: 1.8; }
.tax-sms-tip em { color: #e64340; font-style: normal; font-weight: 600; }
.tax-share-tip { max-width: 560px; margin: 14px auto 0; color: #8b93a1; font-size: 12px; line-height: 1.7; }
.tax-share-tip a { color: #2f6bff; }
.tax-share-tip .tlm-help { margin-left: 4px; }
.tax-minor-links { margin-top: 8px; text-align: center; }
.tax-minor-links a { color: #8b93a1; font-size: 12px; }
.tax-minor-links a:hover { color: #2f6bff; }
.tax-demo-code { margin: 10px auto 0; max-width: 560px; padding: 8px 11px; background: #f0f7ff; border: 1px dashed #b9d4ff; border-radius: 4px; color: #3d6fb5; font-size: 12px; }
.tax-demo-code b { font-size: 15px; letter-spacing: 2px; color: #2f6bff; }
.face-auth-steps { font-size: 12px; color: var(--text-2); line-height: 1.9; }
.face-auth-steps b { color: var(--text); }
.face-auth-steps ol { padding-left: 18px; margin: 6px 0; }
.face-qr { display: grid; place-items: center; padding: 12px; }
.face-qr canvas, .qr-canvas { width: 168px; height: 168px; image-rendering: pixelated; border: 1px solid var(--line); }

/* 购买方推荐 / 客户选择 / 赋码 */
.buyer-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 40; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(20,45,90,.12); max-height: 200px; overflow-y: auto; }
.buyer-suggest button { display: block; width: 100%; text-align: left; border: none; background: #fff; padding: 7px 10px; font-size: 12px; cursor: pointer; }
.buyer-suggest button:hover { background: #f0f5ff; }
.buyer-suggest small { display: block; color: #9aa3b2; }
.pick-list { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; }
.pick-list button { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 9px 11px; font-size: 12px; text-align: left; cursor: pointer; }
.pick-list button:hover { border-color: var(--blue); background: #f0f5ff; }
.pick-list small { color: #9aa3b2; }
.sync-remark-line { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6b7280; margin-top: 6px; }
.code-tree { display: flex; gap: 12px; min-height: 280px; }
.code-tree-cats { width: 180px; border-right: 1px solid var(--line); padding-right: 8px; overflow-y: auto; max-height: 320px; }
.code-tree-cats button { display: block; width: 100%; border: none; background: transparent; text-align: left; font-size: 12px; padding: 6px 8px; cursor: pointer; color: var(--text-2); }
.code-tree-cats button:hover, .code-tree-cats button.active { background: #f0f5ff; color: var(--blue); }
.code-tree-items { flex: 1; overflow-y: auto; max-height: 320px; }
.code-tree-items button { display: block; width: 100%; border: none; border-bottom: 1px solid #f0f2f6; background: #fff; text-align: left; padding: 7px 9px; font-size: 12px; cursor: pointer; }
.code-tree-items button:hover { background: #f0f5ff; }
.code-tree-items small { display: block; color: #9aa3b2; }
.discount-row input { color: #d93b3b !important; }

/* AI 红点 / 全屏 / 对话记录 */
.ai-red-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #e64340; margin-left: 4px; vertical-align: top; }
body.aiFullscreen .ai-drawer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 200; border: none; }
body.aiFullscreen .ai-dw-body { max-width: 780px; margin: 0 auto; width: 100%; }
body.aiFullscreen .ai-dw-input-wrap { max-width: 780px; margin: 0 auto; width: 100%; }
.chat-bubble { background: #f0f5ff; border-radius: 8px; padding: 8px 11px; font-size: 12px; line-height: 1.7; margin-bottom: 10px; }
.chat-bubble.user { background: #e8f0ff; margin-left: 32px; }
.chat-bubble.system { background: #fff8e8; color: #8a6a1f; }
.ai-quote-tip { font-size: 11px; color: #7c5cd6; background: #f3efff; padding: 5px 8px; border-radius: 4px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.ai-order-tip { font-size: 11px; color: #1c7a4b; background: #f0fbf4; padding: 6px 8px; border-radius: 4px; margin-bottom: 8px; }

/* ========== 发票查验（全国增值税查验平台 / 电子税局电票平台） ========== */
.verify-channels { margin-bottom: 14px; }
.verify-channel-badge { font-size: 11px; font-weight: 400; color: #8a94a6; margin-left: 8px; }
.verify-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.verify-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.verify-field > label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.verify-field > label em { color: #e64340; font-style: normal; }
.verify-field input, .verify-field select { height: 32px; border: 1px solid var(--line); border-radius: 4px; padding: 0 9px; font-size: 12px; color: var(--text); background: #fff; width: 100%; outline: none; }
.verify-field input:focus, .verify-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(45,110,240,.1); }
.verify-files { grid-column: span 2; }
.verify-checks { display: flex; align-items: center; gap: 18px; height: 32px; }
.verify-checks label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.verify-checks input { width: 14px; height: 14px; }
.verify-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.verify-loading { font-size: 12px; color: #6b7280; }
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 6px; background: #f0fbf4; border: 1px solid #cdeedb; margin-bottom: 14px; }
.verify-banner.vb-warn { background: #fff8e8; border-color: #f5dfa8; }
.verify-banner.vb-error { background: #fdecec; border-color: #f6cccc; }
.verify-banner b { font-size: 14px; color: var(--text); }
.verify-banner span { font-size: 12px; color: #6b7280; }
.verify-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: #1c9a63; color: #fff; }
.verify-badge.vb-warn { background: #d98a13; }
.verify-badge.vb-error { background: #d93b3b; }
.verify-kv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.verify-kv { padding: 9px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 0; }
.verify-kv:nth-child(4n) { border-right: none; }
.verify-kv > span { display: block; font-size: 11px; color: #9aa3b2; margin-bottom: 3px; }
.verify-kv > b { display: block; font-size: 12px; color: var(--text); font-weight: 500; word-break: break-all; }
.verify-subtitle { font-size: 13px; font-weight: 600; color: var(--text); margin: 16px 0 8px; }
.verify-detail-note { font-size: 11px; color: #8a94a6; margin-bottom: 8px; }
.verify-file-list { display: flex; flex-wrap: wrap; gap: 10px; }
.verify-file-list a { font-size: 12px; color: var(--blue); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; text-decoration: none; background: #fafcff; }
.verify-file-list a:hover { border-color: var(--blue); background: #f0f5ff; }
@media (max-width: 1100px) { .verify-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .verify-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .verify-kv:nth-child(4n) { border-right: 1px solid var(--line); } .verify-kv:nth-child(2n) { border-right: none; } }

/* ========== 企业补充信息表单（公司基础信息 / 税局登录信息 / 开票参数设置） ========== */
.company-profile { max-width: 720px; padding: 4px 0 8px; }
.cp-section-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 22px 0 14px; padding-left: 9px; border-left: 3px solid var(--blue); }
.cp-section-title:first-child { margin-top: 4px; }
.cp-row { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 12px; }
.cp-row > label { text-align: right; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.cp-row > label .req { color: var(--red); margin-right: 2px; }
.cp-control { min-width: 0; display: flex; align-items: center; gap: 10px; }
.cp-control input[type="text"], .cp-control input[type="password"], .cp-control input[type="number"], .cp-control select { width: 100%; height: 32px; border: 1px solid #e2e6ed; border-radius: 4px; padding: 0 10px; font-size: 12px; color: var(--text); background: #f6f7f9; font-family: inherit; outline: none; }
.cp-control input:focus, .cp-control select:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 2px var(--blue-light); }
.cp-control .cp-inline { display: flex; align-items: center; gap: 10px; }
.cp-inline { flex-wrap: wrap; }
.cp-inline .radio-inline { color: var(--text); }
.cp-inline .btn-sm { flex: 0 0 auto; }
.cp-pwd { position: relative; }
.cp-pwd input { padding-right: 36px !important; }
.cp-pwd-eye { position: absolute; right: 4px; top: 4px; width: 26px; height: 24px; border: none; background: transparent; color: #9aa3b2; cursor: pointer; display: grid; place-items: center; }
.cp-pwd-eye:hover { color: var(--blue); }
.cp-pwd-eye svg { width: 15px; height: 15px; }
.cp-input-flex { flex: 0 1 300px; width: auto !important; }
.cp-help { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; cursor: help; flex: 0 0 auto; }
.cp-link { display: inline-flex; align-items: center; gap: 4px; border: none; background: transparent; color: var(--blue); font-size: 12px; cursor: pointer; padding: 0; }
.cp-link:hover { text-decoration: underline; }
.cp-link svg { width: 13px; height: 13px; }
.cp-submit { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.cp-submit .btn { min-width: 96px; }
@media (max-width: 900px) { .cp-row { grid-template-columns: 108px minmax(0, 1fr); } }
.cp-row[hidden] { display: none; }

/* ========== 顶部公司搜索框（放大 + 美化） ========== */
.company-select .company-picker { min-width: 320px; max-width: 380px; height: 38px; border-radius: 19px; padding: 0 14px; gap: 8px; position: relative; background: linear-gradient(180deg,#fff,#f9fbff); border: 1.5px solid #4f7cff; box-shadow: 0 2px 8px rgba(43,111,242,.14); }
.company-select .company-picker:hover { box-shadow: 0 3px 12px rgba(43,111,242,.24); }
.company-search-ico { width: 16px; height: 16px; color: #4f7cff; flex: 0 0 auto; }
/* 顶部搜索框常驻可见，输入即联想（无需点击展开） */
.company-search-input { position: absolute; left: 34px; right: 30px; top: 0; bottom: 0; width: auto; border: none; outline: none; background: transparent; font-size: 13px; color: var(--text); opacity: 1; pointer-events: auto; }
.company-search-input::placeholder { color: #9aa6bd; }
.company-name { font-size: 13px; font-weight: 600; }
.company-select .company-menu { min-width: 420px; max-width: 520px; border-radius: 10px; box-shadow: 0 12px 34px rgba(20,45,90,.22); }
.company-menu-tip { padding: 8px 13px 6px; font-size: 11px; color: #9aa3b2; background: #fafcff; border-bottom: 1px solid var(--line); }
.company-menu-list { max-height: 340px; overflow-y: auto; }
.company-option { width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; border: none; background: #fff; padding: 10px 13px; font-size: 13px; color: #454c5c; cursor: pointer; transition: background .12s; }
.company-option:hover, .company-option.kb-active { background: #f0f5ff; }
.company-option.selected { color: #2f6bff; font-weight: 600; background: #f0f5ff; }
.company-option mark { background: #fff2b8; color: #b26a00; border-radius: 2px; padding: 0 1px; }
.company-option .co-check { width: 15px; height: 15px; color: #2f6bff; flex: 0 0 auto; }
.company-option .co-check svg { width: 15px; height: 15px; }
.company-option .co-sub { display: block; font-size: 11px; color: #9aa3b2; margin-top: 2px; }
.company-add { width: 100%; display: flex; align-items: center; justify-content: center; gap: 5px; border: none; border-top: 1px solid var(--line); background: #fff; padding: 10px; font-size: 12px; color: #606a7d; cursor: pointer; }
.company-add:hover { background: #f5f8ff; color: var(--blue); }
.company-add svg { width: 13px; height: 13px; }

/* ========== 顶栏当前用户 ========== */
.user-chip { display: flex; align-items: center; gap: 7px; padding: 4px 6px 4px 5px; background: #f5f8ff; border: 1px solid #d7e3ff; border-radius: 20px; margin-left: 4px; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,#4d9bff,#2359d6); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-size: 12px; color: var(--text); }
.user-meta small { font-size: 10px; color: #7b8496; }
.user-logout { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #8a94a6; margin-left: 2px; }
.user-logout:hover { background: #ffecec; color: var(--red); }
.user-logout svg { width: 14px; height: 14px; transform: rotate(180deg); }

/* ========== 公司作用域提示条 ========== */
.company-scope-bar { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #4a5a78; background: #f0f5ff; border: 1px solid #d7e3ff; border-radius: 5px; padding: 7px 12px; }
.company-scope-bar b { color: #2359d6; }
.company-scope-bar svg { width: 14px; height: 14px; color: #4f7cff; }

/* ========== 全屏登录层 ========== */
.login-mask { position: fixed; inset: 0; z-index: 2000; background: linear-gradient(135deg,#1b3a73 0%,#2b6ff2 55%,#5a8fff 100%); display: flex; align-items: center; justify-content: center; }
.login-mask[hidden] { display: none; }
.login-box { width: 400px; max-width: 92vw; background: #fff; border-radius: 14px; box-shadow: 0 24px 70px rgba(9,32,74,.35); padding: 34px 36px 30px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand .brand-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 24px; }
.login-brand .brand-name { font-size: 21px; }
.login-sub { font-size: 12px; color: var(--text-3); margin: 0 0 22px 50px; }
.login-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.login-tab { flex: 1; padding: 10px 0; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; }
.login-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 7px; }
.login-field input { width: 100%; height: 40px; border: 1px solid #dfe4ec; border-radius: 6px; padding: 0 12px; font-size: 14px; outline: none; background: #fafbfc; }
.login-field input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-light); }
.login-btn { width: 100%; height: 42px; margin-top: 6px; background: linear-gradient(135deg,#3f83ff,#2459dc); color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(43,111,242,.28); }
.login-btn:hover { filter: brightness(1.05); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-hint { margin-top: 16px; font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.7; }
.login-err { margin-top: 10px; font-size: 12px; color: var(--red); text-align: center; min-height: 16px; }
.wecom-qr { width: 176px; height: 176px; margin: 4px auto 12px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; background: #fafcff; }
.wecom-qr canvas { width: 160px; height: 160px; }
.wecom-tip { font-size: 12px; color: var(--text-2); text-align: center; margin-bottom: 12px; }
.wecom-fields .login-field { margin-bottom: 12px; }

/* ========== 企业管理：登录资料与醒目操作按钮 ========== */
#companyListBody td, #companyListBody2 td { font-size: 13px; vertical-align: middle; }
.company-ops { white-space: nowrap; min-width: 390px; }
.company-ops .btn-text { font-size: 13px; margin-left: 8px; }
.company-op-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 2px 8px rgba(43,111,242,.22);
}
.company-op-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(43,111,242,.32); }
.company-op-secondary { background: #fff; color: #2459dc; border-color: #8db2ff; box-shadow: none; }
.company-op-secondary:hover { background: #f0f6ff; box-shadow: 0 2px 8px rgba(43,111,242,.14); }
.credential-saved { color: #15966b; font-weight: 700; }
.company-excel-bar { align-items: center; gap: 10px; flex-wrap: wrap; }
.company-excel-tip { color: var(--text-3); font-size: 12px; line-height: 1.6; }

/* ========== 整体排版美化：侧边栏 / 标签 / 页面 / 卡片 ========== */
.sidebar {
  width: 178px;
  flex-basis: 178px;
  padding: 12px 10px 24px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fd 100%);
  border-right: 1px solid #e3eaf4;
}
.side-nav { gap: 3px; }
.side-item {
  min-height: 42px;
  padding: 9px 12px;
  gap: 11px;
  border-radius: 9px;
  font-size: 13.5px;
  color: #4b586c;
  transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}
.side-item svg { width: 18px; height: 18px; opacity: .82; }
.side-item:hover { color: #1f5fd8; background: #eaf1ff; transform: translateX(2px); }
.side-item.active {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, #2b6ff2, #5b93ff);
  box-shadow: 0 6px 16px rgba(43,111,242,.26);
}
.side-item.active svg { opacity: 1; }
.side-item.active::before { display: none; }
.side-item.mobile-highlight {
  margin-top: 10px;
  color: #b96a00;
  background: #fff5e6;
  border: 1px solid #ffd8a3;
  font-weight: 700;
}
.side-item[data-page="invoice"], .side-item[data-page="companyBasic"] { margin-top: 9px; }
.side-item[data-page="invoice"]::before, .side-item[data-page="companyBasic"]::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: #e4eaf3;
}
.side-item[data-page="invoice"].active::before, .side-item[data-page="companyBasic"].active::before { display: none; }

.main { padding: 14px 22px 34px; background: linear-gradient(180deg, #f5f8fd 0%, #fff 260px); }
.tab-bar { height: 42px; background: #edf2f9; border-bottom: 1px solid #dfe6f1; }
.tab-scroll { padding-top: 5px; }
.tab-item { height: 33px; padding: 0 12px; border-radius: 8px 8px 0 0; font-size: 12.5px; }
.tab-item.active { box-shadow: 0 -2px 8px rgba(22,48,92,.08); }
.page-head {
  margin: 2px 0 15px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e7edf6;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(22,48,92,.04);
}
.page-title { font-size: 20px; }
.card { border: 1px solid #e6ecf5; border-radius: 10px; box-shadow: 0 4px 18px rgba(22,48,92,.045); }
.card-title { font-size: 15px; padding: 15px 18px 12px; }
.data-table th { background: #f6f9ff; color: #3c4a61; font-weight: 700; }
.data-table tbody tr:hover td { background: #f9fbff; }
.btn { border-radius: 6px; }
.btn-primary { background: linear-gradient(135deg, #3f83ff, #2459dc); border-color: #2459dc; color: #fff; box-shadow: 0 2px 8px rgba(43,111,242,.18); }
.btn-primary:hover { filter: brightness(1.04); }
@media (max-width: 1100px) {
  .sidebar { width: 150px; flex-basis: 150px; }
  .main { padding: 12px 14px 28px; }
}

/* ========== 基础信息表单美化 ========== */
.page[data-page="companyBasic"] .company-scope-bar {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef4ff, #f9fbff);
  border-color: #d9e4ff;
}
.company-profile {
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 26px;
  row-gap: 0;
  padding: 6px 4px 4px;
}
.company-profile .cp-section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  margin: 20px 0 14px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #1f3a6b;
  background: linear-gradient(90deg, #eef4ff, #f9fbff);
  border: 1px solid #dfe9ff;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
}
.company-profile .cp-section-title:first-child { margin-top: 2px; }
.company-profile .cp-section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(43,111,242,.14);
}
.company-profile .cp-row { margin-bottom: 14px; align-items: center; }
.company-profile .cp-row.full { grid-column: 1 / -1; }
.company-profile .cp-row > label { font-size: 13px; color: #43506a; }
.company-profile .cp-control input[type="text"],
.company-profile .cp-control input[type="password"],
.company-profile .cp-control input[type="number"],
.company-profile .cp-control select {
  height: 36px;
  border-radius: 6px;
  background: #fafcff;
  font-size: 13px;
}
.company-profile .cp-control input:focus,
.company-profile .cp-control select:focus {
  border-color: #6a9bff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43,111,242,.12);
}
.company-profile .cp-inline { gap: 12px; }
.company-profile .radio-inline {
  padding: 7px 10px;
  border: 1px solid #e3e9f2;
  border-radius: 6px;
  background: #fff;
  font-size: 12.5px;
}
.company-profile .cp-submit {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e6ecf5;
}
.company-profile .cp-submit .cp-control { justify-content: flex-start; }
@media (max-width: 1100px) {
  .company-profile { grid-template-columns: 1fr; }
  .company-profile .cp-row.full { grid-column: auto; }
}

/* AI 开票引擎配置 */
.ai-engine-card .api-config-grid { margin-top: 14px; }
.ai-engine-card .api-config-item label { font-weight: 600; color: #344054; }
.ai-engine-card .api-config-item select,
.ai-engine-card .api-config-item input {
  min-height: 38px;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  padding: 0 11px;
  background: #fff;
  font-size: 13px;
  color: #1f2a3d;
}
.ai-engine-card .api-config-item select:focus,
.ai-engine-card .api-config-item input:focus {
  outline: none;
  border-color: #6a9bff;
  box-shadow: 0 0 0 3px rgba(43,111,242,.12);
}
.ai-config-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-config-tip { color: var(--text-3, #7a869a); font-size: 12px; line-height: 1.6; }

/* ========== 客户系统对接 ========== */
.sync-config-grid { padding: 14px 16px 18px; }
.sync-config-grid textarea { width: 100%; min-height: 64px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; font: 12px/1.6 Consolas, Monaco, monospace; color: var(--text); resize: vertical; box-sizing: border-box; }
.sync-config-grid .cp-help { display: block; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.sync-auth-row { display: contents; }
.sync-config-grid .sync-auth-row[hidden] { display: none; }
.sync-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-result { min-height: 38px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; background: #f8fafc; color: var(--text-2); font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.sync-result.ok { color: #13795b; background: #f0fbf6; border-color: #bfe8d6; }
.sync-result.err { color: #c0392b; background: #fff4f2; border-color: #ffd3cd; }

/* ========== 首页：销售收入分析 + 收入Top5 ========== */
.home-insight-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.35fr); gap: 12px; }
.home-insight-grid .card { margin-bottom: 12px; }
.revenue-card .card-title, .top5-card .card-title { padding: 13px 16px 6px; }
.revenue-body { display: flex; align-items: center; gap: 26px; padding: 6px 24px 22px; min-height: 210px; }
.donut-wrap { flex: 0 0 auto; display: grid; place-items: center; width: 190px; height: 190px; }
.donut { position: relative; width: 170px; height: 170px; border-radius: 50%; background: conic-gradient(var(--blue) 0deg 360deg, #eef2f8 360deg); box-shadow: 0 4px 16px rgba(43,111,242,.14); }
.donut-hole { position: absolute; inset: 28px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: inset 0 0 0 1px #f0f2f6; }
.donut-hole b { font-size: 16px; font-weight: 700; color: var(--text); font-family: Arial, sans-serif; }
.donut-hole span { font-size: 11px; color: var(--text-3); }
.revenue-legend { display: flex; flex-direction: column; gap: 18px; flex: 1; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.legend-row b { margin-left: auto; font-family: Arial, sans-serif; font-weight: 600; color: var(--text); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot-blue { background: var(--blue); }
.dot-green { background: var(--green); }
.top5-tabs { gap: 0; border: 0; padding: 0; }
.top5-tabs .seg-tab { padding: 4px 10px; border: 1px solid var(--line); border-right: 0; font-size: 11px; }
.top5-tabs .seg-tab:first-child { border-radius: 4px 0 0 4px; }
.top5-tabs .seg-tab:last-child { border-right: 1px solid var(--line); border-radius: 0 4px 4px 0; }
.top5-list { padding: 6px 18px 16px; }
.top5-item { display: grid; grid-template-columns: 22px minmax(0,1fr) 110px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f6; }
.top5-item:last-child { border-bottom: 0; }
.top5-rank { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: #c3cad6; }
.top5-rank.r1 { background: #ffb020; }
.top5-rank.r2 { background: #8e9bb3; }
.top5-rank.r3 { background: #d79a5b; }
.top5-name { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top5-bar-track { height: 6px; border-radius: 3px; background: #eef2f8; margin-top: 5px; overflow: hidden; }
.top5-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg,#7aabff,#2b6ff2); }
.top5-amount { text-align: right; font-size: 12px; font-family: Arial, sans-serif; font-weight: 600; color: var(--text); }
.top5-empty { padding: 40px 10px; text-align: center; color: #b6bcc6; font-size: 12px; }
@media (max-width: 1280px) {
  .home-insight-grid { grid-template-columns: 1fr; }
  .revenue-body { justify-content: center; }
}
.top5-name-wrap { min-width: 0; }

/* ========== 税务局电子发票版式 ========== */
.invoice-modal { max-width: 940px; }
.fp-paper { position: relative; max-width: 860px; margin: 0 auto; padding: 22px 30px 26px; background: #fff; border: 1px solid #d9b48a; outline: 3px double #e7c9a6; outline-offset: -6px; color: #7a3d1f; overflow: hidden; }
.fp-watermark { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%) rotate(-24deg); font-size: 92px; font-weight: 700; color: rgba(196,120,80,.07); white-space: nowrap; pointer-events: none; user-select: none; }
.fp-title { text-align: center; font-size: 24px; font-weight: 700; letter-spacing: 3px; color: #a8541f; padding: 4px 0 8px; border-bottom: 2px solid #c8853f; }
.fp-no { text-align: right; font-size: 12px; color: #a77852; padding: 8px 2px 12px; font-family: Arial, sans-serif; }
.fp-parties { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #d9a978; margin-bottom: 0; }
.fp-party { position: relative; padding: 12px 14px 12px 40px; min-height: 74px; border-right: 1px solid #d9a978; }
.fp-party:last-child { border-right: 0; }
.fp-party-tag { position: absolute; left: 8px; top: 12px; writing-mode: vertical-rl; letter-spacing: 3px; font-size: 12px; font-weight: 700; color: #a8541f; border: 1px solid #d9a978; padding: 6px 3px; }
.fp-party-line { font-size: 12px; line-height: 2; color: #8a4f2a; word-break: break-all; }
.fp-party-line span { color: #a77852; }
.fp-party-line b { color: #6e3316; font-weight: 600; }
.fp-table { width: 100%; border-collapse: collapse; border: 1px solid #d9a978; border-top: 0; font-size: 12px; color: #7a3d1f; }
.fp-table th, .fp-table td { border: 1px solid #d9a978; padding: 8px 8px; vertical-align: middle; }
.fp-table thead th { background: #fbf3ea; font-weight: 600; color: #8a4f2a; white-space: nowrap; }
.fp-table td.c, .fp-table th.c { text-align: center; }
.fp-table td.r { text-align: right; font-family: Arial, sans-serif; }
.fp-item-name { font-weight: 500; }
.fp-sum td { background: #fbf3ea; font-weight: 700; color: #8a4f2a; }
.fp-total { display: flex; justify-content: space-between; align-items: center; border: 1px solid #d9a978; border-top: 0; padding: 10px 14px; font-size: 13px; color: #8a4f2a; }
.fp-total b { color: #6e3316; font-size: 14px; margin-left: 8px; font-family: Arial, sans-serif; }
.fp-remark { display: flex; border: 1px solid #d9a978; border-top: 0; min-height: 46px; font-size: 12px; }
.fp-remark > span { width: 74px; flex: 0 0 74px; padding: 10px; border-right: 1px solid #d9a978; color: #a8541f; font-weight: 600; }
.fp-remark > div { padding: 10px 12px; color: #7a3d1f; word-break: break-all; }
.fp-drawer { border: 1px solid #d9a978; border-top: 0; padding: 8px 14px; font-size: 12px; color: #8a4f2a; }
.fp-stamp { position: absolute; right: 60px; top: 150px; z-index: 3; border: 3px solid rgba(200,50,50,.55); color: rgba(200,50,50,.55); font-size: 30px; font-weight: 700; letter-spacing: 4px; padding: 8px 16px; border-radius: 8px; transform: rotate(-16deg); pointer-events: none; }
@media (max-width: 900px) {
  .fp-parties { grid-template-columns: 1fr; }
  .fp-party { border-right: 0; border-bottom: 1px solid #d9a978; }
}

/* AI 开票税率待确认提示 */
.ai-rate-pending { color: #e34d59 !important; }
.ai-rate-src { color: #8a9099; font-size: 11px; font-weight: 400; margin-left: 6px; }
.ai-required { color: #e34d59; font-style: normal; font-size: 11px; }
.ai-rate-sel.ai-rate-need { border-color: #e34d59 !important; box-shadow: 0 0 0 3px rgba(227,77,89,.12) !important; }
.ai-rate-warn { margin: 6px 0 2px; padding: 8px 10px; background: #fff5f5; border: 1px solid #f3c2c7; border-radius: 6px; color: #c0392b; font-size: 12px; line-height: 1.6; }

/* 操作日志动作徽章 */
.status-badge.tag-blue { color: #2b6ff2; background: #eaf1ff; }
