/* admin.css — Zhongbian Admin dashboard styles */
:root {
  --primary: #D80A1A;
  --primary-hover: #B80915;
  --secondary: #1B5FD9;
  --sidebar-bg: #1a1a2e;
  --sidebar-hover: #252542;
  --sidebar-active: #2d2d4a;
  --topbar-bg: #ffffff;
  --content-bg: #f5f6fa;
  --card-bg: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --radius: 8px;
  --sidebar-width: 240px;
  --topbar-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background: var(--content-bg);
  font-size: 14px;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---------------- layout ---------------- */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .25s ease;
}

.main-area { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title { font-size: 18px; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.site-select { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; }
.notification-btn { position: relative; background: none; border: none; padding: 6px; color: var(--text-secondary); border-radius: 6px; display: flex; }
.notification-btn:hover { background: #f3f4f6; color: var(--text-primary); }
.notification-btn svg { width: 20px; height: 20px; }
.notification-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--text-secondary); padding: 4px 8px; }

.content { padding: 24px; flex: 1; }
.page-loading { color: var(--text-secondary); padding: 40px; text-align: center; }

/* ---------------- sidebar ---------------- */
.sidebar-logo {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-icon {
  width: 30px; height: 30px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.logo-text { color: #fff; font-weight: 700; letter-spacing: .12em; font-size: 14px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255,255,255,.7);
  font-size: 13.5px;
  border-left: 3px solid transparent;
}
.nav-item svg { width: 20px; height: 20px; margin-right: 12px; flex: 0 0 20px; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; border-left-color: var(--primary); }
.nav-item .badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 34px;
}
.user-detail { min-width: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,.45); font-size: 11.5px; }
.logout-btn { background: none; border: none; color: rgba(255,255,255,.5); padding: 8px; border-radius: 6px; display: flex; }
.logout-btn:hover { color: #fff; background: var(--sidebar-hover); }
.logout-btn svg { width: 18px; height: 18px; }

/* ---------------- cards & grids ---------------- */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text-primary); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue   { background: #e8f0fe; color: var(--secondary); }
.stat-icon.orange { background: #fef3e2; color: var(--warning); }
.stat-icon.red    { background: #fdeaea; color: var(--danger); }
.stat-icon.green  { background: #e7f7f0; color: var(--success); }
.stat-icon.purple { background: #f1e9fe; color: #8b5cf6; }
.stat-icon.teal   { background: #e2f7f7; color: #0d9488; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.stat-change { font-size: 11.5px; margin-top: 2px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-card.highlight { outline: 2px solid var(--danger); }

.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.lists-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-wrap { position: relative; height: 300px; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f9fafb; padding: 12px; text-align: left; font-weight: 600; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tr:hover td { background: #f9fafb; }
td.msg-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }

/* ---------------- buttons ---------------- */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text-primary); }
.btn-secondary:hover { border-color: var(--text-light); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #fdeaea; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
button:disabled { opacity: .6; cursor: not-allowed; }

/* ---------------- forms ---------------- */
.field { margin-bottom: 16px; }
label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: #374151; }
input, select, textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(27,95,217,.12); }

/* ---------------- status badges ---------------- */
.status, .prio {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-new      { background: #e8f0fe; color: var(--secondary); }
.status-read     { background: #f3f4f6; color: var(--text-secondary); }
.status-replied, .status-quoted { background: #fef3c7; color: #b45309; }
.status-closed, .status-done    { background: #e7f7f0; color: var(--success); }
.status-draft    { background: #f3f4f6; color: var(--text-secondary); }
.status-published, .status-scheduled { background: #e7f7f0; color: var(--success); }
.status-lead     { background: #e8f0fe; color: var(--secondary); }
.status-contact  { background: #fef3c7; color: #b45309; }
.status-customer { background: #e7f7f0; color: var(--success); }
.status-lost     { background: #fdeaea; color: var(--danger); }
.prio-high   { background: #fdeaea; color: var(--danger); }
.prio-medium { background: #fef3c7; color: #b45309; }
.prio-low    { background: #f3f4f6; color: var(--text-secondary); }
.overdue { color: var(--danger); font-weight: 600; }

/* ---------------- misc ---------------- */
.empty { color: var(--text-light); text-align: center; padding: 30px 10px; font-size: 13px; }
.skeleton { background: linear-gradient(90deg, #f1f2f6 25%, #e9eaf0 50%, #f1f2f6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.error-box { background: #fdeaea; color: var(--danger); border-radius: 6px; padding: 16px; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.mini-list { list-style: none; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mini-list li:last-child { border-bottom: none; }
.mini-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 12.5px; }
.bar-row .bar-path { width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.bar-row .bar-track { flex: 1; height: 8px; background: #eef0f4; border-radius: 4px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--secondary); border-radius: 4px; }
.bar-row .bar-n { width: 52px; text-align: right; font-weight: 600; }

/* ---------------- login ---------------- */
.login-body {
  min-height: 100vh;
  background: #0f0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 36px 34px 26px;
}
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.login-logo .logo-icon { width: 34px; height: 34px; font-size: 19px; }
.login-logo .logo-text { color: var(--text-primary); letter-spacing: .14em; font-size: 14px; font-weight: 700; }
.login-title { text-align: center; font-size: 22px; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 26px; }
.login-error { background: #fdeaea; color: var(--danger); border-radius: 6px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--text-light); pointer-events: none; }
.input-icon input { padding-left: 38px; }
.pw-toggle { position: absolute; right: 8px; background: none; border: none; color: var(--text-light); padding: 6px; display: flex; }
.pw-toggle svg { position: static; width: 17px; height: 17px; }
.btn-login {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 600;
  margin-top: 4px;
}
.btn-login:hover { background: var(--primary-hover); }
.login-hint { text-align: center; color: var(--text-light); font-size: 12px; margin-top: 18px; }

/* ---------------- placeholder ---------------- */
.placeholder { text-align: center; padding: 90px 20px; color: var(--text-secondary); }
.placeholder svg { width: 54px; height: 54px; color: var(--text-light); margin-bottom: 18px; }
.placeholder h2 { color: var(--text-primary); font-size: 19px; margin-bottom: 8px; }
.placeholder p { font-size: 13.5px; }
.placeholder code { background: #eef0f4; padding: 2px 7px; border-radius: 4px; font-size: 12px; }

/* ---------------- toast ---------------- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff;
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--info);
  font-size: 13.5px;
  min-width: 240px;
  max-width: 360px;
  animation: toastIn .25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }
.toast.out     { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* ---------------- responsive ---------------- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .main-area { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid, .lists-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .login-card { width: 90%; }
}


/* ---- V3.0 站点管理 ---- */
.sites-toolbar{display:flex;align-items:center;gap:14px;margin-bottom:16px;flex-wrap:wrap}
.sites-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px}
.site-card{padding:16px;display:flex;flex-direction:column;gap:10px}
.site-card-head{display:flex;flex-direction:column;gap:2px}
.site-stats{display:flex;gap:14px;font-size:12.5px;color:var(--text-3)}
.site-stats b{color:var(--text-1)}
.site-actions{display:flex;gap:8px;flex-wrap:wrap}
.site-form{padding:18px;margin-top:14px}
.form-grid{display:grid;grid-template-columns:140px 1fr;gap:10px 12px;align-items:center;margin:12px 0}
.form-grid label{text-align:right;font-size:13px;color:var(--text-3)}
.form-actions{display:flex;gap:10px;margin-top:8px}
.connector-panel{padding:18px;margin-top:14px}
.connector-panel h4{margin:16px 0 8px}
.code-block{background:var(--bg-2,#F1F5F9);border:1px solid var(--line);border-radius:8px;padding:10px 12px;font-family:'IBM Plex Mono',monospace;font-size:12.5px;white-space:pre-wrap;word-break:break-all;margin:6px 0}
.key-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.key-row .code-block{flex:1;min-width:260px;margin:0}
.tag{display:inline-block;padding:2px 8px;border-radius:20px;font-size:11.5px}
.tag-ok{background:rgba(34,197,94,.12);color:#16a34a}
.tag-warn{background:rgba(234,179,8,.14);color:#b45309}
.btn-danger{border-color:rgba(220,38,38,.4);color:#dc2626}
.btn-danger:hover{background:rgba(220,38,38,.08)}


/* ---- V3.1 询盘收件箱（三栏）---- */
.inq-wrap{display:grid;grid-template-columns:300px 1fr 240px;gap:14px;align-items:start}
.inq-col{background:var(--surface);border:1px solid var(--line);border-radius:10px;min-height:520px}
.inq-list-col{overflow:hidden}
.inq-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:10px;border-bottom:1px solid var(--line)}
.inq-tab{border:1px solid var(--line);background:none;border-radius:16px;padding:4px 10px;font-size:12px;cursor:pointer;color:var(--text-2)}
.inq-tab.is-active{background:var(--accent);color:#fff;border-color:var(--accent)}
.inq-tab b{font-weight:600}
.inq-search{width:calc(100% - 20px);margin:10px;padding:7px 10px;border:1px solid var(--line);border-radius:8px;font-size:13px}
.inq-list{max-height:640px;overflow-y:auto}
.inq-item{padding:10px 14px;border-bottom:1px solid var(--line);cursor:pointer}
.inq-item:hover{background:var(--bg-2)}
.inq-item.is-active{background:rgba(0,136,216,.07);border-left:3px solid var(--accent)}
.inq-item.is-new .inq-item-top b::after{content:'新';margin-left:6px;background:var(--accent);color:#fff;font-size:10px;padding:1px 5px;border-radius:8px}
.inq-item-top{display:flex;justify-content:space-between;gap:8px}
.inq-item-msg{font-size:12.5px;color:var(--text-3);margin:3px 0}
.inq-item-bot{display:flex;gap:6px;align-items:center}
.inq-detail-col{padding:20px}
.inq-detail-head h3{margin-bottom:4px}
.inq-status-row{display:flex;gap:6px;margin-top:10px;flex-wrap:wrap}
.inq-st{border:1px solid var(--line);background:none;border-radius:14px;padding:4px 12px;font-size:12px;cursor:pointer;color:var(--text-3)}
.inq-st.is-active{background:var(--accent);color:#fff;border-color:var(--accent)}
.inq-msg,.inq-replies{margin-top:16px}
.inq-msg p,.reply-item p{background:var(--bg-2);border-radius:8px;padding:10px 12px;margin:6px 0;font-size:13.5px;white-space:pre-wrap}
.reply-item{margin-bottom:10px}
.reply-box{margin-top:16px}
.reply-box textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:10px;font-family:inherit;font-size:13.5px;resize:vertical}
.reply-box .btn{margin-top:8px}
.cust-mini-card{background:var(--bg-2);border-radius:10px;padding:14px;display:flex;flex-direction:column;gap:6px;font-size:13px}
.cust-mini-stats{display:flex;gap:6px}
/* ---- 客户列表 + 360 ---- */
.cust-toolbar{display:flex;gap:12px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
.cust-toolbar select,.cust-toolbar input{padding:7px 10px;border:1px solid var(--line);border-radius:8px;font-size:13px}
.pool-toggle{font-size:13px;color:var(--text-2);display:flex;gap:6px;align-items:center}
.cust-table{width:100%;border-collapse:collapse;background:var(--surface);border-radius:10px;overflow:hidden}
.cust-table th,.cust-table td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line);font-size:13px}
.cust-table th{background:var(--bg-2);color:var(--text-3);font-weight:600}
.cust360{padding:20px}
.cust360-ops{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.cust360-ops select{padding:7px 10px;border:1px solid var(--line);border-radius:8px}
.cust360-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:16px}
.cust360-grid h4{margin-bottom:10px}
.fu-new{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.fu-new input{padding:7px 10px;border:1px solid var(--line);border-radius:8px;font-size:13px}
/* ---- 跟进看板 ---- */
.fu-cols{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.fu-col h3{margin-bottom:12px}
.fu-card{margin-bottom:12px;display:flex;flex-direction:column;gap:6px}


/* ---- V3.2 AI SEO 中心 ---- */
.seo-top{display:flex;gap:20px;align-items:center;margin-bottom:16px}
.seo-score-card{padding:16px 28px;text-align:center;min-width:150px}
.seo-score{font-size:42px;font-weight:700;line-height:1.1}
.seo-score.ok{color:#16a34a}.seo-score.mid{color:#b45309}.seo-score.bad{color:#dc2626}
.seo-actions{display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.seo-runs-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.seo-run-item{border:1px solid var(--line);border-radius:8px;padding:5px 10px;font-size:12px;cursor:pointer;color:var(--text-2)}
.seo-run-item:hover{border-color:var(--accent)}
.seo-issue-group{margin-bottom:18px}
.seo-issue{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:10px 14px;margin-bottom:8px}
.seo-check{font-family:'IBM Plex Mono',monospace;font-size:12.5px;color:var(--accent)}
.seo-evi{font-size:13px;margin-top:4px}
.seo-adv{font-size:12.5px;color:var(--text-3);margin-top:2px}
.seo-purl{font-family:'IBM Plex Mono',monospace;font-size:12px}
#seoPages{margin-top:20px}
#seoIssues h3,#seoPages h3{margin:18px 0 10px}


/* ---- V3.3 多语言矩阵 ---- */
.i18n-top{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.i18n-cov{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.i18n-cov-card{display:flex;gap:12px;align-items:center;padding:12px 16px;min-width:210px}
.i18n-cov-pct{font-size:26px;font-weight:700}
.i18n-cov-pct.ok{color:#16a34a}.i18n-cov-pct.mid{color:#b45309}.i18n-cov-pct.bad{color:#dc2626}
.i18n-legend{display:flex;gap:16px;margin:8px 0 12px;font-size:12.5px;color:var(--text-3)}
.i18n-legend span{display:flex;align-items:center;gap:6px}
.i18n-dot{width:14px;height:14px;border-radius:4px;display:inline-block}
.i18n-table{border-collapse:collapse;width:100%;background:var(--surface);border-radius:10px;overflow:hidden}
.i18n-table th,.i18n-table td{padding:7px 10px;border-bottom:1px solid var(--line);font-size:12.5px;text-align:center}
.i18n-table th:first-child,.i18n-table td:first-child{text-align:left}
.i18n-table th{background:var(--bg-2);color:var(--text-3)}
.i18n-ref{font-family:'IBM Plex Mono',monospace;font-size:11.5px}
.i18n-cell{display:inline-flex;align-items:center;justify-content:center;width:26px;height:22px;border-radius:6px;cursor:pointer;font-size:12px;font-weight:600;transition:transform .1s}
.i18n-cell:hover{transform:scale(1.15)}
.st-none{background:#F1F5F9;color:#94a3b8}
.st-mt{background:#FEF3C7;color:#b45309}
.st-reviewed{background:#DBEAFE;color:#1d4ed8}
.st-published{background:#DCFCE7;color:#15803d}
.i18n-bottom{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:24px}
.gloss-row{padding:6px 0;border-bottom:1px dashed var(--line);font-size:13px}
.gloss-row code{background:var(--bg-2);padding:1px 6px;border-radius:4px;font-size:12px}
.gloss-new{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.gloss-new input{padding:7px 10px;border:1px solid var(--line);border-radius:8px;font-size:12.5px}

/* ================= 补齐历史遗留的未定义变量 =================
   V3.0–V3.3 的页面引用了 --surface / --line / --text-3 / --bg-2 / --text-2，
   但 :root 里从未定义（CSS 变量取不到即失效 → 边框/底色静默丢失）。此处一次性补齐。 */
:root{
  --surface: var(--card-bg);
  --bg-2: #f3f4f6;
  --line: var(--border);
  --text-2: var(--text-secondary);
  --text-3: var(--text-light);
}

/* ================= V3.4 报价单 / 单证 ================= */
.q-stats{grid-template-columns:repeat(auto-fit,minmax(148px,1fr));margin-bottom:18px}
.q-stats .stat-card{flex-direction:column;align-items:flex-start;gap:3px}
.q-stats .stat-card .stat-value{font-size:20px}
.q-stats .stat-card{background:var(--card-bg);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;box-shadow:var(--shadow)}
.q-no{font-family:'IBM Plex Mono',ui-monospace,monospace}
.q-pdf{font-size:11.5px;margin-left:4px}
.q-editor{margin-top:18px}
.q-editor-head{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:6px}
.q-editor-head h3{margin:0}
.q-editor-ops{display:flex;gap:8px;flex-wrap:wrap}
.q-flow{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px 0;border-top:1px dashed var(--line);border-bottom:1px dashed var(--line);margin-bottom:12px}
.q-head{grid-template-columns:repeat(3,minmax(200px,1fr));gap:10px 16px}
.q-items input{border:1px solid var(--line);border-radius:6px;padding:5px 7px;font-size:12.5px;width:100%;font-family:inherit}
.q-items .q-num{max-width:88px}
.q-amount,.q-margin{font-weight:600;white-space:nowrap;font-size:12.5px}
.q-items-ops{margin:10px 0}
.q-totals{margin:14px 0 4px;padding:12px 14px;background:var(--bg-2);border-radius:var(--radius);max-width:380px;margin-left:auto}
.q-sum-row{display:flex;justify-content:space-between;gap:20px;font-size:13px;padding:3px 0}
.q-sum-row b{font-family:'IBM Plex Mono',ui-monospace,monospace}
.q-inq-list{margin-top:10px;max-height:340px;overflow:auto}
.q-inq-pick{cursor:pointer;border:1px solid var(--line);border-radius:var(--radius);padding:10px 12px;margin-bottom:8px}
.q-inq-pick:hover{border-color:var(--primary);background:#fff8f8}

/* ================= V3.4 自动化 ================= */
.a-sec{margin:26px 0 10px;font-size:15px}
.a-wide{grid-column:span 3}
.a-conds{grid-template-columns:repeat(4,minmax(160px,1fr))}
.a-acts{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;margin:10px 0 18px}
.a-act{border:1px solid var(--line);border-radius:var(--radius);padding:12px;background:var(--card-bg)}
.a-act.on{border-color:var(--primary);background:#fffbfb}
.a-act-head{display:flex;align-items:center;gap:8px;font-weight:600;font-size:13px;margin-bottom:8px}
.a-act-params{display:flex;flex-direction:column;gap:8px}
.a-act-params .field{margin-bottom:0}
.a-act-params input,.a-act-params select,.a-act-params textarea{border:1px solid var(--line);border-radius:6px;padding:6px 8px;font-size:12.5px;width:100%;font-family:inherit}
.a-planned{margin:8px 0 0 18px;font-size:13px;line-height:1.7}
.a-detail{max-width:360px;font-size:12px;color:var(--text-secondary)}
.a-tpl-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(268px,1fr));gap:12px;margin-top:12px}
.a-tpl{border:1px solid var(--line);border-radius:var(--radius);padding:12px;display:flex;flex-direction:column;gap:6px}
.a-tpl b{font-size:13px}
.a-tpl .muted{font-size:12px;line-height:1.5;flex:1}
.a-tpl-foot{display:flex;justify-content:space-between;align-items:center;margin-top:6px}
.switch{position:relative;display:inline-block;width:38px;height:21px;cursor:pointer}
.switch input{display:none}
.switch i{position:absolute;inset:0;background:#cbd5e1;border-radius:11px;transition:.18s}
.switch i:after{content:'';position:absolute;width:15px;height:15px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.18s}
.switch input:checked + i{background:var(--success)}
.switch input:checked + i:after{transform:translateX(17px)}

/* ================= V3.4 报表与白标 ================= */
.r-freq{display:inline-flex;gap:6px;margin-left:auto}
.r-freq-btn.active{background:var(--primary);border-color:var(--primary);color:#fff}
.r-period{font-size:12.5px;color:var(--text-secondary);margin-bottom:12px}
.r-trend{display:flex;align-items:flex-end;gap:6px;height:92px;margin:8px 0 26px;padding-bottom:18px;overflow-x:auto}
.r-bar{flex:0 0 auto;width:34px;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;position:relative}
.r-bar i{display:block;width:100%;min-height:3px;background:linear-gradient(180deg,#f87171,var(--primary));border-radius:3px 3px 0 0}
.r-bar span{position:absolute;bottom:-16px;font-size:9.5px;color:var(--text-3);white-space:nowrap}
.r-ops{display:flex;gap:6px;flex-wrap:wrap}
.r-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:10px}
.r-new{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px}
.r-new input,.r-new select{border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:13px;font-family:inherit}
.r-new input#rRecipients{min-width:320px}
.r-new .pool-toggle{white-space:nowrap}
.r-brand-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:24px}
.r-brand-preview{border:1px dashed var(--line);border-radius:var(--radius);padding:16px;background:var(--bg-2);height:fit-content}
.r-prev-head b{font-size:16px}
.r-prev-line{height:3px;background:var(--primary);border-radius:2px;margin:10px 0 12px;width:56px}
.r-prev-tag{margin-top:10px;display:inline-block;background:#fff;border:1px solid var(--line);border-radius:20px;padding:3px 10px;font-size:11.5px;color:var(--text-secondary)}
.r-total td{font-weight:700;background:var(--bg-2)}

/* ================= V3.4 站点健康 ================= */
.h-small{font-size:15px!important}
.h-url{font-size:11px;word-break:break-all}
.h-checks td{font-size:12.5px}
.h-findings{margin-top:12px;font-size:12.5px;color:var(--text-secondary);line-height:1.7}

/* ================= V3.4 表单字段统一（.field 原先只有 margin-bottom，标签排版靠 inline 默认行为，标签会贴右） ================= */
.field{display:flex;flex-direction:column;gap:5px;margin-bottom:0}
.field>span{font-size:12px;color:var(--text-3)}
.field input,.field select,.field textarea{border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:13px;font-family:inherit;background:var(--card-bg);color:var(--text-primary);width:100%}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(216,10,26,.08)}
.field textarea{min-height:78px;resize:vertical}
.field.a-wide{grid-column:1 / -1}
.q-head,.a-conds{gap:12px 16px;margin:14px 0}

/* ================= V3.5 产品管理 ================= */
.prod-cell{display:flex;gap:10px;align-items:center}
.prod-cover{width:58px;height:44px;border-radius:6px;overflow:hidden;background:var(--bg-2);display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.prod-cover img{width:100%;height:100%;object-fit:cover;display:block}
.prod-cover span{font-size:10.5px;color:var(--text-3)}
.prod-slug{font-family:'IBM Plex Mono',ui-monospace,monospace;font-size:11.5px}
.prod-preview{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.prod-preview img{width:78px;height:58px;object-fit:cover;border-radius:6px;border:1px solid var(--line)}
.spec-list{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.spec-row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(240px,2fr) auto;gap:8px;align-items:center}
.spec-row input{border:1px solid var(--line);border-radius:6px;padding:7px 9px;font-size:12.5px;font-family:inherit;width:100%}
.cat-name{border:1px solid var(--line);border-radius:6px;padding:6px 8px;font-size:12.5px;font-family:inherit;width:100%}
.prod-table img{background:var(--bg-2)}

/* ================= V3.5 告警通道 ================= */
.nt-events{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:10px;margin:10px 0 16px}
.nt-event{display:flex;gap:9px;align-items:flex-start;border:1px solid var(--line);border-radius:var(--radius);padding:10px 12px;font-size:12.5px;cursor:pointer}
.nt-event:hover{border-color:var(--primary)}
.nt-event input{margin-top:3px}
.nt-event b{font-weight:600}
.nt-event .muted{font-size:11.5px;line-height:1.5}
.cfg-hint{font-size:11px;color:var(--text-3)}

/* ================= V3.5 AI 回信草稿 ================= */
.ai-body{font-family:'IBM Plex Mono',ui-monospace,monospace;font-size:12.5px;line-height:1.6;white-space:pre-wrap}
.ai-meta{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--text-secondary);margin:8px 0 12px}
.ai-panel{margin-top:14px}
.ai-panel h4{margin:0;font-size:14px}



/* ================= V3.6 图片管理与站点同步 ================= */
.prod-preview{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}
.img-cell{margin:0;border:1px solid var(--line);border-radius:8px;overflow:hidden;width:104px;background:var(--card-bg)}
.img-cell img{width:100%;height:78px;object-fit:cover;display:block;background:var(--bg-2)}
.img-cell figcaption{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:4px 6px;font-size:11px;color:var(--text-3)}
.img-cell figcaption b{color:var(--primary)}
.site-list{font-family:'IBM Plex Mono',ui-monospace,monospace;font-size:12.5px;line-height:1.6}
.bg-cands{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.bg-cands .btn{text-align:left;justify-content:flex-start}
.code-block{background:var(--bg-2);border:1px solid var(--line);border-radius:6px;padding:10px;font-size:11.5px;max-height:260px;overflow:auto;white-space:pre-wrap}

/* ================= 产品编辑：三步式简易布局 ================= */
.btn-lg{padding:12px 20px;font-size:14.5px;border-radius:10px}
.sim-hint{background:#fff7f7;border:1px solid #f3d5d5;border-left:4px solid var(--primary);border-radius:8px;padding:10px 14px;font-size:13px;margin:10px 0 18px;line-height:1.8}
.sim-block{border-top:1px solid var(--line);padding-top:16px;margin-top:18px}
.sim-title{display:flex;align-items:center;gap:9px;font-size:15px;font-weight:600;margin-bottom:12px}
.sim-no{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:var(--primary);color:#fff;font-size:13px;flex:0 0 auto}
.simple-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(258px,1fr));gap:12px 16px;margin:10px 0}
.sim-cta{display:flex;gap:16px;align-items:center;flex-wrap:wrap;background:var(--bg-2);border:1px dashed var(--line);border-radius:10px;padding:14px 16px;margin:6px 0 14px}
.sim-cta .muted{flex:1;min-width:250px;font-size:12.5px;line-height:1.7}
.sim-publish{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
.sim-publish .muted{flex:1 1 100%;font-size:12.5px}
.upload-zone{display:flex;align-items:center;gap:16px;border:2px dashed var(--border);border-radius:12px;padding:16px;background:var(--card-bg);transition:border-color .15s,background .15s}
.upload-zone.is-over{border-color:var(--primary);background:#fff8f8}
.up-plus{width:46px;height:46px;border-radius:10px;background:#fdecec;color:var(--primary);font-size:26px;line-height:1;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.up-text{flex:1;min-width:210px}
.up-text b{display:block;font-size:14px;margin-bottom:2px}
.up-text .muted{font-size:12px;line-height:1.6}
.adv-details{margin:12px 0;border:1px solid var(--line);border-radius:8px;padding:8px 12px;background:var(--card-bg)}
.adv-details>summary{cursor:pointer;font-size:13px;color:var(--text-secondary);padding:2px 0;list-style:none}
.adv-details>summary::-webkit-details-marker{display:none}
.adv-details>summary:before{content:'\25B8  ';color:var(--text-3)}
.adv-details[open]>summary:before{content:'\25BE  '}
.adv-details[open]>summary{color:var(--text-primary);font-weight:600;margin-bottom:10px}


/* ==================== V3.7 富文本编辑器 / 媒体库 / 状态标签 ==================== */
.rt-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 6px; border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0; background: #f9fafb;
}
.rt-btn {
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; color: var(--text-primary);
}
.rt-btn:hover { background: var(--content-bg); }
.rt-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rt-editor {
  min-height: 320px; max-height: 60vh; overflow-y: auto;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  background: var(--card-bg); font-size: 15px; line-height: 1.9; outline: none;
}
.rt-editor:focus { border-color: var(--secondary); }
.rt-editor img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.rt-editor h2 { font-size: 20px; margin: 22px 0 10px; }
.rt-editor h3 { font-size: 17px; margin: 18px 0 8px; }
.rt-editor p { margin: 0 0 12px; }
.rt-editor blockquote { border-left: 3px solid var(--secondary); margin: 12px 0; padding: 6px 14px; color: var(--text-secondary); background: #f8fafc; }
.rt-editor ul, .rt-editor ol { padding-left: 24px; margin: 0 0 12px; }
.rt-editor table { border-collapse: collapse; margin: 10px 0; }
.rt-editor th, .rt-editor td { border: 1px solid var(--border); padding: 6px 10px; }
.rt-preview { font-size: 15px; line-height: 1.9; }
.rt-preview img { max-width: 100%; border-radius: 6px; }
.rt-preview blockquote { border-left: 3px solid var(--secondary); margin: 12px 0; padding: 6px 14px; color: var(--text-secondary); background: #f8fafc; }
.tag-sched { background: #e0edff; color: var(--secondary); }

.med-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin-top: 10px;
}
.med-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg);
  padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow);
}
.med-card.med-sel { outline: 2px solid var(--secondary); }
.med-thumb {
  width: 100%; height: 110px; object-fit: cover; border-radius: 6px;
  background: var(--content-bg); border: 1px solid var(--border);
}
.med-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.med-meta { font-size: 11px; }
.med-check { display: flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; }


/* ==================== V3.7.2 弹窗编辑器 ==================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 300;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 28px 14px; overflow-y: auto;
}
.modal-box {
  background: var(--card-bg); border-radius: 12px;
  width: min(960px, 96vw); max-height: calc(100vh - 56px);
  overflow-y: auto; box-shadow: var(--shadow-md);
}
.modal-box .card { box-shadow: none; }
.modal-box .q-editor-head {
  position: sticky; top: 0; z-index: 6; background: var(--card-bg);
  margin: -20px -20px 10px; padding: 14px 20px;
  border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0;
}


/* ==================== V3.8 侧栏分组 / 仪表盘快捷操作 ==================== */
.nav-group {
  margin: 14px 14px 4px; padding-bottom: 4px;
  font-size: 10.5px; letter-spacing: 1px; color: #8a8aa3;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-group:first-child { margin-top: 4px; }
.dash-quick { margin-bottom: 16px; }
.dq-head { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 12px; }
.dq-head b { color: var(--text-primary); }
.dq-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.dq-btn {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  background: #fafbfc; transition: all .15s ease;
}
.dq-btn:hover { border-color: var(--secondary); background: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dq-ico { font-size: 22px; line-height: 1; }
.dq-btn b { font-size: 14.5px; color: var(--text-primary); }
.dq-btn i { font-style: normal; font-size: 12px; color: var(--text-secondary); }

/* ===== V3.9 用户管理与我的账号 ===== */
a.user-info { text-decoration: none; border-radius: var(--radius); padding: 4px 6px; transition: background .15s ease; }
a.user-info:hover { background: var(--sidebar-hover); }
a.user-info:hover .user-name { color: #fff; }

.um-panel:empty { display: none; }
.um-panel { margin-bottom: 14px; }
.um-panel .card { margin-bottom: 0; }

.um-table td { vertical-align: top; }
.um-table tr.um-off td { opacity: .55; }
.um-domain { white-space: nowrap; font-size: 12px; }
.um-ops { flex-wrap: wrap; gap: 6px; }
.um-ops .btn { flex: none; }
.um-foot { margin: 10px 2px 0; font-size: 12.5px; }

.um-checks { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.um-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; cursor: pointer; }
/* 关键：全局有 input { width:100% }，不显式 width:auto 的话复选框会被撑成整行宽，
   同行的说明文字被压成"竖排单字"（实测 1192px 宽 → 文字 0px）。 */
.um-check input[type="checkbox"] { width: auto; height: auto; flex: none; margin: 2px 0 0; padding: 0; }

.um-legend { display: flex; flex-direction: column; gap: 10px; }
.um-legend-row { display: flex; gap: 12px; align-items: baseline; font-size: 13.5px; }
.um-legend-row b { flex: none; width: 96px; color: var(--text-primary); }
.um-legend-row span { color: var(--text-secondary); line-height: 1.6; }
.um-legend-foot { font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 10px; }

@media (max-width: 760px) {
  .um-legend-row { flex-direction: column; gap: 2px; }
  .um-legend-row b { width: auto; }
}
