/* 观潮 · 采集管理后台
   Ink sidebar, quiet neutral surfaces, one warm accent.
   Class names and layout hooks are shared with admin*.mjs — restyle here, do not rename. */

:root {
  color-scheme: light;
  --font: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --ink-900: #101828;
  --ink-800: #1d2939;
  --ink-700: #344054;
  --ink-600: #475467;
  --ink-500: #667085;
  --ink-400: #98a2b3;
  --ink-300: #d0d5dd;
  --line: #e4e7ec;
  --line-soft: #eef0f4;
  --canvas: #f4f5f7;
  --surface: #fff;
  --surface-2: #f9fafb;

  --accent: #f0622d;
  --accent-600: #dc5220;
  --accent-soft: #fff3ec;
  --accent-line: #fbd5c2;
  --accent-ring: rgba(240, 98, 45, .2);

  --green: #067a57;
  --green-soft: #e6f6ee;
  --amber: #a15c07;
  --amber-soft: #fff6e5;
  --blue: #2a62c9;
  --blue-soft: #eaf1fe;
  --red: #c4372f;
  --red-soft: #fff0ee;
  --violet: #6247d6;
  --violet-soft: #f0edff;

  /* Names kept for markup written against the previous stylesheet. */
  --nav: #0e1626;
  --muted: var(--ink-500);
  --border: var(--line);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .04);
  --shadow-lg: 0 32px 80px rgba(13, 20, 36, .28), 0 8px 24px rgba(13, 20, 36, .12);

  --sidebar: 236px;
  --topbar: 60px;

  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-700);
  background: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink-900); }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; }
::selection { background: #ffd9c7; }

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Form controls ---------- */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: auto;
  max-width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d5d9e1;
  border-radius: var(--radius-sm);
  background-color: #fff;
  color: var(--ink-800);
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-400); }
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: #bcc3ce; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input[readonly], input:disabled, select:disabled, textarea:disabled {
  background-color: var(--surface-2);
  color: var(--ink-500);
  box-shadow: none;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #8a94a6 50%), linear-gradient(135deg, #8a94a6 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
textarea { padding: 10px 12px; line-height: 1.6; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }

