:root {
  --bg: #f4f2ed;
  --surface: #fffefa;
  --surface-strong: #ffffff;
  --ink: #1b1c28;
  --muted: #737485;
  --line: #e5e2dc;
  --nav: #17182f;
  --nav-muted: #a9aabc;
  --violet: #635bff;
  --violet-dark: #4d45e8;
  --violet-soft: #efedff;
  --coral: #ff6e5f;
  --cyan: #41bfd0;
  --green: #2fa66f;
  --amber: #d89528;
  --red: #d94d5a;
  --shadow: 0 16px 40px rgba(27, 28, 48, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 250px;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 8%, rgba(99,91,255,.22), transparent 28%),
    linear-gradient(160deg, #1d1e3a 0%, var(--nav) 58%, #111225 100%);
  transition: width .24s ease, padding .24s ease;
}
.sidebar-toggle {
  position: absolute;
  top: 34px;
  right: -14px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--bg);
  border-radius: 50%;
  color: #fff;
  background: #34355d;
  box-shadow: 0 7px 18px rgba(17,18,37,.26);
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.sidebar-toggle:hover { background: var(--violet); transform: scale(1.06); }
.sidebar-toggle span { margin-top: -2px; font-size: 23px; line-height: 1; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 30px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #7c75ff, #554ce4);
  box-shadow: 0 8px 24px rgba(99,91,255,.35);
}
.brand-mark svg { width: 27px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font-size: 21px; letter-spacing: -.4px; }
.brand small { display: block; margin-top: 1px; color: var(--nav-muted); font-size: 12px; }

.main-nav { display: grid; gap: 7px; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 0;
  border-radius: 13px;
  color: var(--nav-muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.is-active { color: #fff; background: rgba(99,91,255,.26); box-shadow: inset 3px 0 #8e88ff; }
.nav-icon { width: 23px; text-align: center; font-size: 20px; font-weight: 600; }
.sidebar-foot { margin-top: auto; }
.connection-card {
  display: flex; align-items: center; gap: 11px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;
  background: rgba(255,255,255,.05);
}
.connection-card strong, .connection-card small { display: block; }
.connection-card strong { font-size: 13px; }
.connection-card small { margin-top: 2px; color: var(--nav-muted); font-size: 12px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(216,149,40,.12); }
.status-dot.ok { background: #4ad38f; box-shadow: 0 0 0 4px rgba(74,211,143,.12); }
.status-dot.error { background: #ff6874; box-shadow: 0 0 0 4px rgba(255,104,116,.12); }
.sidebar-foot p { padding: 10px 13px 0; color: #777990; font-size: 12px; line-height: 1.65; }
.sidebar-login-button {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding: 10px 13px;
  border: 1px solid rgba(142,136,255,.42); border-radius: 12px;
  color: #fff; background: linear-gradient(135deg, rgba(99,91,255,.86), rgba(117,94,244,.68));
  box-shadow: 0 8px 20px rgba(55,44,170,.2);
  font-size: 12px; font-weight: 800; text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.sidebar-login-button:hover {
  transform: translateY(-1px); border-color: rgba(181,176,255,.8);
  background: linear-gradient(135deg, rgba(112,104,255,.96), rgba(130,105,250,.82));
}
.sidebar-login-button[hidden] { display: none; }

.main { min-height: 100vh; margin-left: 250px; transition: margin-left .24s ease; }

@media (min-width: 761px) {
  body.sidebar-collapsed .sidebar { width: 86px; padding-right: 12px; padding-left: 12px; }
  body.sidebar-collapsed .main { margin-left: 86px; }
  body.sidebar-collapsed .brand { justify-content: center; padding-right: 0; padding-left: 0; }
  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .connection-copy,
  body.sidebar-collapsed #sidebarAccessHint,
  body.sidebar-collapsed .sidebar-login-button { display: none; }
  body.sidebar-collapsed .nav-item { justify-content: center; gap: 0; padding-right: 0; padding-left: 0; }
  body.sidebar-collapsed .nav-item:hover { transform: none; }
  body.sidebar-collapsed .nav-item.is-active { box-shadow: inset 0 0 0 1px rgba(142,136,255,.55); }
  body.sidebar-collapsed .nav-icon { width: 28px; }
  body.sidebar-collapsed .connection-card { justify-content: center; padding-right: 0; padding-left: 0; }
}
.topbar {
  position: sticky; top: 0; z-index: 15;
  min-height: 86px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 34px;
  border-bottom: 1px solid rgba(229,226,220,.75);
  background: rgba(244,242,237,.86);
  backdrop-filter: blur(16px);
}
.topbar h1 { margin: 1px 0 0; font-size: 24px; letter-spacing: -.5px; }
.eyebrow, .kicker { margin: 0; color: var(--violet); font-size: 12px; font-weight: 800; letter-spacing: 1.7px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.live-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 11px;
  color: #4f5161;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  font-size: 12px;
}
.live-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(47,166,111,.12); }
.icon-button {
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.7);
  cursor: pointer; font-size: 20px;
}
.icon-button:hover { background: #fff; transform: rotate(12deg); }
.content { padding: 30px 34px 80px; }
.view { display: none; animation: viewIn .28s ease; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.primary, .secondary {
  min-height: 43px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .18s ease;
}
.primary { color: #fff; background: var(--violet); box-shadow: 0 9px 20px rgba(99,91,255,.2); }
.primary:hover { background: var(--violet-dark); transform: translateY(-1px); }
.secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.secondary:hover { border-color: #cfcbd3; transform: translateY(-1px); }
.primary.compact, .secondary.compact { min-height: 38px; padding: 0 14px; font-size: 12px; }
.primary.full { width: 100%; margin-top: 18px; }
.primary.danger { background: var(--coral); box-shadow: 0 9px 20px rgba(255,110,95,.18); }
.danger-outline {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #efbec3;
  border-radius: 11px;
  color: #b83f4c;
  background: #fff6f7;
  font-weight: 700;
  cursor: pointer;
}
.danger-outline:hover { border-color: #da7c86; background: #ffedef; }
.danger-outline.compact { font-size: 12px; white-space: nowrap; }
.primary:disabled, .secondary:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
html.android-standalone .danger-outline:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
html.android-standalone .is-loading {
  position: relative;
  pointer-events: none;
  cursor: wait !important;
}
html.android-standalone .is-loading:disabled { opacity: .78; }
html.android-standalone .is-loading::before {
  content: "";
  width: 12px; height: 12px;
  display: inline-block; vertical-align: -2px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: buttonSpin .72s linear infinite;
  opacity: .82;
}
html.android-standalone .icon-button.is-loading { color: transparent; }
html.android-standalone .icon-button.is-loading::before {
  position: absolute; left: 50%; top: 50%;
  width: 15px; height: 15px; margin: -9px 0 0 -9px;
  color: var(--violet);
}
@keyframes buttonSpin { to { transform: rotate(360deg); } }
.text-button {
  border: 0; padding: 4px 0;
  color: var(--violet);
  background: transparent;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.muted { color: var(--muted); font-size: 12px; }

.hero-card {
  --radar-x: 0px;
  --radar-y: 0px;
  position: relative;
  min-height: 270px;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  overflow: hidden;
  border-radius: 27px;
  color: #fff;
  background:
    radial-gradient(circle at 87% 20%, rgba(112,217,255,.19), transparent 23%),
    radial-gradient(circle at 72% 85%, rgba(99,91,255,.42), transparent 34%),
    linear-gradient(135deg, #171832, #272952 62%, #222143);
  box-shadow: 0 20px 54px rgba(27,28,57,.18);
  isolation: isolate;
}
.hero-grid-overlay {
  position: absolute; z-index: 0; inset: 0;
  opacity: .16;
  background-image:
    linear-gradient(rgba(166,174,255,.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166,174,255,.2) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, transparent 2%, #000 38%, #000 100%);
  animation: heroGridDrift 16s linear infinite;
}
.hero-noise {
  position: absolute; z-index: 0; inset: 0;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  pointer-events: none;
}
@keyframes heroGridDrift { to { background-position: 42px 42px; } }
.hero-copy { position: relative; z-index: 2; padding: 32px 40px 30px; }
.hero-kicker-row { display: flex; align-items: center; gap: 9px; }
.hero-copy .kicker { color: #9a94ff; text-shadow: 0 0 18px rgba(142,136,255,.42); }
.hero-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #66efbd;
  box-shadow: 0 0 0 4px rgba(102,239,189,.09), 0 0 16px rgba(102,239,189,.7);
  animation: heroLive 1.8s ease-in-out infinite;
}
.hero-build {
  margin-left: 3px; padding: 4px 7px;
  border: 1px solid rgba(171,174,255,.18); border-radius: 999px;
  color: rgba(218,220,255,.58); background: rgba(255,255,255,.04);
  font: 700 11px/1 "Cascadia Code", Consolas, monospace; letter-spacing: .8px;
}
@keyframes heroLive { 50% { opacity: .55; transform: scale(.78); } }
.hero-title {
  max-width: 760px;
  margin: 13px 0 14px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -1.8px;
}
.hero-title-line, .hero-glitch { display: block; }
.hero-hot-word { position: relative; color: #fff; }
.hero-hot-word::after {
  content: "";
  position: absolute; right: 0; bottom: -3px; left: 0;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #8e88ff, #76dcff, transparent);
  background-size: 180% 100%;
  animation: hotScan 2.7s ease-in-out infinite;
}
@keyframes hotScan { 50% { background-position: 100% 0; filter: brightness(1.5); } }
.hero-glitch {
  position: relative; width: fit-content;
  color: transparent; font-style: normal;
  background: linear-gradient(100deg, #8f88ff 8%, #c4a8ff 45%, #6edfff 70%, #8f88ff 92%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: titleFlow 5s linear infinite;
}
.hero-glitch::before, .hero-glitch::after {
  content: "";
  position: absolute; z-index: -1;
  opacity: 0; pointer-events: none;
}
@keyframes titleFlow { to { background-position: -220% 0; } }
.hero-copy p { max-width: 660px; margin: 0; color: #c4c5d3; font-size: 14px; line-height: 1.8; }
.hero-telemetry {
  width: fit-content; min-height: 27px;
  display: flex; align-items: center; gap: 8px;
  margin-top: 13px; padding: 6px 10px;
  border: 1px solid rgba(153,157,239,.16); border-radius: 8px;
  color: #aeb1d0; background: rgba(10,11,30,.23);
  backdrop-filter: blur(8px);
}
.hero-telemetry code { font: 600 11px/1.3 "Cascadia Code", Consolas, monospace; letter-spacing: .45px; }
.telemetry-led { width: 5px; height: 5px; border-radius: 50%; background: #6be6b8; box-shadow: 0 0 9px #6be6b8; }
.telemetry-cursor { width: 5px; height: 10px; background: #8e88ff; animation: telemetryBlink 1s steps(1) infinite; }
@keyframes telemetryBlink { 50% { opacity: 0; } }
.hero-actions { display: flex; gap: 10px; margin-top: 14px; }
.hero-card .primary { box-shadow: 0 9px 30px rgba(99,91,255,.28), inset 0 1px rgba(255,255,255,.18); }
.hero-card .secondary { border-color: rgba(255,255,255,.14); color: #fff; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hero-card .primary:hover, .hero-card .secondary:hover { transform: translateY(-2px); }
.hero-visual { position: relative; z-index: 2; display: grid; place-items: center; min-height: 260px; perspective: 900px; }
.hero-radar {
  position: relative;
  width: min(360px, 95%); height: 260px;
  display: grid; place-items: center;
  transform: translate3d(var(--radar-x), var(--radar-y), 0);
  transition: transform .18s ease-out;
}
.pulse-core {
  position: relative; z-index: 3;
  width: 118px; height: 118px;
  display: grid; place-content: center; text-align: center;
  border: 1px solid rgba(255,255,255,.25); border-radius: 50%;
  background:
    radial-gradient(circle at 34% 25%, rgba(255,255,255,.23), transparent 25%),
    linear-gradient(145deg, rgba(126,119,255,.96), rgba(72,63,202,.82));
  box-shadow: 0 0 65px rgba(99,91,255,.53), inset 0 0 30px rgba(255,255,255,.12);
  animation: coreBreathe 3.2s ease-in-out infinite;
}
.pulse-core::before, .pulse-core::after {
  content: ""; position: absolute; inset: -10px;
  border: 1px solid rgba(134,127,255,.23); border-radius: 50%;
  animation: pulseWave 2.8s ease-out infinite;
}
.pulse-core::after { animation-delay: 1.4s; }
.pulse-core b { position: absolute; right: 13px; top: 13px; width: 7px; height: 7px; border: 2px solid #746de5; border-radius: 50%; background: #6af0ba; box-shadow: 0 0 12px #6af0ba; }
.pulse-core span { font-size: 34px; font-weight: 800; }
.pulse-core small { color: #d6d4ff; font-size: 12px; }
@keyframes coreBreathe { 50% { transform: scale(1.035); box-shadow: 0 0 82px rgba(99,91,255,.65), inset 0 0 30px rgba(255,255,255,.12); } }
@keyframes pulseWave { to { inset: -32px; opacity: 0; } }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.orbit i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #7ce3ff; box-shadow: 0 0 11px #7ce3ff; }
.orbit-one { width: 220px; height: 220px; animation: orbitOne 14s linear infinite; }
.orbit-one i { left: 20px; top: 42px; }
.orbit-two { width: 310px; height: 180px; animation: orbitTwo 18s linear infinite reverse; }
.orbit-two i { right: 35px; bottom: 20px; background: #a69fff; box-shadow: 0 0 11px #a69fff; }
.orbit-three { width: 265px; height: 116px; animation: orbitThree 12s ease-in-out infinite alternate; }
.radar-sweep {
  position: absolute; z-index: 1;
  width: 250px; height: 250px;
  border-radius: 50%; opacity: .32;
  background: conic-gradient(from 0deg, transparent 0 82%, rgba(108,221,255,.22) 94%, rgba(108,221,255,.55) 100%);
  mask-image: radial-gradient(circle, transparent 0 43%, #000 45% 100%);
  animation: radarSweep 5.5s linear infinite;
}
@keyframes orbitOne { to { transform: rotate(360deg); } }
@keyframes orbitTwo { from { transform: rotate(-24deg); } to { transform: rotate(336deg); } }
@keyframes orbitThree { from { transform: rotate(17deg) scale(.96); } to { transform: rotate(8deg) scale(1.04); } }
@keyframes radarSweep { to { transform: rotate(360deg); } }
.float-tag {
  position: absolute; z-index: 4;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.15); border-radius: 999px;
  color: #dedfff; background: rgba(255,255,255,.08); backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 700;
  animation: floatTag 4s ease-in-out infinite;
}
.float-tag i { width: 4px; height: 4px; border-radius: 50%; background: #76e3ff; box-shadow: 0 0 7px #76e3ff; }
.tag-one { top: 19%; left: 20%; }
.tag-two { right: 9%; top: 34%; animation-delay: -.9s; }
.tag-three { left: 23%; bottom: 14%; animation-delay: -1.8s; }
@keyframes floatTag { 50% { transform: translateY(-6px); border-color: rgba(139,213,255,.34); } }
.data-particle { position: absolute; z-index: 2; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 9px #8edfff; animation: particlePulse 2.4s ease-in-out infinite; }
.particle-one { left: 14%; top: 48%; }
.particle-two { right: 18%; bottom: 17%; animation-delay: -.8s; }
.particle-three { right: 24%; top: 12%; animation-delay: -1.6s; }
@keyframes particlePulse { 50% { opacity: .2; transform: scale(.5); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 16px 0; }
.stat-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface);
}
.stat-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: var(--violet); background: var(--violet-soft); font-size: 15px; }
.stat-value { display: flex; align-items: baseline; gap: 7px; margin-top: 13px; }
.stat-value strong { font-size: 29px; line-height: 1; }
.stat-value small { color: var(--muted); font-size: 12px; }

.dashboard-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 3px 16px rgba(27,28,48,.025);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-head h3 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.25px; }
.record-list, .topic-mini-list { display: grid; gap: 3px; }
.record-row {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid #eeece7;
  cursor: pointer;
}
.record-row:first-child { border-top: 0; }
.record-row:hover .record-title { color: var(--violet); }
.record-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #f0eff8; }
.record-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.record-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.record-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
}
.status-chip.published, .status-chip.success { color: #21734d; background: #e8f7ef; }
.status-chip.failed, .status-chip.cli_error, .status-chip.exception { color: #a93242; background: #fdecef; }
.status-chip.generated, .status-chip.publishing, .status-chip.running { color: #8a5c12; background: #fff5df; }
.topic-mini {
  padding: 12px 3px; border-top: 1px solid #eeece7; cursor: pointer;
}
.topic-mini:first-child { border-top: 0; }
.topic-mini strong { display: block; font-size: 12px; line-height: 1.5; }
.topic-mini div { display: flex; gap: 8px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.section-intro {
  display: flex; justify-content: space-between; align-items: center; gap: 36px;
  padding: 4px 2px 18px;
}
.section-intro h2 { margin: 7px 0 0; font-size: clamp(25px, 2.7vw, 34px); line-height: 1.2; letter-spacing: -1px; }
.section-intro > p { max-width: 450px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.section-intro code { color: var(--violet); }
.pull-refresh { display: none; }
html.android-standalone #view-dashboard .hero-card,
html.android-standalone .section-intro { display: none; }
.history-toolbar {
  display: flex; justify-content: space-between; gap: 15px;
  padding: 8px;
  border: 1px solid var(--line); border-radius: 17px;
  background: var(--surface);
}
.segmented { display: flex; padding: 3px; border-radius: 12px; background: #efede8; }
.segmented button {
  min-width: 92px; padding: 8px 13px; border: 0; border-radius: 9px;
  color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer;
}
.segmented button.is-active { color: var(--ink); background: #fff; box-shadow: 0 3px 12px rgba(27,28,48,.08); }
.toolbar-filters { display: flex; align-items: stretch; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.search-box { min-width: 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.search-box span { color: var(--muted); font-size: 18px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.toolbar-filters select { min-width: 130px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; font-size: 12px; outline: 0; }
.history-date-filter {
  display: grid; grid-template-columns: minmax(105px,1fr) auto minmax(105px,1fr) auto;
  align-items: center; gap: 5px; padding: 3px 4px 3px 9px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
}
.history-date-filter label { min-width: 0; display: flex; align-items: center; gap: 5px; }
.history-date-filter label > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.history-date-filter input {
  width: 82px; min-width: 0; padding: 6px 3px; border: 0; outline: 0;
  color: var(--ink); background: transparent; font-size: 12px; cursor: pointer;
}
.history-date-filter input::placeholder { color: #aaa8b2; }
.history-date-filter > i { color: #bbb8c3; font-size: 11px; font-style: normal; }
.history-date-clear {
  padding: 6px 8px; border: 0; border-radius: 8px;
  color: var(--violet); background: var(--violet-soft); font-size: 11px; font-weight: 800; cursor: pointer;
}
.history-date-clear:hover { background: #e8e3ff; }
.history-summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px 9px; color: var(--muted); font-size: 12px; }
.history-content { min-height: 180px; }
html.android-standalone .history-content.is-refreshing { opacity: .62; transition: opacity .18s ease; pointer-events: none; }
.topic-table { display: grid; gap: 10px; }
.topic-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px;
  padding: 18px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface);
    transition: .18s ease;
    cursor: pointer;
  }
.topic-card:hover { border-color: #cbc7e2; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(27,28,48,.05); }
.topic-card.is-selected { border-color: var(--violet); background: #fbfaff; box-shadow: inset 3px 0 var(--violet); }
.topic-check { position: relative; width: 22px; height: 22px; margin-top: 2px; }
.topic-check input { position: absolute; opacity: 0; }
.topic-check i { width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid #c9c6cf; border-radius: 7px; background: #fff; cursor: pointer; }
.topic-check input:checked + i { border-color: var(--violet); background: var(--violet); }
.topic-check input:checked + i::after { content: "✓"; color: #fff; font-size: 12px; font-style: normal; font-weight: 800; }
.topic-origin-mark {
  width: 22px; height: 22px; display: grid; place-items: center; margin-top: 2px;
  border-radius: 7px; color: #fff; background: linear-gradient(135deg, #6757f5, #8f83ff);
  box-shadow: 0 5px 12px rgba(103,87,245,.2); font-size: 11px; font-weight: 900;
}
.published-topic-badge {
  flex: none; padding: 4px 7px; border: 1px solid #cfc9ff; border-radius: 999px;
  color: #5d4ee5; background: #f3f1ff; font-size: 11px; font-weight: 900;
  letter-spacing: .2px;
}
.table-check { width: 36px; }
.table-check .topic-check { display: block; margin: 0; }
.topic-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topic-title-line h3 { margin: 0; font-size: 14px; line-height: 1.5; }
.domain-chip { padding: 3px 7px; border-radius: 999px; color: var(--violet); background: var(--violet-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.topic-content-preview {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 8px 0 10px; color: #5f606e; font-size: 12px; line-height: 1.7;
}
.topic-facts { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.topic-facts b { color: #555665; font-weight: 700; }
.topic-action { align-self: center; border: 0; color: var(--violet); background: transparent; cursor: pointer; font-size: 18px; }
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th { padding: 12px 15px; color: var(--muted); background: #f7f5f1; font-size: 11px; text-align: left; letter-spacing: .6px; text-transform: uppercase; }
.data-table td { padding: 14px 15px; border-top: 1px solid var(--line); font-size: 12px; vertical-align: top; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fbfaff; }
.data-table tbody tr.is-selected { background: #f4f1ff; box-shadow: inset 3px 0 var(--violet); }
.cell-title { max-width: 420px; font-size: 12px; font-weight: 700; line-height: 1.5; }
.cell-sub { max-width: 420px; margin-top: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-pagination {
  display: grid; grid-template-columns: minmax(110px,1fr) auto minmax(110px,1fr);
  align-items: center; gap: 14px; margin-top: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 15px; background: var(--surface);
}
.page-size-control {
  display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700;
}
.page-size-control select {
  min-width: 58px; padding: 7px 20px 7px 9px; border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); background: #fff; font-size: 12px; font-weight: 800; outline: 0;
}
.pagination-actions, .pagination-pages { display: flex; align-items: center; justify-content: center; gap: 5px; }
.pagination-actions button {
  width: 31px; height: 31px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 9px; color: #666575; background: #fff;
  font-size: 12px; font-weight: 800; cursor: pointer; transition: .15s ease;
}
.pagination-actions button:hover:not(:disabled) { border-color: #bcb5fa; color: var(--violet); transform: translateY(-1px); }
.pagination-actions button.is-active { border-color: var(--violet); color: #fff; background: var(--violet); box-shadow: 0 5px 13px rgba(103,87,245,.2); }
.pagination-actions button:disabled { opacity: .35; cursor: not-allowed; }
.pagination-actions .pagination-arrow { font-size: 18px; font-weight: 500; }
.pagination-ellipsis { width: 20px; color: var(--muted); text-align: center; font-size: 12px; }
.page-meta { justify-self: end; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.selection-tray {
  position: sticky; bottom: 18px; z-index: 12;
  display: none; grid-template-columns: auto minmax(140px,1fr) auto auto auto; align-items: center; gap: 10px;
  width: min(790px, calc(100% - 30px)); margin: 18px auto 0; padding: 12px 14px;
  border: 1px solid rgba(99,91,255,.25); border-radius: 18px;
  background: rgba(29,30,58,.96); color: #fff; box-shadow: 0 18px 46px rgba(27,28,48,.25); backdrop-filter: blur(16px);
}
.selection-tray.is-visible { display: grid; animation: trayIn .22s ease; }
@keyframes trayIn { from { opacity: 0; transform: translateY(12px); } }
.selection-stack { display: flex; padding-left: 7px; }
.selection-stack span { width: 29px; height: 29px; display: grid; place-items: center; margin-left: -7px; border: 2px solid #222345; border-radius: 50%; background: var(--violet); font-size: 11px; font-weight: 800; }
.selection-copy strong, .selection-copy small { display: block; }
.selection-copy strong { font-size: 12px; }
.selection-copy small { margin-top: 3px; color: #adaec4; font-size: 11px; }

.operations-layout { display: grid; gap: 18px; }
.workflow-builder { display: grid; gap: 18px; }
.workflow-panel { overflow: visible; }
.query-stage-grid {
  display: grid;
  grid-template-columns: minmax(390px,1.12fr) minmax(320px,.88fr);
  grid-template-areas:
    "custom collector"
    "tags collector"
    "date collector";
  gap: 16px;
  align-items: start;
}
.query-source-column, .query-filter-column { display: contents; }
.execution-primary, .execution-actions { min-width: 0; }
.query-stage .custom-query-primary { grid-area: custom; }
.query-stage .focus-tag-grid { grid-area: tags; }
.query-stage .collector-options-card { grid-area: collector; }
.query-stage .date-limit-card { grid-area: date; margin-top: 0; }
.query-stage .focus-tag-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.query-stage .custom-query-primary { margin: 0; }
.query-stage .collector-options-card, .execution-stage .collector-options-card { margin-top: 0; }
.query-stage .collector-option-grid { grid-template-columns: 1fr; }
.execution-stage-grid {
  display: grid;
  grid-template-columns: minmax(360px,1.05fr) minmax(320px,.95fr);
  gap: 16px;
  align-items: start;
}
.execution-actions {
  padding: 4px 15px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #faf9f6;
}
.execution-actions .command-preview { margin-top: 13px; }
.execution-actions .primary.full { margin-top: 11px; min-height: 45px; }
.job-area {
  display: grid;
  grid-template-columns: minmax(0,1.55fr) minmax(290px,.65fr);
  gap: 16px;
  align-items: start;
}
.step-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.step-title > b { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; color: var(--violet); background: var(--violet-soft); font-size: 12px; }
.step-title h3, .step-title p { margin: 0; }
.step-title h3 { font-size: 15px; }
.step-title p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.workflow-options { display: grid; gap: 9px; }
.workflow-option {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px;
  padding: 13px;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fff; cursor: pointer; transition: .18s ease;
}
.workflow-option input { position: absolute; opacity: 0; pointer-events: none; }
.workflow-option:hover { border-color: #c7c3da; }
.workflow-option.is-selected { border-color: var(--violet); background: #faf9ff; box-shadow: inset 3px 0 var(--violet); }
.workflow-symbol { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; font-size: 12px; font-weight: 800; }
.workflow-symbol.violet { color: var(--violet); background: var(--violet-soft); }
.workflow-symbol.coral { color: #c75045; background: #ffefed; }
.workflow-symbol.cyan { color: #218495; background: #e6f8fa; }
.workflow-option strong, .workflow-option small { display: block; }
.workflow-option strong { font-size: 12px; }
.workflow-option small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.workflow-option > i { display: none; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #fff; background: var(--violet); font-size: 12px; font-style: normal; }
.workflow-option.is-selected > i { display: grid; }
.focus-tag-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.focus-tag-option {
  position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px;
  min-height: 68px; padding: 11px;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fff; cursor: pointer; transition: .18s ease;
}
.focus-tag-option input { position: absolute; opacity: 0; pointer-events: none; }
.focus-tag-option:hover { border-color: #c7c3da; }
.focus-tag-option.is-selected { border-color: var(--violet); background: #faf9ff; box-shadow: inset 3px 0 var(--violet); }
.focus-tag-option strong, .focus-tag-option small { display: block; }
.focus-tag-option strong { font-size: 12px; }
.focus-tag-option small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.focus-tag-option > i { display: none; width: 19px; height: 19px; place-items: center; border-radius: 50%; color: #fff; background: var(--violet); font-size: 11px; font-style: normal; }
.focus-tag-option.is-selected > i { display: grid; }
.workflow-symbol.amber { color: #a86412; background: #fff1d8; }
.workflow-symbol.blue { color: #3c68ba; background: #eaf1ff; }
.workflow-symbol.red { color: #bd4b57; background: #ffeaed; }
.workflow-symbol.green { color: #32835c; background: #e6f7ee; }
.workflow-symbol.gold { color: #a3780b; background: #fff6d8; }
.workflow-symbol.pink { color: #af4f80; background: #ffeaf4; }
.collector-options-card {
  display: grid; gap: 13px;
  margin-top: 16px; padding: 16px;
  border: 1px solid var(--line); border-radius: 17px;
  background: #faf9f6;
}
.custom-query-primary {
  margin: 14px 0 16px; padding: 14px;
  border: 1px solid rgba(99,91,255,.22); border-radius: 15px;
  background: linear-gradient(145deg, #fbfaff, #f5f3ff);
}
.collector-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.collector-section-title strong { font-size: 12px; }
.collector-section-title small { color: var(--muted); font-size: 11px; }
.custom-query-field, .collector-option-grid > label, .collector-toggle { display: grid; gap: 9px; }
.custom-query-field span strong, .custom-query-field span small,
.collector-option-grid span strong, .collector-option-grid span small,
.collector-toggle span strong, .collector-toggle span small { display: block; }
.custom-query-field strong, .collector-option-grid strong, .collector-toggle strong { font-size: 12px; }
.custom-query-field small, .collector-option-grid small, .collector-toggle small {
  margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5;
}
.custom-query-field input {
  width: 100%; min-width: 0; height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 11px;
  outline: none; color: var(--ink); background: #fff; font-size: 12px;
}
.custom-query-field input:focus, .collector-option-grid input:focus {
  border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,91,255,.09);
}
.collector-option-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.collector-option-grid > label {
  grid-template-columns: minmax(0,1fr) 72px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff;
}
.collector-option-grid input {
  width: 72px; height: 38px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 9px;
  outline: none; text-align: center; background: #fff;
}
.collector-toggle {
  position: relative; grid-template-columns: minmax(0,1fr) auto; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff;
}
.collector-toggle input { position: absolute; opacity: 0; }
.collector-toggle i {
  position: relative; width: 38px; height: 22px;
  border-radius: 999px; background: #cfcdc7; transition: .2s ease;
}
.collector-toggle i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s ease;
}
.collector-toggle input:checked + i { background: var(--violet); }
.collector-toggle input:checked + i::after { transform: translateX(16px); }
.collector-options-card > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.date-limit-card {
  margin-top: 13px; padding: 14px;
  overflow: visible;
  border: 1px solid var(--line); border-radius: 15px;
  background: linear-gradient(145deg, #fbfaf7, #f7f5f1);
  transition: border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.date-limit-card.is-enabled {
  border-color: rgba(99,91,255,.3);
  background: linear-gradient(145deg, #fff, #f8f7ff);
  box-shadow: 0 9px 25px rgba(62,57,130,.07);
}
.date-limit-toggle { display: flex; align-items: center; justify-content: space-between; gap: 15px; cursor: pointer; }
.date-limit-toggle strong, .date-limit-toggle small { display: block; }
.date-limit-toggle strong { font-size: 12px; }
.date-limit-toggle small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.date-limit-toggle input { position: absolute; opacity: 0; }
.date-limit-toggle > i { position: relative; flex: 0 0 auto; width: 39px; height: 22px; border-radius: 999px; background: #d7d5d0; transition: .2s; }
.date-limit-toggle > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.16); transition: .2s; }
.date-limit-toggle input:checked + i { background: var(--violet); }
.date-limit-toggle input:checked + i::after { transform: translateX(17px); }
.date-range-inputs {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto;
  align-items: end; gap: 9px;
  max-height: 90px; margin-top: 12px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height .24s ease, margin .24s ease, opacity .18s ease, transform .24s ease;
}
.date-range-inputs label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.date-range-inputs input {
  width: 100%; min-height: 38px;
  padding: 9px 34px 9px 11px;
  border: 1px solid #dedbe8; border-radius: 11px; outline: none;
  color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='5' width='18' height='16' rx='3' stroke='%23635BFF' stroke-width='1.8'/%3E%3Cpath d='M3 9H21M8 3V7M16 3V7' stroke='%23635BFF' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: .18s ease;
}
.date-range-inputs input:hover { border-color: #bdb8dc; background-color: #fcfbff; }
.date-range-inputs input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,91,255,.09); }
.date-range-inputs input:disabled { cursor: default; }
.date-range-inputs > b { align-self: center; margin-top: 14px; color: var(--muted); font-size: 11px; }
.date-limit-card > p {
  max-height: 30px;
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--muted); font-size: 11px; line-height: 1.55;
  opacity: 1;
  transition: max-height .24s ease, margin .24s ease, opacity .18s ease;
}
.date-limit-card:not(.is-enabled) .date-range-inputs {
  max-height: 0; margin-top: 0;
  overflow: hidden;
  opacity: 0; transform: translateY(-5px);
  pointer-events: none;
}
.date-limit-card:not(.is-enabled) > p { max-height: 0; margin-top: 0; opacity: 0; pointer-events: none; }

.date-picker-popover {
  position: fixed; z-index: 1000;
  width: 292px;
  padding: 13px;
  border: 1px solid rgba(108,101,186,.2); border-radius: 18px;
  color: var(--ink);
  background: rgba(255,255,255,.97);
  box-shadow: 0 22px 70px rgba(25,25,53,.2), 0 3px 12px rgba(25,25,53,.08);
  backdrop-filter: blur(18px);
  transform-origin: top center;
  animation: datePickerIn .18s ease-out;
}
@keyframes datePickerIn { from { opacity: 0; transform: translateY(-5px) scale(.97); } }
.date-picker-head { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 6px; margin-bottom: 10px; }
.date-picker-head strong { text-align: center; font-size: 12px; letter-spacing: .2px; }
.date-picker-nav {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 10px;
  color: #5f5c73; background: #f5f3fa;
  cursor: pointer; transition: .16s ease;
}
.date-picker-nav:hover { border-color: #d8d4f0; color: var(--violet); background: var(--violet-soft); }
.date-picker-week, .date-picker-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.date-picker-week { margin-bottom: 5px; }
.date-picker-week span { padding: 4px 0; color: #9995aa; text-align: center; font-size: 11px; font-weight: 700; }
.date-picker-day {
  position: relative;
  aspect-ratio: 1;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  color: #353348; background: transparent;
  font-size: 12px; cursor: pointer;
  transition: .14s ease;
}
.date-picker-day:hover { color: var(--violet); background: #f0eeff; transform: translateY(-1px); }
.date-picker-day.is-outside { color: #c5c2cc; }
.date-picker-day.is-today { box-shadow: inset 0 0 0 1px #aaa5ff; color: var(--violet); font-weight: 800; }
.date-picker-day.is-selected { color: #fff; background: linear-gradient(145deg, #7d75ff, #5f56ed); box-shadow: 0 5px 13px rgba(99,91,255,.27); font-weight: 800; }
.date-picker-day.is-selected:hover { color: #fff; }
.date-picker-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; padding-top: 10px; border-top: 1px solid #eceaf1; }
.date-picker-foot button {
  padding: 6px 9px; border: 0; border-radius: 8px;
  color: var(--violet); background: transparent;
  font-size: 11px; font-weight: 700; cursor: pointer;
}
.date-picker-foot button:hover { background: var(--violet-soft); }
.topic-count-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 9px;
  margin: 14px 0 6px;
  padding: 11px;
  border: 1px solid #e7e4f1;
  border-radius: 15px;
  background: linear-gradient(145deg, #fbfaff, #f7f6fc);
}
.topic-count-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) 54px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e5e2ec;
  border-radius: 12px;
  background: #fff;
}
.topic-count-card strong, .topic-count-card small { display: block; }
.topic-count-card strong { font-size: 12px; }
.topic-count-card small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.topic-count-icon {
  width: 31px; height: 31px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--violet); background: var(--violet-soft);
  font-size: 11px; font-weight: 800;
}
.topic-count-icon.publish { color: #b84f42; background: #fff0ec; }
.topic-count-card input {
  width: 54px; min-height: 36px;
  padding: 5px 4px 5px 9px;
  border: 1px solid #dcd8e8; border-radius: 10px; outline: none;
  color: var(--ink); background: #faf9ff;
  font-size: 13px; font-weight: 800; text-align: center;
}
.topic-count-card input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,91,255,.09); }
.topic-count-settings > p {
  grid-column: 1 / -1;
  margin: 1px 3px 0;
  color: #66637a;
  font-size: 11px; line-height: 1.55;
}
.toggle-list { display: grid; gap: 1px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 3px; border-top: 1px solid #eceae5; cursor: pointer; }
.toggle-row:first-child { border-top: 0; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row > i { position: relative; flex: 0 0 auto; width: 39px; height: 22px; border-radius: 999px; background: #d7d5d0; transition: .2s; }
.toggle-row > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.16); transition: .2s; }
.toggle-row input:checked + i { background: var(--violet); }
.toggle-row input:checked + i::after { transform: translateX(17px); }
.toggle-row.is-disabled { opacity: .45; pointer-events: none; }
.danger-soft strong { color: #b7414d; }
.command-preview { margin-top: 16px; padding: 12px; border-radius: 12px; background: #20213d; color: #d5d6e4; }
.command-preview span { display: block; margin-bottom: 6px; color: #85879c; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.command-preview code { font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.job-console-panel { min-height: 380px; }
.job-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 999px; color: var(--muted); background: #efede8; font-size: 11px; font-weight: 800; }
.job-status span { width: 7px; height: 7px; border-radius: 50%; background: #aaa; }
.job-status.running { color: #6e51ba; background: #efeaff; }
.job-status.running span { background: var(--violet); animation: blink 1.1s infinite; }
.job-status.success { color: #21734d; background: #e8f7ef; }
.job-status.success span { background: var(--green); }
.job-status.failed { color: #a93242; background: #fdecef; }
.job-status.failed span { background: var(--red); }
@keyframes blink { 50% { opacity: .25; } }
.job-meta { min-height: 20px; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.job-console {
  height: 238px; margin: 0; padding: 16px;
  overflow: auto;
  border: 1px solid #30314f; border-radius: 14px;
  color: #d9dbea; background: #18192d;
  font: 12px/1.65 Consolas, "Cascadia Code", monospace;
  white-space: pre-wrap; word-break: break-word;
}
.job-console > span { color: #777991; }
.job-actions { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.job-actions .text-button { margin-left: auto; }
.tool-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.tool-card {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  padding: 12px;
  border: 1px solid var(--line); border-radius: 13px;
  background: #fff; text-align: left; cursor: pointer;
}
.tool-card:hover { border-color: #c7c3da; background: #fbfaff; }
.tool-card > span { grid-row: span 2; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: var(--violet); background: var(--violet-soft); font-size: 11px; font-weight: 800; }
.tool-card strong { font-size: 12px; }
.tool-card small { color: var(--muted); font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; gap: 16px; align-items: start; }
.android-only { display: none !important; }
html.android-standalone .android-only { display: block !important; }
.provider-panel { grid-column: span 2; }
.query-pool-panel { grid-column: span 2; }
.command-help { grid-column: span 2; }
.query-pool-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.query-pool-item { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #faf9f6; }
.query-pool-item > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 12px; font-weight: 800; }
.query-pool-item small { color: var(--muted); font-size: 11px; font-weight: 600; }
.query-pool-item textarea { width: 100%; min-height: 92px; resize: vertical; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--ink); background: #fff; font-size: 12px; line-height: 1.65; }
.query-pool-item textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,91,255,.1); }
.query-pool-status { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
html.android-standalone .server-only { display: none !important; }
.weibo-auth-panel .panel-head { align-items: center; }
.weibo-auth-panel .primary { width: 100%; }
.provider-help { margin: -2px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.provider-help code { color: var(--violet); font-weight: 700; }
.provider-list { display: grid; }
.provider-row { display: grid; grid-template-columns: auto minmax(105px,.75fr) minmax(190px,1.25fr) minmax(160px,1fr) auto; align-items: center; gap: 14px; padding: 14px 2px; border-top: 1px solid var(--line); }
.provider-row:first-child { border-top: 0; }
.provider-rank { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--violet); background: var(--violet-soft); font-size: 12px; font-weight: 800; }
.provider-row strong, .provider-row small, .provider-model span, .provider-metrics span { display: block; }
.provider-row strong { font-size: 12px; }
.provider-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.provider-model span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.provider-model select { width: 100%; min-width: 0; padding: 8px 28px 8px 9px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: #fff; font-size: 11px; }
.provider-model select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,91,255,.09); }
.provider-model select:disabled { color: #aaa; background: #f5f3ee; }
.provider-balance { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.provider-balance b { margin-right: 6px; color: var(--muted); font-size: 11px; }
.provider-check-time { margin-top: 5px; color: var(--muted); font-size: 11px; }
.provider-actions { display: grid; justify-items: end; gap: 7px; }
.provider-state { font-size: 11px; font-weight: 800; }
.provider-state.ok { color: var(--green); }
.provider-state.error { color: var(--red); }
.provider-state.off { color: #aaa; }
.system-status { display: grid; gap: 10px; }
.system-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 12px; background: #f7f5f1; font-size: 12px; }
.system-row b { font-size: 12px; }
.system-row span { color: var(--muted); }
.copy-command { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; padding: 12px 14px; border-radius: 12px; color: #d8d9e6; background: #20213d; }
.copy-command code { font-size: 12px; }
.copy-command button { border: 0; color: #a6a1ff; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.command-help p { color: var(--muted); font-size: 12px; }
.command-help .note { padding: 11px 13px; border-left: 3px solid var(--violet); background: var(--violet-soft); color: #575477; line-height: 1.6; }

.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  padding: 0;
  overflow: hidden;
  border: 0; border-radius: 23px;
  color: var(--ink); background: var(--surface);
  box-shadow: 0 28px 90px rgba(20,21,43,.36);
}
.modal::backdrop { background: rgba(20,21,39,.55); backdrop-filter: blur(5px); }
.modal[open] { animation: modalIn .22s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 4px 0 0; font-size: 18px; }
.modal-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; font-size: 22px; }
.modal-body { max-height: calc(86vh - 150px); padding: 22px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 18px; }
.detail-fact { padding: 12px; border-radius: 12px; background: #f5f3ee; }
.detail-fact span, .detail-fact strong { display: block; }
.detail-fact span { color: var(--muted); font-size: 11px; letter-spacing: .8px; text-transform: uppercase; }
.detail-fact strong { margin-top: 5px; font-size: 12px; word-break: break-all; }
.detail-section { margin-top: 17px; }
.detail-section h4 { margin: 0 0 7px; font-size: 12px; }
.detail-section p, .detail-section pre { margin: 0; color: #555662; font-size: 12px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.detail-section pre { max-height: 280px; overflow: auto; padding: 13px; border-radius: 12px; color: #d8d9e6; background: #20213d; font: 11px/1.6 Consolas, monospace; }
.sample-list { display: grid; gap: 9px; }
.sample-item { padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: #faf9f6; }
.sample-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.sample-head b { font-size: 12px; }
.sample-head span { flex: none; color: var(--muted); font-size: 11px; }
.sample-item p { margin: 0; color: #555662; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.sample-item a, .detail-link { display: inline-flex; margin-top: 8px; color: var(--violet); font-size: 12px; font-weight: 800; text-decoration: none; }
.related-post { padding: 16px; border: 1px solid #ddd8ff; border-radius: 16px; background: #faf9ff; }
.related-post .detail-grid { margin: 10px 0 14px; }
.draft-source-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.draft-source-list span { max-width: 100%; padding: 5px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; color: #575477; background: var(--violet-soft); font-size: 11px; }
.draft-editor > span { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.draft-editor b { color: var(--violet); }
.draft-editor b.over { color: var(--red); }
.draft-editor textarea { width: 100%; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: #fff; font-size: 12px; line-height: 1.75; }
.draft-editor textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,91,255,.1); }
.publish-notice { margin-top: 13px; padding: 12px 14px; border: 1px solid #f0d6aa; border-radius: 12px; background: #fff8ea; }
.publish-notice strong { color: #895c14; font-size: 12px; }
.publish-notice p { margin: 4px 0 0; color: #7c6a4d; font-size: 11px; line-height: 1.65; }
.delete-target-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: #f5f3ee; }
.delete-target-card > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #b83f4c; background: #ffedef; font-size: 11px; font-weight: 800; }
.delete-target-card strong, .delete-target-card small { display: block; }
.delete-target-card strong { font-size: 12px; }
.delete-target-card small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.delete-time-section { margin-top: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; }
.delete-time-section > label > span { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.delete-time-section input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: #fff; font-size: 12px; }
.delete-time-section input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,91,255,.09); }
.quick-time-options { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.quick-time-options button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: #5f606f; background: #fff; font-size: 11px; cursor: pointer; }
.quick-time-options button:hover { color: var(--violet); border-color: #c8c4ff; }
.delete-time-section p { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.delete-warning { margin-top: 15px; padding: 13px 14px; border: 1px solid #f0bdc3; border-radius: 13px; background: #fff2f3; }
.delete-warning strong { color: #ad3442; font-size: 12px; }
.delete-warning p { margin: 4px 0 0; color: #815a5f; font-size: 11px; line-height: 1.65; }
.delete-confirm-input { display: block; margin-top: 14px; }
.delete-confirm-input span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.delete-confirm-input b { color: var(--red); letter-spacing: .6px; }
.delete-confirm-input input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; text-transform: uppercase; }
.delete-confirm-input input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(217,77,90,.08); }
.confirm-check { display: flex; align-items: center; gap: 9px; margin-top: 15px; font-size: 12px; cursor: pointer; }
.confirm-check input { accent-color: var(--violet); }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 9px; }
.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border-radius: 13px; color: #fff; background: #292a44; box-shadow: var(--shadow); font-size: 12px; line-height: 1.5; animation: toastIn .2s ease; }
.toast.success { border-left: 4px solid #49d291; }
.toast.error { border-left: 4px solid #ff6874; }
@keyframes toastIn { from { opacity: 0; transform: translateX(10px); } }
.weibo-auth-prompt {
  position: fixed; z-index: 105; left: 272px; bottom: 22px;
  width: min(390px, calc(100vw - 294px));
  display: grid; grid-template-columns: auto minmax(0,1fr); gap: 11px 12px; align-items: start;
  padding: 17px; border: 1px solid rgba(255,104,116,.38); border-radius: 17px;
  color: #fff; background: linear-gradient(145deg, #292a44, #20213a);
  box-shadow: 0 20px 55px rgba(20,21,43,.32); animation: authPromptIn .22s ease;
}
.weibo-auth-prompt[hidden] { display: none; }
.weibo-auth-prompt-icon {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 11px; color: #fff; background: #ff6874; font-size: 13px; font-weight: 900;
}
.weibo-auth-prompt-copy strong { display: block; padding-right: 22px; font-size: 13px; }
.weibo-auth-prompt-copy p { margin: 4px 0 0; color: #c7c8d7; font-size: 12px; line-height: 1.55; }
.weibo-auth-prompt-copy small { display: block; margin-top: 7px; color: #a9a5ff; font-size: 12px; font-weight: 800; letter-spacing: .4px; }
.weibo-auth-prompt-action {
  grid-column: 1 / -1; min-height: 38px; border: 0; border-radius: 11px;
  color: #fff; background: var(--violet); font-size: 12px; font-weight: 800; cursor: pointer;
}
.weibo-auth-prompt-action:hover { background: #746af8; }
.weibo-auth-prompt-action:disabled { opacity: .62; cursor: wait; }
.weibo-auth-prompt-link {
  grid-column: 1 / -1; color: #b7b3ff; font-size: 12px; font-weight: 700; text-align: center; text-decoration: none;
}
.weibo-auth-prompt-link:hover { color: #fff; }
.weibo-auth-prompt-link[hidden] { display: none; }
.weibo-auth-prompt-close {
  position: absolute; top: 8px; right: 9px; width: 27px; height: 27px;
  border: 0; color: #aeb0c3; background: transparent; font-size: 19px; cursor: pointer;
}
@keyframes authPromptIn { from { opacity: 0; transform: translateY(9px); } }
.empty-state { min-height: 160px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.stats-grid.is-unavailable { grid-template-columns: 1fr; }
.stats-grid.is-unavailable .empty-state { min-height: 92px; padding: 16px; border: 1px dashed #d9d5e5; border-radius: 16px; background: #faf9f6; }
.dashboard-grid .empty-state { min-height: 112px; }
.history-content .empty-state { min-height: 170px; }
.history-pagination[hidden] { display: none !important; }
.empty-state b { color: var(--ink); font-size: 14px; }
.empty-state p { margin: 7px 0 0; font-size: 12px; }
.skeleton, .loading-block { position: relative; overflow: hidden; }
.skeleton::after, .loading-block:empty::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.65) 45%, transparent 70%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .hero-grid-overlay, .hero-live-dot, .hero-hot-word::after, .hero-glitch,
  .telemetry-cursor, .pulse-core, .pulse-core::before, .pulse-core::after,
  .orbit-one, .orbit-two, .orbit-three, .radar-sweep, .float-tag, .data-particle {
    animation: none !important;
  }
  .hero-radar, .date-range-inputs, .content, .pull-refresh { transition: none !important; }
  html.android-standalone .is-loading::before,
  html.android-standalone .pull-refresh.is-refreshing .pull-refresh-disc span { animation-duration: 1.5s !important; }
}

@media (max-width: 1100px) {
  .sidebar { width: 215px; }
  .main { margin-left: 215px; }
}

@media (max-width: 1020px) {
  .dashboard-grid, .operations-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .hero-card { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .provider-panel { grid-column: auto; }
  .query-pool-panel { grid-column: auto; }
  .query-pool-grid { grid-template-columns: 1fr; }
  .command-help { grid-column: auto; }
  .provider-row { grid-template-columns: auto minmax(100px,.7fr) minmax(170px,1.3fr); }
  .provider-metrics { grid-column: 2 / 3; }
  .provider-actions { grid-column: 3 / 4; grid-row: 2; }
  .query-stage-grid, .execution-stage-grid { grid-template-columns: 1fr; }
  .query-stage-grid { grid-template-areas: "custom" "tags" "collector" "date"; }
  .query-stage .collector-option-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .job-area { grid-template-columns: 1fr; }
  .job-area .tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .sidebar-toggle { display: none; }
  .sidebar {
    inset: auto 0 0 0; width: auto; height: 68px;
    padding: 7px 10px;
    flex-direction: row; align-items: center;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .brand, .sidebar-foot { display: none; }
  .main-nav { width: 100%; grid-template-columns: repeat(4,1fr); gap: 3px; }
  .nav-item { justify-content: center; flex-direction: column; gap: 1px; padding: 5px 2px; font-size: 12px; }
  .nav-item.is-active { box-shadow: inset 0 3px #8e88ff; }
  .nav-icon { height: 22px; font-size: 17px; }
  .main { margin: 0 0 68px; }
  body.sidebar-collapsed .sidebar { width: auto; padding: 7px 10px; }
  body.sidebar-collapsed .main { margin: 0 0 68px; }
  body.sidebar-collapsed .nav-label { display: inline; }
  body.sidebar-collapsed .nav-item { justify-content: center; flex-direction: column; gap: 1px; padding: 5px 2px; }
  body.sidebar-collapsed .nav-item.is-active { box-shadow: inset 0 3px #8e88ff; }
  .topbar { min-height: 70px; padding: 13px 16px; }
  .topbar h1 { font-size: 19px; }
  .topbar-actions .live-pill, .topbar-actions .primary { display: none; }
  .content { padding: 18px 14px 65px; }
  html.android-standalone .content.pull-refresh-moving { will-change: transform; }
  html.android-standalone #view-dashboard .hero-card,
  html.android-standalone .section-intro { display: none; }
  html.android-standalone .pull-refresh {
    --pull-progress: 0;
    position: fixed; z-index: 14;
    top: 74px; left: 50%;
    display: flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 12px 0 6px;
    border: 1px solid rgba(99,91,255,.16);
    border-radius: 999px;
    color: #5d57cf;
    background: rgba(255,255,255,.94);
    box-shadow: 0 9px 24px rgba(36,34,76,.12);
    opacity: 0;
    transform: translate(-50%, -28px) scale(calc(.72 + var(--pull-progress) * .28));
    transition: opacity .16s ease, transform .16s ease;
    pointer-events: none;
  }
  html.android-standalone .pull-refresh.is-visible {
    opacity: calc(.3 + var(--pull-progress) * .7);
    transform: translate(-50%, calc(-20px + var(--pull-progress) * 32px)) scale(calc(.72 + var(--pull-progress) * .28));
  }
  html.android-standalone .pull-refresh-disc {
    position: relative;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--violet) calc(var(--pull-progress) * 1turn), #eceaff 0);
    transform: scale(calc(.62 + var(--pull-progress) * .38));
  }
  html.android-standalone .pull-refresh-disc::before {
    content: "";
    position: absolute;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
  }
  html.android-standalone .pull-refresh-disc span {
    position: relative; z-index: 1;
    font-size: 16px; line-height: 1;
    transform: rotate(calc(var(--pull-progress) * 240deg));
  }
  html.android-standalone .pull-refresh small { font-size: 12px; font-weight: 800; white-space: nowrap; }
  html.android-standalone .pull-refresh.is-armed { color: #fff; background: var(--violet); border-color: var(--violet); }
  html.android-standalone .pull-refresh.is-armed .pull-refresh-disc { background: rgba(255,255,255,.24); }
  html.android-standalone .pull-refresh.is-armed .pull-refresh-disc::before { background: transparent; }
  html.android-standalone .pull-refresh.is-refreshing {
    --pull-progress: 1;
    opacity: 1;
    color: #fff; background: var(--violet); border-color: var(--violet);
    transform: translate(-50%, 12px) scale(1);
  }
  html.android-standalone .pull-refresh.is-refreshing .pull-refresh-disc { background: rgba(255,255,255,.2); }
  html.android-standalone .pull-refresh.is-refreshing .pull-refresh-disc::before { display: none; }
  html.android-standalone .pull-refresh.is-refreshing .pull-refresh-disc span { animation: buttonSpin .75s linear infinite; }
  .hero-card { min-height: auto; }
  .hero-copy { padding: 28px 24px; }
  .hero-copy h2 { font-size: 27px; letter-spacing: -1px; }
  .hero-actions { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .stat-card { min-height: 112px; padding: 15px; }
  .stat-value strong { font-size: 24px; }
  .section-intro { display: block; padding-top: 0; }
  .section-intro > p { margin-top: 13px; }
  .section-intro h2 { font-size: 29px; }
  .history-toolbar { display: grid; }
  .segmented { overflow-x: auto; }
  .segmented button { min-width: 83px; }
  .toolbar-filters { display: grid; grid-template-columns: 1fr auto; }
  .search-box { min-width: 0; }
  .history-date-filter { grid-column: 1 / -1; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto; }
  .history-date-filter input { width: 100%; }
  .history-pagination {
    grid-template-columns: 1fr auto;
    grid-template-areas: "size meta" "pages pages";
    gap: 10px; padding: 11px;
  }
  .page-size-control { grid-area: size; }
  .pagination-actions { grid-area: pages; }
  .page-meta { grid-area: meta; }
  html.android-standalone .history-toolbar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    justify-items: stretch;
    align-items: stretch;
  }
  html.android-standalone .segmented { width: 100%; min-width: 0; }
  html.android-standalone .segmented button { min-width: 0; flex: 1 1 0; text-align: center; }
  html.android-standalone .toolbar-filters {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  html.android-standalone .search-box { grid-column: 1 / 3; }
  html.android-standalone .history-date-filter {
    grid-column: 1 / 3;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
    padding: 7px 9px;
  }
  html.android-standalone .history-date-filter label { min-height: 36px; }
  html.android-standalone .history-date-filter .history-date-clear {
    grid-column: 1 / 4; min-height: 34px;
  }
  html.android-standalone .toolbar-filters select,
  html.android-standalone #deleteByTimeButton {
    width: 100%; min-height: 42px;
    display: flex; align-items: center; justify-content: center;
    text-align: center; text-align-last: center;
  }
  html.android-standalone .toolbar-filters select { grid-column: 1 / 2; min-width: 0; }
  html.android-standalone #deleteByTimeButton { grid-column: 2 / 3; }
  html.android-standalone .history-summary {
    gap: 9px;
    flex-wrap: wrap;
  }
  html.android-standalone .history-summary > span { flex: 1 1 210px; }
  html.android-standalone .history-summary .text-button { margin-left: auto; }
  html.android-standalone .history-pagination { margin-bottom: 82px; }
  html.android-standalone .pagination-actions { max-width: 100%; overflow-x: auto; padding: 2px; }
  html.android-standalone .pagination-actions button { flex: 0 0 34px; width: 34px; height: 34px; }
  .topic-card { grid-template-columns: auto minmax(0,1fr); padding: 15px; }
  .topic-action { display: none; }
  .selection-tray { bottom: 77px; grid-template-columns: auto 1fr auto; width: calc(100% - 24px); }
  .selection-tray .secondary, .selection-tray .selection-stack { display: none; }
  .selection-stack { display: none; }
  .selection-tray .danger-outline { grid-column: 1 / 2; grid-row: 2; }
  .selection-tray .primary { grid-column: 2 / 4; grid-row: 2; }
  .operations-layout { grid-template-columns: 1fr; }
  .query-stage .focus-tag-grid { grid-template-columns: 1fr; }
  .query-stage .collector-option-grid { grid-template-columns: 1fr; }
  .execution-actions { padding: 4px 12px 12px; }
  .job-area .tool-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .focus-tag-grid { grid-template-columns: 1fr; }
  .focus-tag-option strong { font-size: 12px; }
  .focus-tag-option small { font-size: 12px; }
  .collector-option-grid { grid-template-columns: 1fr; }
  .collector-section-title { display: grid; gap: 3px; }
  .collector-option-grid > label { grid-template-columns: minmax(0,1fr) 64px; }
  .collector-option-grid input { width: 64px; }
  .topic-count-settings { grid-template-columns: 1fr; }
  .topic-count-card { grid-template-columns: auto minmax(0,1fr) 60px; }
  .topic-count-card strong { font-size: 12px; }
  .topic-count-card small, .topic-count-settings > p { font-size: 11px; }
  .topic-count-card input { width: 60px; }
  .toggle-row strong { font-size: 12px; }
  .toggle-row small { font-size: 11px; }
  .date-limit-toggle small, .date-limit-card > p { font-size: 11px; }
  .date-range-inputs { grid-template-columns: 1fr auto 1fr; }
  .date-range-inputs .text-button { grid-column: 1 / 4; justify-self: start; }
  .date-picker-popover { width: min(292px, calc(100vw - 24px)); }
  .settings-grid { grid-template-columns: 1fr; }
  .query-pool-grid { grid-template-columns: 1fr; }
  .provider-row { grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; }
  .provider-row strong { font-size: 12px; }
  .provider-row small, .provider-model span, .provider-check-time { font-size: 11px; }
  .provider-model select, .provider-balance { font-size: 12px; }
  .provider-model { grid-column: 2 / 4; }
  .provider-metrics { grid-column: 2 / 3; }
  .provider-actions { grid-column: 3 / 4; grid-row: 3; }
  .detail-grid { grid-template-columns: 1fr; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot button { width: 100%; }
  .toast-region { right: 12px; left: 12px; bottom: 82px; }
  .toast { min-width: 0; max-width: none; }
  .weibo-auth-prompt { left: 12px; right: 12px; bottom: 82px; width: auto; }
}
.search-credit-estimate {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 130, 0, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 130, 0, 0.10), rgba(255, 255, 255, 0.72));
}

.search-credit-estimate.is-over-balance {
  border-color: rgba(215, 66, 66, 0.35);
  background: linear-gradient(135deg, rgba(215, 66, 66, 0.10), rgba(255, 255, 255, 0.72));
}

.search-credit-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: #ff8200;
  color: white;
  font: 800 15px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.search-credit-estimate div {
  min-width: 0;
}

.search-credit-estimate strong,
.search-credit-estimate small {
  display: block;
}

.search-credit-estimate strong {
  color: var(--ink, #20222d);
  font-size: 13px;
}

.search-credit-estimate small {
  margin-top: 4px;
  color: var(--muted, #797b87);
  font-size: 12px;
  line-height: 1.5;
}

.weibo-credit-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  gap: 14px;
  margin: 16px 0;
}

.weibo-credit-balance,
.weibo-credit-meta {
  border: 1px solid rgba(31, 34, 45, 0.08);
  border-radius: 18px;
  background: rgba(247, 247, 244, 0.82);
  padding: 18px;
}

.weibo-credit-balance span,
.weibo-credit-balance small {
  display: block;
  color: var(--muted, #797b87);
}

.weibo-credit-balance span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.weibo-credit-balance strong {
  display: block;
  margin: 8px 0 7px;
  color: #ff8200;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.weibo-credit-balance small {
  font-size: 12px;
}

.weibo-credit-meta {
  display: grid;
  align-content: center;
  gap: 13px;
}

.weibo-credit-meta p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  font-size: 12px;
}

.weibo-credit-meta span {
  color: var(--muted, #797b87);
}

.weibo-credit-meta strong {
  color: var(--ink, #20222d);
  text-align: right;
}

.weibo-credit-cost-list {
  display: grid;
  gap: 10px;
}

.weibo-credit-cost-item {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 5px 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(31, 34, 45, 0.08);
  border-radius: 15px;
}

.weibo-credit-cost-item div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.weibo-credit-cost-item strong {
  color: var(--ink, #20222d);
  font-size: 13px;
}

.weibo-credit-cost-item code {
  color: var(--muted, #797b87);
  font-size: 12px;
}

.weibo-credit-cost-item b {
  color: #ff8200;
  font-size: 13px;
  white-space: nowrap;
}

.weibo-credit-cost-item small {
  grid-column: 1 / -1;
  color: var(--muted, #797b87);
  font-size: 12px;
  line-height: 1.5;
}

.weibo-credit-note {
  margin-top: 14px;
}

.weibo-credit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}

.weibo-credit-links a {
  color: #d96e00;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.weibo-credit-links a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .weibo-credit-summary {
    grid-template-columns: 1fr;
  }

  .weibo-credit-cost-item {
    grid-template-columns: 1fr;
  }

  .weibo-credit-cost-item small {
    grid-column: auto;
  }
}
