:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #dbe3ec;
  --line-strong: #b9c6d4;
  --text: #16202d;
  --muted: #657386;
  --primary: #1f5f99;
  --primary-strong: #17466f;
  --teal: #0f766e;
  --green: #157347;
  --amber: #9a6700;
  --red: #b42318;
  --shadow: 0 10px 28px rgba(22, 32, 45, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.notification-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.notification-toast {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 14px 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(22, 32, 45, 0.16);
  pointer-events: auto;
}

.notification-toast::before {
  content: "";
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.notification-toast[data-tone="success"]::before {
  background: var(--green);
}

.notification-toast[data-tone="error"]::before {
  background: var(--red);
}

.notification-toast[data-tone="warning"]::before {
  background: var(--amber);
}

.notification-toast span {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.notification-toast button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.notification-toast button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(8, 17, 31, 0.97), rgba(18, 39, 57, 0.94)),
    #08111f;
}

.boot-card {
  width: min(360px, 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
}

.boot-card strong,
.boot-card span {
  display: block;
}

.boot-card span {
  margin-top: 4px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 13px;
}

.auth-screen {
  --auth-bg-image: url("/static/auth-backgrounds/auth-bg-01.jpg");
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 30px 38px;
  background:
    linear-gradient(115deg, rgba(4, 11, 22, 0.96), rgba(10, 24, 38, 0.84)),
    var(--auth-bg-image) center / cover no-repeat,
    #08111f;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: -24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(219, 185, 105, 0.20), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(42, 190, 164, 0.18), transparent 30%),
    var(--auth-bg-image) center / cover no-repeat;
  filter: blur(22px) saturate(1.08);
  opacity: 0.58;
  transform: scale(1.04);
}

.auth-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 9, 18, 0.48), rgba(3, 9, 18, 0.12) 48%, rgba(244, 248, 252, 0.34)),
    radial-gradient(circle at center, transparent 0, rgba(2, 8, 16, 0.44) 100%);
}

.auth-layout {
  width: min(1120px, 100%);
  min-height: 660px;
  display: grid;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(420px, 1.05fr) minmax(430px, 0.9fr);
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: rgba(246, 249, 252, 0.72);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.auth-hero {
  min-width: 0;
  position: relative;
  display: grid;
  overflow: hidden;
  padding: 42px;
  background: #101b2a;
  color: #eef5fb;
}

.auth-visual-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 13, 24, 0.04), rgba(6, 13, 24, 0.58)),
    var(--auth-bg-image) center / cover no-repeat;
  transform: scale(1.01);
  transition: background-image 0.6s ease;
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 10, 20, 0.10), rgba(4, 10, 20, 0.46)),
    radial-gradient(circle at 12% 20%, rgba(225, 194, 119, 0.22), transparent 28%),
    radial-gradient(circle at 78% 72%, rgba(42, 190, 164, 0.18), transparent 30%);
}

.auth-hero-inner {
  min-height: 100%;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
}

.auth-card {
  min-width: 0;
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 48px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.97)),
    #fff;
}

.auth-brand h1 {
  color: inherit;
  font-size: 21px;
}

.auth-brand p,
.auth-copy p {
  color: var(--muted);
}

.auth-quote-card span {
  color: rgba(232, 241, 248, 0.68);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
}

.auth-quote-card {
  align-self: center;
  justify-self: center;
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 13, 24, 0.58);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.daily-quote {
  min-height: 132px;
  color: #edf6ff;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 760;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.36);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #eef3f8;
}

.auth-tab {
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6a7788;
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
}

