/* ==========================================================================
   MICA PBS · 业务层样式
   只消费 Mica UI 令牌（--mh-*），不定义颜色字面值
   组件层见 mica-ui.css
   ========================================================================== */

/* ---------- 页面骨架 ---------- */
body { min-height: 100vh; }

.main {
  padding: 38px 22px 78px;
  min-width: 0;
}

.main a { color: var(--mh-blue); }
.main a:hover { color: var(--mh-accent-deep); }

/* ---------- 辅助说明 ---------- */
.lede {
  margin-top: 10px;
  max-width: 62ch;
  font-size: 14px;
  line-height: 1.7;
  color: var(--mh-text-2);
}

/* ---------- 内容面板 ---------- */
.card {
  position: relative;
  padding: 20px 22px 18px;
  margin-bottom: 18px;
  border-radius: var(--mh-radius);
  background: linear-gradient(152deg, var(--mh-card-a), var(--mh-card-b));
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  backdrop-filter: blur(22px) saturate(155%);
  border: 1px solid var(--mh-glass-border);
  box-shadow: inset 0 1px 0 var(--mh-inset), var(--mh-shadow);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--mh-font-d);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.012em;
  color: var(--mh-text);
}
.card-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--mh-accent);
  flex: none;
}
.card-count {
  font-family: var(--mh-font-m);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mh-text-3);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }

/* ---------- 快速报表按钮组 ---------- */
.quick-btns { display: flex; flex-wrap: wrap; gap: 7px; }

/* 快速报表按运营商分组 */
.quick-groups { display: flex; flex-direction: column; gap: 10px; }
.quick-group {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
}
.quick-group-head {
  flex: none;
  width: 68px;
  padding-top: 8px;
  font-family: var(--mh-font-m);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--mh-text-3);
}
.quick-group .quick-btns { flex: 1; }
.quick-btns .btn.ghost.active,
.quick-btns .btn.ghost.active:hover {
  background: var(--mh-text);
  color: var(--mh-bg);
  border-color: var(--mh-text);
  font-weight: 600;
}

/* ---------- 统计条 ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  padding: 14px 18px;
  border-radius: var(--mh-radius);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  box-shadow: inset 0 1px 0 var(--mh-inset);
}
.stat-label {
  font-family: var(--mh-font-m);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mh-text-3);
}
.stat-value {
  margin-top: 7px;
  font-family: var(--mh-font-m);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--mh-text);
}
.stat-value .unit { font-size: 11px; color: var(--mh-text-3); margin-left: 4px; }

/* ---------- 表单 ---------- */
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 0; }
.form-row + .form-row { margin-top: 14px; }
.form-group { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 140px; }
.form-label {
  font-family: var(--mh-font-m);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mh-text-3);
}

input[type="text"], input[type="search"], input[type="password"], input[type="number"], select, textarea {
  height: 34px;
  width: 100%;
  padding: 0 12px;
  font-family: var(--mh-font-b);
  font-size: 13px;
  color: var(--mh-text);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  border-radius: 12px;
  outline: none;
  transition: border-color .3s, background .3s;
}
textarea { height: auto; padding: 8px 12px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--mh-accent-line);
  background: var(--mh-surface);
}
input::placeholder, textarea::placeholder { color: var(--mh-text-3); }
input[type="checkbox"] { accent-color: var(--mh-accent); width: 14px; height: 14px; }

.inline-check {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--mh-text-2);
  cursor: pointer; height: 34px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 18px;
  font-family: var(--mh-font-b);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--mh-bg);
  background: var(--mh-text);
  border: 1px solid var(--mh-text);
  border-radius: 999px;
  cursor: pointer;
  transition: background .3s, color .3s, border-color .3s, transform .35s var(--mh-ease), box-shadow .35s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--mh-shadow); color: var(--mh-bg); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled,
