:root {
  --background: #f9fafc;
  --foreground: #101826;
  --card: #fff;
  --primary: #245fd4;
  --primary-foreground: #fafafa;
  --secondary: #edf2f9;
  --muted: #f1f4f7;
  --muted-foreground: #6b727e;
  --accent: #e6effc;
  --accent-fg: #1a469d;
  --destructive: #e40014;
  --success: #00a05b;
  --warning: #e49e22;
  --border: #e2e5e9;
  --radius: .7rem;
  --sidebar: #131b29;
  --sidebar-foreground: #dadee5;
  --sidebar-primary: #3c79f0;
  --sidebar-accent: #1e293d;
  --sidebar-accent-foreground: #f1f5fc;
  --sidebar-border: #2a3342;
  --shadow: 0 8px 30px rgba(16, 24, 38, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif; background: var(--background); color: var(--foreground); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
svg { display: block; }
.app { display: flex; min-height: 100vh; background: var(--background); }
.side { width: 16rem; flex-shrink: 0; display: flex; flex-direction: column; background: var(--sidebar); color: var(--sidebar-foreground); border-right: 1px solid var(--sidebar-border); }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg { width: 20px; height: 20px; }
.brand b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.site-dd { position: relative; padding: 0 12px 12px; }
.site-dd > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid var(--sidebar-border); background: var(--sidebar-accent); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.site-dd > summary::-webkit-details-marker { display: none; }
.overflow-hidden { overflow: hidden; min-width: 0; }
.site-dd > summary svg { width: 16px; height: 16px; opacity: .5; flex-shrink: 0; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--success); flex-shrink: 0; }
.dot.off { background: var(--muted-foreground); }
.site-dd .ttl { display: block; font-size: 13px; font-weight: 500; color: var(--sidebar-accent-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-dd .sub { display: block; font-size: 12px; color: color-mix(in srgb, var(--sidebar-foreground) 50%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-dd-menu { position: absolute; left: 12px; right: 12px; z-index: 30; margin-top: 6px; max-height: 280px; overflow: auto; border: 1px solid var(--sidebar-border); background: var(--sidebar); border-radius: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.site-dd-menu a { display: block; padding: 10px 12px; color: var(--sidebar-foreground); }
.site-dd-menu a:hover { background: var(--sidebar-accent); }
.site-dd-menu .ttl { color: #fff; }
.site-dd-menu .cap { padding: 6px 12px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--sidebar-foreground) 40%, transparent); border-top: 1px solid var(--sidebar-border); }
.side nav { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-label { padding: 8px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--sidebar-foreground) 40%, transparent); }
.side nav a { display: flex; align-items: center; gap: 12px; border-radius: 8px; padding: 10px 12px; font-size: 14px; font-weight: 500; color: color-mix(in srgb, var(--sidebar-foreground) 70%, transparent); }
.side nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.side nav a:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.side nav a.on { background: var(--primary); color: var(--primary-foreground); }
.side-user { margin-top: auto; border-top: 1px solid var(--sidebar-border); padding: 12px; display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 20%, transparent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { display: block; font-size: 13px; color: var(--sidebar-accent-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { display: block; font-size: 12px; color: color-mix(in srgb, var(--sidebar-foreground) 50%, transparent); }
.ico-btn { width: 32px; height: 32px; border: 0; background: transparent; color: color-mix(in srgb, var(--sidebar-foreground) 60%, transparent); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.ico-btn:hover { background: var(--sidebar-accent); color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--background) 80%, transparent); backdrop-filter: blur(10px); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-foreground); }
.crumb b { color: var(--foreground); font-weight: 600; }
.crumb i { color: color-mix(in srgb, var(--muted-foreground) 40%, transparent); font-style: normal; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-foreground); }
.search input { width: 220px; padding: 8px 12px 8px 32px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--foreground); font-size: 13px; }
.wrap { padding: 24px 32px 56px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted-foreground); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(16,24,38,.04); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-top span { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.stat-ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; }
.stat-ico svg { width: 18px; height: 18px; }
.stat-ico.primary { background: #245fd41a; color: var(--primary); }
.stat-ico.success { background: #00a05b1a; color: var(--success); }
.stat-ico.warning { background: #e49e221f; color: #c4841a; }
.stat b { display: block; margin-top: 12px; font-size: 30px; font-weight: 600; letter-spacing: -.04em; }
.stat em { display: block; margin-top: 4px; font-size: 12px; color: var(--muted-foreground); font-style: normal; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px solid var(--border); background: #f1f4f766; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.filters select, .filters input { height: 36px; min-width: 140px; }
.panel { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,38,.04); }
.panel table { border: 0; border-radius: 0; }
.panel .foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); }
.empty { text-align: center; padding: 64px 20px; color: var(--muted-foreground); }
.empty .btn { margin-top: 12px; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 22px 0 12px; }
.lead { color: var(--muted-foreground); margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(16,24,38,.04); }
.card span { color: var(--muted-foreground); font-size: 13px; font-weight: 500; }
.card b { display: block; font-size: 30px; margin-top: 10px; letter-spacing: -.04em; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted-foreground); font-weight: 500; background: #f1f4f766; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f9fafc; }
.title-cell { font-weight: 500; color: var(--foreground); }
.title-cell:hover { color: var(--primary); }
.ops { display: flex; gap: 14px; white-space: nowrap; align-items: center; }
.ops form { display: inline; margin: 0; }
.ops a, .ops button { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 13px; }
.ops .del { color: var(--destructive); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 13px; font-weight: 500; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #fff; border: 1px solid var(--border); color: var(--foreground); }
.btn.sm { padding: 8px 12px; }
.btn.danger { background: var(--destructive); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.form { max-width: 860px; display: grid; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 1px 2px rgba(16,24,38,.04); }
.form.wide { max-width: 1100px; }
.editor-hint { margin: 6px 0 8px; font-size: 12px; color: var(--muted-foreground); }
.editor-toast { margin: 0 0 8px; font-size: 12px; color: var(--primary); }
.form label { display: grid; gap: 6px; color: var(--muted-foreground); font-size: 13px; }
.form input, .form textarea, .form select, select, input, textarea { background: #fff; color: var(--foreground); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font: inherit; }
.form input, .form textarea, .form select { width: 100%; }
.form input:focus, .form textarea:focus, .form select:focus, .search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #245fd433; }
.flash { margin: 12px 32px 0; padding: 10px 14px; border-radius: 8px; }
.flash.ok { background: #e8f8f0; color: #0d6b40; }
.flash.err { background: #fde8e8; color: #b42318; }
.muted { color: var(--muted-foreground); }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; background: var(--secondary); color: var(--muted-foreground); }
.badge.green { background: #e8f8f0; color: #0d6b40; }
.badge.orange { background: #fff6e5; color: #9a6700; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--secondary); color: var(--muted-foreground); }
.tag:before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.tag.ok { background: #e8f8f0; color: #0d6b40; }
.tag.warn { background: #fff6e5; color: #9a6700; }
.tag.err { background: #fde8e8; color: #b42318; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--sidebar); position: relative; overflow: hidden; }
.login-wrap:before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; }
.login-inner { position: relative; width: min(420px, 92vw); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; color: #fff; font-weight: 600; font-size: 18px; }
.login { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); padding: 32px; border-radius: 16px; backdrop-filter: blur(18px); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login h1 { color: #fff; text-align: center; font-size: 24px; margin-bottom: 6px; }
.login p { color: rgba(255,255,255,.6); text-align: center; margin: 0 0 22px; }
.login .form { background: none; border: 0; padding: 0; max-width: none; }
.login label { color: rgba(255,255,255,.8); display: block; margin-bottom: 6px; }
.login input { background: #fff; border-color: transparent; color: #101826; }
.login input::placeholder { color: #98a0ac; }
.login .password-field { position: relative; }
.login .password-field input { width: 100%; padding-right: 42px; box-sizing: border-box; }
.login .password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: #6b7280; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0; }
.login .password-toggle .eye-hide { display: none; }
.login .password-toggle.is-plain .eye-show { display: none; }
.login .password-toggle.is-plain .eye-hide { display: block; }
.login .password-toggle:hover { color: #111827; background: rgba(16,24,38,.06); }
.login .password-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.login .btn { width: 100%; justify-content: center; padding: 11px; }
.pick-wrap { width: min(860px, 92vw); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0; }
.pick-card { display: grid; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 22px; color: var(--foreground); box-shadow: var(--shadow); }
.pick-card:hover { border-color: var(--primary); }
.pick-card b { font-size: 18px; }
.pick-card span { color: var(--primary); }
.pick-card em { color: var(--muted-foreground); font-style: normal; font-size: 13px; }
.login .flash { margin: 0 0 16px; }
.ai-panel { border: 1px dashed var(--border); background: #f7f9fc; border-radius: 10px; padding: 14px; display: grid; gap: 10px; }
.ai-panel-head { display: flex; justify-content: space-between; align-items: center; }
.ai-panel-head b { font-size: 13px; color: var(--foreground); }
.ai-panel-row { display: flex; gap: 8px; align-items: center; }
.ai-panel-row select { flex: 1; }
.ai-status { margin: 0; font-size: 12px; color: var(--muted-foreground); }
.ai-status.ok { color: #0d6b40; }
.ai-status.err { color: var(--destructive); }
.ai-compare { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ai-compare[hidden] { display: none !important; }
.ai-compare-box { background: #fff; border-radius: 12px; width: min(1100px, 96vw); max-height: 90vh; overflow: auto; padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); position: relative; z-index: 100002; }
.ai-compare-loading { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 100000; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; }
.ai-compare-loading[hidden] { display: none !important; }
.ai-compare-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ai-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-compare-grid h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted-foreground); }
.ai-compare-body { border: 1px solid var(--border); border-radius: 8px; padding: 10px; max-height: 320px; overflow: auto; font-size: 13px; background: #fafafa; }
.collection-compare .ai-compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.collection-compare .ai-compare-body { min-height: 300px; max-height: min(62vh, 680px); overflow: auto; background: #fff; font-size: 14px; line-height: 1.8; }
.collection-compare .ai-compare-body img { display: block; max-width: 100%; height: auto; }
.collection-compare .ai-compare-body table { display: block; max-width: 100%; overflow-x: auto; }
.collection-cover-editor { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
.collection-cover-label { font-weight: 600; }
.collection-cover-tools { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.collection-cover-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.collection-cover-upload input[type=file] { max-width: 220px; }
.collection-cover-preview { width: 180px; height: 100px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.collection-cover-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.editor-image-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
.editor-image-panel[hidden] { display: none !important; }
.editor-image-panel-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; font-weight: 600; }
.editor-image-panel-body { display: flex; gap: 16px; align-items: flex-start; }
.editor-image-preview { width: 380px; height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: #f5f6f8; }
.editor-image-canvas { position: relative; width: 360px; height: 240px; overflow: hidden; border: 1px dashed #b6bdc9; background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 50% / 16px 16px; }
.editor-image-preview img { position: absolute; display: block; max-width: none; max-height: none; object-fit: contain; cursor: move; user-select: none; }
.editor-image-preview img[hidden] { display: none; }
.editor-image-resize-handle { position: absolute; z-index: 2; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 2px; background: var(--primary); cursor: nwse-resize; box-shadow: 0 0 0 1px var(--primary); }
.editor-image-resize-handle[hidden] { display: none; }
.editor-image-fields { display: flex; flex: 1; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.editor-image-fields label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.editor-image-fields input, .editor-image-fields select { width: 110px; }
.editor-image-fields .editor-image-wide { flex: 1 1 260px; }
.editor-image-fields .editor-image-wide input { flex: 1; width: auto; }
.editor-image-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.editor-image-actions .danger { color: #fff; }
@media (max-width: 700px) {
  .editor-image-panel-body { flex-direction: column; }
  .editor-image-preview { width: 100%; max-width: 380px; }
  .editor-image-canvas { max-width: 100%; }
}
@media (max-width: 800px) { .ai-compare-grid { grid-template-columns: 1fr; } }
.ai-batch { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #f7f9fc; }
.ai-batch input[name=instruction] { min-width: 220px; flex: 1; }
.ai-batch select { min-width: 140px; }
.hidden-form { display: none; }
.recommend-picker { position: relative; flex: 1 1 420px; min-width: 280px; }
.recommend-picker > input { width: 100%; }
.recommend-search-results { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(16,24,40,.12); }
.recommend-search-results:empty { display: none; }
.recommend-search-item { display: block; width: 100%; padding: 9px 11px; border: 0; border-bottom: 1px solid var(--border); background: #fff; color: var(--foreground); text-align: left; cursor: pointer; font: inherit; font-size: 13px; }
.recommend-search-item:last-child { border-bottom: 0; }
.recommend-search-item:hover { background: #f1f4f7; color: var(--primary); }
.recommend-picker [data-recommend-selected] { display: block; margin-top: 5px; font-size: 12px; }
.import-sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.import-site-card, .node-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: 0 1px 2px rgba(16,24,38,.04); display: grid; gap: 10px; }
.import-site-top, .node-card-top, .import-progress-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.import-site-card b, .node-card b { font-size: 16px; }
.import-site-card .domain { display: block; color: var(--primary); font-size: 13px; }
.import-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted-foreground); }
.import-meta .bad { color: var(--destructive); }
.node-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 24px; }
.node-card p { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.node-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px #245fd433; }
.node-card.is-fail { border-color: #f0b4b4; }
.node-err { margin: 0; font-size: 12px; color: var(--destructive); word-break: break-all; }
.import-progress { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.import-progress p { margin: 10px 0 0; color: var(--muted-foreground); }
.import-progress .bar { height: 8px; background: var(--muted); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.import-progress .bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
@media (max-width: 900px) {
  .side { display: none; }
  .stats, .cards { grid-template-columns: 1fr; }
}

.info-box { background: #f7f9fc; border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; font-size: 13px; color: var(--muted-foreground); }
.info-box-title { font-weight: 600; color: var(--foreground); margin-bottom: 8px; }
.info-box ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.info-box code { font-size: 12px; }

.ai-providers-page .lead { margin: 6px 0 0; font-size: 14px; }
.ai-providers-table .col-id { width: 56px; }
.ai-providers-table .col-ops { width: 88px; }
.ai-providers-table .url-cell { font-size: 12px; word-break: break-all; max-width: 220px; }
.ai-providers-table .key-cell code { font-size: 12px; letter-spacing: .04em; }
.ops-col { flex-direction: column; align-items: flex-start !important; gap: 8px !important; }
.op-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 13px; text-decoration: none; }
.op-link svg { flex-shrink: 0; opacity: .85; }
.op-link.del { color: var(--destructive); }
.ops-col form { display: block; margin: 0; }
.ai-test-toast { margin: 12px 0 0; font-size: 13px; }

.pager { display: flex; align-items: center; gap: 8px; }
.pager select { height: 30px; font-size: 12px; padding: 4px 8px; min-width: 64px; }
.pager-btn { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--muted-foreground); }
.pager-btn:disabled { opacity: .5; cursor: default; }
.pager-num { font-size: 12px; min-width: 36px; text-align: center; }

.ai-chat { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ai-chat[hidden] { display: none !important; }
.ai-chat-box { background: #fff; border-radius: 12px; width: min(640px, 96vw); max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.15); overflow: hidden; }
.ai-chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.ai-chat-head b { display: block; font-size: 15px; }
.ai-chat-head span { font-size: 12px; }
.ai-chat-messages { flex: 1; overflow: auto; padding: 16px 18px; display: grid; gap: 12px; min-height: 240px; max-height: 420px; background: #fafbfc; }
.ai-chat-msg { max-width: 92%; }
.ai-chat-msg.user { justify-self: end; }
.ai-chat-msg.assistant { justify-self: start; }
.ai-chat-role { font-size: 11px; color: var(--muted-foreground); margin-bottom: 4px; }
.ai-chat-text { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.ai-chat-msg.user .ai-chat-text { background: #eef4ff; border-color: #c8dafc; }
.ai-chat-input { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); align-items: flex-end; }
.ai-chat-input textarea { flex: 1; resize: vertical; min-height: 44px; font: inherit; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.ai-chat-status { margin: 0; padding: 0 18px 12px; font-size: 12px; }

.collection-rules-page { padding: 16px 24px 40px; }
.collection-rules-page .page-head { margin-bottom: 12px; align-items: center; }
.collection-rules-page .page-head h1 { font-size: 20px; margin-bottom: 0; }
.collection-rules-page .page-head p { margin-top: 4px; font-size: 13px; }
.collection-rules-page .table-compact th,
.collection-rules-page .table-compact td { padding: 7px 10px; font-size: 13px; vertical-align: middle; }
.collection-rules-page .table-compact th { padding-top: 8px; padding-bottom: 8px; }
.collection-rules-page .rule-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.collection-rules-page .rule-name b { font-size: 13px; font-weight: 600; }
.collection-rules-page .rule-url { font-size: 12px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.collection-rules-page .cell-stack { display: grid; gap: 2px; }
.collection-rules-page .cell-stack .muted { font-size: 12px; line-height: 1.35; }
.collection-rules-page .col-schedule { font-size: 12px; }
.collection-rules-page .col-ops { min-width: 180px; }
.collection-rules-page .ops { gap: 6px 12px; }

.tags-page { padding: 16px 24px 40px; }
.tags-page .page-head { margin-bottom: 10px; align-items: center; }
.tags-page .page-head h1 { font-size: 20px; margin-bottom: 0; }
.tags-page .page-head p { margin-top: 4px; font-size: 13px; }
.tags-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: #f7f9fc; }
.tags-toolbar-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.tags-toolbar-form input { height: 32px; padding: 6px 10px; font-size: 13px; min-width: 140px; width: auto; border: 1px solid var(--border); border-radius: 8px; }
.tags-toolbar-sep { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }
.tags-empty { padding: 32px 16px; }
.tag-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; align-content: flex-start; }
.tag-item { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 13px; line-height: 1.4; }
.tag-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.tag-item form { display: inline; margin: 0; }
.tag-item-del { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; border-radius: 999px; background: transparent; color: var(--muted-foreground); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.tag-item-del:hover { color: var(--destructive); background: #fde8e8; }
.tags-page .foot { padding: 8px 12px; }
a.pager-btn { text-decoration: none; color: inherit; }
