/* AI单页生成系统 - WordPress 风格后台主题（参照龍一后台） */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "抖音美好体", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #0b0e11;
  color: #3c434a;
  font-size: 14px;
  line-height: 1.6;
}
a { color: #0073aa; text-decoration: none; }
a:hover { color: #00b9eb; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit; font-size: 14px;
  background: #fff; color: #3c434a;
  border: 1px solid #ccd0d4; border-radius: 4px;
  padding: 8px 10px; width: 100%; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: #0073aa; box-shadow: 0 0 0 1px #0073aa;
}
textarea { min-height: 100px; resize: vertical; }
label { display: block; margin-bottom: 6px; color: #23282d; font-size: 13px; font-weight: 600; }

/* ===== 布局：WordPress 风格 ===== */
.wrapper { display: flex; width: 100%; align-items: stretch; }
.sidebar {
  min-width: 240px; max-width: 240px;
  background: #23282d; color: #fff;
  min-height: 100vh; position: fixed; height: 100%;
  overflow-y: auto; z-index: 1000;
  display: flex; flex-direction: column;
}
.sidebar-header {
  padding: 15px 20px; background: #191e23; color: #fff;
  font-weight: bold; display: flex; align-items: center; gap: 10px;
}
.ly-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: #fcd535; color: #23282d;
  font-weight: 700; border-radius: 6px; font-size: 18px; flex-shrink: 0;
}
.ly-brand { display: flex; flex-direction: column; line-height: 1.3; }
.ly-brand strong { font-size: 14px; color: #fff; }
.ly-brand em { font-style: normal; font-size: 11px; color: #8c8f94; }

/* 兼容旧 .logo */
.logo { padding: 15px 20px; background: #191e23; display: flex; align-items: center; gap: 10px; }
.logo-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: #fcd535; color: #23282d;
  font-weight: 700; border-radius: 6px; font-size: 16px;
}
.logo-text b { display: block; font-size: 14px; color: #151414; }
.logo-text small { color: #8c8f94; font-size: 11px; }

/* 参照蓝本: .sidebar ul.components > li > a（兼容旧 .menu） */
.sidebar ul.components, .menu { padding: 0; margin: 0; list-style: none; flex: 1; overflow-y: auto; }
.sidebar ul li a, .menu a {
  padding: 10px 18px; font-size: 14px; display: block;
  color: #eee; text-decoration: none; border-left: 3px solid transparent;
  transition: all 0.2s; line-height: 1.5;
}
.sidebar ul li a:hover, .menu a:hover { color: #00b9eb; background: #191e23; }
.sidebar ul li a.active, .menu a.active { background: #0073aa; color: #fff; border-left-color: #fff; font-weight: 600; }
.sidebar ul li a i, .menu a .ic { margin-right: 10px; width: 20px; text-align: center; opacity: 0.7; font-size: 14px; }
.sidebar ul li a.active i, .menu a.active .ic { opacity: 1; }

.sidebar-foot {
  padding: 12px 16px; border-top: 1px solid #32373c;
  display: flex; flex-direction: column; gap: 8px; background: #191e23;
}
.sidebar-foot .user { color: #eee; font-size: 12px; }

/* 内容区 */
.content { width: 100%; margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; background: #f0f0f1; }
.top-bar, .topbar {
  background: #fff; padding: 10px 30px; box-shadow: 0 1px 1px rgba(0,0,0,0.04);
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; height: 50px;
}
.topbar h1, .top-bar h1, .topbar h5, .top-bar h5 { font-size: 16px; font-weight: 600; color: #6c757d; margin: 0; }
.main-container, .content-inner { padding: 0 20px 20px 20px; }
/* 兼容旧 .main + .content */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: 240px; background: #f0f0f1; min-height: 100vh; }
.btn-ghost {
  padding: 6px 14px; border: 1px solid #ccd0d4; border-radius: 4px;
  color: #23282d; font-size: 12px; background: #f6f7f7;
}
.btn-ghost:hover { border-color: #0073aa; color: #0073aa; background: #fff; }

/* ===== 卡片：WordPress 风格（白色无圆角） ===== */
.card {
  border: 1px solid #ccd0d4; box-shadow: 0 1px 1px rgba(0,0,0,0.04);
  margin-bottom: 20px; background: #fff; border-radius: 0;
}
h6 { font-size: 15px; font-weight: 700; color: #23282d; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
h6 i { color: #2271b1; }
.card-h, .card-header {
  background: #fff; border-bottom: 1px solid #ccd0d4;
  font-weight: 600; font-size: 14px; padding: 12px 15px; color: #23282d;
}
.card-b { padding: 16px; }

/* 统计卡片网格 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border: 1px solid #ccd0d4; border-left: 3px solid #0073aa;
  border-radius: 0; padding: 16px; box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
.stat-card.green { border-left-color: #46b450; }
.stat-card.yellow { border-left-color: #f0c33c; }
.stat-card.gray { border-left-color: #8c8f94; }
.stat-card .t { color: #646970; font-size: 12px; margin-bottom: 8px; }
.stat-card .n { color: #23282d; font-size: 26px; font-weight: 600; }
.stat-card .s { color: #8c8f94; font-size: 11px; margin-top: 6px; }

/* ===== 表单 ===== */
.form-row { margin-bottom: 14px; }
.form-row.inline { display: inline-block; width: auto; margin-right: 12px; }
.btn-primary {
  background: #2271b1; color: #fff; border: 1px solid #2271b1; border-radius: 4px;
  padding: 0 16px; font-size: 13px; font-weight: 600; line-height: 2.3; width: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn-primary:hover { background: #135e96; border-color: #135e96; color: #fff; }
.btn-primary:disabled { background: #ccd0d4; border-color: #ccd0d4; color: #646970; cursor: not-allowed; }
.btn-secondary {
  background: #2271b1; color: #fff; border: 1px solid #2271b1; border-radius: 4px;
  padding: 0 16px; font-size: 13px; font-weight: 600; line-height: 2.3; width: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn-secondary:hover { background: #135e96; border-color: #135e96; color: #fff; }
.btn-success {
  background: #2271b1; color: #fff; border: 1px solid #2271b1; border-radius: 5px;
  padding: 0 24px; font-size: 14px; font-weight: 600; line-height: 2.6; width: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none; transition: all .15s;
  box-shadow: 0 2px 4px rgba(34,113,177,.25);
}
.btn-success:hover { background: #135e96; border-color: #135e96; color: #fff; box-shadow: 0 3px 6px rgba(34,113,177,.35); }
.btn-warning {
  background: #dba617; color: #fff; border: 1px solid #dba617; border-radius: 4px;
  padding: 0 16px; font-size: 13px; font-weight: 600; line-height: 2.3; width: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn-warning:hover { background: #bd8b0a; border-color: #bd8b0a; color: #fff; }
.btn-danger {
  background: #d63638; color: #fff; border: none; border-radius: 4px;
  padding: 6px 14px; font-size: 12px; width: auto;
}
.btn-danger:hover { background: #b32d2e; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e0e0e0; font-size: 13px; color: #3c434a; }
th { color: #646970; font-weight: 600; background: #f6f7f7; }
tr:hover td { background: #f6f7f7; }
.t-title { color: #23282d; font-weight: 600; }
.t-muted { color: #8c8f94; }
.t-num { color: #0073aa; font-family: Consolas, monospace; }
.t-mono { font-family: Consolas, "Courier New", monospace; }
.t-nowrap { white-space: nowrap; }
.t-break { word-break: break-all; overflow-wrap: anywhere; white-space: normal; }

/* 提示 */
.alert {
  padding: 10px 16px; border-radius: 4px; margin: 12px 24px;
  font-size: 13px;
}
.alert.danger { background: #fef0f0; color: #d63638; border: 1px solid #f5c6c8; }
.alert.warn { background: #fff8e5; color: #b45309; border: 1px solid #f0c33c; }
.alert.ok { background: #edfaed; color: #2a8a2a; border: 1px solid #46b450; }
.alert.info { background: #e5f5fa; color: #0073aa; border: 1px solid #72aee6; }
.alert.err { background: #fef0f0; border-color: #d63638; color: #d63638; }

/* 操作结果浮动 toast（右上角弹出，自动消失） */
.ly-toast {
  position: fixed; top: 20px; right: 24px; z-index: 99998;
  margin: 0; padding: 12px 40px 12px 16px;
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  max-width: 420px; font-size: 13px;
  animation: lyToastIn .25s ease;
}
.ly-toast .ly-toast-x { position: absolute; right: 10px; top: 8px; cursor: pointer; font-size: 18px; opacity: .6; }
.ly-toast .ly-toast-x:hover { opacity: 1; }
.ly-toast.out { opacity: 0; transform: translateX(20px); transition: opacity .4s, transform .4s; }
@keyframes lyToastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* 两栏 */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* 关键词标签 */
.kw-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-tag {
  background: #e5f5fa; color: #0073aa; padding: 3px 10px;
  border-radius: 12px; font-size: 12px;
}

/* 操作按钮组 */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions .danger { background: #d63638; color: #fff; border-color: #d63638; }
.actions .danger:hover { background: #b32d2e; color: #fff; }

/* 折线图 */
.chart-box { background: #fff; border: 1px solid #ccd0d4; border-radius: 0; padding: 16px; box-shadow: 0 1px 1px rgba(0,0,0,0.04); }
.chart-box .chart-h { font-size: 13px; color: #23282d; margin-bottom: 12px; font-weight: 600; }
.chart-svg { width: 100%; height: 200px; }

/* 代码框 */
.code-box {
  background: #1d2329; border: 1px solid #32373c; border-radius: 4px;
  padding: 12px; font-family: Consolas, "Courier New", monospace;
  font-size: 12px; color: #eaecef; overflow: auto;
  max-height: 500px; white-space: pre-wrap; word-break: break-all;
}

/* 生成中遮罩 */
.loading-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center; z-index: 999;
}
.loading-mask.show { display: flex; }
.loading-box {
  background: #fff; border: 1px solid #ccd0d4; border-radius: 4px;
  padding: 28px 40px; text-align: center; min-width: 280px;
}
.loading-box .spinner {
  width: 36px; height: 36px; border: 3px solid #ccd0d4;
  border-top-color: #0073aa; border-radius: 50%;
  margin: 0 auto 14px; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box .t { color: #23282d; font-size: 14px; }
.loading-box .s { color: #646970; font-size: 12px; margin-top: 6px; }

/* 登录页 */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: #0b0e11;
}
.login-box {
  width: 340px; background: #fff; border: 1px solid #ccd0d4;
  border-radius: 4px; padding: 28px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.login-box .logo { justify-content: center; border: none; padding: 0 0 18px; background: transparent; }
.login-box .btn-primary { width: 100%; margin-top: 6px; }
.login-tip { color: #646970; font-size: 12px; text-align: center; margin-top: 14px; }

/* 预览 iframe */
.preview-frame {
  width: 100%; height: 600px; border: 1px solid #ccd0d4; border-radius: 4px;
  background: #fff;
}

/* 分页 */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pagination a, .pagination span {
  padding: 5px 11px; background: #f6f7f7; border: 1px solid #ccd0d4;
  border-radius: 3px; color: #23282d; font-size: 12px;
}
.pagination .cur { background: #0073aa; color: #fff; border-color: #0073aa; }

/* 模板列表（模板管理页） */
.tpl-list { display: flex; flex-direction: column; gap: 2px; }
.tpl-item {
  display: block; padding: 8px 12px; color: #50575e; text-decoration: none;
  border-radius: 4px; font-size: 13px; transition: background .15s;
}
.tpl-item:hover { background: #f0f0f1; color: #2271b1; }
.tpl-item.active { background: #e7f3ff; color: #2271b1; font-weight: 600; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

/* ===== v2.1 组件（参照龍一后台，适配浅色主题） ===== */

/* 开关 */
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #3c434a; }
.switch input[type="checkbox"] { width: 16px; height: 16px; accent-color: #0073aa; }

/* 标签芯片（蜘蛛/设备选择） */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: #f6f7f7; border: 1px solid #ccd0d4;
  border-radius: 16px; font-size: 12px; color: #3c434a; cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: #8c8f94; background: #fff; }
.chip input { display: none; }
.chip:has(input:checked) { background: #2271b1; border-color: #2271b1; color: #fff; }
.chip.on { background: #d63638; border-color: #d63638; color: #fff; }

/* 蜘蛛防火墙扁平标签（参照龍一 .bot-chip） */
.btn-check { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.bot-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 100px; padding: 4px 12px; border: 1px solid #c3c4c7;
  border-radius: 4px; background: #f6f7f7; color: #3c434a;
  font-size: 13px; line-height: 1.6; cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.bot-chip:hover { background: #eaeaea; border-color: #8c8f94; }
.btn-check:checked + .bot-chip { background: #d63638; border-color: #d63638; color: #fff; }
.btn-check:checked + .bot-chip:hover { background: #b32d2e; border-color: #b32d2e; }

/* 子标签导航 */
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid #ccd0d4; margin-bottom: 14px; flex-wrap: wrap; }
.sub-tab {
  padding: 8px 16px; color: #646970; font-size: 13px;
  border-bottom: 2px solid transparent; border-radius: 4px 4px 0 0; cursor: pointer;
  background: transparent; border-top: none; border-left: none; border-right: none;
}
.sub-tab:hover { color: #0073aa; background: #f6f7f7; }
.sub-tab.active { color: #0073aa; border-bottom-color: #0073aa; font-weight: 600; }

/* KPI 卡片 */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  background: #fff; border: 1px solid #ccd0d4; border-radius: 0; padding: 14px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
.kpi-l { color: #646970; font-size: 12px; margin-bottom: 6px; }
.kpi-v { font-size: 24px; font-weight: 700; color: #23282d; }
.kpi-s { color: #8c8f94; font-size: 11px; margin-top: 4px; }

/* 状态标签 */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; background: #f0f0f1; color: #646970;
}
.tag.ok { background: #46b450; color: #fff; }
.tag.warn { background: #f0c33c; color: #23282d; }
.tag.danger { background: #d63638; color: #fff; }

/* 表格容器 */
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap th, .table-wrap td { padding: 8px 10px; border-bottom: 1px solid #e0e0e0; text-align: left; }
.table-wrap th { color: #646970; font-weight: 600; background: #f6f7f7; }
.table-wrap tr:hover td { background: #f6f7f7; }
/* 固定列宽表格：按 th 设定宽度严格分列，超长内容（URL/来源页）在列内换行，不撑破卡片 */
.table-wrap table.tbl-fixed { table-layout: fixed; min-width: 1020px; }
.table-wrap table.tbl-fixed td { vertical-align: top; }

/* 空状态 */
.empty { text-align: center; color: #8c8f94; padding: 24px; }

/* 分页 */
.pager { text-align: center; margin-top: 14px; color: #646970; font-size: 12px; }
.pager .btn-mini { margin: 0 4px; }

/* 迷你按钮 */
.btn-mini {
  display: inline-block; padding: 4px 10px; font-size: 12px;
  background: #f6f7f7; color: #23282d; border-radius: 3px; border: 1px solid #ccd0d4;
  text-decoration: none;
}
.btn-mini:hover { background: #fff; border-color: #0073aa; color: #0073aa; }
.btn-mini.danger { background: #d63638; color: #fff; border-color: #d63638; }
.btn-mini.danger:hover { background: #b32d2e; color: #fff; }

/* ===== 访问统计视觉规范（参照龍一 .as-* 系列） ===== */
.as-wrap { --as-ink:#0f172a; --as-muted:#64748b; --as-faint:#94a3b8; --as-line:#eef2f7; }
.as-tabs { display:inline-flex; flex-wrap:wrap; gap:4px; padding:4px; background:#f1f5f9; border:1px solid #e9eef5; border-radius:999px; }
.as-tab { display:inline-flex; align-items:center; gap:7px; padding:8px 16px; border-radius:999px; font-size:13.5px; font-weight:600; color:#64748b; text-decoration:none; white-space:nowrap; transition:background .18s ease, color .18s ease, box-shadow .18s ease; }
.as-tab i { font-size:12px; opacity:.75; }
.as-tab:hover { color:#334155; background:rgba(255,255,255,.75); }
.as-tab.active { background:#fff; color:#4f46e5; box-shadow:0 1px 2px rgba(16,24,40,.06), 0 4px 12px -6px rgba(79,70,229,.38); }
.as-tab.active i { opacity:1; }
.as-section-title { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; letter-spacing:.02em; margin:18px 0 10px; }
.as-section-title .dot { width:8px; height:8px; border-radius:50%; }
.as-section-title.real { color:#047857; }
.as-section-title.real .dot { background:#10b981; box-shadow:0 0 0 3px rgba(16,185,129,.15); }
.as-section-title.spider { color:#be123c; }
.as-section-title.spider .dot { background:#f43f5e; box-shadow:0 0 0 3px rgba(244,63,94,.15); }
.as-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:14px; }
.as-kpi { position:relative; background:#fff; border:1px solid var(--as-line); border-radius:16px; padding:16px; overflow:hidden; box-shadow:0 1px 2px rgba(16,24,40,.04); transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.as-kpi:hover { transform:translateY(-2px); box-shadow:0 12px 28px -16px rgba(16,24,40,.28); border-color:#e3e9f2; }
.as-kpi::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; background:var(--as-accent, linear-gradient(135deg,#6366f1,#a855f7)); }
.as-kpi .as-kpi-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.as-kpi .as-chip { width:38px; height:38px; border-radius:11px; display:inline-flex; align-items:center; justify-content:center; color:#fff; font-size:15px; background:var(--as-accent, linear-gradient(135deg,#6366f1,#a855f7)); box-shadow:0 6px 14px -7px var(--as-glow, rgba(99,102,241,.65)); }
.as-kpi .as-label { font-size:12px; font-weight:600; color:var(--as-muted); }
.as-kpi .as-value { font-size:28px; font-weight:700; line-height:1.05; color:var(--as-ink); font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.as-kpi .as-sub { margin-top:6px; font-size:12px; color:var(--as-faint); font-variant-numeric:tabular-nums; }
.as-kpi .as-sub b { color:#475569; font-weight:600; }
.as-kpi.real { --as-accent:linear-gradient(135deg,#10b981,#34d399); --as-glow:rgba(16,185,129,.6); }
.as-kpi.spider { --as-accent:linear-gradient(135deg,#f43f5e,#fb7185); --as-glow:rgba(244,63,94,.55); }
.as-kpi.violet { --as-accent:linear-gradient(135deg,#6366f1,#a855f7); --as-glow:rgba(99,102,241,.55); }
.as-kpi.amber { --as-accent:linear-gradient(135deg,#f59e0b,#fbbf24); --as-glow:rgba(245,158,11,.55); }
.as-ratio { display:flex; align-items:center; gap:14px; flex-wrap:wrap; background:#fff; border:1px solid var(--as-line); border-radius:16px; padding:14px 16px; margin-top:14px; }
.as-ratio-bar { flex:1 1 160px; height:10px; border-radius:999px; background:#eef2f7; overflow:hidden; display:flex; min-width:120px; }
.as-ratio-bar i { display:block; height:100%; transition:width .4s ease; }
.as-ratio-bar i.real { background:linear-gradient(90deg,#10b981,#34d399); }
.as-ratio-bar i.spider { background:linear-gradient(90deg,#f43f5e,#fb7185); }
.as-ratio-legend { display:inline-flex; align-items:center; gap:14px; font-size:12px; color:var(--as-muted); }
.as-ratio-legend .k { display:inline-flex; align-items:center; gap:6px; }
.as-ratio-legend .k b { color:#0f172a; font-variant-numeric:tabular-nums; }
.as-note { display:flex; gap:9px; font-size:12.5px; color:#475569; background:#f8fafc; border:1px solid var(--as-line); border-radius:14px; padding:11px 13px; margin-bottom:14px; line-height:1.7; }
.as-note > i { color:#6366f1; margin-top:3px; flex:0 0 auto; }
.as-panel { background:#fff; border:1px solid var(--as-line); border-radius:16px; overflow:hidden; box-shadow:0 1px 2px rgba(16,24,40,.04); }
.as-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; border-bottom:1px solid var(--as-line); background:linear-gradient(180deg,#fbfdff,#fff); }
.as-panel-head .t { display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:700; color:var(--as-ink); }
.as-panel-head .t i { color:#6366f1; }
.as-panel-head .m { font-size:12px; color:var(--as-faint); }
.as-table { width:100%; margin:0; border-collapse:separate; border-spacing:0; font-size:12.5px; }
.as-table thead th { background:#f8fafc; color:#64748b; font-weight:600; font-size:11px; letter-spacing:.04em; text-transform:uppercase; padding:10px 12px; border-bottom:1px solid var(--as-line); white-space:nowrap; text-align:right; }
.as-table thead th:first-child { text-align:left; }
.as-table thead th.as-th-grp { text-align:center; color:#94a3b8; font-size:10.5px; }
.as-table thead th.as-left, .as-table tbody td.as-left { text-align:left; }
.as-table tbody td { padding:11px 12px; border-bottom:1px solid #f4f7fb; color:#334155; text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.as-table tbody td:first-child { text-align:left; }
.as-table tbody tr:last-child td { border-bottom:0; }
.as-table tbody tr:hover td { background:#f9fbff; }
.as-table.logs thead th, .as-table.logs tbody td { text-align:left; }
.as-table.logs tbody td { white-space:normal; }
.as-num { font-weight:700; color:#0f172a; font-variant-numeric:tabular-nums; }
.as-num.real { color:#059669; }
.as-num.spider { color:#e11d48; }
.as-num.zero { color:#cbd5y1; font-weight:500; }
.as-name { display:inline-flex; align-items:center; gap:7px; font-weight:600; color:#0f172a; }
.as-name .as-dot { width:7px; height:7px; border-radius:50%; background:linear-gradient(135deg,#6366f1,#a855f7); flex:0 0 auto; }
.as-tag { display:inline-flex; align-items:center; gap:5px; padding:2px 9px; border-radius:999px; font-size:11.5px; font-weight:600; background:#eef2ff; color:#4f46e5; }
.as-tag.mute { background:#f1f5f9; color:#64748b; }
.as-tag.danger { background:#fef2f2; color:#dc2626; }
.as-tag.warn { background:#fffbeb; color:#b45309; }
.as-tag.info { background:#f0f9ff; color:#0369a1; }
.as-mono { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.as-empty { text-align:center; color:#94a3b8; padding:44px 16px; font-size:13px; }
.as-empty i { display:block; font-size:26px; margin-bottom:10px; color:#cbd5y1; }
.as-seg { display:inline-flex; flex-wrap:wrap; gap:2px; padding:3px; background:#f1f5f9; border:1px solid #e9eef5; border-radius:10px; }
.as-seg-item { border:0; background:transparent; padding:6px 13px; border-radius:8px; font-size:12.5px; font-weight:600; color:#64748b; cursor:pointer; display:inline-flex; align-items:center; gap:6px; transition:background .16s ease, color .16s ease, box-shadow .16s ease; }
.as-seg-item:hover { color:#334155; background:rgba(255,255,255,.75); }
.as-seg-item.active { background:#fff; color:#4f46e5; box-shadow:0 1px 2px rgba(16,24,40,.08); }
.as-seg-item.active.danger { color:#e11d48; }
.as-seg-item.active.success { color:#059669; }
.as-seg-item.active.warn { color:#d97706; }
.as-seg-item.active.info { color:#0284c7; }
.as-seg-item.active.mute { color:#64748b; }

/* 域名标签 */
.domain-tag { display: inline-block; background-color: #e5f5fa; padding: 4px 8px; margin: 2px; border-radius: 6px; font-size: 13px; border: 1px solid #72aee6; color: #0073aa; }
.domain-tag .remove { cursor: pointer; margin-left: 5px; color: #d63638; font-weight: bold; }

/* 页面列表项（页面管理 .page-item） */
#batchForm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.page-item {
  border: 1px solid #e0e0e0; border-radius: 6px; padding: 14px 16px;
  background: #fff; transition: box-shadow .15s;
}
.page-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: #c4c4c4; }
.page-item.ly-selected { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1, 0 2px 10px rgba(34,113,177,.18); }
.page-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.page-item-head h5 { margin: 0; font-size: 15px; font-weight: 600; color: #1d2327; }
.page-item-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; color: #646970; }
.page-item-meta div { display: flex; align-items: center; gap: 4px; }
.page-item-domains { margin-bottom: 10px; }
.page-item-domains .domain-list { margin-top: 6px; }
.page-item-actions { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid #f0f0f1; }
.check-inline { display: inline-flex !important; align-items: center; gap: 4px; margin-bottom: 0 !important; font-weight: 400; }
.domain-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* ===== Dashboard 蓝本布局（ly-* 系列） ===== */
.ly-notice { background: #1a1e25; border: 1px solid #262d36; border-radius: 6px; padding: 10px 16px; margin-bottom: 16px; overflow: hidden; white-space: nowrap; }
.ly-notice .scrolling-text { display: inline-block; padding-left: 100%; animation: ly-scroll 30s linear infinite; white-space: nowrap; color: #fcd535; font-size: 13px; }
.ly-notice .scrolling-text:hover { animation-play-state: paused; }
.ly-notice .scrolling-text i { margin-right: 6px; }
@keyframes ly-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
.ly-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ly-head h6 { font-size: 14px; color: #6c757d; margin: 0; font-weight: 600; }
.ly-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.ly-kpi { background: #fff; border: 1px solid #ccd0d4; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.ly-kpi-body { padding: 16px; border-top: 3px solid #ccd0d4; }
.ly-kpi-up .ly-kpi-body { border-top-color: #10b981; }
.ly-kpi-down .ly-kpi-body { border-top-color: #f43f5e; }
.ly-kpi-info .ly-kpi-body { border-top-color: #3b82f6; }
.ly-kpi-base .ly-kpi-body { border-top-color: #f59e0b; }
.ly-kpi-title { font-size: 13px; color: #646970; margin: 0 0 8px; font-weight: 600; }
.ly-kpi-title i { margin-right: 6px; }
.ly-kpi-num { font-size: 28px; font-weight: 700; color: #23282d; line-height: 1.2; }
.ly-kpi-sub { color: #8c8f94; font-size: 12px; }
.ly-row-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin-bottom: 16px; }
.ly-bot-list { padding: 0; }
.ly-list-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 15px; border-bottom: 1px solid #f0f0f1; font-size: 13px; list-style: none; }
.ly-list-item:last-child { border-bottom: none; }
.ly-list-item i { margin-right: 6px; color: #646970; }
.ly-badge { background: #f0f0f1; color: #23282d; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.ly-empty { padding: 20px; text-align: center; color: #8c8f94; font-size: 13px; }
.ly-device { padding: 12px 15px; border-top: 1px solid #ccd0d4; background: #f6f7f7; }
.ly-device h6 { font-size: 12px; color: #646970; margin: 0 0 8px; font-weight: 600; }
.ly-device-row { display: flex; }
.ly-device-col { flex: 1; text-align: center; }
.ly-device-col:first-child { border-right: 1px solid #ccd0d4; }
.ly-device-label { font-size: 13px; font-weight: 600; }
.ly-device-col:first-child .ly-device-label { color: #0073aa; }
.ly-device-col:last-child .ly-device-label { color: #46b450; }
.ly-device-num { font-size: 20px; font-weight: 700; color: #23282d; }
.ly-sys-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: 13px; color: #3c434a; }
.ly-sys-row strong { color: #23282d; }

/* ===== spider_stats 蓝本布局 ===== */
.ly-page-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.ly-page-head h5 { font-size: 16px; font-weight: 600; color: #23282d; margin: 0 0 4px; }
.ly-page-head .actions { display: flex; gap: 8px; }
.ly-filter-form { width: 100%; }
.ly-filter-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ly-filter-col { min-width: 120px; }
.ly-filter-col label { margin-bottom: 4px; }
.ly-filter-actions { display: flex; align-items: center; gap: 12px; }
.ly-card-h-flex { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ly-card-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; border-top: 1px solid #ccd0d4; background: #f6f7f7; }

/* ===== pages 蓝本布局 ===== */
.ly-nav-tabs { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; }
.ly-nav-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; font-size: 13px; font-weight: 600; color: #646970; text-decoration: none; border-bottom: 2px solid transparent; }
.ly-nav-tab:hover { color: #0073aa; }
.ly-nav-tab.active { color: #0073aa; border-bottom-color: #0073aa; }
.ly-pages-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.ly-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ly-search-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ly-search-input { position: relative; flex: 1; min-width: 200px; }
.ly-search-icon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: #8c8f94; }
.ly-search-input input { padding-left: 28px; }
.ly-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ly-search-inline { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; }
.ly-search-inline .ly-search-input { flex: 1; }

/* 可折叠配置卡片（details/summary） */
.ly-collapse { border: 1px solid #ccd0d4; border-radius: 0; background: #fff; margin-bottom: 12px; }
.ly-collapse > summary { padding: 12px 15px; font-weight: 600; font-size: 14px; color: #23282d; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; }
.ly-collapse > summary::-webkit-details-marker { display: none; }
.ly-collapse > summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: auto; color: #8c8f94; font-size: 12px; transition: transform .2s; }
.ly-collapse[open] > summary::after { transform: rotate(180deg); }
.ly-collapse > summary:hover { background: #f6f7f7; }
.ly-collapse > .card-b { padding: 15px; border-top: 1px solid #ccd0d4; }

/* 使用说明列表（Google/Bing SEO 规范等） */
.usage-list { margin: 12px 0 4px; padding-left: 24px; }
.usage-list li { margin-bottom: 10px; line-height: 1.75; color: #3c434a; font-size: 13px; }
.usage-list li::marker { color: #2271b1; font-weight: 700; }
.usage-list li:last-child { margin-bottom: 0; }
.usage-list li b { color: #23282d; font-weight: 600; }
.usage-list code {
  background: #f0f0f1; color: #d63638; padding: 1px 6px;
  border-radius: 3px; font-family: Consolas, "Courier New", monospace; font-size: 12px;
}

/* ===== 按钮式模板多选（域名绑定 - 自定义勾选） ===== */
.tpl-picker { border: 1px solid #dcdcde; border-radius: 10px; background: #fbfbfc; overflow: hidden; }
.tpl-picker-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #f6f7f7; border-bottom: 1px solid #ececec; font-size: 12px; color: #646970; }
.tpl-picker-count b { color: #2271b1; font-size: 13px; }
.tpl-picker-link { border: 0; background: none; padding: 0; color: #2271b1; font-size: 12px; cursor: pointer; }
.tpl-picker-link:hover { text-decoration: underline; }
.tpl-picker-hint { margin-left: auto; color: #8c8f94; }
.tpl-picker-body { max-height: 380px; overflow: auto; padding: 12px; }
.tpl-picker-group + .tpl-picker-group { margin-top: 16px; }
.tpl-picker-group-h { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: #3c434a; }
.tpl-picker-group-h i { color: #8c8f94; font-size: 11px; }
.tpl-picker-num { padding: 1px 8px; border-radius: 999px; background: #eef2f7; color: #646970; font-size: 11px; font-weight: 500; }
.tpl-picker-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-chip {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  margin: 0; padding: 6px 12px 6px 9px;
  background: #fff; border: 1px solid #dcdcde; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; line-height: 1.4; color: #3c434a;
  white-space: nowrap; cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.tpl-chip:hover { border-color: #2271b1; color: #2271b1; box-shadow: 0 1px 4px rgba(34,113,177,.14); }
.tpl-chip:focus-within { outline: 2px solid #72aee6; outline-offset: 2px; }
.tpl-chip input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.tpl-chip-box { width: 15px; height: 15px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid #c3c4c7; border-radius: 4px; background: #fff; transition: border-color .15s, background .15s; }
.tpl-chip-box::after { content: ""; width: 7px; height: 4px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) scale(0); transition: transform .12s; }
.tpl-chip-name { font-weight: 500; }
.tpl-chip-id { font-size: 11px; color: #8c8f94; }
.tpl-chip.is-checked,
.tpl-chip:has(input:checked) { background: #2271b1; border-color: #2271b1; color: #fff; box-shadow: 0 2px 6px rgba(34,113,177,.28); }
.tpl-chip.is-checked .tpl-chip-box,
.tpl-chip:has(input:checked) .tpl-chip-box { background: #fff; border-color: #fff; }
.tpl-chip.is-checked .tpl-chip-box::after,
.tpl-chip:has(input:checked) .tpl-chip-box::after { border-color: #2271b1; transform: rotate(-45deg) scale(1); }
.tpl-chip.is-checked .tpl-chip-id,
.tpl-chip:has(input:checked) .tpl-chip-id { color: rgba(255,255,255,.78); }
.tpl-picker-empty { padding: 18px 12px; text-align: center; color: #8c8f94; font-size: 12px; }

@media (max-width: 640px) {
  .tpl-picker-hint { display: none; }
}

/* 响应式 */
@media (max-width: 900px) {
  .sidebar { margin-left: -240px; transition: margin-left 0.3s; }
  .sidebar.active { margin-left: 0; box-shadow: 2px 0 5px rgba(0,0,0,0.2); }
  .content, .main { margin-left: 0; width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .as-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}