.btn.ghost:disabled {
  color: var(--mh-text-3);
  background: var(--mh-soft);
  border-color: var(--mh-line);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn.ghost {
  color: var(--mh-text-2);
  background: var(--mh-soft);
  border-color: var(--mh-line);
}
.btn.ghost:hover {
  color: var(--mh-text);
  background: var(--mh-surface);
  border-color: var(--mh-accent-line);
  box-shadow: var(--mh-shadow);
}
.btn.ghost.active {
  color: var(--mh-text);
  background: var(--mh-surface);
  border-color: var(--mh-accent-line);
  font-weight: 600;
}
.btn.danger {
  color: var(--mh-warn-text);
  background: color-mix(in srgb, var(--mh-amber) 10%, transparent);
  border-color: var(--mh-warn-line);
}
.btn.danger:hover { background: color-mix(in srgb, var(--mh-amber) 16%, transparent); }
.btn.sm { height: 26px; padding: 0 12px; font-size: 11.5px; }
.btn.text {
  height: auto; padding: 0; border: 0; background: none;
  color: var(--mh-accent-deep);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.text:hover { color: var(--mh-text); box-shadow: none; transform: none; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 14px; }
.data { width: 100%; border-collapse: collapse; font-size: 13px; }
.data thead th {
  padding: 10px 12px;
  font-family: var(--mh-font-m);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mh-text-3);
  text-align: left;
  white-space: nowrap;
  background: var(--mh-surface);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--mh-line-strong);
}
.data tbody td {
  padding: 10px 12px;
  color: var(--mh-text-2);
  border-bottom: 1px solid var(--mh-line);
  vertical-align: middle;
  white-space: nowrap;
}
.data tbody tr:hover { background: var(--mh-hover); }
.data tbody tr:last-child td { border-bottom: 0; }
.data .num {
  text-align: right;
  font-family: var(--mh-font-m);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--mh-text);
}
.data tbody th {
  width: 170px;
  padding: 10px 12px;
  text-align: left;
  font-family: var(--mh-font-m);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mh-text-3);
  white-space: nowrap;
  border-bottom: 1px solid var(--mh-line);
}
.data .mono { font-family: var(--mh-font-m); }
.data td.wrap { white-space: normal; word-break: break-all; }
.data th.wrap { white-space: normal; }
.data tbody td.cell-hidden { display: none; }

.col-note {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 操作列：td 不能设 display:flex，否则脱离表格布局导致列错位/画面撕裂 */
.data td.actions { white-space: nowrap; }
.data td.actions > * { vertical-align: middle; }
.data td.actions > * + * { margin-left: 7px; }

/* ---------- 标签 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  font-family: var(--mh-font-m);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mh-text-2);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  border-radius: 999px;
}
.chip.ok {
  color: var(--mh-accent-deep);
  background: var(--mh-accent-soft);
  border-color: var(--mh-accent-line);
}
.chip.warn {
  color: var(--mh-warn-text);
  background: var(--mh-warn-bg);
  border-color: var(--mh-warn-line);
}
.chip.muted { color: var(--mh-text-3); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- 提示 ---------- */
.alert {
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--mh-text-2);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  border-radius: 12px;
}
.alert-success {
  color: var(--mh-accent-deep);
  background: var(--mh-accent-soft);
  border-color: var(--mh-accent-line);
}
.alert-error {
  color: var(--mh-warn-text);
  background: var(--mh-warn-bg);
  border-color: var(--mh-warn-line);
}
.alert-warn {
  color: var(--mh-warn-text);
  background: var(--mh-warn-bg);
  border-color: var(--mh-warn-line);
}
.alert a { color: inherit; }

.muted { color: var(--mh-text-3); }
.success-text { color: var(--mh-accent-deep); }
.error-text { color: var(--mh-warn-text); }
.num-text, .mono { font-family: var(--mh-font-m); font-variant-numeric: tabular-nums; }

/* ---------- 报表底部抬头（表格说明 / 收款账号） ---------- */
.report-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--mh-line);
}
.report-footer-line {
  margin: 0 0 6px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--mh-text-2);
  white-space: pre-line;
}

.empty {
  padding: 38px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--mh-text-3);
  background: var(--mh-soft);
  border: 1px dashed var(--mh-line-strong);
  border-radius: var(--mh-radius);
}

