@charset "utf-8";
/* ==========================================================================
   admin.css —— 后台管理系统样式
   ========================================================================== */
:root {
  --blue: #004A9E;
  --blue-l: #1D5BAF;
  --green: #7DAE18;
  --red: #e23a2e;
  --ink: #0f172a;
  --gray: #4b5563;
  --bg: #f1f5f9;
  --border: #e2e8f0;
  --side: #0b1a2e;
  --steel: #334155;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
a { color: inherit; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: linear-gradient(180deg, var(--side), #10233d);
  color: #cbd5e1; flex: 0 0 220px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.logo { padding: 20px 22px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.logo .b { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.logo .b i { color: #4d9de0; font-style: normal; }
.logo .s { font-size: 10.5px; color: #64748b; letter-spacing: 1.2px; margin-top: 4px; }
.menu { flex: 1; padding: 14px 12px; overflow-y: auto; }
.mi {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 9px;
  cursor: pointer; color: #94a3b8; font-weight: 600; font-size: 13.5px; margin-bottom: 4px;
  transition: all .2s;
}
.mi:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.mi.on { background: linear-gradient(90deg, var(--blue), var(--blue-l)); color: #fff; box-shadow: 0 4px 14px rgba(0, 74, 158, .4); }
.mi .ico { width: 18px; text-align: center; font-size: 15px; }
.bdg {
  display: none; margin-left: auto; background: var(--red); color: #fff; font-size: 11px;
  font-weight: 700; border-radius: 9px; padding: 0 7px; line-height: 17px; min-width: 17px; text-align: center;
}
.side-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 11px; color: #64748b; line-height: 1.7; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--border); padding: 0 28px; height: 58px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100;
}
.topbar h1 { font-size: 16px; font-weight: 800; }
.topbar .acts { display: flex; gap: 10px; align-items: center; }
.content { padding: 24px 28px; flex: 1; }

/* ---------- 按钮 ---------- */
.btn { border: none; border-radius: 7px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-p { background: var(--blue); color: #fff; } .btn-p:hover { background: var(--blue-l); }
.btn-g { background: #334155; color: #cbd5e1; } .btn-g:hover { background: #475569; color: #fff; }
.btn-d { background: transparent; color: #ef4444; border: 1px solid #ef4444; padding: 4px 10px; font-size: 12px; }
.btn-d:hover { background: #ef4444; color: #fff; }
.btn-s { background: #fff; border: 1px solid var(--border); color: var(--gray); padding: 4px 8px; font-size: 12px; }
.btn-s:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- 面板 ---------- */
.panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 20px; }
.panel h2 { font-size: 15.5px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel h2 .tag { font-size: 11px; background: #eff6ff; color: var(--blue); padding: 2px 8px; border-radius: 4px; font-weight: 600; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px;
  font-size: 13.5px; font-family: inherit; transition: border .2s; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--blue); }
.field textarea { min-height: 110px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.6; }
.field textarea.rich { font-family: inherit; font-size: 14px; min-height: 220px; }
.field .hint { font-size: 12px; color: #94a3b8; margin-top: 6px; line-height: 1.7; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
/* 系列 / 产品弹窗里的 TDK 区块 */
.seo-inline { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 4px; background: #fafbfc; }
.seo-inline-hd { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.seo-inline .field { margin-bottom: 10px; }
.seo-inline .field input, .seo-inline .field textarea { background: #fff; }
.empty { color: #94a3b8; text-align: center; padding: 40px; font-size: 13px; background: #f8fafc; border-radius: 10px; border: 1px dashed var(--border); line-height: 1.9; }

/* ---------- 统计卡 ---------- */
/* 5 张卡片 → 5 列铺满一行，不留空格。
   注意：别用 auto-fit + minmax —— 它按容器宽度自行算列数，5 张卡在常见视口下会算成 4 列，
   分行成「4 + 1」，最后一行空 3 格，比固定列数更难看。列数要跟卡片数量对齐。
   若增减卡片，这里的列数要同步改。 */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat .ic { width: 46px; height: 46px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: #eff6ff; flex: 0 0 46px; }
.stat .n { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat .t { font-size: 12px; color: #64748b; margin-top: 2px; }

/* ---------- 快捷入口 ---------- */
/* 当前 5 个按钮 → 5 列铺满一行。列数跟按钮数量对齐，窄屏降列时避免「N+1」的孤立尾行。 */
.quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.quick-grid .btn { padding: 12px; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 10px 12px; background: #f8fafc; color: #64748b; font-size: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: #fafcff; }
.tree-row-l1 { background: #f8fafc; }
.tree-row-l1:hover td { background: #f1f6ff; }
.tree-row-l2:hover td { background: #fafcff; }
.tree-toggle { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer; color: #64748b; font-size: 11px; user-select: none; }
.tree-toggle:hover { background: #e2e8f0; color: var(--blue); }
.tree-name-l1 { font-weight: 700; }
.tree-name-l2 { color: var(--gray); }
.tree-branch { color: #cbd5e1; margin-right: 6px; font-family: monospace; }
.tag-on { display: inline-block; background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; padding: 2px 9px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.tag-off { display: inline-block; background: #f1f5f9; color: #94a3b8; border: 1px solid var(--border); padding: 2px 9px; border-radius: 4px; font-size: 12px; cursor: pointer; }

/* 管理账号：当前登录标记 */
.tag-me {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
  background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
}
.thumb-box { width: 96px; height: 60px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- 留言 ---------- */
.q-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.q-tab { padding: 7px 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 13px; font-weight: 600; color: var(--gray); cursor: pointer; }
.q-tab.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.q-tab .n { opacity: .75; font-weight: 400; margin-left: 4px; }
.q-row.done td { color: #94a3b8; }
.q-msg { max-width: 420px; white-space: pre-wrap; word-break: break-word; line-height: 1.65; }
.q-meta { font-size: 11.5px; color: #94a3b8; margin-top: 4px; }

/* ---------- 错误页 ---------- */
.err-view { max-width: 520px; margin: 60px auto; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 44px 36px; }
.err-view .ic { font-size: 42px; margin-bottom: 14px; }
.err-view h2 { font-size: 17px; margin-bottom: 10px; }
.err-view p { font-size: 13px; color: var(--gray); line-height: 2; margin-bottom: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff;
  padding: 11px 22px; border-radius: 8px; font-size: 13px; display: none; z-index: 999;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25); max-width: 90vw;
}
.toast.show { display: block; animation: tin .25s; }
@keyframes tin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 富文本编辑器 ---------- */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; padding: 7px; background: #f8fafc; }
.rte-toolbar button { border: 1px solid var(--border); background: #fff; border-radius: 5px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; color: var(--gray); font-family: inherit; }
.rte-toolbar button:hover { border-color: var(--blue); color: var(--blue); }
.rte-toolbar button.ai-btn { background: linear-gradient(100deg, #0369a1, #0ea5e9 55%, #22d3ee); color: #fff; border: none; box-shadow: 0 3px 12px rgba(14, 165, 233, .3); }
.rte-toolbar button.ai-btn:hover:not(:disabled):not(.disabled) { filter: brightness(1.08); color: #fff; box-shadow: 0 5px 16px rgba(14, 165, 233, .45); }
.rte-toolbar button.ai-btn.disabled { background: #cbd5e1; color: #94a3b8; cursor: not-allowed; box-shadow: none; }
.rte-toolbar .sep { width: 1px; background: var(--border); margin: 2px 4px; }
.rte-area { min-height: 260px; border: 1px solid var(--border); border-radius: 0 0 8px 8px; padding: 16px 18px; font-size: 14px; line-height: 1.9; background: #fff; overflow-y: auto; cursor: text; }
.rte-area:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.rte-area:empty:before { content: attr(data-ph); color: #9aa4b2; pointer-events: none; }
.rte-area[contenteditable="true"]:empty { min-height: 260px; }
.rte-area img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.rte-area h2 { font-size: 19px; margin: 16px 0 10px; }
.rte-area h3 { font-size: 16px; margin: 14px 0 8px; }
.rte-area p { margin-bottom: 12px; }
.rte-area ul, .rte-area ol { padding-left: 24px; margin-bottom: 12px; }
.rte-area blockquote { border-left: 4px solid var(--blue); padding-left: 14px; color: var(--gray); margin: 12px 0; }
.rte-src { width: 100%; border: 1px solid var(--border); border-radius: 0 0 8px 8px; padding: 16px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; min-height: 260px; line-height: 1.7; }

/* ---------- 图片「点击更换」 ---------- */
.img-repl { position: relative; cursor: pointer; }
.img-repl .repl-mask {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .6); color: #fff; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px;
  opacity: 0; transition: opacity .16s; pointer-events: none; border-radius: inherit; text-align: center; line-height: 1.25;
}
.img-repl:hover .repl-mask { opacity: 1; }
.img-repl .repl-mask b { font-size: 17px; line-height: 1; }
.gal-item { width: 148px; }
.gal-box { width: 148px; height: 92px; border: 1px solid var(--border); border-radius: 7px; background: #fff; overflow: hidden; }
.gal-box img { width: 100%; height: 100%; object-fit: contain; }
.gal-title { margin-top: 5px; width: 148px; box-sizing: border-box; padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.gal-del {
  position: absolute; top: 2px; right: 2px; z-index: 3; width: 18px; height: 18px; background: rgba(226, 58, 46, .9);
  color: #fff; border-radius: 50%; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.gal-add { width: 96px; height: 72px; border: 1px dashed var(--border); border-radius: 7px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #94a3b8; font-size: 22px; }
.gal-add:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- 登录页 ---------- */
.login-body {
  margin: 0; min-height: 100vh; overflow: hidden; position: relative;
  background: radial-gradient(1200px 700px at 50% -10%, #123a6b 0%, #0a1730 45%, #050b18 100%);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ai-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; }
.ai-glow {
  position: fixed; left: 50%; top: 42%; width: 900px; height: 900px; z-index: 0;
  transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle, rgba(0, 140, 255, .22) 0%, rgba(0, 90, 200, .10) 35%, transparent 68%);
  animation: glowPulse 7s ease-in-out infinite;
}
@keyframes glowPulse { 0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.07); } }
.ai-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .28;
  background-image: linear-gradient(rgba(90, 160, 255, .10) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(90, 160, 255, .10) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
}

.login-stage {
  position: relative; z-index: 3; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px 0;
}

/* 玻璃卡片 */
.login-card {
  width: 420px; max-width: 100%; position: relative;
  background: rgba(13, 26, 48, .62);
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: 18px; padding: 40px 38px 34px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: cardIn .7s cubic-bezier(.2, .8, .2, 1);
}
.login-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: 18px; padding: 1px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .55), transparent 40%, transparent 60%, rgba(59, 130, 246, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.ai-badge {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 auto 22px;
  padding: 5px 14px; border-radius: 999px; font-size: 12px; letter-spacing: .5px;
  color: #7dd3fc; background: rgba(56, 189, 248, .10);
  border: 1px solid rgba(56, 189, 248, .30);
  width: fit-content; display: flex;
}
.ai-badge .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee; animation: dotBlink 1.6s ease-in-out infinite;
}
@keyframes dotBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.login-logo { text-align: center; margin-bottom: 20px; }
/* 图片为 2x 高清，逻辑尺寸为一半；白色版直接用于深色背景，无需反色滤镜 */
.login-logo img {
  height: 37px; width: auto; display: inline-block;
  filter: drop-shadow(0 2px 10px rgba(56, 189, 248, .28));
}

.login-title { text-align: center; margin-bottom: 26px; }
.login-title h1 {
  font-size: 21px; font-weight: 700; letter-spacing: 1.5px; color: #fff;
  background: linear-gradient(90deg, #e0f2fe, #7dd3fc 50%, #e0f2fe);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-title p { font-size: 11px; color: rgba(148, 180, 220, .55); letter-spacing: 1.6px; margin-top: 7px; text-transform: uppercase; }

.login-err {
  background: rgba(239, 68, 68, .12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .35);
  border-radius: 9px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 16px; display: none;
}

.ipt {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(96, 165, 250, .20);
  border-radius: 10px; padding: 0 14px; height: 48px;
  transition: border-color .22s, box-shadow .22s, background .22s;
}
.ipt:focus-within {
  border-color: rgba(56, 189, 248, .75); background: rgba(56, 189, 248, .07);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .13);
}
.ipt-ico { color: #4b7ba8; font-size: 13px; flex: 0 0 auto; transition: color .22s; }
.ipt:focus-within .ipt-ico { color: #38bdf8; }
.ipt input {
  flex: 1; border: none; outline: none; background: transparent;
  color: #eaf2fb; font-size: 14px; font-family: inherit; height: 100%;
  letter-spacing: .5px;
}
.ipt input::placeholder { color: rgba(130, 160, 195, .55); }
.ipt input:-webkit-autofill { -webkit-text-fill-color: #eaf2fb; transition: background-color 9999s; }

.captcha-ipt { padding-right: 8px; }
.captcha-q {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 7px; cursor: pointer; user-select: none;
  font-size: 14px; font-weight: 700; letter-spacing: 1px; color: #67e8f9;
  background: rgba(34, 211, 238, .10); border: 1px solid rgba(34, 211, 238, .28);
  transition: background .2s;
}
.captcha-q:hover { background: rgba(34, 211, 238, .20); }

.login-btn {
  width: 100%; height: 48px; margin-top: 8px; border: none; border-radius: 10px;
  cursor: pointer; position: relative; overflow: hidden;
  font-size: 15px; font-weight: 700; letter-spacing: 2px; color: #fff; font-family: inherit;
  background: linear-gradient(100deg, #0369a1, #0ea5e9 45%, #22d3ee);
  box-shadow: 0 10px 26px rgba(14, 165, 233, .34);
  transition: transform .15s, box-shadow .22s, filter .22s;
}
.login-btn:hover { filter: brightness(1.08); box-shadow: 0 14px 32px rgba(14, 165, 233, .5); }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { filter: grayscale(.5) brightness(.85); cursor: not-allowed; box-shadow: none; }
.login-btn::after {
  content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-18deg); animation: shine 3.4s ease-in-out infinite;
}
@keyframes shine { 0% { left: -120%; } 55%, 100% { left: 160%; } }
.login-btn span { position: relative; z-index: 2; }

.login-hint {
  font-size: 12px; color: rgba(130, 160, 195, .62); text-align: center;
  margin-top: 20px; line-height: 1.8;
}

.login-foot {
  position: fixed; left: 0; right: 0; bottom: 22px; z-index: 3;
  text-align: center; font-size: 12.5px; color: rgba(130, 160, 195, .55);
  letter-spacing: .5px;
}
.login-foot a { color: rgba(125, 211, 252, .85); text-decoration: none; transition: color .2s; }
.login-foot a:hover { color: #7dd3fc; text-decoration: underline; }

@media (max-width: 560px) {
  .login-card { padding: 32px 24px 28px; border-radius: 15px; }
  .ai-glow { width: 620px; height: 620px; }
}

/* ---------- AI 功能 ---------- */
.ai-btn {
  background: linear-gradient(100deg, #0369a1, #0ea5e9 55%, #22d3ee);
  color: #fff; border: none; font-weight: 600;
  box-shadow: 0 3px 12px rgba(14, 165, 233, .3);
  display: inline-flex; align-items: center; gap: 5px;
}
.ai-btn:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 5px 16px rgba(14, 165, 233, .45); }
.ai-btn:disabled { background: #cbd5e1; color: #94a3b8; cursor: not-allowed; box-shadow: none; }
.ai-btn .ai-ico { font-size: 12px; }

.ai-panel {
  border: 1px solid #bae6fd; border-radius: 12px; padding: 16px 18px;
  background: linear-gradient(180deg, #f0f9ff, #f8fcff); margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.ai-panel::before {
  content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: linear-gradient(180deg, #0ea5e9, #22d3ee);
}
.ai-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ai-badge-sm {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(100deg, #0369a1, #0ea5e9); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  letter-spacing: .3px;
}
.ai-sub { font-size: 12px; color: #0369a1; }
.ai-sub.ai-off { color: #94a3b8; }
.ai-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; flex-wrap: wrap; }
.ai-len { font-size: 12.5px; color: #64748b; }

.ai-loading { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 13px; color: #0369a1; }
.ai-spin {
  width: 14px; height: 14px; border: 2px solid #bae6fd; border-top-color: #0ea5e9;
  border-radius: 50%; display: inline-block; animation: aiSpin .8s linear infinite;
}
@keyframes aiSpin { to { transform: rotate(360deg); } }

.ai-tip {
  font-size: 12.5px; color: #94a3b8; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 13px; margin-bottom: 14px; line-height: 1.7;
}
.ai-tip-on { color: #0369a1; background: #f0f9ff; border-color: #bae6fd; }

.ai-box { margin-top: 10px; }
.ai-result {
  border: 1px solid #bae6fd; border-left: 3px solid #0ea5e9; border-radius: 8px;
  background: #f8fcff; padding: 12px 14px;
}
.ai-result-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.ai-lvl {
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  border: 1px solid transparent;
}
.ai-tag {
  font-size: 11.5px; color: #0369a1; background: #e0f2fe;
  padding: 2px 9px; border-radius: 999px;
}
.ai-sum { font-size: 12.5px; color: #334155; line-height: 1.75; margin-bottom: 9px; }
.ai-reply { border-top: 1px dashed #bae6fd; padding-top: 9px; }
.ai-reply-head {
  font-size: 12px; color: #0369a1; font-weight: 600; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.ai-reply-body {
  font-size: 13px; color: #1e293b; line-height: 1.85; background: #fff;
  border: 1px solid #e0f2fe; border-radius: 7px; padding: 10px 12px;
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- AI：产品详情补全 ---------- */
.ai-panel-hd {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13.5px; font-weight: 700; color: #075985;
  padding: 0 0 12px; border-bottom: 1px dashed #bae6fd; margin-bottom: 12px;
}
.ai-panel-hd .ai-ico {
  width: 20px; height: 20px; border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
  box-shadow: 0 2px 8px rgba(14, 165, 233, .35);
}
.ai-panel-hd .ai-sub { font-size: 11.5px; font-weight: 400; color: #64748b; }
.ai-panel-bd { position: relative; }

.ai-block {
  border: 1px solid #e0f2fe; border-radius: 8px; background: #fff;
  padding: 10px 12px; margin-top: 10px;
}
.ai-block-hd {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  font-weight: 700; color: #0369a1; margin-bottom: 7px;
}
.ai-block-hd .ai-dot { color: #22d3ee; font-size: 11px; }
.ai-list { margin: 0; padding-left: 18px; }
.ai-list li {
  font-size: 12.5px; color: #334155; line-height: 1.85;
  margin-bottom: 3px; word-break: break-word;
}
.ai-empty { font-size: 12.5px; color: #94a3b8; padding: 10px 0; }

/* ---------- AI：SEO 批量生成 ---------- */
.ai-seo-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 4px 0 12px; padding-bottom: 12px; border-bottom: 1px dashed #bae6fd;
}
.ai-chk {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: #334155; cursor: pointer; user-select: none;
}
.ai-chk input { accent-color: #0ea5e9; cursor: pointer; }
.ai-chk .ai-filled {
  font-style: normal; font-size: 10.5px; color: #0f766e;
  background: #ccfbf1; border-radius: 4px; padding: 1px 5px; margin-left: 5px;
}
.ai-seo-count { font-size: 12.5px; color: #0369a1; font-weight: 600; }
.ai-seo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px 14px; margin-bottom: 14px;
}
.ai-seo-grid .ai-chk {
  padding: 5px 8px; border-radius: 6px; border: 1px solid transparent;
}
.ai-seo-grid .ai-chk:hover { background: #fff; border-color: #e0f2fe; }
.ai-seo-grid .ai-chk.filled { color: #64748b; }

/* 刚被 AI 填充的 TDK 卡片高亮提示 */
.ai-filled-box {
  border-color: #7dd3fc !important;
  background: linear-gradient(180deg, #f0f9ff, #fafdff) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .1);
  animation: aiFlash 1.1s ease-out;
}
@keyframes aiFlash {
  0% { background: #e0f2fe; }
  100% { background: #f0f9ff; }
}

/* ---------- 响应式 ---------- */
/* .stats / .quick-grid 都是 5 个格子，5 是质数 → 只有 1 列和 5 列能整除。
   策略：优先保 5 列铺满；空间实在不够时降到 3 列（3+2，两行都满）或 2 列（2+2+1）。
   ⚠️ 绝不用 4 列 —— 会成「4+1」，第二行孤零零 1 个、右边空 3 格，视觉最差。
   改动卡片/按钮数量时，这些列数要一起重新算。 */
@media (max-width: 1400px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1200px) { .quick-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }   /* 5 张 → 2+2+1，移动端可接受 */
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 10px; }   /* 5 个 → 2+2+1 */
  .sidebar { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar h1 { font-size: 15px; }
  .row2, .row3 { grid-template-columns: 1fr; }
}

/* ---------- TinyMCE 6 编辑器容器（与后台表单风格统一） ---------- */
.tox-tinymce {
  border: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 8px !important;
  font-family: inherit;
}
.tox .tox-toolbar__primary,
.tox .tox-menubar { background: #f8fafc !important; }
.tox-tinymce, .tox .tox-edit-area__iframe { border-radius: 0 0 8px 8px !important; }
.tox .tox-statusbar { border-top: 1px solid #eef2f7 !important; }
