﻿/*  ============================================================
 *  融通金报价 SaaS 后台样式（Layui 风格，原生 CSS）
 *  公共：tenant.html / admin.html
 *  ============================================================ */

:root {
  --primary: #1E9FFF;
  --primary-dark: #1A8CDF;
  --success: #16BAAA;
  --warn: #FFB800;
  --danger: #FF5722;
  --dark: #1F2329;
  --side-bg: #20222A;
  --side-fg: #C2C8D0;
  --side-active: #1E9FFF;
  --border: #E6E6E6;
  --bg: #F0F2F5;
  --text: #303133;
  --text-secondary: #888;
  --shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --radius: 4px;
  --side-w: 220px;
  --nav-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; color: inherit; outline: none; }

/* ============== 布局 ============== */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* 顶部导航 */
.app-nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  background: var(--dark); color: #fff; z-index: 100;
  display: flex; align-items: center; padding: 0 20px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .15);
}
.app-nav .brand {
  font-size: 16px; font-weight: 600; letter-spacing: .5px;
  display: flex; align-items: center; gap: 8px;
  width: var(--side-w); flex-shrink: 0;
}
.app-nav .brand i {
  width: 30px; height: 30px; border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--success));
  display: inline-flex; align-items: center; justify-content: center; font-style: normal;
  font-weight: 700;
}
.app-nav .nav-toggle {
  display: none; background: none; border: 0; color: #fff; font-size: 20px;
  margin-right: 12px; cursor: pointer; padding: 6px;
}
.app-nav .spacer { flex: 1; }
.app-nav .user {
  display: flex; align-items: center; gap: 12px; color: #c2c8d0; font-size: 13px;
}
.app-nav .user a { color: #FFD76B; }
.app-nav .user .btn-logout {
  background: transparent; border: 1px solid #4a4f5a; color: #c2c8d0;
  padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.app-nav .user .btn-logout:hover { background: #2c3038; color: #fff; }

/* 侧边导航 */
.app-side {
  position: fixed; top: var(--nav-h); bottom: 0; left: 0; width: var(--side-w);
  background: var(--side-bg); color: var(--side-fg); padding: 12px 0;
  overflow-y: auto; z-index: 90;
}
.app-side a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 22px; color: var(--side-fg); font-size: 14px;
  cursor: pointer; transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.app-side a:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.app-side a.active {
  background: rgba(30, 159, 255, .08); color: #fff;
  border-left-color: var(--side-active);
}
.app-side a i { width: 18px; text-align: center; font-style: normal; opacity: .8; }
.app-side a.active i { opacity: 1; }

/* 主内容 */
.app-main {
  margin-left: var(--side-w); margin-top: var(--nav-h);
  padding: 18px; min-height: calc(100vh - var(--nav-h));
}
.banner-trial {
  background: #FFF7E0; color: #8A6500;
  padding: 10px 16px; margin-bottom: 16px; border-radius: var(--radius);
  border: 1px solid #FFE4A8; font-size: 13px;
}
.banner-trial a { margin-left: 8px; color: #C47B00; text-decoration: underline; }

/* 卡片 */
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.card-head {
  padding: 14px 18px; border-bottom: 1px solid #F2F2F2;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600;
}
.card-head .title { display: flex; align-items: center; gap: 10px; }
.card-body { padding: 18px; }
.card-disabled { opacity: .5; pointer-events: none; user-select: none; }
.card-disabled .card-head { pointer-events: auto; opacity: 1; }

/* 标签 */
.flag-ok, .flag-warn, .flag-info, .flag-danger {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: normal;
}
.flag-ok { background: #E6F6F1; color: #069F8E; }
.flag-warn { background: #FFF4E1; color: #C2410C; }
.flag-info { background: #E3F1FF; color: #1A6FBF; }
.flag-danger { background: #FFE7DE; color: #C03A19; }

.muted { color: var(--text-secondary); font-size: 13px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }

/* 表单 */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.form-item { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; min-width: 0; }
.form-item label { font-size: 13px; color: #555; }
.form-item .hint { font-size: 12px; color: #aaa; }
.input, select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid #D8DCE2; border-radius: var(--radius);
  background: #fff; transition: border-color .15s; width: 100%;
}
textarea { height: auto; min-height: 80px; padding: 8px 10px; font-family: inherit; resize: vertical; }
.input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input[type="color"] { width: 50px; height: 36px; padding: 2px; border: 1px solid #D8DCE2; border-radius: var(--radius); cursor: pointer; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: var(--radius); border: 1px solid #D8DCE2;
  background: #fff; color: var(--text); cursor: pointer; font-size: 14px;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #13A89B; color: #fff; }
.btn-danger { color: var(--danger); border-color: #FFCFC0; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

.msg { font-size: 12px; color: #888; margin-left: 10px; }
.msg.ok { color: var(--success); }
.msg.err { color: var(--danger); }

/* Toast 轻提示 */
.toast-box {
  position: fixed;
  right: 18px;
  top: 70px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 180px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 9px 14px;
  border-radius: 4px;
  color: #fff;
  background: #4E5969;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
  font-size: 13px;
  line-height: 1.5;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .2s, transform .2s;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
.toast.warn { background: var(--warn); color: #5f3f00; }
.toast.hide { opacity: 0; transform: translateY(-6px); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid #EEE; text-align: left; vertical-align: middle; }
.table th { background: #FAFBFC; color: #555; font-weight: 500; font-size: 13px; }
.table tr:hover td { background: #F8FBFF; }

/* 标签徽章 */
.tag {
  display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 11px;
  background: #F0F2F5; color: #555;
}
.tag-trial { background: #FFF4E1; color: #C2410C; }
.tag-active, .tag-paid { background: #E6F6F1; color: #069F8E; }
.tag-expired { background: #F0F2F5; color: #6B7280; }
.tag-pending { background: #E3F1FF; color: #1A6FBF; }
.tag-warn { background: #FFF3CD; color: #856404; }
.tag-failed { background: #FFE7DE; color: #C03A19; }
.tag-none { background: #F0F2F5; color: #6B7280; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(135deg, #1E9FFF, #16BAAA);
}
.login-card {
  background: #fff; border-radius: 12px; padding: 36px 32px;
  max-width: 400px; width: 100%; box-shadow: 0 12px 48px rgba(0, 0, 0, .18);
}
.login-card h2 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.login-card .sub { color: #999; font-size: 12px; margin-bottom: 16px; text-align: center; }

/* 输入框 + 按钮内联组 */
.input-group {
  display: flex; gap: 0;
}
.input-group .input {
  flex: 1; min-width: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
}
.input-group-btn {
  flex-shrink: 0; white-space: nowrap;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 14px; font-size: 13px;
}

/* 登录 Tab */
.login-tabs {
  display: flex; gap: 0; margin-bottom: 18px;
  border-bottom: 2px solid #eee;
}
.login-tab {
  flex: 1; padding: 10px 0; border: none; background: none;
  font-size: 14px; font-weight: 500; color: #999; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.login-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.login-tab:hover { color: #555; }

/* 模板缩略图栅格 */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tpl-cell {
  border: 2px solid #EEE; border-radius: 8px; padding: 14px 12px; cursor: pointer; text-align: center;
  background: #fff; transition: border-color .15s, background .15s;
}
.tpl-cell:hover { border-color: var(--primary); }
.tpl-cell.active { border-color: var(--primary); background: #F0F8FF; }
.tpl-cell .tpl-name { font-size: 14px; font-weight: 600; }
.tpl-cell .tpl-desc { font-size: 12px; color: #888; margin-top: 4px; min-height: 1em; }
.tpl-cell .tpl-recommended {
  display: inline-block; margin-top: 6px; padding: 1px 7px;
  border-radius: 10px; background: #FFF4E1; color: #C2410C; font-size: 11px;
}

/* 品种 + 调价合并行 */
.prod-table { width: 100%; border-collapse: collapse; }
.prod-table th, .prod-table td { padding: 10px 8px; border-bottom: 1px solid #F2F2F2; }
.prod-table th { background: #FAFBFC; color: #666; font-size: 12px; font-weight: 500; text-align: left; }
.prod-table td .input, .prod-table td select { height: 32px; }
.prod-table .col-vis { width: 60px; text-align: center; }
.prod-table .col-sort { width: 76px; }
.prod-table .col-name { width: 200px; }
.prod-table .col-mode { width: 90px; }
.prod-table .col-val { width: 110px; }
.prod-table .col-alias { min-width: 110px; }
.prod-table tr.dim td { opacity: .45; }
.prod-table tr.dragging td { background: #EAF5FF !important; opacity: .75; }
.prod-table td.code-sub { color: #aaa; font-size: 12px; }
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: #8A94A6;
  cursor: grab;
  user-select: none;
  font-size: 18px;
  line-height: 1;
}
.drag-handle:hover { background: #EEF6FF; color: var(--primary); }
.drag-handle:active { cursor: grabbing; }

/* 开关 */
.switch {
  position: relative; display: inline-block; width: 38px; height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: #CFD3D9; border-radius: 20px; transition: background .15s;
}
.switch .slider:before {
  position: absolute; content: ""; height: 16px; width: 16px;
  left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }

/* 选项卡（用于 admin 多 tab）*/
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid #EEE; margin-bottom: 16px; flex-wrap: wrap;
}
.tabs a {
  padding: 9px 16px; font-size: 14px; cursor: pointer; color: #555;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--primary); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* 网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* 模块 / 订阅中心 */
.module-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #F0F8FF 0%, #F4FFFC 100%);
  border: 1px solid #DDEEFF;
}
.module-eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.module-hero h2 {
  margin: 6px 0 8px;
  font-size: 24px;
  line-height: 1.2;
}
.module-hero p {
  margin: 0;
  color: #667085;
  line-height: 1.7;
}
.module-hero-total {
  min-width: 150px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: right;
}
.module-hero-total span { color: #8A94A6; font-size: 12px; }
.module-hero-total b { color: var(--danger); font-size: 24px; margin-top: 4px; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.module-card {
  border: 1px solid #E8ECF2;
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.module-card:hover {
  border-color: #B7DFFF;
  box-shadow: 0 8px 24px rgba(30, 159, 255, .08);
  transform: translateY(-1px);
}
.module-card.is-open {
  border-color: #BDEFE5;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FFFD 100%);
}
.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.module-name { font-size: 16px; font-weight: 700; }
.module-desc { margin-top: 6px; color: #667085; font-size: 13px; line-height: 1.5; }
.module-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #E8ECF2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8A94A6;
  font-size: 13px;
}
.module-meta b { color: #344054; }
.module-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.module-ok { color: var(--success); font-size: 12px; }
.sub-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.sub-pill {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #EEF1F5;
  border-radius: 8px;
  background: #FAFBFC;
}
.sub-pill b { display: block; margin-bottom: 4px; }
.sub-pill span { color: #98A2B3; font-size: 12px; }
.sub-pill em {
  display: block;
  margin-top: 7px;
  color: #667085;
  font-style: normal;
  font-size: 12px;
  text-align: right;
}
.empty-state {
  padding: 24px;
  border: 1px dashed #D8DCE2;
  border-radius: 8px;
  text-align: center;
  color: #667085;
  background: #FAFBFC;
}
.empty-state b { color: #344054; font-size: 15px; }
.empty-state p { margin: 8px 0 0; }
.buy-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 74px 86px 110px 110px;
  gap: 12px;
  align-items: center;
  padding: 14px 12px;
  border: 1px solid transparent;
  border-bottom-color: #EEF1F5;
  border-radius: 8px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.buy-card .mod-name { font-weight: 600; }
.buy-card .mod-price { color: #667085; font-size: 13px; margin-top: 3px; }
.buy-card .mod-end { color: #999; font-size: 12px; }
.buy-card .input { height: 32px; }
.buy-card .buy-rule-hint {
  grid-column: 1 / -1;
  color: #98A2B3;
  font-size: 12px;
  line-height: 1.5;
}
.buy-card.selected {
  background: #F3FAFF;
  border-color: #B7DFFF;
  box-shadow: 0 4px 14px rgba(30, 159, 255, .06);
}
.buy-card.disabled,
.buy-card.buy-disabled {
  background: #FAFBFC;
  color: #98A2B3;
  opacity: .7;
}
.buy-card.disabled .buy-line-total,
.buy-card.buy-disabled .buy-line-total { color: #98A2B3; }
.buy-card.disabled .buy-check,
.buy-card.buy-disabled .buy-check { cursor: not-allowed; }
.buy-card .buy-days[readonly],
.buy-card.buy-disabled .buy-days {
  background: #F7F8FA;
  color: #667085;
}
.dependency-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #FFE4A8;
  border-radius: 8px;
  background: #FFF9E8;
  color: #8A6500;
  font-size: 13px;
  line-height: 1.6;
}
.dependency-note b { color: #C47B00; }
.buy-card.pulse { animation: buyPulse .85s ease; }
.buy-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475467;
}
.buy-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border-top: 1px solid #EEF1F5;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
.buy-footer-total b {
  color: var(--danger);
  font-size: 18px;
}
@keyframes buyPulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 159, 255, .25); }
  100% { box-shadow: 0 0 0 10px rgba(30, 159, 255, 0); }
}
.screen-link-box {
  border-top: 1px dashed #EEE;
  padding-top: 10px;
}
.link-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.qr-link-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qr-link-modal[hidden] { display: none !important; }
.qr-link-card {
  position: relative;
  width: min(340px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.qr-link-card h3 { margin: 0 0 14px; font-size: 16px; }
.qr-link-card img { width: 260px; height: 260px; max-width: 100%; }
.qr-link-card p { margin: 12px 0 0; color: #666; font-size: 12px; word-break: break-all; }
.qr-link-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: #999;
  cursor: pointer;
}

/* ============== Profile 分栏 ============== */
.profile-split {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 16px;
  align-items: start;
}
.profile-left { min-width: 0; }
.profile-right {
  position: sticky;
  top: calc(var(--nav-h) + 18px);
}

.phone-card { overflow: visible; }
.phone-card .card-head { border-radius: var(--radius) var(--radius) 0 0; }

.phone-frame {
  width: 375px;
  margin: 0 auto;
  background: #111;
  border-radius: 0 0 28px 28px;
  padding: 0 0 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18), inset 0 0 0 2px #333;
  overflow: hidden;
}
.phone-notch {
  width: 120px; height: 6px;
  margin: 0 auto; border-radius: 0 0 8px 8px;
  background: #222;
}
.profile-split.single-col { grid-template-columns: 1fr; }
.profile-split.single-col .profile-right { display: none; }

.phone-screen {
  background: #fff;
  margin: 6px 6px 0;
  border-radius: 0 0 22px 22px;
  height: calc(100vh - var(--nav-h) - 130px);
  overflow-y: auto;
}
.phone-screen .ql-toolbar {
  border: none;
  border-bottom: 1px solid #e8e8e8;
  background: #fafbfc;
  border-radius: 0;
  padding: 6px 8px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.phone-screen .ql-container {
  border: none;
  font-size: 14px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.phone-screen .ql-editor {
  min-height: 340px;
  padding: 16px 14px;
  line-height: 1.8;
}
.phone-screen .ql-editor p { margin: 0 0 0.8em; }
.phone-screen .ql-editor h1,
.phone-screen .ql-editor h2,
.phone-screen .ql-editor h3 { margin: 1em 0 0.5em; }
.phone-screen .ql-editor img { max-width: 100%; border-radius: 6px; }

/* 风险提示编辑器 */
#risk-editor .ql-toolbar {
  border-color: #e6e6e6;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #fafbfc;
}
#risk-editor .ql-container {
  border-color: #e6e6e6;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
}
#risk-editor .ql-editor {
  min-height: 160px;
  line-height: 1.8;
}
#risk-reset-btn {
  font-size: 12px;
  color: var(--primary);
}

/* 价格指示 */
.price-up   { color: var(--danger); }
.price-down { color: var(--success); }

/* ============== 响应式：移动端 ============== */
@media (max-width: 900px) {
  :root { --side-w: 0px; }
  .app-side {
    left: -240px; width: 220px; transition: left .25s;
    z-index: 1000;
  }
  .app-side.open { left: 0; box-shadow: 4px 0 20px rgba(0, 0, 0, .3); }
  .app-side-mask {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 999;
  }
  .app-side-mask.show { display: block; }
  .app-nav .nav-toggle { display: inline-flex; }
  .app-nav .brand { width: auto; flex: 1; }
  .app-main { margin-left: 0; padding: 12px; }
  .card-body { padding: 14px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .profile-split { grid-template-columns: 1fr; }
  .profile-right { position: static; }
  .phone-frame { width: 100%; max-width: 375px; border-radius: 0 0 22px 22px; }
  .module-hero { flex-direction: column; padding: 14px; }
  .module-hero h2 { font-size: 20px; }
  .module-hero-total { text-align: left; }
  .buy-card { grid-template-columns: 1fr 72px; }
  .buy-card .buy-info,
  .buy-card .buy-line-total { grid-column: 1 / -1; }
  .buy-footer { position: static; justify-content: stretch; align-items: stretch; flex-direction: column; }
  .buy-footer .btn { width: 100%; }
  .link-row { grid-template-columns: 1fr; }
  /* 品种表移动端：把列变窄 */
  .prod-table .col-alias { display: none; }
  .prod-table th, .prod-table td { padding: 8px 4px; font-size: 13px; }
  .card-head { padding: 12px 14px; font-size: 14px; }
  .form-item { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .prod-table .col-mode { display: none; }
  .login-card { padding: 28px 20px; }
}

/* ── 弹层 ── */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 16px; overflow-y: auto;
}
.modal-mask[hidden] { display: none !important; }
.modal-box {
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: 100%; animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid #eee; font-weight: 600;
}
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer; color: #888;
  line-height: 1; padding: 0 4px;
}
.modal-body { padding: 16px 20px; }

/* 租户详情双栏 */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.detail-section h4 { margin: 0 0 10px; font-size: 14px; color: #333; }
.table-sm td, .table-sm th { padding: 6px 8px; font-size: 13px; }
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* 分页器 */
.card-foot { padding: 10px 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* tag 补充 */
.tag-refunded { color: #999; border-color: #ddd; background: #f9f9f9; }
.tag-revoked  { color: #999; border-color: #ddd; background: #f5f5f5; text-decoration: line-through; }

/* 域名 — 默认子域行 */
.dom-host-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dom-host-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 14px; color: #333; user-select: all;
  background: #f8f8f8; padding: 6px 12px; border-radius: 6px;
  border: 1px solid #e5e5e5;
}
.slug-changed-tag { font-size: 12px; }

/* slug 编辑面板 */
.slug-panel {
  margin-top: 10px;
  animation: slugPanelIn .2s ease;
}
@keyframes slugPanelIn { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 300px; } }
.slug-panel-inner {
  background: #fafbfc; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 14px 16px;
}
.slug-panel-tip {
  font-size: 13px; color: #666; margin-bottom: 10px;
  padding: 8px 12px; background: #fffbe6; border-radius: 6px; border: 1px solid #ffe58f;
}
.slug-row {
  display: flex; align-items: center; gap: 0;
}
.slug-row .slug-input {
  flex: 1; max-width: 200px;
  border-radius: 6px 0 0 6px; border-right: none;
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: 14px;
  text-transform: lowercase;
}
.slug-suffix {
  display: inline-flex; align-items: center;
  height: 36px; padding: 0 10px;
  background: #f0f0f0; border: 1px solid #d0d0d0; border-left: none;
  border-radius: 0 6px 6px 0;
  color: #888; font-size: 13px; white-space: nowrap;
  font-family: 'SFMono-Regular', Consolas, monospace;
}
.slug-hint { font-size: 12px; margin-top: 6px; }
.slug-ok   { color: #16a34a; }
.slug-err  { color: #dc2626; }

/* slug 预览 */
.slug-preview {
  margin-top: 8px; font-size: 13px; color: #555;
  font-family: 'SFMono-Regular', Consolas, monospace;
}
.slug-preview-slug {
  color: #dc2626; font-weight: 700; font-size: 15px;
}
.slug-preview-base { color: #888; }

.slug-panel-actions {
  margin-top: 12px; display: flex; gap: 8px;
}
.slug-changed-tag {
  font-size: 12px; color: #999;
}

/* DNS 解析引导 */
.dns-guide {
  background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 8px;
  padding: 14px 16px; margin-bottom: 4px;
}
.dns-guide-title {
  font-weight: 600; font-size: 14px; color: #333; margin-bottom: 10px;
}
.dns-guide-steps { display: flex; flex-direction: column; gap: 8px; }
.dns-step {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #555; line-height: 1.6;
}
.dns-step-num {
  flex-shrink: 0; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--accent);
}
.dns-step code {
  background: #fff3e0; padding: 1px 5px; border-radius: 3px; font-size: 12px; color: #e65100;
}
.dns-target-row {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 4px 28px;
}
.dom-cname-copy {
  cursor: pointer; transition: background .15s;
}
.dom-cname-copy:hover { background: #eef1f5; }