/* ---------- 上传区 ---------- */
.drop-zone {
  padding: 44px 22px;
  text-align: center;
  cursor: pointer;
  border: 1px dashed var(--mh-line-strong);
  border-radius: var(--mh-radius);
  background: var(--mh-soft);
  transition: background .3s, border-color .3s;
}
.drop-zone:hover {
  border-color: var(--mh-accent-line);
  background: var(--mh-surface);
}
.drop-zone.drag {
  border-color: var(--mh-accent);
  background: var(--mh-accent-soft);
}
.drop-zone-text {
  font-family: var(--mh-font-d);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--mh-text);
}
.drop-zone-hint { margin-top: 7px; font-size: 12.5px; color: var(--mh-text-3); }
.drop-zone-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 10px;
  font-family: var(--mh-font-m);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mh-accent-deep);
  background: var(--mh-accent-soft);
  border: 1px solid var(--mh-accent-line);
  border-radius: 999px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--mh-line);
  font-size: 12.5px;
  text-align: left;
}
.file-row:last-child { border-bottom: 0; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-family: var(--mh-font-m); font-size: 11px; color: var(--mh-text-3); white-space: nowrap; }
.progress-bar { flex: 1; height: 3px; background: var(--mh-line); border-radius: 999px; min-width: 60px; overflow: hidden; }
.progress-bar > div { height: 100%; width: 0; background: var(--mh-accent); border-radius: 999px; transition: width .2s ease; }
.file-remove {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: 1px solid var(--mh-line);
  background: var(--mh-soft);
  color: var(--mh-text-3);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}
.file-remove:hover { color: var(--mh-warn-text); border-color: var(--mh-warn-line); background: var(--mh-warn-bg); }

/* ---------- 页签 ---------- */
.section-tabs { display: flex; gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px;
  font-family: var(--mh-font-b);
  font-size: 12.5px;
  color: var(--mh-text-2);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .3s var(--mh-ease);
}
.tab-btn:hover { color: var(--mh-text); border-color: var(--mh-accent-line); transform: translateY(-1px); }
.tab-btn.is-active {
  color: var(--mh-bg);
  background: var(--mh-text);
  border-color: var(--mh-text);
  box-shadow: var(--mh-shadow);
}

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--mh-scrim);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.modal {
  width: 440px;
  max-width: 94vw;
  max-height: 90vh;
  overflow: auto;
  padding: 22px 26px;
  border-radius: var(--mh-radius-lg);
  background: linear-gradient(160deg, var(--mh-glass-solid), var(--mh-surface));
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--mh-glass-border);
  box-shadow: var(--mh-shadow-hi);
  animation: mh-rise .5s var(--mh-ease) both;
}
.modal-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 18px;
  font-family: var(--mh-font-d);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--mh-text);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--mh-line);
}

/* ---------- 系统页 ---------- */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 26px; }
.meta-label {
  font-family: var(--mh-font-m);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mh-text-3);
  margin-bottom: 5px;
}
.meta-value { font-size: 13px; line-height: 1.6; word-break: break-all; color: var(--mh-text-2); }
.meta-value.mono { font-family: var(--mh-font-m); font-size: 12.5px; color: var(--mh-text); }

.cmd-box {
  margin-top: 7px;
  padding: 14px 16px;
  font-family: var(--mh-font-m);
  font-size: 12px;
  color: var(--mh-code-text);
  background: var(--mh-code-bg);
  border: 1px solid var(--mh-line);
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-x: auto;
}
.commit-note {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--mh-text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 字典库 ---------- */
.dict-add { display: flex; gap: 7px; margin-bottom: 14px; }
.dict-add input[type="text"] { flex: 1; }
.dict-add .btn { flex: none; }
.dict-list { border-top: 1px solid var(--mh-line); }
.dict-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--mh-line);
  font-size: 13px;
  color: var(--mh-text-2);
}
.dict-row:hover { background: var(--mh-hover); }
.dict-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-sort { font-family: var(--mh-font-m); font-size: 10.5px; color: var(--mh-text-3); }

/* ---------- 顶栏附属 ---------- */
.app-version {
  flex: 0 0 auto;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--mh-text-3);
}

.app-mobilenav {
  display: none;
  max-width: 1240px;
  width: calc(100% - 36px);
  margin: 10px auto 0;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.app-mobilenav::-webkit-scrollbar { display: none; }
.app-mobilenav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--mh-text-2);
  text-decoration: none;
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  border-radius: 999px;
  white-space: nowrap;
}
.app-mobilenav a[aria-current="page"] {
  color: var(--mh-bg);
  background: var(--mh-text);
  border-color: var(--mh-text);
}
.app-mobilenav__no {
  font-family: var(--mh-font-m);
  font-size: 9.5px;
  letter-spacing: .08em;
  opacity: .6;
}