.field { display: grid; align-content: start; gap: 7px; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-600); }
.field > input, .field > select, .field > textarea { width: 100%; }
.help { font-size: 12px; font-weight: 400; line-height: 1.65; color: var(--ink-500); }
.checkbox-line { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 400; line-height: 1.6; color: var(--ink-700); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--ink-500); }
.form-inline { display: flex; gap: 10px; }
.form-inline > * { flex: 1; }
.keyword-platform-picker { min-width: 0; padding: 0; border: 0; }
.keyword-platform-picker legend { margin-bottom: 7px; color: var(--ink-600); font-size: 12.5px; font-weight: 600; }
.keyword-platform-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-platform-checks label { padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; }
.keyword-platform-checks label:has(:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.keyword-credentials { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.keyword-credentials:not(:has(> :not([hidden]))) { display: none; }
.inline-form { display: flex; align-items: end; gap: 10px; }
.inline-form .field { flex: 1; }
form[data-ops] textarea { width: 100%; min-height: 80px; resize: vertical; }

.form-error, .error-banner {
  padding: 10px 14px;
  border: 1px solid #f7cfc9;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  line-height: 1.65;
}
.form-error:empty { display: none; }
.error-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
form > .form-error { margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #d5d9e1;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.button:hover { background: var(--surface-2); border-color: #bcc3ce; color: var(--ink-900); text-decoration: none; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.small { min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; }
.button.primary, button.primary {
  border-color: #e0531e;
  background: linear-gradient(180deg, #f6753f 0%, #eb5b26 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(190, 70, 20, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.button.primary:hover, button.primary:hover { background: linear-gradient(180deg, #f26a33 0%, #e25220 100%); border-color: #d44c1a; color: #fff; }
.button.ghost { border-color: transparent; background: transparent; color: var(--ink-500); box-shadow: none; }
.button.ghost:hover { background: rgba(16, 24, 40, .06); border-color: transparent; color: var(--ink-800); }
.button.danger { color: var(--red); }
.button.danger:hover { background: var(--red-soft); border-color: #f3c3bc; color: var(--red); }
.button.confirm-delete { background: var(--red); border-color: var(--red); color: #fff; }
.button.confirm-delete:hover { background: #a62c25; border-color: #a62c25; color: #fff; }

.muted { color: var(--ink-500); }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); }
.hidden, [hidden] { display: none !important; }

/* ---------- Boot + login ---------- */
.boot-state { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--ink-500); font-size: 14px; }
.boot-state .brand-symbol { animation: breathe 1.6s ease-in-out infinite; }
.brand-symbol {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #ff8d55, #ea5420);
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(240, 98, 45, .35), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.login-aside {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 64px max(40px, 11%);
  color: #fff;
  background:
    radial-gradient(760px 520px at 0% 100%, rgba(240, 98, 45, .40), transparent 62%),
    radial-gradient(640px 440px at 100% 0%, rgba(78, 110, 245, .30), transparent 60%),
    #0c1322;
}
.login-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse at 30% 40%, #000 15%, transparent 72%);
}
.login-aside::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -210px;
  bottom: -210px;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 64px rgba(255, 255, 255, .025), 0 0 0 128px rgba(255, 255, 255, .018);
}
.login-aside h1 { color: #fff; font-size: 38px; font-weight: 700; line-height: 1.4; letter-spacing: 1px; }
.login-aside p { max-width: 420px; font-size: 15px; line-height: 1.9; color: #aeb9cd; }
.login-steps { display: grid; gap: 12px; max-width: 420px; margin-top: 6px; font-size: 14px; color: #dbe2ee; }
.login-steps > div { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 12px; background: rgba(255, 255, 255, .045); }
.login-steps span { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(240, 98, 45, .2); color: #ffb48f; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.login-main { display: grid; place-items: center; padding: 32px; background: #fff; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin-bottom: 10px; font-size: 26px; font-weight: 700; letter-spacing: -.2px; }
.login-card > p { margin-bottom: 30px; font-size: 14px; line-height: 1.8; color: var(--ink-500); }
.login-card form { display: grid; gap: 18px; }
.login-card .field { font-size: 13px; }
.login-card input { min-height: 44px; font-size: 15px; }
.login-card .button { min-height: 46px; margin-top: 6px; font-size: 15px; }
.login-footer { margin-top: 30px !important; text-align: center; font-size: 12px !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 12px 16px;
  color: #a7b2c5;
  background: radial-gradient(420px 260px at 0% 0%, rgba(240, 98, 45, .17), transparent 70%), linear-gradient(180deg, #121b2e 0%, #0c1322 100%);
}
.brand { flex-shrink: 0; display: flex; align-items: center; gap: 11px; padding: 4px 10px 6px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; letter-spacing: 4px; }
.brand small { display: block; margin-top: 4px; font-size: 9px; letter-spacing: 2.2px; color: #8190a8; }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
.sidebar-title { margin: 4px 12px 8px; font-size: 11px; letter-spacing: 1.2px; color: #63728c; }
.nav-list { display: grid; gap: 2px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  background: none;
  color: #a7b2c5;
  font-size: 13.5px;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #eaeef5; }
.nav-item.active, .nav-item[aria-current="page"] { background: linear-gradient(90deg, rgba(240, 98, 45, .26), rgba(240, 98, 45, .07)); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #ff7b45; }
.nav-item.active svg { opacity: 1; color: #ffa57c; }
.sidebar-bottom { flex-shrink: 0; margin-top: auto; display: grid; gap: 10px; padding: 14px 12px 0; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; }
.sidebar-bottom a { color: #b7c3d6; }
.sidebar-footnote { line-height: 1.75; color: #6a7993; }

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
.breadcrumb { font-size: 13px; color: var(--ink-400); }
.breadcrumb strong { margin-left: 6px; font-weight: 600; color: var(--ink-800); }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-700); }
.topbar-right > span { display: inline-flex; align-items: center; }
.user-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 50%; background: linear-gradient(145deg, #ffe3d3, #ffcdb3); color: #b4491c; font-size: 12px; font-weight: 600; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .16); }

.content { max-width: 1680px; margin: auto; padding: 28px 32px 48px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading h1 { font-size: 24px; font-weight: 700; line-height: 1.35; letter-spacing: -.2px; }
.page-heading p { margin-top: 6px; font-size: 13.5px; line-height: 1.7; color: var(--ink-500); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.footer-note { margin-top: 28px; font-size: 12px; line-height: 1.8; text-align: center; color: var(--ink-400); }

/* ---------- Platform switcher ---------- */
.platform-tabs { display: flex; gap: 4px; width: max-content; max-width: 100%; margin-bottom: 20px; padding: 4px; border-radius: 12px; background: #e9ecf1; overflow-x: auto; scrollbar-width: none; }
.platform-tabs::-webkit-scrollbar { display: none; }
.platform-tab { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 9px; background: transparent; color: var(--ink-500); font-size: 13px; white-space: nowrap; transition: background .15s, color .15s; }
.platform-tab:hover { color: var(--ink-800); }
.platform-tab.active { background: #fff; color: var(--ink-900); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .1), 0 1px 2px rgba(16, 24, 40, .06); }
.platform-icon { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 7px; border-radius: 6px; background: #d9dee6; color: var(--ink-600); font-size: 10.5px; font-weight: 700; }
.platform-tab.active .platform-icon { background: var(--accent-soft); color: var(--accent-600); }

/* ---------- Metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric { position: relative; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.metric:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.metric-label { font-size: 13px; color: var(--ink-500); }
.metric-value { margin: 12px 0 6px; font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: -1px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.metric-note { font-size: 12.5px; color: var(--ink-400); }
.metric-mark { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.metric-mark svg { width: 18px; height: 18px; }
.metric:nth-child(2) .metric-mark { background: var(--blue-soft); color: var(--blue); }
.metric:nth-child(3) .metric-mark { background: var(--green-soft); color: var(--green); }
.metric:nth-child(4) .metric-mark { background: var(--violet-soft); color: var(--violet); }

/* ---------- Panels ---------- */
.panel { min-width: 0; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line-soft); }
.panel-head > div { min-width: 0; }
.panel-head h2 { font-size: 15px; font-weight: 650; }
.panel-head h2 .muted { margin-left: 4px; font-weight: 500; }
.panel-head p { margin-top: 4px; font-size: 12.5px; line-height: 1.65; color: var(--ink-500); }
.panel-body { padding: 22px; }
.panel-body > p { font-size: 13.5px; line-height: 1.8; color: var(--ink-600); }
.panel-body > p + p { margin-top: 10px; }
.panel-body > p.help { font-size: 12.5px; color: var(--ink-500); }
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.grid-2 > .panel { display: flex; flex-direction: column; }
.grid-2 > .panel > .panel-body { flex: 1; }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; height: 100%; }
.pipeline-step { position: relative; padding: 16px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pipeline-step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -11px; width: 7px; height: 7px; border-top: 1.5px solid #b8c0cc; border-right: 1.5px solid #b8c0cc; transform: translateY(-50%) rotate(45deg); }
.pipeline-step b { display: block; margin-bottom: 14px; font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--accent); }
.pipeline-step strong { display: block; margin-bottom: 6px; font-size: 13.5px; color: var(--ink-900); }
.pipeline-step p { font-size: 12.5px; line-height: 1.7; color: var(--ink-500); }

.info-list { display: grid; font-size: 13.5px; }
.panel-body.info-list { padding-top: 10px; padding-bottom: 10px; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.info-list > .info-row { padding: 11px 0; }
.info-list > .info-row + .info-row { border-top: 1px solid var(--line-soft); }
.info-row strong { color: var(--ink-900); font-variant-numeric: tabular-nums; }
.info-row .muted { font-size: 12.5px; }

.notice {
  position: relative;
  margin-bottom: 20px;
  padding: 12px 16px 12px 42px;
  border: 1px solid #f5e2bf;
  border-radius: 11px;
  background: #fffaf0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b7791f' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6m0-10h.01'/%3E%3C/svg%3E") 15px 13px / 17px 17px no-repeat;
  color: #7a5310;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.notice strong { color: #5f3f08; }
.notice a { color: #8a5a0f; text-decoration: underline; }
.notice .button { margin-left: 8px; vertical-align: middle; }

/* ---------- Toolbars + tables ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.toolbar input:not([type=checkbox]), .toolbar select { min-height: 34px; font-size: 13px; box-shadow: none; }
.toolbar .search-input, .toolbar input:not([type=checkbox]) { flex: 1; min-width: 220px; max-width: 340px; }
.toolbar select { max-width: 230px; }
.toolbar .button.small { min-height: 34px; padding: 0 12px; }
.toolbar-end { margin-left: auto; font-size: 12.5px; color: var(--ink-400); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--accent-line); background: var(--accent-soft); font-size: 13px; }
.bulk-bar strong { margin-right: 6px; color: var(--accent-600); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; white-space: nowrap; }
th { height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink-500); font-size: 12px; font-weight: 600; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink-700); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbfc; }
td strong { color: var(--ink-900); font-weight: 600; }
.table-check { width: 38px; padding-right: 0 !important; }

.account-cell { display: flex; align-items: center; gap: 11px; min-width: 190px; max-width: 320px; }
.account-avatar { flex: 0 0 36px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, #eef2fb, #e2e8f5); color: #4d5f85; font-size: 12px; font-weight: 600; }
.account-name { max-width: 250px; min-height: 0; padding: 0; overflow: hidden; background: none; color: var(--ink-900); font-size: 13.5px; font-weight: 600; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.account-name:hover { color: var(--accent-600); }
.account-meta { max-width: 240px; margin-top: 3px; overflow: hidden; color: var(--ink-400); font-size: 12px; text-overflow: ellipsis; overflow-wrap: anywhere; }
.count { color: var(--ink-900); font-weight: 600; font-variant-numeric: tabular-nums; }

.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 9px; border-radius: 999px; background: #eef0f4; color: var(--ink-600); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.pill.green, .pill.succeeded, .pill.classified, .pill.completed { background: var(--green-soft); color: var(--green); }
.pill.orange, .pill.pending, .pill.queued { background: var(--amber-soft); color: var(--amber); }
.pill.blue, .pill.running, .pill.processing { background: var(--blue-soft); color: var(--blue); }
.pill.red, .pill.failed, .pill.blocked { background: var(--red-soft); color: var(--red); }
.pill.tag { border-radius: 6px; background: #eff1f6; color: #55607a; }
.pill:is(.green, .succeeded, .classified, .completed, .orange, .pending, .queued, .blue, .running, .processing, .red, .failed, .blocked)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill:is(.running, .processing)::before { animation: blink 1.1s ease-in-out infinite; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }

.table-select { width: 124px; min-height: 30px !important; padding-left: 9px; font-size: 12.5px !important; color: var(--ink-700); box-shadow: none !important; }
.selection-note { margin-top: 4px; font-size: 12px; color: var(--ink-400); }
.selection-note.yes { color: var(--green); }
.selection-note.no { color: var(--ink-400); }
.row-actions { display: flex; gap: 6px; }

.content-title { display: block; min-width: 260px; max-width: 420px; color: var(--ink-900); font-size: 13.5px; font-weight: 500; line-height: 1.6; white-space: normal; }
a.content-title:hover { color: var(--accent-600); text-decoration: none; }
.content-subtitle { max-width: 420px; margin-top: 4px; color: var(--ink-400); font-size: 12px; white-space: normal; }
.job-target { max-width: 190px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-900); font-weight: 500; }
.job-error { max-width: 270px; margin-top: 5px; color: var(--red); font-size: 12px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.request-log-route { max-width: 420px; overflow-wrap: anywhere; white-space: normal; font-family: var(--mono); font-size: 12px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 24px; text-align: center; color: var(--ink-500); font-size: 13.5px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 4px; border: 1px dashed var(--ink-300); border-radius: 16px; background: var(--surface-2); color: var(--ink-400); }
.empty strong { font-size: 15px; font-weight: 600; color: var(--ink-800); }
.empty p { max-width: 440px; font-size: 13px; line-height: 1.8; color: var(--ink-500); }
.empty .button { margin-top: 8px; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-soft); color: var(--ink-500); font-size: 12.5px; }
.pagination > div { display: flex; align-items: center; gap: 8px; }
.pager-buttons { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.page-jump { display: flex; align-items: center; gap: 8px; }
.page-jump label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-jump input { width: 64px; min-height: 30px !important; padding: 0 8px !important; border-radius: 8px !important; font-size: 12.5px !important; text-align: center; box-shadow: none !important; }

/* ---------- Scope + category cards ---------- */
.scope-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.scope-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s, transform .2s; }
.scope-card:hover { border-color: #d3d8e0; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.scope-card.disabled { background: var(--surface-2); box-shadow: none; }
.scope-card.disabled .scope-title { color: var(--ink-500); }
.scope-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.scope-title { font-size: 16px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.scope-kind { margin-top: 4px; font-size: 12px; color: var(--ink-400); }
.scope-data { display: grid; gap: 9px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.scope-data .info-row { font-size: 12.5px; color: var(--ink-800); }
.scope-time { margin-top: 12px; font-size: 12px; color: var(--ink-400); }
.scope-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.scope-footer .last { margin-left: auto; }
.keyword-group + .keyword-group { border-top: 1px solid var(--line-soft); }
.keyword-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(105px, 1.5fr) auto; align-items: center; gap: 14px; padding: 14px 20px; }
.keyword-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.keyword-row > .keyword-actions { justify-content: flex-end; }
.keyword-platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; padding: 0 20px 16px; }
.keyword-platform-detail { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.keyword-platform-detail .info-row { gap: 8px; align-items: flex-start; }
.keyword-platform-detail .info-row > span:last-child { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.keyword-platform-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.keyword-platform-detail .keyword-actions { margin-top: 10px; }
.monitor-summary .row-actions { flex-wrap: wrap; }
.monitor-target { margin: 0 0 12px; font-size: 12px; color: var(--ink-500); overflow-wrap: anywhere; }
.direct-monitors { margin-bottom: 22px; }
.direct-monitors .scope-grid { padding: 20px; }
.direct-monitors .scope-card { box-shadow: none; }
.direct-monitors .info-row { align-items: flex-start; gap: 12px; }
.direct-monitors .info-row > span:last-child { text-align: right; overflow-wrap: anywhere; }

.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.category-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, background .15s; }
.category-card:hover { border-color: var(--accent-line); background: #fffbf8; }
.category-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.category-card h3 { font-size: 14px; font-weight: 600; }
.category-card p { margin-top: 3px; font-size: 12px; color: var(--ink-400); }

/* ---------- Toast + loading ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 40; max-width: min(600px, 90vw); padding: 12px 18px; border-radius: 12px; background: var(--ink-900); color: #fff; font-size: 13.5px; line-height: 1.65; box-shadow: var(--shadow-lg); transform: translateX(-50%); animation: toast-in .22s ease; }
.toast.error { background: #b42318; }
.loading-line { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 3px; background: linear-gradient(90deg, transparent, #ff9a66, var(--accent), #ff9a66, transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: loading 1.1s linear infinite; }

/* ---------- Dialogs ---------- */
dialog { width: min(640px, 94vw); max-height: 90vh; padding: 0; overflow: hidden; border: 0; border-radius: 18px; background: #fff; color: var(--ink-700); box-shadow: var(--shadow-lg); }
dialog[open] { animation: dialog-in .2s cubic-bezier(.2, .8, .3, 1); }
dialog::backdrop { background: rgba(13, 20, 36, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.dialog-head h2 { font-size: 17px; font-weight: 650; }
.dialog-head p { margin-top: 4px; font-size: 12.5px; color: var(--ink-500); overflow-wrap: anywhere; }
.dialog-head .button { flex-shrink: 0; width: 32px; padding: 0; border-radius: 50%; font-size: 14px; }
.dialog-body { max-height: 65vh; padding: 22px 24px; overflow: auto; }
.dialog-body > p { margin-bottom: 14px; font-size: 13.5px; line-height: 1.7; }
.dialog-body > .form-error { margin-bottom: 16px; }
.dialog-body > .table-wrap { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; }
.dialog-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.delete-scope-note { margin-top: 14px; }
#delete-scope-form .dialog-body strong, #delete-scope-form .account-meta { overflow-wrap: anywhere; }

.creator-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.creator-detail-head .account-avatar { flex-basis: 52px; width: 52px; height: 52px; border-radius: 14px; font-size: 17px; }
.creator-detail-head h3 { margin-bottom: 4px; font-size: 19px; font-weight: 650; }
.creator-detail-head p { font-size: 12.5px; color: var(--ink-500); }
.bio { margin-bottom: 18px; font-size: 13.5px; line-height: 1.8; color: var(--ink-600); white-space: pre-line; overflow-wrap: anywhere; }
.detail-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-bottom: 22px; padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); }
.detail-counts strong { display: block; margin-bottom: 3px; color: var(--ink-900); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-counts small { font-size: 12px; color: var(--ink-500); }
.section-label { margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .4px; color: var(--ink-500); }
.ids { display: grid; gap: 8px; margin-bottom: 22px; }
.id-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 12.5px; }
.id-row code { color: var(--ink-700); line-height: 1.6; overflow-wrap: anywhere; }
.detail-controls { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 16px; }
.detail-keywords { margin-top: 22px; }

/* ---------- Operations pages ---------- */
.ops-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ops-plan { min-width: 0; padding: 0 20px 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ops-plan h3 { position: sticky; top: var(--topbar); z-index: 1; margin: 0 0 6px; padding: 16px 0 12px; background: #fff; font-size: 16px; font-weight: 650; }
.ops-plan .form-grid { gap: 14px 16px; }
.ops-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.ops-save { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 10px; margin: 20px 0; padding: 14px 0; border-top: 1px solid var(--line); background: rgba(244, 245, 247, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ops-user-detail { min-width: 0; }
.ops-user-detail .dialog-body > h3 { margin: 26px 0 10px; font-size: 14px; font-weight: 650; }
.ops-user-detail .dialog-body > .table-wrap { margin-top: 0; }
.ops-user-detail .dialog-body > .empty { padding: 22px; border: 1px dashed var(--line); border-radius: 10px; }
.ops-user-detail .dialog-body > .empty strong { font-size: 13px; font-weight: 500; color: var(--ink-500); }
.ops-user-detail code { overflow-wrap: anywhere; }

.request-log-json { width: 100%; min-height: 50vh; padding: 14px 16px; border-color: #1c2740; background: #0f172a; color: #d5def0; font: 12px/1.65 var(--mono); white-space: pre; resize: vertical; }
.request-log-json:focus { border-color: var(--accent); }

.platform-guide { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink-600); font-size: 13px; line-height: 1.75; }
.platform-guide.compact { padding: 13px 16px; }
.native-session-guide { border-color: #f5e2bf; background: #fffbf3; }
.guide-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.guide-heading strong, .platform-guide > strong { color: var(--ink-900); font-size: 13.5px; }
.platform-guide p { margin: 8px 0 0; overflow-wrap: anywhere; }
.platform-guide .help { font-size: 12px; }
.guide-steps { margin: 10px 0; padding-left: 20px; }
.guide-steps li + li { margin-top: 4px; }
.guide-example-label { font-size: 12px; font-weight: 600; color: var(--amber); }
.guide-code { max-height: 360px; margin: 8px 0 0; padding: 12px 14px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-700); font: 12px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-extra, .guide-file { padding-top: 10px; border-top: 1px solid var(--line); }
.guide-file code, .guide-inline-example { color: #2f4d7c; font: 12px/1.7 var(--mono); overflow-wrap: anywhere; }
.guide-inline-example { display: block; margin-top: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.guide-fields { display: grid; gap: 8px; margin: 14px 0; }
.guide-fields > div { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.2fr); gap: 10px; }
.guide-fields dt { color: #2f4d7c; font: 12px/1.7 var(--mono); overflow-wrap: anywhere; }
.guide-fields dd { margin: 0; font-size: 12.5px; color: var(--ink-500); }

.reference-summary { min-width: 200px; max-width: 340px; line-height: 1.65; white-space: normal; }
.reference-summary > strong { color: var(--ink-900); font-size: 13px; font-weight: 600; }
.reference-summary > .help { margin: 5px 0 0; font-size: 12px; color: var(--ink-500); }
.credential-fields { margin-top: 6px; font-size: 12px; color: var(--ink-600); }
.credential-fields summary { width: fit-content; cursor: pointer; }
.credential-fields ul { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.credential-fields code { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); font-size: 11px; overflow-wrap: anywhere; }

.content, .field, .ops-plan { min-width: 0; }

/* ---------- Motion ---------- */
@keyframes pulse { 50% { opacity: .25; } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes breathe { 50% { transform: scale(.92); opacity: .75; } }
@keyframes loading { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Responsive ---------- */
@media (min-width: 1550px) {
  .scope-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  :root { --sidebar: 200px; }
  .scope-grid, .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 24px; }
  .topbar { padding: 0 24px; }
  .metrics { gap: 12px; }
  .metric { padding: 18px; }
}
@media (max-width: 900px) {
  .ops-plan-grid { grid-template-columns: 1fr; }
  .keyword-row { grid-template-columns: minmax(0, 1fr) auto; }
  .keyword-row .pills { justify-content: flex-end; }
  .keyword-row > .keyword-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 850px) {
  :root { --sidebar: 68px; }
  .sidebar { gap: 16px; padding: 18px 10px; }
  .brand { padding: 0; justify-content: center; }
  .brand > div, .sidebar-title, .nav-item span, .sidebar-bottom { display: none; }
  .nav-item { justify-content: center; min-height: 42px; padding: 0; }
  .nav-item svg { width: 20px; height: 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading h1 { font-size: 22px; }
  .topbar { justify-content: flex-end; }
  .topbar-right .muted, .breadcrumb { display: none; }
  .login-aside { padding: 44px 30px; }
  .login-aside h1 { font-size: 28px; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline-step::after { display: none; }
}
@media (max-width: 600px) {
  .login-page { grid-template-columns: 1fr; }
  .login-aside { gap: 16px; padding: 28px; }
  .login-aside h1 { font-size: 23px; }
  .login-aside p, .login-steps { display: none; }
  .login-main { padding: 34px 24px; }
  .content { padding: 20px 14px 40px; }
  .topbar { height: auto; min-height: 56px; padding: 10px 14px; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
  .page-heading { display: block; margin-bottom: 18px; }
  .page-heading .page-actions { margin-top: 14px; }
  .scope-grid, .category-grid { grid-template-columns: 1fr; }
  .keyword-row { grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; }
  .keyword-row .pills { justify-content: flex-start; }
  .keyword-platforms { padding: 0 14px 12px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 26px; }
  .metric-mark { display: none; }
  .metric-label { font-size: 12px; }
  .panel-head { flex-wrap: wrap; padding: 14px 16px; }
  .panel-body { padding: 16px; }
  .direct-monitors .scope-grid { padding: 14px; }
  .toolbar { padding: 12px 14px; }
  .toolbar input:not([type=checkbox]) { min-width: 0; max-width: none; flex: 1 1 100%; }
  .toolbar select { min-width: 0; max-width: 100%; flex: 1 1 140px; }
  .toolbar-end { display: none; }
  .form-grid { gap: 14px; }
  .form-grid .field, .form-grid .full { grid-column: 1 / -1; }
  .dialog-head { align-items: flex-start; padding: 18px; }
  .dialog-body { padding: 18px; }
  .dialog-footer { padding: 12px 18px; }
  .detail-controls { grid-template-columns: 1fr; }
  .detail-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .detail-counts strong { font-size: 17px; }
  .id-row { grid-template-columns: 80px 1fr; }
  .pagination { padding: 12px 14px; }
  .pagination > div { margin-left: auto; }
  .platform-icon { display: none; }
  .brand-symbol { width: 34px; height: 34px; font-size: 19px; }
  .ops-save .button { width: 100%; }
  .platform-guide { padding: 14px; }
  .guide-fields > div { grid-template-columns: 1fr; gap: 2px; }
  .guide-code { max-height: 300px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.account-avatar { position: relative; overflow: hidden; }
.account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.selection-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 10px 22px; border-bottom: 1px solid var(--line, #e8edf4); color: #69768b; font-size: 12px; }
.bulk-bar { flex-wrap: wrap; }
.bulk-bar select { max-width: 280px; min-height: 32px; border: 1px solid #dbe2ec; border-radius: 6px; background: white; padding: 5px 8px; }
.account-rule-reason { max-width: 260px; white-space: normal; color: #778399; font-size: 11px; margin-top: 5px; line-height: 1.5; }
.account-job-status { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 6px; font-size: 11px; }
.account-job-status .button { padding: 3px 5px; font-size: 10px; }
.account-job-error { max-width: 260px; white-space: normal; color: #b77560; font-size: 11px; line-height: 1.5; margin-top: 4px; }