.auth-tab.is-active {
  background: #fff;
  color: #12243a;
  box-shadow: 0 6px 18px rgba(22, 32, 45, 0.10);
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h2 {
  font-size: 32px;
  font-weight: 780;
  letter-spacing: 0;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label span {
  color: #536275;
  font-size: 13px;
  font-weight: 760;
}

.auth-form input {
  height: 46px;
  padding: 0 13px;
  border-color: #d6e0ea;
  background: #fbfdff;
}

.auth-form input:focus {
  background: #fff;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: end;
}

.auth-code-row .button {
  width: 132px;
  min-width: 132px;
  white-space: nowrap;
}

.auth-code-status {
  grid-column: 1 / -1;
  min-height: 20px;
}

.captcha-row {
  grid-template-columns: minmax(0, 1fr) 148px;
}

.captcha-box {
  width: 148px;
  height: 46px;
  padding: 0;
  border: 1px solid #cbd7e4;
  border-radius: 8px;
  background: #f7f9fc;
  cursor: pointer;
  overflow: hidden;
}

.captcha-box img {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-status {
  min-height: 22px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: 20px 16px;
  background:
    linear-gradient(180deg, rgba(10, 18, 29, 0.98), rgba(6, 13, 24, 0.98)),
    #0b1522;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: #eaf0f6;
  box-shadow: 16px 0 36px rgba(9, 18, 30, 0.18);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(234, 240, 246, 0.10);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(234, 240, 246, 0.16),
    0 10px 24px rgba(5, 12, 22, 0.24);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 820;
}

.brand p {
  margin-top: 4px;
  font-size: 12px;
  color: #8ea0b2;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  padding-bottom: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(183, 197, 214, 0.38) transparent;
  -webkit-overflow-scrolling: touch;
}

.side-nav::-webkit-scrollbar {
  width: 8px;
}

.side-nav::-webkit-scrollbar-track {
  background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(183, 197, 214, 0.38);
  background-clip: content-box;
}

.side-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(220, 231, 242, 0.62);
  background-clip: content-box;
}

.nav-section {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(234, 240, 246, 0.09);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.02);
  box-shadow: 0 14px 26px rgba(4, 11, 20, 0.12);
  overflow: hidden;
  --nav-accent: #4fa3ff;
  --nav-accent-soft: rgba(79, 163, 255, 0.16);
}

.nav-section:nth-child(2) {
  --nav-accent: #25c4ad;
  --nav-accent-soft: rgba(37, 196, 173, 0.16);
}

.nav-section:nth-child(3) {
  --nav-accent: #a98cff;
  --nav-accent-soft: rgba(169, 140, 255, 0.16);
}

.nav-section:nth-child(4) {
  --nav-accent: #f0b35a;
  --nav-accent-soft: rgba(240, 179, 90, 0.16);
}

.nav-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nav-accent), rgba(255, 255, 255, 0.08));
  opacity: 0.95;
}

.nav-parent {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #dce7f2;
  cursor: pointer;
  font-size: 15px;
  font-weight: 820;
  letter-spacing: 0;
  text-align: left;
  min-width: 0;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.nav-parent::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), var(--nav-accent));
  box-shadow: 0 0 0 4px var(--nav-accent-soft);
  flex: none;
}

.nav-parent::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 1.75px solid currentColor;
  border-bottom: 1.75px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.82;
  transition: transform 0.16s ease;
}

.nav-parent:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: 0 12px 22px rgba(5, 12, 20, 0.12);
  transform: translateX(1px);
}

.nav-section.is-collapsed .nav-parent::after {
  transform: rotate(-45deg);
}

.nav-section.is-collapsed .nav-children {
  display: none;
}

.nav-children {
  display: grid;
  gap: 6px;
}

.side-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px 0 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: #d0dce7;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  min-width: 0;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.side-nav a::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(148, 166, 183, 0.78);
  flex: none;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.06);
  color: #fff;
  box-shadow: 0 10px 18px rgba(5, 12, 20, 0.08);
  transform: translateX(2px);
}

.side-nav a.is-active {
  background: linear-gradient(90deg, rgba(247, 250, 254, 0.98), rgba(225, 238, 250, 0.9));
  color: #0c2137;
  box-shadow: 0 10px 22px rgba(4, 12, 24, 0.22);
  transform: translateX(2px);
}

.side-nav a.is-active::before {
  background: var(--nav-accent);
  box-shadow: 0 0 0 4px var(--nav-accent-soft);
}

.sidebar-status {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(234, 240, 246, 0.10);
}

.sidebar-status .button {
  width: 100%;
}

.workspace {
  min-width: 0;
}

.workspace-header {
  display: none;
}

.workspace-header h2 {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 760;
}

.workspace-main {
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 16px;
  padding: 18px 30px 38px;
}

[data-view] {
  min-width: 0;
  scroll-margin-top: 128px;
}

.eyebrow,
.section-kicker {
  color: var(--teal);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.header-actions,
.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
}