/* ---------- AI 中心 ---------- */
.aihub-grid {
  margin-bottom: 26px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.aihub-card { display: flex; flex-direction: column; }
.aihub-card .mh-card__desc { flex: 1; }
.aihub-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-family: var(--mh-font-m);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--mh-text-3);
}
.aihub-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--mh-line);
}

.wizard-steps { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.wizard-step {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--mh-line);
  background: var(--mh-soft);
  font-family: var(--mh-font-m);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mh-text-3);
}
.wizard-step.is-active {
  color: var(--mh-accent-deep);
  background: var(--mh-accent-soft);
  border-color: var(--mh-accent-line);
}
.wizard-step.is-done { color: var(--mh-accent-deep); }
.wizard-step__no {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 5px;
  background: var(--mh-hover);
  color: var(--mh-text-2);
  font-size: 10px;
}
.wizard-step.is-active .wizard-step__no { background: var(--mh-accent); color: var(--mh-bg); }

.step-block { margin-top: 22px; }
.step-title {
  font-family: var(--mh-font-d);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 10px;
  color: var(--mh-text);
}
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.header-row-preview {
  max-height: 190px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--mh-line);
  background: var(--mh-soft);
  font-family: var(--mh-font-m);
  font-size: 11px;
  line-height: 1.9;
  color: var(--mh-text-2);
}
.header-row-preview div { white-space: nowrap; }
.header-row-preview .row-no { color: var(--mh-text-3); margin-right: 9px; }

.preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-family: var(--mh-font-m);
  font-size: 12px;
  color: var(--mh-text-2);
}
.preview-summary strong { color: var(--mh-text); font-weight: 500; }
.preview-table-wrap { max-height: 300px; overflow: auto; margin-top: 10px; }

.file-hash { font-family: var(--mh-font-m); font-size: 11px; color: var(--mh-text-3); }
.file-name-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.aihub-hint { margin-top: 7px; font-size: 12px; color: var(--mh-text-3); line-height: 1.7; }

/* ---------- AI 助手 ---------- */
.ai-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--mh-glass-border);
  background: var(--mh-text);
  color: var(--mh-bg);
  font-family: var(--mh-font-m);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: var(--mh-shadow);
  transition: transform .35s var(--mh-ease), box-shadow .35s;
}
.ai-fab:hover { transform: translateY(-2px) rotate(-6deg); box-shadow: var(--mh-shadow-hi); }

.ai-panel {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 90;
  width: 376px;
  height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--mh-radius-lg);
  background: linear-gradient(160deg, var(--mh-glass-solid), var(--mh-surface));
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--mh-glass-border);
  box-shadow: var(--mh-shadow-hi);
}
.ai-hidden { display: none; }

.ai-head {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 14px;
  background: var(--mh-accent-soft);
  border-bottom: 1px solid var(--mh-line);
}
.ai-title {
  flex: 1;
  font-family: var(--mh-font-m);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mh-accent-deep);
}
.ai-icon-btn {
  height: 26px;
  padding: 0 10px;
  font-family: var(--mh-font-b);
  font-size: 11.5px;
  color: var(--mh-text-2);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s;
}
.ai-icon-btn:hover { color: var(--mh-text); border-color: var(--mh-accent-line); background: var(--mh-surface); }

.ai-log { flex: 1; overflow-y: auto; padding: 14px; }
.ai-msg {
  margin-bottom: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-word;
  border-radius: 14px;
}
.ai-bot {
  color: var(--mh-text-2);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
}
.ai-user {
  color: var(--mh-accent-deep);
  background: var(--mh-accent-soft);
  border: 1px solid var(--mh-accent-line);
}
.ai-bot code, .ai-msg code {
  padding: 1px 5px;
  font-family: var(--mh-font-m);
  font-size: 11.5px;
  border-radius: 5px;
  background: var(--mh-accent-soft);
  color: var(--mh-accent-deep);
}
.ai-loading { color: var(--mh-text-3); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.ai-chip {
  padding: 5px 11px;
  font-family: var(--mh-font-b);
  font-size: 11px;
  color: var(--mh-text-2);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .3s var(--mh-ease);
}
.ai-chip:hover { color: var(--mh-text); border-color: var(--mh-accent-line); transform: translateY(-1px); }
.ai-form {
  display: flex;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid var(--mh-line);
}
.ai-input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  font-family: var(--mh-font-b);
  font-size: 12.5px;
  color: var(--mh-text);
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  border-radius: 12px;
  outline: none;
}
.ai-input:focus { border-color: var(--mh-accent-line); background: var(--mh-surface); }
.ai-send {
  height: 34px;
  padding: 0 14px;
  font-family: var(--mh-font-b);
  font-size: 12px;
  font-weight: 600;
  color: var(--mh-bg);
  background: var(--mh-text);
  border: 1px solid var(--mh-text);
  border-radius: 999px;
  cursor: pointer;
}
.ai-pending {
  padding: 10px 12px;
  background: var(--mh-warn-bg);
  border-top: 1px solid var(--mh-warn-line);
}
.ai-pending:empty { display: none; }
.ai-pending-text { font-size: 12px; line-height: 1.7; color: var(--mh-warn-text); }
.ai-pending-actions { display: flex; gap: 7px; margin-top: 7px; }
.ai-confirm, .ai-cancel {
  height: 26px;
  padding: 0 12px;
  font-family: var(--mh-font-b);
  font-size: 11.5px;
  border-radius: 999px;
  cursor: pointer;
}
.ai-confirm { color: var(--mh-bg); background: var(--mh-text); border: 1px solid var(--mh-text); }
.ai-cancel { color: var(--mh-text-2); background: var(--mh-soft); border: 1px solid var(--mh-line); }

/* ---------- 入场动效 ---------- */
.main > .card,
.main > .stat-row,
.main > .section-tabs,
.main > .empty,
.main > .alert {
  animation: mh-rise .8s var(--mh-ease) both;
}
.main > *:nth-child(2) { animation-delay: .06s; }
.main > *:nth-child(3) { animation-delay: .12s; }
.main > *:nth-child(4) { animation-delay: .18s; }
.main > *:nth-child(5) { animation-delay: .24s; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .app-mobilenav { display: flex; }
  .main { padding: 22px 22px 64px; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main { padding: 18px 18px 44px; }
  .app-mobilenav { width: calc(100% - 28px); }
  .app-version { display: none; }
  .card { padding: 18px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .ai-panel {
    right: 14px;
    left: 14px;
    bottom: 78px;
    width: auto;
    height: min(70vh, 480px);
  }
  .modal { padding: 20px; }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; color: #000; }
  .mh-scene, .mh-topbar, .app-mobilenav, .ai-fab, .ai-panel, .no-print { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0 0 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  /* 打印时移除滚动截断：否则只会显示前 N 行，剩余被裁掉 */
  .table-wrap { max-height: none !important; max-width: none !important; overflow: visible !important; height: auto !important; border-radius: 0; }
  .data { font-size: 11px; }
  .data thead th { position: static !important; color: #000; background: none; border-bottom: 1px solid #000; }
  .data tbody td { color: #000; border-bottom: 1px solid #ccc; padding: 4px 6px; }
  .data .num { color: #000; }
  .card-title { border-bottom: 1px solid #000; padding-bottom: 6px; }
  .stat-row { display: grid; margin-bottom: 10px; }
  .stat { padding: 6px 10px; box-shadow: none; }
  .stat-value { font-size: 14px; margin-top: 2px; }
  .empty { display: none !important; }
}

/* ---------- 顶栏退出 ---------- */
.mh-logout {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--mh-line);
  background: var(--mh-soft);
  color: var(--mh-text-2);
  font-family: var(--mh-font-b);
  font-size: 11.5px;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.mh-logout:hover { color: var(--mh-text); border-color: var(--mh-accent-line); }

/* ---------- 账号页 ---------- */
.alert-ok {
  background: color-mix(in srgb, var(--mh-accent) 10%, transparent);
  border: 1px solid var(--mh-accent-line);
  color: var(--mh-accent-deep);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 14px;
}
.login-secret {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--mh-soft);
  border: 1px solid var(--mh-line);
  font-family: var(--mh-font-m);
  font-size: 12px;
  word-break: break-all;
}