.button-small {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.button-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.button-danger {
  background: #fff;
  border-color: #efb4ad;
  color: var(--red);
}

.button-ghost {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #dbe6f0;
}

.button-full {
  width: 100%;
}

.button:hover {
  filter: brightness(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.status-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #c6d1dc;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.workspace-header .status-chip,
.status-chip-amber {
  background: #fff4db;
  border-color: #f3dfad;
  color: var(--amber);
}

.status-chip-green {
  background: #e6f4ea;
  border-color: #cce8d5;
  color: var(--green);
}

.status-chip-blue {
  background: #e8f2ff;
  border-color: #c7dcf5;
  color: #175cd3;
}

.status-chip-red {
  background: #feecec;
  border-color: #f6c7c7;
  color: #b42318;
}

.toolbar-panel,
.intel-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intel-toolbar {
  padding: 12px;
}

.toolbar-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.intel-toolbar .search-field,
.intel-toolbar .toolbar-actions {
  grid-column: span 2;
}

label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 38px;
}

select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select[multiple] {
  height: auto;
  min-height: 86px;
  padding: 6px 8px;
  overflow: auto;
  white-space: normal;
}

select[multiple] option {
  max-width: 100%;
  overflow: hidden;
  padding: 4px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  min-height: 96px;
  padding: 10px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35, 94, 168, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.stat {
  min-height: 96px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 780;
}

.stat-footnote {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.primary-grid,
.two-col,
.intelligence-main,
.intelligence-secondary {
  display: grid;
  gap: 16px;
  align-items: start;
}

.primary-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.intelligence-main {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
}

.intel-primary .table-wrap {
  max-height: 560px;
  overflow: auto;
}

.compact-table-wrap {
  max-height: 320px;
  overflow: auto;
}

.intel-tabs {
  display: grid;
}

.intel-tabbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.intel-tab {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.intel-tab.is-active {
  background: var(--primary);
  color: #fff;
}

.intel-tab-panel {
  min-width: 0;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.panel-head h2 {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 740;
}

.crawler-form,
.import-box,
.config-box,
.detail-content,
.member-profile,
.updates-list {
  padding: 16px;
  display: grid;
  gap: 13px;
}

.crawler-rule-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.crawler-rule-strip div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.crawler-rule-strip span {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 760;
}

.crawler-rule-strip strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.crawler-rule-strip p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-wide {
  min-width: 0;
}

.form-row,
.ai-row,
.config-grid,
.ai-config-summary,
.detail-grid,
.crawl-summary {
  display: grid;
  gap: 10px;
}

.form-row {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.form-row-compact {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.45fr);
}

.form-row > * {
  min-width: 0;
}

.ai-row,
.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.ai-config-summary {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.ai-config-form {
  display: grid;
  gap: 12px;
}

.ai-config-form textarea {
  min-height: 120px;
  resize: vertical;
}

.ai-config-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.crawl-summary {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.crawler-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.platform-session-box {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.platform-session-box textarea {
  min-height: 82px;
  resize: vertical;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-row .check-row {
  min-width: 180px;
  flex: 1 1 180px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.form-submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.studio-form > .button {
  justify-self: start;
}

.inline-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.inline-status[data-tone="success"] {
  color: var(--green);
}

.inline-status[data-tone="error"] {
  color: var(--red);
}

.api-test-status {
  min-height: 20px;
  margin: 0;
}

.api-test-status[data-tone="success"] {
  color: var(--green);
}

.api-test-status[data-tone="error"] {
  color: var(--red);
}

.check-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.form-row > .check-row,
.ai-row > .check-row {
  align-self: end;
  min-height: 34px;
}

input[type="file"] {
  padding: 5px 8px;
}

input[type="file"]::file-selector-button {
  height: 24px;
  margin-right: 8px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
}

.inline-note {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.status-grid-note {
  grid-column: 1 / -1;
}

.cleanup-auxiliary-row {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.cleanup-maintenance {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.cleanup-maintenance summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.cleanup-maintenance summary::-webkit-details-marker {
  display: none;
}

.cleanup-maintenance summary::before {
  content: "›";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  border-radius: 50%;
  background: #eef5ff;
  color: var(--primary);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.cleanup-maintenance[open] summary::before {
  transform: rotate(90deg);
}

.cleanup-maintenance summary span {
  margin-right: auto;
}

.cleanup-maintenance summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cleanup-maintenance-body {
  display: grid;
  gap: 12px;
  padding: 8px 2px 2px;
}

.cleanup-policy-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.cleanup-policy-row label {
  min-width: 0;
}

.cleanup-policy-row input {
  min-width: 0;
}

.cleanup-maintenance-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}

.cleanup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.result-panel {
  min-height: 520px;
  order: -1;
}

.crawler-runs {
  max-height: 188px;
  overflow: auto;
  padding: 12px 16px;
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.crawler-runs-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.crawler-runs-toolbar-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.crawler-select-all {
  min-height: 30px;
}

.crawler-run-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.crawler-run-item:hover,
.crawler-run-item.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35, 94, 168, 0.08);
}

.crawler-run-select {
  display: flex;
  align-items: center;
  justify-content: center;
}

.crawler-run-select input,
.crawler-select-all input {
  width: 16px;
  height: 16px;
}

.crawler-run-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 6px 10px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.crawler-run-title {
  min-width: 0;
  font-weight: 720;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crawler-run-meta {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.crawler-run-actions {
  grid-column: 2;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.crawler-result {
  max-height: calc(100vh - 330px);
  min-height: 560px;
  overflow: auto;
  overflow-x: hidden;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.crawler-status-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  display: grid;
  gap: 12px;
}

.crawler-status-head {
  min-width: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.crawler-status-head > div {
  min-width: 0;
}

.crawler-status-title {
  font-size: 16px;
  font-weight: 780;
  line-height: 1.35;
}

.crawler-status-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 8px;
}

.diagnostic-item {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.diagnostic-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.diagnostic-item strong {
  min-width: 0;
  font-size: 18px;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crawler-signal-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #cddff2;
  border-radius: 8px;
  background: #fff;
}

.crawler-signal-strip div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.crawler-signal-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.crawler-signal-strip strong {
  min-width: 0;
  color: var(--primary-strong);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.keyword-rule span {
  min-width: 72px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.keyword-rule div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.keyword-rule b {
  font-weight: 700;
}

.crawler-diagnostics {
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.crawler-diagnostics summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--primary-strong);
}

.crawler-diagnostics p {
  margin-top: 8px;
  line-height: 1.6;
}

.crawler-log-panel,
.crawler-rejected-panel,
.crawler-result-stream {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.crawler-log-panel-primary {
  border-color: #b8d5f2;
  background: #f7fbff;
}

.crawler-log-head {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.crawler-log-head > div {
  min-width: 0;
}

.crawler-log-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.crawler-live-log {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 8px;
  scroll-behavior: smooth;
}

.crawler-page-list {
  display: grid;
  gap: 10px;
}

.crawler-page-group {
  display: grid;
  gap: 10px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--line);
}

.crawler-page-group:first-of-type {
  border-top: 0;
}

.crawler-page-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crawler-page-group-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.crawler-page-group-head strong {
  color: var(--text);
  font-size: 14px;
}

.crawler-page-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.crawler-page-group-head b {
  color: var(--primary-strong);
  font-size: 14px;
}

.crawler-diagnostics-block,
.crawler-rejected-panel {
  min-width: 0;
}

.crawler-diagnostics-block summary,
.crawler-rejected-panel summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 760;
}

.crawler-rejected-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.crawler-rejected-panel summary::-webkit-details-marker {
  display: none;
}

.crawler-rejected-panel summary::before {
  content: ">";
  color: var(--primary-strong);
  font-weight: 800;
}

.crawler-rejected-panel[open] summary::before {
  content: "v";
}

.crawler-rejected-panel summary span {
  flex: 1;
}

.crawler-rejected-panel summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.rejected-candidate-list {
  display: grid;
  gap: 8px;
}

.rejected-candidate {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fbfcfe;
  display: grid;
  gap: 6px;
}

.rejected-candidate-main {
  display: flex;
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.rejected-candidate-title {
  min-width: 0;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.4;
  word-break: break-word;
}

.rejected-reason {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff3d6;
  color: #8a5b00;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.rejected-candidate-meta,
.rejected-candidate-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.crawler-log-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fbfcfe;
  display: grid;
  gap: 6px;
}

.crawler-log-info {
  border-left-color: var(--primary);
}

.crawler-log-debug {
  border-left-color: var(--line-strong);
}

.crawler-log-warn {
  border-left-color: var(--amber);
}

.crawler-log-error {
  border-left-color: var(--red);
}

.crawler-log-main {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.crawler-log-time,
.crawler-log-level,
.crawler-log-details,
.crawler-log-row a {
  color: var(--muted);
  font-size: 12px;
}

.crawler-log-level {
  font-weight: 720;
}

.crawler-log-message {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.crawler-log-details,
.crawler-log-row a {
  line-height: 1.45;
  word-break: break-word;
}

.crawler-empty-state {
  padding: 14px 2px 6px;
}

.crawl-card {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.crawl-card:first-of-type {
  border-top: 0;
}

.crawl-title {
  color: var(--primary-strong);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.4;
}

.crawl-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.crawl-title-row .crawl-title {
  min-width: 0;
}

.crawl-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.crawl-summary-text {
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.update-entry {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.update-entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.update-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.update-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.update-entry h3 {
  margin-top: 9px;
  font-size: 16px;
  line-height: 1.35;
}

.update-entry ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.ai-review {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}

.ai-badge,
.score-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

.ai-badge {
  min-width: auto;
  height: 26px;
  background: #e8f0fe;
  color: var(--primary-strong);
}

.score-high,
.status-success {
  background: #e6f4ea;
  color: var(--green);
}

.score-mid,
.status-partial_success,
.status-skipped,
.status-queued,
.status-running,
.status-throttled,
.status-cancelled {
  background: #fff4db;
  color: var(--amber);
}

.score-low,
.status-failed {
  background: #fbeaea;
  color: var(--red);
}

.detail-panel {
  min-height: 540px;
}

.detail-item,
.config-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.crawl-summary .detail-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-item .label,
.config-item .label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 660;
}

.detail-item .value,
.config-item .value {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.crawl-summary .detail-item .value {
  font-size: 18px;
  font-weight: 780;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.insight-list,
.snapshot-list {
  display: grid;
  gap: 8px;
}

.insight,
.snapshot-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.table-wrap {
  min-width: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  min-height: 44px;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 720;
}

.compact-table th,
.compact-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.table-subtext {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f7fafc;
}

.sample {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.empty {
  padding: 18px 0;
  color: var(--muted);
  font-size: 14px;
}

.panel,
.stat,
.toolbar-panel,
.intel-toolbar {
  border-radius: var(--radius);
}

.panel-head {
  background: linear-gradient(180deg, #fbfcfe, #f5f8fb);
}

.section-kicker {
  color: #56728e;
  letter-spacing: 0.06em;
}

.studio-page {
  display: grid;
  gap: 16px;
}

.studio-panel {
  min-height: 600px;
}

.studio-form {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.proxy-row {
  align-items: end;
}

.proxy-hint {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.proxy-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.proxy-guide > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.proxy-guide strong {
  color: var(--text);
}

.proxy-guide span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.proxy-status-grid,
.smtp-status-grid,
.quota-monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.proxy-status-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.proxy-status-card span,
.proxy-status-card small {
  color: var(--muted);
  font-size: 12px;
}

.proxy-status-card strong {
  font-size: 20px;
  color: var(--text);
}

.proxy-status-card.is-ok {
  border-color: rgba(24, 128, 92, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f2fbf7 100%);
}

.proxy-status-card.is-warn {
  border-color: rgba(190, 111, 16, 0.32);
  background: linear-gradient(180deg, #ffffff 0%, #fff8ed 100%);
}

.studio-form textarea {
  resize: vertical;
}

.studio-form {
  padding: 16px;
}

.member-profile-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.member-profile-card strong {
  font-size: 22px;
}

.quota-card,
.onboarding-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quota-head,
.onboarding-head,
.panel-head-compact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.quota-head span,
.onboarding-head span {
  color: var(--muted);
  font-size: 12px;
}

.quota-grid,
.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.system-health-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.operations-report-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.operations-report-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.operations-report-head span {
  color: var(--muted);
  font-size: 12px;
}

.operations-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.operations-report-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.operations-report-card strong {
  color: var(--text);
}

.operations-report-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin: 0;
}

.operations-report-card div {
  min-width: 0;
}

.operations-report-card dt {
  color: var(--muted);
  font-size: 12px;
}

.operations-report-card dd {
  margin: 2px 0 0;
  color: var(--text);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.system-health-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.system-health-head div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.system-health-head span,
.system-health-head small,
.system-health-item span,
.system-health-item small {
  color: var(--muted);
  font-size: 12px;
}

.system-health-head strong,
.system-health-item strong {
  font-size: 13px;
}

.system-health-head .health-ok,
.system-health-item.health-ok strong {
  color: var(--green);
}

.system-health-head .health-warn,
.system-health-item.health-warn strong {
  color: var(--amber);
}

.system-health-head .health-error,
.system-health-item.health-error strong {
  color: var(--red);
}

.system-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.system-health-item {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.system-health-item div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.system-health-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

.system-health-item.health-warn {
  border-color: #f2c979;
  background: #fffaf0;
}

.system-health-item.health-error {
  border-color: #efb4ad;
  background: #fff5f3;
}

.quota-item,
.admin-stat-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.quota-item span,
.admin-stat-card span,
.admin-stat-card small {
  color: var(--muted);
  font-size: 12px;
}

.quota-item strong,
.admin-stat-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.12;
  color: var(--text);
}

.quota-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.onboarding-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.onboarding-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.onboarding-steps .is-done {
  border-color: rgba(21, 115, 71, 0.28);
  background: #eef8f1;
  color: var(--green);
}

.member-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.plan-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.plan-card h3 {
  font-size: 16px;
  font-weight: 760;
}

.plan-price {
  font-size: 24px;
  font-weight: 780;
  color: var(--primary-strong);
}

.plan-card p {
  color: var(--muted);
  font-size: 13px;
}

.plan-quota-list {
  display: grid;
  gap: 5px;
  margin: 2px 0 4px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.plan-quota-preview {
  align-self: stretch;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.plan-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 750;
}

.support-contact-card,
.inline-action-box {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.support-contact {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.support-contact-compact {
  grid-template-columns: 72px minmax(0, 1fr);
  padding: 10px;
}

.support-contact img,
.support-qr-placeholder {
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.support-contact-compact img,
.support-contact-compact .support-qr-placeholder {
  width: 72px;
  height: 72px;
}

.support-qr-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.support-contact strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.support-contact p,
.support-contact span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.support-contact .button {
  margin-top: 8px;
}

.order-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 0;
}

.order-summary-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.order-summary-card span,
.order-card-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.order-summary-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

.order-summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.order-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.82fr);
  gap: 14px;
  padding: 14px 16px 16px;
  align-items: start;
}

.order-list {
  display: grid;
  gap: 10px;
}

.order-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.order-card:hover,
.order-card.is-active {
  border-color: rgba(42, 105, 192, 0.36);
  box-shadow: 0 10px 24px rgba(25, 55, 92, 0.10);
  transform: translateY(-1px);
}

.order-card-main,
.order-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.order-card-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  word-break: break-all;
}

.order-card-meta,
.order-card-actions > span,
.order-card-grid small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-card-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.72fr 1fr;
  gap: 10px;
}

.order-card-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f7f9fc;
}

.order-card-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.order-card-actions > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.order-status {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef3f9;
  color: #526171;
  font-size: 12px;
  font-weight: 760;
}

.order-status-paid {
  background: #e7f7ee;
  color: #167247;
}

.order-status-pending {
  background: #fff5dc;
  color: #946413;
}

.order-status-expired,
.order-status-cancelled {
  background: #f2f4f7;
  color: #687382;
}

.order-detail-panel {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  position: sticky;
  top: 18px;
}

.order-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-action-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.inline-action-box .inline-status {
  grid-column: 1 / -1;
}

.support-upload-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto minmax(140px, 0.7fr);
  gap: 10px;
  align-items: end;
}

.referral-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.referral-stat-card {
  min-height: 96px;
}

.referral-invite-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
}

.referral-grid-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.5fr);
}

.referral-payout-panel {
  border-right: 1px solid var(--line);
}

.referral-payout-preview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 118px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.referral-payout-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.referral-payout-preview strong,
.referral-payout-preview span,
.referral-payout-preview small {
  display: block;
}

.referral-payout-preview span,
.referral-payout-preview small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.compact-form {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.compact-form .form-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.referral-withdraw-box {
  border-bottom: 0;
}

.referral-history-panel {
  min-width: 0;
}

.referral-history-panel .table-wrap + .table-wrap {
  border-top: 1px solid var(--line);
}

.referral-admin-config {
  border-bottom: 1px solid var(--line);
}

.referral-withdraw-toolbar {
  grid-template-columns: minmax(160px, 220px) auto;
}

.withdrawal-qr-cell {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.withdrawal-qr-cell img,
.withdrawal-qr-cell .support-qr-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 8px;
}

.withdrawal-qr-cell span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.support-qr-admin-preview {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.support-qr-admin-preview img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-subpanel {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.admin-plan-editor,
.admin-quota-editor,
.admin-proxy-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

#admin-proxy-section .proxy-master-switch,
#admin-proxy-status,
#admin-proxy-pool-editor,
#admin-smtp-status,
#admin-smtp-section .smtp-config-form {
  margin-left: 12px;
  margin-right: 12px;
}

#admin-proxy-section .proxy-master-switch {
  margin-top: 12px;
}

#admin-proxy-pool-editor {
  margin-bottom: 12px;
}

.admin-plan-row,
.quota-edit-row,
.proxy-pool-row {
  display: grid;
  grid-template-columns: 0.8fr 1fr 0.7fr 0.8fr 0.7fr;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.admin-plan-row .field-wide {
  grid-column: 1 / -1;
}

.quota-edit-row {
  grid-template-columns: minmax(120px, 0.7fr) repeat(3, minmax(132px, 1fr));
}

.quota-edit-row strong {
  grid-row: span 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding-right: 6px;
  line-height: 1.35;
}

.quota-edit-row label input {
  text-align: right;
}

.proxy-master-switch {
  margin-top: 10px;
}

.proxy-pool-row {
  grid-template-columns: 180px repeat(4, minmax(120px, 1fr));
}

.proxy-pool-row-head {
  align-self: stretch;
  display: grid;
  gap: 8px;
  align-content: center;
}

.proxy-pool-row-head > div {
  display: grid;
  gap: 3px;
}

.proxy-pool-row-head span {
  color: var(--muted);
  font-size: 12px;
}

.proxy-pool-row .field-wide {
  grid-column: 1 / -1;
}

.proxy-mode-field[hidden] {
  display: none;
}

.proxy-health {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.proxy-health small {
  color: var(--muted);
}

.health-ok {
  color: #087a55;
  font-weight: 700;
}

.health-warn {
  color: #b45309;
  font-weight: 700;
}

.proxy-row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.table-toolbar label {
  max-width: 220px;
}

.audit-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  align-items: end;
}

.audit-actions {
  display: flex;
  justify-content: flex-end;
}

.member-toolbar {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(120px, 0.8fr)) auto;
  align-items: end;
}

.member-actions {
  display: flex;
  justify-content: flex-end;
}

.order-toolbar {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(120px, 0.8fr)) auto;
  align-items: end;
}

.order-actions {
  display: flex;
  justify-content: flex-end;
}

.member-create-form {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.error-text {
  padding: 10px 12px;
  border: 1px solid #efb4ad;
  border-radius: var(--radius);
  background: #fff5f3;
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
}

.admin-help-strip,
.affiliate-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.admin-help-strip > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-help-strip strong {
  color: var(--text);
  font-size: 13px;
}

.admin-help-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.affiliate-strip-compact {
  padding-bottom: 0;
  border-bottom: 0;
}

.affiliate-role-callout {
  margin-top: -2px;
}

.affiliate-compact,
.affiliate-toolbar {
  align-self: end;
}

.affiliate-cta {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #c9d9ea;
  border-radius: 8px;
  background: #f7fbff;
}

.affiliate-cta strong {
  display: block;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 780;
}

.affiliate-cta small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.affiliate-editor {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.affiliate-edit-row {
  display: grid;
  grid-template-columns: 148px 72px minmax(128px, 0.65fr) minmax(250px, 1.2fr) minmax(220px, 1fr);
  gap: 8px;
  align-items: end;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.affiliate-edit-head {
  display: grid;
  gap: 3px;
  align-content: center;
}

.affiliate-edit-head strong {
  font-size: 13px;
}

.affiliate-edit-head span {
  color: var(--muted);
  font-size: 12px;
}

.affiliate-edit-row label {
  min-width: 0;
}

.affiliate-edit-row .field-wide {
  grid-column: auto;
}

@media (max-width: 1180px) {
  .affiliate-edit-row {
    grid-template-columns: 148px 72px minmax(140px, 1fr) minmax(260px, 1.35fr);
  }

  .affiliate-edit-row .field-wide:last-child {
    grid-column: 3 / -1;
  }
}

/* Compact product-wide pass: reduce empty air without changing workflows. */
.app-shell {
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  gap: 16px;
  padding: 20px 16px;
}

.brand {
  padding-bottom: 12px;
}

.side-nav {
  gap: 12px;
}

.nav-section {
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
}

.side-nav a {
  min-height: 42px;
  padding: 0 12px 0 14px;
  font-size: 15px;
}

.workspace-main {
  gap: 12px;
  padding: 14px 22px 30px;
}

.panel-head {
  min-height: 52px;
  padding: 10px 14px;
}

.panel-head h2 {
  font-size: 17px;
}

.button {
  height: 34px;
  padding: 0 12px;
}

.button-small {
  height: 28px;
  padding: 0 9px;
}

label {
  gap: 5px;
}

label span {
  font-size: 12px;
}

input,
select {
  height: 34px;
}

textarea {
  min-height: 76px;
  padding: 8px 10px;
}

.crawler-form,
.import-box,
.config-box,
.detail-content,
.member-profile,
.updates-list,
.studio-form {
  padding: 12px;
  gap: 9px;
}

.form-row,
.toolbar-panel,
.intel-toolbar,
.primary-grid,
.two-col,
.intelligence-main,
.studio-page {
  gap: 12px;
}

.form-row {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.form-row-compact {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.45fr);
}

.stat {
  min-height: 78px;
  padding: 11px 12px;
}

.stat-value {
  margin-top: 5px;
  font-size: 23px;
}

.crawler-rule-strip,
.plan-grid,
.admin-subpanel,
.member-create-form,
.support-contact-card,
.inline-action-box {
  padding: 12px;
}

.crawler-result {
  min-height: 460px;
  max-height: calc(100vh - 270px);
  padding: 12px;
}

.studio-panel {
  min-height: 0;
}

th,
td {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 13px;
}

.empty {
  padding: 12px 0;
}

@media (max-width: 1380px) {
  .primary-grid,
  .intelligence-main {
    grid-template-columns: 1fr;
  }

  .result-panel {
    order: -1;
  }

  .crawler-result {
    max-height: none;
  }

  .detail-panel {
    min-height: 360px;
  }
}

@media (max-width: 1180px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 360px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;
    overflow: visible;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    overflow: auto;
  }

  .nav-section {
    min-width: 220px;
  }

  .sidebar-status {
    grid-auto-flow: column;
  }

  .workspace-header {
    top: 0;
  }

  .toolbar-panel,
  .intel-toolbar,
  .stats-grid,
  .two-col,
  .intelligence-main {
    grid-template-columns: 1fr 1fr;
  }

  .primary-grid {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: span 2;
  }

  .toolbar-actions {
    grid-column: 1 / -1;
    grid-template-columns: auto auto minmax(150px, 1fr);
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    padding: 14px;
  }

  .auth-layout {
    min-height: auto;
  }

  .auth-hero,
  .auth-card {
    padding: 22px;
  }

  .auth-code-row {
    grid-template-columns: 1fr;
  }

  .auth-code-row .button {
    width: 100%;
    min-width: 0;
  }

  .captcha-row {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .workspace-header,
  .toolbar-panel,
  .primary-grid,
  .two-col,
  .intelligence-main,
  .crawler-rule-strip,
  .form-row,
  .ai-row,
  .config-grid,
  .detail-grid,
  .crawl-summary,
  .diagnostic-grid,
  .crawler-actions,
  .inline-action-box,
  .support-upload-row,
  .support-contact,
  .support-contact-compact,
  .option-row,
  .form-submit-row,
  .proxy-status-grid,
  .smtp-status-grid,
  .proxy-guide {
    grid-template-columns: 1fr;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .quota-grid,
  .admin-overview-grid,
  .referral-summary-grid,
  .operations-report-grid,
  .admin-plan-row,
  .quota-edit-row,
  .proxy-pool-row,
  .affiliate-edit-row {
    grid-template-columns: 1fr;
  }

  .referral-invite-card,
  .referral-grid-panel,
  .referral-payout-preview,
  .compact-form .form-row,
  .withdrawal-qr-cell {
    grid-template-columns: 1fr;
  }

  .referral-payout-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .form-row-compact {
    grid-template-columns: 1fr;
  }

  .quota-edit-row strong {
    grid-row: auto;
  }

  .table-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .intel-toolbar,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-actions .inline-status {
    grid-column: 1 / -1;
  }

  .sidebar {
    padding: 14px 16px;
    gap: 14px;
  }

  .side-nav,
  .sidebar-status {
    display: flex;
    flex-wrap: nowrap;
    overflow: auto;
  }

  .side-nav .nav-section {
    flex: 0 0 220px;
  }

  .side-nav a {
    min-width: 0;
  }

  .workspace-header {
    position: static;
    align-items: stretch;
    padding: 18px;
  }

  .workspace-main {
    padding: 16px;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .stat {
    min-height: 86px;
    padding: 12px;
  }

  .stat-value {
    font-size: 24px;
  }

  .panel-head-split {
    align-items: stretch;
    flex-direction: column;
  }

  .intel-tabbar {
    width: 100%;
  }

  .intel-tab {
    flex: 1;
  }

  .crawler-runs-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .crawler-runs-toolbar .button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .crawler-run-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .crawler-run-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .crawler-log-main {
    grid-template-columns: auto auto;
  }

  .crawler-signal-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crawler-log-message {
    grid-column: 1 / -1;
  }

  .order-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-workspace {
    grid-template-columns: 1fr;
  }

  .order-detail-panel {
    position: static;
  }

  .order-card-grid {
    grid-template-columns: 1fr;
  }

  .order-card-main,
  .order-card-actions {
    flex-direction: column;
  }

  .order-card-actions > div {
    justify-content: flex-start;
  }
}
