@charset "UTF-8";

/* ==========================================================================
   1. FLAGSHIP MULTI-THEME DESIGN TOKENS (深海蓝 / 珍珠白 / 曜石黑)
   ========================================================================== */
:root,
[data-theme="douyin"] {
  color-scheme: dark;
  --bg: #070b16;
  --bg-accent:
    radial-gradient(1100px 500px at 8% -8%, rgba(14, 165, 233, 0.14), transparent 62%),
    radial-gradient(900px 460px at 92% 0%, rgba(79, 70, 229, 0.14), transparent 60%);
  --sidebar: rgba(11, 16, 31, 0.94);
  --topbar: rgba(13, 19, 36, 0.9);
  --surface: rgba(16, 23, 42, 0.92);
  --surface-sub: rgba(11, 16, 30, 0.88);
  --raised: rgba(24, 34, 62, 0.92);
  --raised-hover: rgba(33, 46, 82, 0.98);
  --input-bg: rgba(9, 13, 25, 0.95);
  --line: rgba(148, 163, 184, 0.13);
  --line-strong: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --text-secondary: #e2e8f0;
  --muted: #94a3b8;
  --subtle: #64748b;
  --primary: #38bdf8;
  --primary-2: #0ea5e9;
  --primary-hover: #7dd3fc;
  --primary-text: #ffffff;
  --primary-soft: rgba(56, 189, 248, 0.13);
  --primary-border: rgba(56, 189, 248, 0.34);
  --primary-glow: rgba(14, 165, 233, 0.36);
  --btn-primary-grad: linear-gradient(135deg, #2563eb 0%, #0ea5e9 55%, #10b981 100%);
  --btn-primary-hover: linear-gradient(135deg, #3b82f6 0%, #38bdf8 55%, #34d399 100%);
  --hero-grad: linear-gradient(125deg, rgba(37, 99, 235, 0.12) 0%, rgba(14, 165, 233, 0.08) 50%, transparent 100%);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --green-border: rgba(16, 185, 129, 0.34);
  --red: #f43f5e;
  --red-soft: rgba(244, 63, 94, 0.13);
  --red-border: rgba(244, 63, 94, 0.32);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.34);
  --shadow-card: 0 10px 28px -6px rgba(2, 6, 23, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-row: 0 3px 10px -2px rgba(2, 6, 23, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-row-hover: 0 10px 24px -6px rgba(2, 6, 23, 0.65), 0 0 0 1px var(--primary-border);
  --shadow-pop: 0 22px 58px rgba(2, 6, 23, 0.78);
  --brand-grad: linear-gradient(135deg, #2563eb 0%, #0ea5e9 55%, #10b981 100%);
  --bar-grad: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
  --bar-today-grad: linear-gradient(180deg, #34d399 0%, #059669 100%);
  --radius: 18px;
  --radius-sm: 10px;
  --sidebar-width: 248px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

[data-theme="stripe"] {
  color-scheme: light;
  --bg: #f3f6fc;
  --bg-accent:
    radial-gradient(1000px 460px at 8% -5%, rgba(79, 70, 229, 0.07), transparent 60%),
    radial-gradient(900px 420px at 92% 0%, rgba(14, 165, 233, 0.07), transparent 60%);
  --sidebar: rgba(255, 255, 255, 0.96);
  --topbar: rgba(255, 255, 255, 0.92);
  --surface: #ffffff;
  --surface-sub: #f8fafc;
  --raised: #f1f5f9;
  --raised-hover: #e2e8f0;
  --input-bg: #ffffff;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #1e293b;
  --muted: #475569;
  --subtle: #64748b;
  --primary: #4f46e5;
  --primary-2: #2563eb;
  --primary-hover: #4338ca;
  --primary-text: #ffffff;
  --primary-soft: rgba(79, 70, 229, 0.09);
  --primary-border: rgba(79, 70, 229, 0.28);
  --primary-glow: rgba(79, 70, 229, 0.28);
  --btn-primary-grad: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  --btn-primary-hover: linear-gradient(135deg, #4338ca 0%, #1d4ed8 100%);
  --hero-grad: linear-gradient(125deg, rgba(79, 70, 229, 0.06) 0%, rgba(14, 165, 233, 0.05) 55%, transparent 100%);
  --green: #059669;
  --green-soft: rgba(16, 185, 129, 0.1);
  --green-border: rgba(16, 185, 129, 0.28);
  --red: #e11d48;
  --red-soft: rgba(225, 29, 72, 0.08);
  --red-border: rgba(225, 29, 72, 0.24);
  --amber: #d97706;
  --amber-soft: rgba(245, 158, 11, 0.11);
  --amber-border: rgba(245, 158, 11, 0.28);
  --shadow-card: 0 6px 20px -4px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.03);
  --shadow-row: 0 2px 6px rgba(15, 23, 42, 0.03);
  --shadow-row-hover: 0 8px 20px -4px rgba(79, 70, 229, 0.12), 0 0 0 1px var(--primary-border);
  --shadow-pop: 0 20px 50px rgba(15, 23, 42, 0.14);
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  --bar-grad: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  --bar-today-grad: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

[data-theme="linear"] {
  color-scheme: dark;
  --bg: #090a0f;
  --bg-accent:
    radial-gradient(950px 440px at 15% -8%, rgba(99, 102, 241, 0.13), transparent 62%),
    radial-gradient(850px 380px at 85% 0%, rgba(56, 189, 248, 0.09), transparent 60%);
  --sidebar: rgba(14, 16, 23, 0.95);
  --topbar: rgba(15, 17, 25, 0.9);
  --surface: #12141d;
  --surface-sub: #0d0f17;
  --raised: #191c28;
  --raised-hover: #222636;
  --input-bg: #0b0d13;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f1f5f9;
  --text-secondary: #e2e8f0;
  --muted: #94a3b8;
  --subtle: #64748b;
  --primary: #818cf8;
  --primary-2: #6366f1;
  --primary-hover: #a5b4fc;
  --primary-text: #ffffff;
  --primary-soft: rgba(99, 102, 241, 0.14);
  --primary-border: rgba(129, 140, 248, 0.34);
  --primary-glow: rgba(99, 102, 241, 0.35);
  --btn-primary-grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #3b82f6 100%);
  --btn-primary-hover: linear-gradient(135deg, #6366f1 0%, #818cf8 55%, #60a5fa 100%);
  --hero-grad: linear-gradient(125deg, rgba(99, 102, 241, 0.12) 0%, rgba(59, 130, 246, 0.07) 55%, transparent 100%);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --green-border: rgba(16, 185, 129, 0.32);
  --red: #f43f5e;
  --red-soft: rgba(244, 63, 94, 0.13);
  --red-border: rgba(244, 63, 94, 0.32);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.32);
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-row: 0 3px 10px rgba(0, 0, 0, 0.32);
  --shadow-row-hover: 0 10px 22px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--primary-border);
  --shadow-pop: 0 22px 55px rgba(0, 0, 0, 0.75);
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --bar-grad: linear-gradient(180deg, #818cf8 0%, #4f46e5 100%);
  --bar-today-grad: linear-gradient(180deg, #34d399 0%, #059669 100%);
}

/* ==========================================================================
   2. GLOBAL RESET, CUSTOM SCROLLBARS & KEYFRAME ANIMATIONS
   ========================================================================== */
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.38);
}

html { scroll-padding-bottom: 170px; overflow-x: hidden; scroll-behavior: smooth; background: var(--bg); }
.ai-progress { display:block!important; width:min(420px,100%); height:10px; margin:8px 0; border:1px solid var(--primary-border); border-radius:999px; overflow:hidden; appearance:none; -webkit-appearance:none; accent-color:var(--primary); background:var(--raised); }
.ai-progress::-webkit-progress-bar { background:var(--raised); }
.ai-progress::-webkit-progress-value { background:var(--primary); border-radius:999px; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--bg-accent);
  background-attachment: fixed;
  color: var(--text);
  min-width: 320px;
  overflow-x: hidden;
  transition: background-color .25s ease, color .2s ease;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .48; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.3; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
h2 { font-size: 15.5px; font-weight: 700; }
h3 { font-size: 14.5px; font-weight: 650; }
.icon { display: block; width: 20px; height: 20px; flex-shrink: 0; }
button .icon { width: 16px; height: 16px; transition: transform .22s var(--ease-spring); }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@keyframes viewFadeUp {
  from { opacity: 0; transform: translateY(14px) scale(0.992); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes cardRiseIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rowSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes topbarDropIn {
  from { opacity: 0; transform: translateY(-18px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sidebarSlideIn {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes navItemCascade {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes headingRefreshEnter {
  0% { opacity: 0.35; transform: translateY(8px) scale(0.994); filter: blur(3px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes symbolPop {
  0% { transform: translateY(-50%) scale(0.76) rotate(-10deg); opacity: 0.4; }
  65% { transform: translateY(-50%) scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: translateY(-50%) scale(1) rotate(0deg); opacity: 1; }
}
@keyframes metricReveal {
  0% { opacity: 0.15; transform: translateY(8px) scale(0.96); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes laserSweep {
  0% { width: 0%; opacity: 1; }
  45% { width: 72%; opacity: 1; }
  80% { width: 100%; opacity: 0.95; }
  100% { width: 100%; opacity: 0; }
}
@keyframes auroraFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -14px, 0) scale(1.06); }
  100% { transform: translate3d(-12px, 16px, 0) scale(0.97); }
}
@keyframes loginPortalOut {
  to { opacity: 0; transform: scale(1.025); filter: blur(6px); }
}
@keyframes drawCurve {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}
@keyframes fadeArea {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes barGrowUp {
  from { transform: scaleY(0.08); opacity: 0.3; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: .72; }
}
@keyframes pulseHalo {
  0%, 100% { transform: scale(1); opacity: 0.32; }
  50% { transform: scale(1.45); opacity: 0.12; }
}
@keyframes modalPopIn {
  from { opacity: 0; transform: translateY(12px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(18px) scale(0.97); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Top Laser Progress Bar (Login / Refresh / Route Switch) */
.top-laser-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  background: linear-gradient(90deg, #06b6d4 0%, #6366f1 45%, #a855f7 75%, #10b981 100%);
  box-shadow: 0 0 14px var(--primary), 0 0 28px var(--primary-soft);
}
.top-laser-bar.is-active {
  animation: laserSweep .56s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Choreographed Workspace Boot & Refresh Cascade */
body.workspace-boot-enter .topbar {
  animation: topbarDropIn .44s var(--ease-spring) both;
}
body.workspace-boot-enter .sidebar {
  animation: sidebarSlideIn .46s var(--ease-spring) both;
}
body.workspace-boot-enter .desktop-nav a {
  animation: navItemCascade .38s var(--ease-spring) both;
  animation-delay: calc(70ms + var(--nav-idx, 0) * 35ms);
}
body.workspace-boot-enter .page-heading {
  animation: headingRefreshEnter .46s var(--ease-spring) 60ms both;
}

.page-heading.heading-refresh {
  animation: headingRefreshEnter .38s var(--ease-spring) both;
}
.ui-page-symbol.symbol-pop {
  animation: symbolPop .48s var(--ease-spring) both;
}
.metric-reveal {
  animation: metricReveal .42s var(--ease-spring) both;
}

.page-view { animation: viewFadeUp .36s var(--ease-spring) both; }
.page-view.view-enter { animation: viewFadeUp .36s var(--ease-spring) both; }
.page-view > *:nth-child(1) { animation: cardRiseIn .36s var(--ease-spring) 20ms both; }
.page-view > *:nth-child(2) { animation: cardRiseIn .38s var(--ease-spring) 55ms both; }
.page-view > *:nth-child(3) { animation: cardRiseIn .4s var(--ease-spring) 90ms both; }
.page-view > *:nth-child(4) { animation: cardRiseIn .42s var(--ease-spring) 125ms both; }

.stagger-card {
  animation: cardRiseIn .38s var(--ease-spring) both;
  animation-delay: calc(var(--card-idx, 0) * 26ms);
}
.stagger-row {
  animation: rowSlideIn .32s var(--ease-spring) both;
  animation-delay: calc(var(--row-idx, 0) * 24ms);
}

/* ==========================================================================
   3. FORM CONTROLS & HELPER ELEMENTS
   ========================================================================== */
input, textarea, select {
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 13px;
  min-height: 38px;
  min-width: 0;
  max-width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
input:hover:not(:disabled), textarea:hover:not(:disabled), select:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--line-strong));
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { width: 100%; resize: vertical; line-height: 1.8; border-radius: 12px; }
input[type=checkbox] { accent-color: var(--primary); width: 17px; height: 17px; min-height: 0; padding: 0; flex-shrink: 0; cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .55; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -70px; left: 16px; background: var(--primary); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 100; }
.skip-link:focus { top: 12px; }
.small-text { font-size: 12px; }
.muted { color: var(--muted); }
.full-width { width: 100%; }
.helper { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.75; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: var(--primary);
  text-transform: uppercase;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  white-space: nowrap;
  transition: all .18s var(--ease-spring);
}
.text-link:hover {
  background: var(--btn-primary-grad);
  color: #ffffff;
  border-color: transparent;
  transform: translateX(2px);
}
.text-link .icon { width: 14px; height: 14px; }
.button-link { cursor: pointer; }

/* ==========================================================================
   4. FLAGSHIP BUTTON SYSTEM (高对比度流光按钮 + 动态扫光与微动效)
   ========================================================================== */
.button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 16px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .1px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform .2s var(--ease-spring), box-shadow .2s var(--ease-spring), background .18s ease, border-color .18s ease, color .18s ease;
}
.button::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 35%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-140%) skewX(-22deg);
  transition: transform .5s var(--ease-spring);
  pointer-events: none;
}
.button:hover:not(:disabled)::after {
  transform: translateX(420%) skewX(-22deg);
}
.button:hover:not(:disabled) {
  background: var(--raised-hover);
  border-color: var(--primary-border);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.26);
}
.button:hover:not(:disabled) .icon {
  transform: scale(1.08);
}
.button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.button-primary,
.add-shopee-product-btn,
.login-submit {
  background: var(--btn-primary-grad);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  font-weight: 750;
  padding: 9px 18px;
  box-shadow: 0 6px 20px -4px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.button-primary:hover:not(:disabled),
.add-shopee-product-btn:hover:not(:disabled),
.login-submit:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -4px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.button-secondary {
  background: var(--surface-sub);
  border: 1px solid var(--line-strong);
  color: var(--text-secondary);
}
.button-secondary:hover:not(:disabled) {
  background: var(--raised);
  border-color: var(--primary);
  color: var(--primary);
}

.button-accent-soft {
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: var(--amber);
}
.button-accent-soft:hover:not(:disabled) {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px -4px rgba(245, 158, 11, 0.38);
}

.button-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}
.button-ghost:hover:not(:disabled) {
  background: var(--raised);
  border-color: var(--line);
  color: var(--text);
}

.button-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
  box-shadow: 0 6px 18px -4px rgba(244, 63, 94, 0.4);
}
.button-danger-ghost {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  box-shadow: none;
}
.button-danger-ghost:hover:not(:disabled) {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border-color: transparent;
  color: #ffffff !important;
  box-shadow: 0 6px 16px -4px rgba(244, 63, 94, 0.38);
}

.button-small {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 8px;
  gap: 5px;
}
.button-small .icon { width: 14px; height: 14px; }
.ui-button-icon { display: inline-flex; align-items: center; flex-shrink: 0; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 34px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
  transition: all .18s var(--ease-spring);
}
.icon-button:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
}
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

/* ==========================================================================
   5. FLOATING GLASS SIDEBAR (无任何滚动条溢出 · 悬浮导航舱)
   ========================================================================== */
.app-shell { display: flex; min-height: 100dvh; }
.sidebar {
  width: calc(var(--sidebar-width) - 16px);
  position: fixed;
  top: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 30;
  background: var(--sidebar);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: width .24s var(--ease-spring), padding .24s var(--ease-spring);
}
.sidebar::-webkit-scrollbar,
.desktop-nav::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--hero-grad), var(--surface-sub);
  border: 1px solid var(--line);
  transition: border-color .2s ease;
}
.brand:hover { border-color: var(--primary-border); }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-grad);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-name { font-size: 17px; font-weight: 800; white-space: nowrap; color: var(--text); letter-spacing: -.3px; }
.brand-name small { display: block; font-size: 8.5px; letter-spacing: 1.2px; color: var(--primary); font-weight: 700; margin-top: 2px; }
.nav-caption { color: var(--subtle); font-size: 10px; font-weight: 700; padding: 0 10px; margin-bottom: 6px; letter-spacing: 1.2px; text-transform: uppercase; }
.desktop-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}
.desktop-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.desktop-nav a > [data-icon] {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all .18s ease;
}
.desktop-nav a:hover {
  background: var(--raised);
  color: var(--text);
  border-color: var(--line);
}
.desktop-nav a:hover > [data-icon] {
  color: var(--primary);
  border-color: var(--primary-border);
}
.desktop-nav a.active {
  background: linear-gradient(90deg, var(--primary-soft), rgba(255, 255, 255, 0.02));
  color: var(--text) !important;
  font-weight: 750;
  border-color: var(--primary-border);
  box-shadow: inset 3px 0 0 var(--primary);
}
.desktop-nav a.active > [data-icon] {
  background: var(--btn-primary-grad);
  border-color: transparent;
  color: #ffffff !important;
  box-shadow: 0 4px 10px var(--primary-glow);
}
.desktop-nav .icon { width: 16px; height: 16px; }

.sidebar-footer { margin-top: auto; padding-top: 12px; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.sidebar-user strong { display: block; font-weight: 700; color: var(--text); }
.sidebar-user small { display: block; font-size: 10.5px; color: var(--subtle); }
.sidebar-user .icon-button { margin-left: auto; }
.collapse-button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-sub);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  transition: all .18s ease;
}
.collapse-button:hover { border-color: var(--primary-border); color: var(--primary); background: var(--primary-soft); }
.collapse-button .icon { width: 15px; height: 15px; }

/* Circular Admin Avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
}
.avatar.small, .avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13.5px;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary-border);
}
.avatar-circle-sm { width: 32px; height: 32px; border-radius: 50%; }
.avatar-circle-lg { width: 44px; height: 44px; border-radius: 50%; font-size: 17px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--primary); }
.avatar-online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--surface);
}

/* ==========================================================================
   6. FLOATING TOPBAR & 3-THEME SWITCHER BAR (全宽对齐布局)
   ========================================================================== */
.workspace {
  margin-left: var(--sidebar-width);
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: margin-left .24s var(--ease-spring);
}
.topbar {
  height: 60px;
  position: sticky;
  top: 12px;
  z-index: 25;
  margin: 12px 24px 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-card);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.breadcrumb-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
}
.breadcrumb .desktop-only { color: var(--subtle); font-weight: 500; }
.crumb-divider { padding: 0 6px; color: var(--subtle); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-theme-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
}
.topbar-theme-pill {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  padding: 5px 11px;
  border-radius: 7px;
  transition: all .16s ease;
}
.topbar-theme-pill:hover { color: var(--text); }
.topbar-theme-pill.is-active {
  background: var(--raised-hover);
  border-color: var(--primary-border);
  color: var(--primary);
  font-weight: 750;
}
.theme-switch-btn {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: var(--green);
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: pulseDot 2s infinite;
}
.service-state.offline { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-border); }
.service-state.unknown { color: var(--muted); background: var(--raised); border-color: var(--line); }

.account-menu { position: relative; z-index: 35; }
.account-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  list-style: none;
  cursor: pointer;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-sub);
  min-height: 40px;
  transition: all .18s ease;
}
.account-menu summary:hover { border-color: var(--primary-border); background: var(--raised); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary .icon { width: 14px; height: 14px; color: var(--subtle); }
.admin-trigger-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.admin-trigger-text strong { font-size: 12px; font-weight: 750; color: var(--text); }
.admin-trigger-text small { font-size: 10px; color: var(--subtle); font-weight: 500; }

.account-popover {
  position: absolute;
  right: 0;
  top: 50px;
  width: 292px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-pop);
  animation: modalPopIn .2s var(--ease-spring);
}
.account-popover-header { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.account-popover-title { flex: 1; min-width: 0; }
.account-popover-title strong { display: block; font-size: 15px; font-weight: 800; padding: 0; }
.account-popover-title small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.account-online-pill { display: inline-block; margin-top: 5px; font-size: 10px; font-weight: 700; color: var(--green); background: var(--green-soft); border: 1px solid var(--green-border); padding: 2px 8px; border-radius: 999px; }
.account-meta-box { margin: 12px 0; padding: 11px 13px; border-radius: 12px; background: var(--surface-sub); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.account-meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.account-meta-row b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.account-theme-picker { padding: 8px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.account-theme-label { display: block; font-size: 11px; font-weight: 600; color: var(--subtle); margin-bottom: 8px; }
.account-theme-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.account-theme-pills button { padding: 7px 4px; font-size: 11px; font-weight: 700; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-sub); color: var(--muted); justify-content: center; transition: all .15s; }
.account-theme-pills button.is-active,
.account-theme-pills button:hover { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary); }
.account-popover-actions { display: flex; flex-direction: column; gap: 4px; }
.account-popover-actions button { background: transparent; border: 0; display: flex; align-items: center; gap: 9px; padding: 9px 11px; width: 100%; border-radius: 10px; color: var(--text); font-size: 12.5px; font-weight: 650; transition: background .15s; }
.account-popover-actions button:hover { background: var(--raised); }
.account-popover-actions .logout-button { color: var(--red); }
.account-popover-actions .logout-button:hover { background: var(--red-soft); }

/* ==========================================================================
   7. EXECUTIVE PAGE HEADER (.page-heading) & FULL-WIDTH WORKSPACE
   ========================================================================== */
.main-content {
  padding: 18px 24px 32px;
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1;
}
.page-heading {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--hero-grad), var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-card);
}
.page-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--green), transparent);
  opacity: 0.78;
}
.page-heading-info {
  position: relative;
  padding-left: 58px;
  min-width: 0;
  flex: 1;
}
.ui-page-symbol {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ui-page-symbol .icon { width: 22px; height: 22px; }
.page-heading h1 { margin: 3px 0 3px; font-size: 22px; font-weight: 800; }
.page-heading-info > #pageDescription { font-size: 12.5px; color: var(--muted); }
.page-heading-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; position: relative; z-index: 1; }
.workspace-footer { padding: 16px 24px 24px; display: flex; justify-content: space-between; gap: 12px; color: var(--subtle); font-size: 11.5px; font-weight: 500; border-top: 1px solid var(--line); margin: 0 24px; }

.sidebar-collapsed { --sidebar-width: 92px; }
.sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
.sidebar-collapsed .brand-name,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-caption,
.sidebar-collapsed .sidebar-user .icon-button { display: none; }
.sidebar-collapsed .sidebar > .brand { padding: 10px !important; justify-content: center; }
.sidebar-collapsed .desktop-nav a { justify-content: center; padding: 9px; }
.sidebar-collapsed .sidebar-user { justify-content: center; padding: 8px; }

/* ==========================================================================
   8. ENGINE COMMAND BAR (.engine-panel)
   ========================================================================== */
.engine-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, var(--green-soft), var(--surface) 40%);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
  transition: transform .2s var(--ease-spring);
}
.engine-panel:hover { transform: translateY(-1px); }
.engine-icon {
  width: 44px;
  height: 44px;
  background: var(--bar-today-grad);
  color: #ffffff;
  border-radius: 13px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--green-soft);
}
.engine-info { flex: 1; min-width: 0; }
.engine-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.engine-info strong { font-weight: 800; font-size: 14.5px; color: var(--text); }
.engine-info p { font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.engine-live-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.engine-live-badge.is-paused { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.engine-live-badge.is-offline { background: var(--red-soft); color: var(--red); border-color: var(--red-border); }
.engine-metrics { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.heartbeat {
  text-align: right;
  font-size: 10.5px;
  color: var(--subtle);
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 10px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
}
.heartbeat strong { display: block; font-size: 12.5px; font-weight: 750; color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.engine-panel.is-offline { border-color: var(--amber-border); background: linear-gradient(90deg, var(--amber-soft), var(--surface) 40%); }
.engine-panel.is-offline .engine-icon { color: #ffffff; background: linear-gradient(135deg, #f59e0b, #d97706); }

/* ==========================================================================
   9. COLOR-CODED 4 KPI BENTO CARDS (.stat-card)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  animation: cardRiseIn .36s var(--ease-spring) both;
  transition: transform .2s var(--ease-spring), border-color .2s ease, box-shadow .2s ease;
}
.stat-card:nth-child(1) { animation-delay: 15ms; }
.stat-card:nth-child(2) { animation-delay: 50ms; }
.stat-card:nth-child(3) { animation-delay: 85ms; }
.stat-card:nth-child(4) { animation-delay: 120ms; }
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-row-hover);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--btn-primary-grad);
}
.stat-card-1::before { background: linear-gradient(90deg, #10b981, #06b6d4); }
.stat-card-2::before { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.stat-card-3::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.stat-card-4::before { background: linear-gradient(90deg, #f43f5e, #6366f1); }

.stat-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}
.stat-icon-orb {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  transition: transform .2s var(--ease-spring);
}
.stat-card:hover .stat-icon-orb { transform: scale(1.06); }
.stat-card-1 .stat-icon-orb { background: var(--green-soft); border-color: var(--green-border); color: var(--green); }
.stat-card-3 .stat-icon-orb { background: var(--amber-soft); border-color: var(--amber-border); color: var(--amber); }
.stat-card-4 .stat-icon-orb { background: var(--red-soft); border-color: var(--red-border); color: var(--red); }

.stat-card > strong {
  display: block;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 850;
  margin: 10px 0 8px;
  letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}
.stat-card p { font-size: 11.5px; color: var(--subtle); margin-top: auto; }
.stat-card p b { color: var(--primary); font-weight: 750; }
.stat-card strong small { font-size: 15px; color: var(--subtle); font-weight: 600; letter-spacing: 0; }
.stat-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--raised);
  overflow: hidden;
  margin-bottom: 8px;
}
.stat-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #0ea5e9);
  transition: width .5s var(--ease-spring);
}
.stat-pages-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.stat-failed-inline { font-size: 11px; color: var(--subtle); }
.stat-failed-inline b { color: var(--red); }

/* ==========================================================================
   10. DASHBOARD VISUAL BENTO GRID & ANIMATED CHARTS
   ========================================================================== */
.dashboard-visual-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 0.95fr;
  gap: 16px;
  margin-bottom: 18px;
  align-items: stretch;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sub);
}
.panel-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 750; }
.ui-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
}
.ui-heading-icon .icon { width: 14px; height: 14px; }
.panel-heading p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 18px 20px; }
.chart-panel-body { padding: 14px 16px 16px; }
.chart-container { min-height: 215px; display: flex; align-items: stretch; flex-direction: column; justify-content: center; }

/* Animated SVG Curve Chart */
.svg-chart-wrap { position: relative; width: 100%; }
.svg-chart { width: 100%; height: 215px; display: block; overflow: visible; }
.chart-grid-line { stroke: var(--line); stroke-dasharray: 3 3; stroke-width: 1; }
.chart-axis-text { fill: var(--subtle); font-size: 11px; font-family: inherit; }
.chart-axis-text.is-today { fill: var(--green); font-weight: 800; }
.chart-axis-text.is-yesterday { fill: var(--text); font-weight: 700; }
.chart-line-success { stroke: var(--primary); stroke-width: 2.8; stroke-linecap: round; }
.chart-line-animated {
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: drawCurve .9s var(--ease-spring) both;
}
.chart-area-animated {
  animation: fadeArea .65s ease .12s both;
}
.chart-line-failed { stroke: var(--red); stroke-width: 1.8; stroke-dasharray: 4 4; opacity: .8; }
.chart-dot-success { fill: var(--surface); stroke: var(--primary); stroke-width: 2.5; }
.chart-dot-success.is-today { fill: var(--green); stroke: var(--surface); stroke-width: 2.5; }
.chart-dot-halo { fill: var(--green); opacity: .28; transform-origin: center; transform-box: fill-box; animation: pulseHalo 2.2s infinite; }
.chart-dot-failed { fill: var(--red); }
.chart-val-label { fill: var(--muted); font-size: 10.5px; font-weight: 700; }
.chart-val-label.is-today { fill: var(--green); font-size: 12px; font-weight: 800; }
.chart-hit-area { cursor: pointer; }
.chart-tooltip {
  position: absolute;
  top: 8px;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 11.5px;
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  min-width: 140px;
}
.chart-tooltip-date { font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.chart-tooltip-row { display: flex; align-items: center; gap: 6px; color: var(--muted); line-height: 1.65; }
.chart-tooltip-row strong { color: var(--text); margin-left: auto; }
.dot-success, .dot-failed { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-success { background: var(--primary); }
.dot-failed { background: var(--red); }

/* Animated Daily Success Bar Chart */
.daily-bar-chart {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  height: 215px;
  padding: 6px 4px 2px;
}
.daily-bar-chart.is-dense { gap: 3px; }
.daily-bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.daily-bar-val { font-size: 11px; font-weight: 750; color: var(--muted); height: 16px; line-height: 16px; font-variant-numeric: tabular-nums; }
.daily-bar-col.is-today .daily-bar-val { color: var(--green); font-weight: 850; font-size: 12px; }
.daily-bar-track {
  flex: 1;
  width: 100%;
  max-width: 28px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: flex-end;
  padding: 3px;
  overflow: hidden;
  transition: border-color .18s ease, transform .18s var(--ease-spring);
}
.daily-bar-col:hover .daily-bar-track { border-color: var(--primary-border); transform: translateY(-2px); }
.daily-bar-col.is-dense .daily-bar-track { max-width: 14px; padding: 1px; }
.daily-bar-fill {
  width: 100%;
  border-radius: 999px;
  background: var(--bar-grad);
  transform-origin: bottom;
  animation: barGrowUp .5s var(--ease-spring) both;
  animation-delay: calc(var(--bar-idx, 0) * 32ms);
}
.daily-bar-col.is-today .daily-bar-track { border-color: var(--green-border); background: var(--green-soft); }
.daily-bar-col.is-today .daily-bar-fill { background: var(--bar-today-grad); }
.daily-bar-date { font-size: 11px; color: var(--subtle); white-space: nowrap; font-variant-numeric: tabular-nums; }
.daily-bar-col.is-today .daily-bar-date { color: var(--green); font-weight: 800; }
.daily-bar-col.is-yesterday .daily-bar-date { color: var(--text); font-weight: 700; }

/* Overview Panel on Dashboard */
.overview-panel-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.overview-subcaption { font-size: 11px; font-weight: 800; color: var(--primary); margin-bottom: 6px; letter-spacing: .4px; }
.overview-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
  margin-bottom: 6px;
  transition: all .18s var(--ease-spring);
}
.overview-rank-item:hover {
  border-color: var(--primary-border);
  background: var(--raised);
  transform: translateX(3px);
}
.overview-rank-item:last-child { margin-bottom: 0; }
.overview-rank-item.is-product { cursor: pointer; }
.overview-rank-num {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: var(--raised);
  color: var(--muted);
  flex-shrink: 0;
}
.overview-rank-num.rank-1 { background: linear-gradient(135deg, #f59e0b, #ea580c); color: #ffffff; }
.overview-rank-num.rank-2 { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }
.overview-rank-tag { padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 800; background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); flex-shrink: 0; }
.overview-rank-info { flex: 1; min-width: 0; }
.overview-rank-info strong { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overview-rank-info small { display: block; font-size: 11px; color: var(--subtle); }

/* ==========================================================================
   11. FLOATING CARD-ROW TABLES, LISTS & STATUS BADGES
   ========================================================================== */
.last-updated { color: var(--subtle); text-align: right; font-size: 11.5px; margin-top: 12px; }
.notice { border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.notice-error { background: var(--red-soft); border-color: var(--red-border); color: var(--red); }
.empty-state { grid-column: 1/-1; padding: 48px 20px; text-align: center; color: var(--muted); width: 100%; }
.state-icon { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 14px; background: var(--primary-soft); border: 1px solid var(--primary-border); color: var(--primary); }
.state-icon .icon { width: 24px; height: 24px; }
.empty-state h3 { font-size: 15.5px; font-weight: 750; color: var(--text); margin-bottom: 5px; }
.empty-state p { font-size: 12.5px; max-width: 420px; margin: auto; overflow-wrap: anywhere; }
.empty-state .button { margin-top: 16px; }
.loading-state { padding: 20px; display: flex; flex-direction: column; gap: 12px; grid-column: 1/-1; }
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
}
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--raised), var(--line-strong), var(--raised));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton, .skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--raised), var(--line-strong), var(--raised));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-line-lg { width: 62%; height: 13px; }
.skeleton-line-sm { width: 38%; height: 10px; opacity: 0.75; }

/* Luminous Status Badges with Dot */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-success { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); }
.badge-failed { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-border); }
.badge-pending { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-urgent { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-neutral { background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.badge-processing { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-primary { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }

/* Floating Card-Row Data Table (No unwanted scrollbars) */
.table-frame {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 14px 12px;
}
.table-frame > .data-table { min-width: 600px; }
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 7px;
  text-align: left;
  font-size: 13px;
}
.data-table th {
  font-weight: 750;
  font-size: 11px;
  color: var(--subtle);
  padding: 8px 16px 4px;
  background: transparent;
  border: 0;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.data-table tbody tr {
  background: var(--surface-sub);
  box-shadow: var(--shadow-row);
  transition: background-color .16s ease, box-shadow .18s ease;
}
.data-table tbody td {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
  vertical-align: middle;
  transition: border-color .16s ease, background-color .16s ease;
}
.data-table tbody td:first-child {
  border-left: 1px solid var(--line);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}
.data-table tbody td:last-child {
  border-right: 1px solid var(--line);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}
.data-table tbody tr:hover {
  background: var(--raised);
  box-shadow: var(--shadow-row-hover);
}
.data-table tbody tr:hover td {
  border-top-color: var(--primary-border);
  border-bottom-color: var(--primary-border);
}
.data-table tbody tr:hover td:first-child { border-left-color: var(--primary); }
.data-table tbody tr:hover td:last-child { border-right-color: var(--primary-border); }

/* Rich Entity Cells inside Floating Rows */
.row-entity-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.row-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--btn-primary-grad);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.row-avatar-badge.is-product {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
}
.row-avatar-badge.is-paused {
  background: var(--raised);
  color: var(--subtle);
}
.subtitle-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.post-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 750;
}
.time-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.time-cell .icon { width: 13px; height: 13px; color: var(--subtle); }
.status-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.status-text.is-active { color: var(--green); }

.cell-title { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); max-width: 380px; overflow-wrap: anywhere; }
.cell-title a:hover { color: var(--primary); }
.cell-subtitle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--subtle); margin-top: 3px; overflow-wrap: anywhere; }
.cell-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.cell-check { width: 44px; text-align: center !important; padding-left: 14px !important; padding-right: 8px !important; }
.align-right { text-align: right; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-detail-button { display: inline-flex; align-items: center; gap: 5px; background: var(--red-soft); border: 1px solid var(--red-border); border-radius: 999px; color: var(--red); padding: 4px 10px; font-size: 11.5px; font-weight: 700; transition: all .15s; }
.log-detail-button:hover { background: var(--red); color: #fff; }
.log-detail-button .icon { width: 13px; height: 13px; }
.mobile-records, .page-cards { display: none; }

/* ==========================================================================
   12. TOOLBARS, SEARCH FIELDS & SEGMENTED SWITCHERS
   ========================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.toolbar-note { font-size: 12px; font-weight: 650; color: var(--subtle); margin-left: auto; }
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  background: var(--input-bg);
  border-radius: 10px;
  padding: 0 12px;
  min-width: 160px;
  max-width: 340px;
  flex: 1;
  color: var(--subtle);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-field .icon { width: 16px; height: 16px; color: var(--primary); }
.search-field input { border: 0; background: transparent; padding: 7px 0; width: 100%; min-width: 0; min-height: 34px; box-shadow: none; }
.search-field input:focus { box-shadow: none; }
.search-field .icon-button { width: 30px; min-height: 30px; padding: 4px; }
.toolbar > select { border-radius: 10px; padding-left: 12px; padding-right: 12px; font-weight: 650; }
.toolbar > .button-danger-ghost { margin-left: auto; }

.sync-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sync-row > div:first-child { flex: 1; min-width: 220px; }
.sync-row h2 { font-size: 15.5px; font-weight: 750; }
.sync-row .helper { margin-top: 4px; }
.pages-binding-direct { margin-bottom: 17px; }
.pages-binding-direct .sync-row { gap: 18px; }
.pages-binding-direct .sync-controls { flex-wrap: wrap; }
.pages-binding-direct .sync-controls input { flex: 1; min-width: 220px; }
.pages-binding-direct .sync-row { display: grid; grid-template-columns: minmax(250px,.8fr) minmax(480px,1.6fr); align-items: center; }
.pages-binding-direct .sync-row.pages-binding-compact { display: block; }
.pages-binding-direct .pages-binding-compact .sync-controls { width: 100%; }
.pages-binding-direct .sync-row > div:first-child { min-width: 0; }
.pages-binding-direct .sync-row h2 { margin: 0; font-size: 16px; }
.pages-binding-direct .sync-row .helper { max-width: 520px; line-height: 1.7; }
.pages-binding-direct .sync-controls { display: grid; grid-template-columns: minmax(240px,1fr) auto auto; align-items: center; }
@media (max-width: 1099px) {
  .pages-binding-direct .sync-row { grid-template-columns: 1fr; }
  .pages-binding-direct .sync-controls { width: 100%; }
}
@media (max-width: 767px) {
  .pages-binding-direct { padding: 16px; }
  .pages-binding-direct .sync-row { gap: 12px; }
  .pages-binding-direct .sync-controls { display: flex; flex-wrap: wrap; }
  .pages-binding-direct .sync-controls input { flex-basis: 100%; width: 100%; min-height: 43px; font-size: 16px; }
  .pages-binding-direct .sync-controls .button { flex: 1; min-height: 40px; }
}
.sync-controls { display: flex; gap: 10px; flex-wrap: wrap; flex: 1.5; min-width: 0; }
.sync-controls input { flex: 1; min-width: 160px; border-radius: 10px; padding-left: 14px; }

.selection-bar {
  position: sticky;
  top: 82px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  box-shadow: var(--shadow-pop);
  animation: modalPopIn .2s var(--ease-spring);
}
.selection-bar > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.switch { display: inline-flex; position: relative; width: 42px; flex-shrink: 0; vertical-align: middle; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; z-index: 1; cursor: pointer; }
.switch > span { width: 42px; height: 23px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line-strong); transition: all .2s var(--ease-spring); flex-shrink: 0; }
.switch > span::after { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: #fff; margin: 2px; transition: transform .2s var(--ease-spring); box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--btn-primary-grad); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(19px); }
.switch input:disabled + span { opacity: .4; }

.page-status-cell { display: flex; align-items: center; gap: 9px; font-size: 11px; color: var(--subtle); }
.page-error-link, .page-card-error { display: block; color: var(--red); background: transparent; border: 0; text-align: left; font-size: 11px; padding: 4px 0; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Segmented Switcher (Restrained glass pill active state) */
.segmented {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  background: var(--surface-sub);
  border-radius: 11px;
  max-width: 100%;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 13px;
  min-height: 31px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all .16s ease;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed=true] {
  background: var(--raised-hover);
  border-color: var(--primary-border);
  color: var(--primary);
  font-weight: 750;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* ==========================================================================
   13. PRODUCT MANAGEMENT CARDS (20 ITEMS PER PAGE · 整洁对齐的旗舰卡片)
   ========================================================================== */
.product-toolbar { margin-top: 0; justify-content: flex-start; }
.product-toolbar .search-field { max-width: 280px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .22s var(--ease-spring), border-color .18s ease, box-shadow .22s var(--ease-spring);
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-row-hover);
}
.product-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-card);
}
.product-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-sub);
  border-bottom: 1px solid var(--line);
}
.product-card-select-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
}
.product-id {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--raised);
  border: 1px solid var(--line);
}
.product-top-badges { display: flex; align-items: center; gap: 6px; }
.product-source-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  background: var(--raised);
  color: var(--muted);
  border: 1px solid var(--line);
}
.product-source-pill.is-manual {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

.product-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  flex: 1;
}
.product-photo {
  position: relative;
  width: 88px;
  height: 88px;
  background: var(--surface-sub);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--subtle);
  flex-shrink: 0;
}
.product-photo .icon { width: 26px; height: 26px; }
.product-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .32s var(--ease-spring);
}
.product-card:hover .product-photo img { transform: scale(1.06); }
.product-image-source {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(9, 13, 25, 0.78);
  backdrop-filter: blur(4px);
  color: #f8fafc;
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.35;
  pointer-events: none;
}
.product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.product-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.42;
  min-height: 38px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 7px 0 5px;
}
.product-price {
  font-size: 17px;
  font-weight: 850;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -.2px;
}
.product-sold {
  font-size: 10.5px;
  font-weight: 650;
  color: var(--muted);
  background: var(--raised);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.product-highlights {
  font-size: 11.5px;
  color: var(--subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Product Posted Pages Interactive Bar */
.product-posted-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-sub);
  font-size: 11.5px;
  color: var(--muted);
  text-align: left;
  transition: all .18s ease;
}
.product-posted-bar.has-posted {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: var(--green);
}
.product-posted-bar:hover {
  border-color: var(--primary-border);
  background: var(--raised);
  color: var(--text);
}
.posted-bar-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.posted-bar-left strong, .posted-bar-left span { white-space: nowrap; }
.posted-flag-icon .icon { width: 14px; height: 14px; }
.posted-bar-names { display: inline-flex; align-items: center; gap: 4px; overflow: hidden; }
.mini-page-pill {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.posted-bar-link { font-weight: 750; white-space: nowrap; flex-shrink: 0; color: var(--primary); font-size: 11px; }

.product-card-footer {
  display: flex;
  align-items: center;
  background: var(--surface-sub);
  border-top: 1px solid var(--line);
  padding: 10px 14px;
}
.product-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.product-card-actions > .button {
  flex: 1;
  padding-left: 8px;
  padding-right: 8px;
}
.product-select-all-box {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  margin-left: auto;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  box-shadow: var(--shadow-card);
}
.pagination-summary strong { color: var(--primary); font-weight: 800; }
.pagination-controls { display: flex; align-items: center; gap: 8px; }
.page-position { font-variant-numeric: tabular-nums; min-width: 56px; text-align: center; font-weight: 800; color: var(--text); }

/* ==========================================================================
   14. ANALYTICS VIEW (#view-analytics) & DIAGNOSTIC VIEW (#view-diagnostic)
   ========================================================================== */
.analytics-toolbar { justify-content: space-between; }
.analytics-split-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.analytics-pages-list { max-height: 620px; overflow-y: auto; overflow-x: hidden; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.analytics-page-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface-sub);
  text-align: left;
  transition: all .18s ease;
}
.analytics-page-item:hover { border-color: var(--primary-border); background: var(--raised); }
.analytics-page-item.is-selected {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}
.analytics-page-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.analytics-page-meta { flex: 1; min-width: 0; }
.analytics-page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.analytics-page-title-row strong { font-size: 13px; font-weight: 750; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analytics-page-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 3px; }
.analytics-page-sub b { color: var(--primary); font-weight: 750; }

.analytics-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-sub); }
.analytics-detail-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.analytics-detail-actions { display: flex; align-items: center; gap: 10px; }
.analytics-posts-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.analytics-post-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-sub);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.analytics-post-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-row-hover);
}
.analytics-post-thumb, .analytics-prod-thumb {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--subtle);
}
.analytics-post-thumb img, .analytics-prod-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.analytics-post-body { flex: 1; min-width: 0; }
.analytics-post-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.analytics-post-title { font-size: 13.5px; font-weight: 750; color: var(--text); overflow-wrap: anywhere; }
.analytics-post-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.price-inline { color: var(--primary); font-weight: 800; }
.analytics-post-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.analytics-prod-cell { display: flex; align-items: center; gap: 12px; }
.posted-pages-inline { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.posted-pages-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.page-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 650; background: var(--raised); border: 1px solid var(--line); color: var(--text-secondary); }
.page-chip.is-paused { opacity: .65; }

/* Diagnostic Table Styles */
.diag-meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.diag-key-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  color: var(--primary);
}
.diag-key-missing { color: var(--red); font-size: 12px; font-weight: 700; }
.diag-review-note { font-size: 11px; margin-top: 4px; }
.diag-review-note.is-blocked { color: var(--red); font-weight: 700; }
.diag-review-note.is-ok { color: var(--subtle); }
.diag-rotation-box { font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.diag-rotation-box b.is-claimed { color: var(--amber); }
.diag-rotation-sub { color: var(--subtle); }
.diag-rotation-lock { color: var(--red); font-weight: 700; }
.diag-conclusion-badge { white-space: normal; text-align: left; line-height: 1.45; }
.diagnostic-row-issue td { border-top-color: var(--red-border) !important; border-bottom-color: var(--red-border) !important; }
.diagnostic-row-issue td:first-child { border-left: 3px solid var(--red) !important; }

/* Product Posted Pages Detail Modal */
.posted-pages-dialog { width: min(660px, calc(100vw - 28px)); }
.posted-pages-modal-body { max-height: 60dvh; overflow-y: auto; margin: 10px 0; }
.posted-pages-list { display: flex; flex-direction: column; gap: 8px; }
.posted-page-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 15px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--surface-sub); transition: border-color .15s; }
.posted-page-item:hover { border-color: var(--primary-border); }
.posted-page-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.page-avatar-badge { width: 36px; height: 36px; border-radius: 10px; background: var(--btn-primary-grad); color: #ffffff; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.posted-page-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.posted-page-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.unposted-pages-box { margin-top: 14px; padding: 13px 15px; border-radius: 12px; background: var(--surface-sub); border: 1px dashed var(--line-strong); }
.unposted-pages-box h4 { font-size: 12px; font-weight: 750; color: var(--muted); margin-bottom: 8px; }
.unposted-pages-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==========================================================================
   15. TEMPLATES, SETTINGS, LOGS & MODALS
   ========================================================================== */
.template-select { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.template-select label { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.template-select select { width: 280px; max-width: 100%; border-radius: 10px; }
.template-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
.field-label { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.field-label .muted { font-size: 11px; font-weight: 400; }
.template-editor #templateTitle { width: 100%; margin-bottom: 18px; }
.variable-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.variable-bar button {
  font-size: 11.5px;
  padding: 5px 11px;
  min-height: 30px;
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 8px;
  font-weight: 700;
  transition: all .16s ease;
}
.variable-bar button:hover {
  background: var(--btn-primary-grad);
  color: #ffffff;
  border-color: transparent;
}
.emoji-bar { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 14px; }
.emoji-bar button { width: 34px; min-height: 34px; padding: 3px; font-size: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-sub); transition: transform .16s ease, border-color .15s; }
.emoji-bar button:hover { background: var(--raised); border-color: var(--primary-border); transform: scale(1.1); }
.form-footline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12.5px; font-weight: 600; cursor: pointer; min-height: 24px; }
.checkbox-label input { margin: 0; }

.social-preview { background: var(--surface-sub); border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-row); }
.social-preview > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.social-preview > header > div { flex: 1; min-width: 0; }
.social-preview header strong { font-size: 13px; font-weight: 700; }
.social-preview header small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.preview-text { padding: 0 16px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; min-height: 110px; }
.social-preview > footer { display: flex; justify-content: space-around; padding: 11px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); }
.mobile-template-tabs { display: none; }

.settings-panel {
  max-width: none;
  width: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
#settingsFields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}
.settings-section {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform .2s var(--ease-spring), border-color .2s ease, box-shadow .2s ease;
}
.settings-section:hover {
  transform: translateY(-2px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-row-hover);
}
.settings-section-title { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.section-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-border); color: var(--primary); flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }
.section-icon .icon { width: 20px; height: 20px; }
.settings-section h2 { font-size: 15.5px; font-weight: 800; }
.settings-section p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.settings-master {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, var(--primary-soft), var(--surface) 45%);
  border: 1px solid var(--primary-border);
}
.settings-master > div { flex: 1; }
.range-fields { display: flex; align-items: flex-end; gap: 16px; margin-left: 56px; max-width: 100%; }
.range-fields label { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; font-size: 12px; font-weight: 650; color: var(--muted); }
.range-fields input { width: 100%; font-variant-numeric: tabular-nums; }
.settings-section > .helper { margin-left: 56px; }
.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  margin-top: 18px;
  max-width: none;
  width: 100%;
  background: var(--hero-grad), var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
#syncForm {
  background: linear-gradient(90deg, var(--primary-soft), var(--surface) 38%);
  border-left: 0;
}
.date-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.date-filter input { width: 142px; font-size: 12px; padding: 7px 11px; border-radius: 9px; }
.logs-toolbar { margin-top: 0; }
.logs-toolbar .search-field { max-width: 270px; }

.mobile-nav { display: none; }
.modal {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 24px;
  width: min(450px, calc(100% - 32px));
  max-height: 85dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  animation: modalPopIn .2s var(--ease-spring);
}
.modal::backdrop { background: rgba(2, 6, 23, 0.72); backdrop-filter: blur(6px); }
.modal h2 { font-size: 18px; font-weight: 800; }
.modal p { margin-top: 8px; font-size: 13px; line-height: 1.75; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-symbol { width: 44px; height: 44px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.modal-heading h2 { font-size: 17.5px; }
.detail-dialog { width: min(600px, calc(100% - 32px)); }
.detail-dialog pre { font: 12.5px/1.8 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-sub); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--text); max-height: 45dvh; overflow-y: auto; }
.detail-dialog footer { display: flex; justify-content: flex-end; margin-top: 16px; }

.more-links { display: flex; flex-direction: column; gap: 8px; }
.more-links a, .more-links button { display: flex; align-items: center; gap: 12px; padding: 13px 15px; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-sub); font-size: 13.5px; font-weight: 650; color: var(--text); transition: all .15s; }
.more-links a:hover, .more-links button:hover { border-color: var(--primary-border); background: var(--raised); }
.more-links a > [data-icon]:last-child { margin-left: auto; color: var(--muted); }
.more-links .logout-button { color: var(--red); margin-top: 4px; }

.toast-container { position: fixed; top: 20px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(350px, calc(100% - 32px)); pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.55;
  box-shadow: var(--shadow-pop);
  pointer-events: auto;
  overflow-wrap: anywhere;
  color: var(--text);
  animation: toastSlideIn .22s var(--ease-spring);
}
.toast.success { border-left-color: var(--green); }
.toast.success > [data-icon] { color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.error > [data-icon] { color: var(--red); }

/* Login Page */
.login-body { min-height: 100dvh; background: var(--bg); overflow-x: hidden; }
.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 48% 52%;
  transition: opacity .24s ease, transform .24s ease;
}
.login-shell.is-login-success {
  animation: loginPortalOut .24s ease forwards;
}
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 44px 56px;
  border-right: 1px solid var(--line);
  background: radial-gradient(ellipse at 10% 80%, rgba(14, 165, 233, 0.25), transparent 65%), radial-gradient(ellipse at 85% 15%, rgba(79, 70, 229, 0.24), transparent 60%), #070a18;
  color: #f8fafc;
  overflow: hidden;
}
.login-brand::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  top: -120px;
  right: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
  filter: blur(28px);
  pointer-events: none;
  animation: auroraFloat 9s ease-in-out infinite alternate;
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  bottom: -100px;
  left: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.24), transparent 70%);
  filter: blur(28px);
  pointer-events: none;
  animation: auroraFloat 11s ease-in-out infinite alternate-reverse;
}
.login-brand .brand-name { color: #fff; }
.login-brand .brand-name small { color: #38bdf8; }
.login-story { position: relative; z-index: 1; margin: auto 0; padding: 40px 0; max-width: 480px; animation: viewFadeUp .52s var(--ease-spring) both; }
.login-story .eyebrow { color: #10b981; }
.login-story h1 { font-size: clamp(36px, 4vw, 54px); line-height: 1.25; letter-spacing: -1.5px; margin: 20px 0; font-weight: 850; color: #fff; }
.login-story h1 > span { color: #38bdf8; }
.story-description { font-size: 15px; color: #cbd5e1; line-height: 1.9; }
.login-flow { display: flex; align-items: center; gap: 12px; margin-top: 36px; }
.login-flow > div {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 18px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  transition: transform .22s var(--ease-spring), border-color .22s ease, background .22s ease;
  animation: cardRiseIn .46s var(--ease-spring) both;
}
.login-flow > div:nth-child(1) { animation-delay: 90ms; }
.login-flow > div:nth-child(3) { animation-delay: 160ms; }
.login-flow > div:nth-child(5) { animation-delay: 230ms; }
.login-flow > div:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(255,255,255,0.09);
}
.login-flow > .flow-arrow { color: #64748b; }
.story-line { height: 1px; background: rgba(255,255,255,0.12); margin: 28px 0 20px; }
.story-tags { display: flex; flex-wrap: wrap; gap: 20px; font-size: 11px; color: #cbd5e1; }
.story-tags span { display: flex; align-items: center; gap: 6px; }
.story-tags i { width: 5px; height: 5px; border-radius: 50%; background: #10b981; }
.brand-bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 15px; flex-wrap: wrap; font-size: 11px; color: #94a3b8; }
.login-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 36px 28px; background: var(--bg-grad), var(--bg); }
.login-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 410px;
  margin: auto 0;
  padding: 34px 32px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-pop);
  animation: cardRiseIn .48s var(--ease-spring) 60ms both;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--btn-primary-grad);
}
.login-welcome { font-size: 11.5px; font-weight: 750; color: var(--primary); }
.login-card h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; margin: 8px 0; }
.login-description { font-size: 12.5px; color: var(--muted); margin-bottom: 24px; }
.login-card .field-label { margin-top: 16px; margin-bottom: 7px; }
.login-input { display: flex; align-items: center; gap: 10px; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--input-bg); padding: 0 14px; color: var(--muted); }
.login-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.login-input input { background: transparent; border: 0; box-shadow: none; padding: 10px 0; width: 100%; min-width: 0; min-height: 42px; font-size: 14px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 20px; }
.login-options > span { font-size: 11px; color: var(--subtle); }
.login-submit { width: 100%; min-height: 46px; font-size: 14px; position: relative; }
.login-security { display: flex; justify-content: center; align-items: center; gap: 7px; color: var(--subtle); font-size: 11px; margin-top: 16px; }
.login-copyright { margin-top: 22px; color: var(--subtle); font-size: 11px; }

/* Extra Components Compatibility */
.template-preview-picker { margin-bottom: 16px; }
.template-preview-picker > label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.template-preview-picker select { width: 100%; text-overflow: ellipsis; }
.template-image-block { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 11px; background: var(--surface-sub); border: 1px solid var(--line-strong); border-radius: 12px; min-width: 0; }
.template-image-thumb { width: 60px; height: 60px; border-radius: 9px; overflow: hidden; background: var(--raised); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.template-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.template-image-block > div:nth-child(2) { flex: 1; min-width: 0; }
.template-image-block strong { display: block; font-size: 12px; color: var(--text); }
.template-image-block code { font-size: 11px; color: var(--primary); margin-left: 4px; }
.template-image-block #templateImageName { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--muted); margin-top: 3px; }
.template-image-block small { display: block; color: var(--subtle); font-size: 10px; margin-top: 2px; }
.template-media-validation { font-size: 12px; color: var(--amber); line-height: 1.75; margin-top: 8px; }
.template-preview-media { position: relative; background: var(--surface-sub); overflow: hidden; border-top: 1px solid var(--line); }
.template-preview-media > img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: contain; }
.template-media-label { position: absolute; bottom: 10px; left: 10px; background: rgba(15, 23, 42, 0.84); color: #fff; font-size: 10px; border-radius: 999px; padding: 3px 9px; pointer-events: none; }
.template-image-unavailable { min-height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 26px 18px; color: var(--muted); text-align: center; }
.template-caption { padding-bottom: 12px; }
.template-preview .template-caption .preview-text { padding: 0 16px; min-height: 0; }
.template-caption .preview-text.is-collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.template-expand { border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 700; padding: 5px 16px 0; min-height: 28px; text-align: left; }
.template-order-picker { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.social-preview[data-preview-order=image-first] .template-caption { padding-top: 12px; }
.social-preview[data-preview-order=image-first] .template-preview-media { border-top: 0; border-bottom: 1px solid var(--line); }

.test-post-dialog { width: min(700px, calc(100vw - 24px)); max-height: 90dvh; overflow: auto; }
.test-post-dialog > label { display: block; margin: 12px 0; }
.test-post-dialog select { width: 100%; margin-top: 6px; }
.test-check { display: flex !important; gap: 10px; align-items: flex-start; line-height: 1.7; }
.test-post-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 12px 0; }
.test-post-preview img { display: block; width: 100%; max-height: 300px; object-fit: contain; background: var(--surface-sub); }
.test-post-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; padding: 0 14px 14px; }

dialog:not([open]), .modal:not([open]), .sync-pages-dialog:not([open]) { display: none !important; }
.sync-pages-dialog[open] { width: min(820px, calc(100vw - 32px)); max-height: 85dvh; display: flex !important; flex-direction: column; overflow: hidden; padding: 22px; }
.sync-modal-body { display: flex; flex-direction: column; gap: 12px; overflow: hidden; margin: 10px 0; flex: 1; }
.sync-modal-search { max-width: none; }
.sync-modal-content { max-height: 400px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-sub); }
.sync-modal-table { width: 100%; border-collapse: collapse; }
.sync-modal-table th { position: sticky; top: 0; background: var(--surface); z-index: 2; padding: 10px 14px; font-size: 11.5px; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); }
.sync-modal-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.sync-modal-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }
.sync-modal-buttons { display: flex; gap: 10px; margin-left: auto; }

.diagnostic-toolbar { display: flex; align-items: center; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.diagnostic-toolbar .search-field { flex: 1; min-width: 200px; max-width: 340px; }
.page-schedule-cell { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-time-input { min-height: 32px; height: 32px; padding: 4px 9px; font-size: 12px; font-variant-numeric: tabular-nums; border-radius: 8px; width: auto; }
.page-time-save, .page-time-reset { min-height: 30px; padding: 4px 10px; font-size: 11px; }
.selection-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.batch-schedule-group { display: inline-flex; align-items: center; gap: 6px; padding-right: 8px; margin-right: 4px; border-right: 1px solid var(--line); }
.page-card-schedule { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; }
.token-field-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 6px; }
.change-password-dialog { width: min(420px, calc(100% - 32px)); }
.material-processing { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow-card); }

/* ==========================================================================
   16. RESPONSIVE BREAKPOINTS (PC -> Laptop -> Tablet -> Mobile H5 320px)
   ========================================================================== */
@media (max-width: 1360px) {
  .dashboard-visual-grid { grid-template-columns: 1fr 1fr; }
  .overview-panel { grid-column: 1 / -1; }
  .overview-panel-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

@media (max-width: 1180px) {
  :root { --sidebar-width: 220px; }
  .main-content { padding: 18px 20px; }
  .topbar { margin: 12px 20px 0; }
  .workspace-footer { margin: 0 20px; }
  .stats-grid { gap: 12px; }
  .stat-card > strong { font-size: 28px; }
  .analytics-split-layout { grid-template-columns: 270px minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-visual-grid { grid-template-columns: 1fr; }
  .overview-panel-body { grid-template-columns: 1fr; }
  .template-layout, .analytics-split-layout, #settingsFields { grid-template-columns: 1fr; }
  .engine-metrics { display: none; }
  .topbar-theme-pill { display: none; }
  .theme-switch-btn { display: inline-flex; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .workspace, .sidebar-collapsed .workspace { margin-left: 0; }
  .topbar { height: 56px; margin: 10px 12px 0; padding: 0 14px; border-radius: 14px; }
  .topbar-right { gap: 8px; }
  .main-content { padding: 14px 12px; }
  .page-heading { margin-bottom: 14px; padding: 16px; border-radius: 16px; gap: 12px; }
  .page-heading-info { padding-left: 50px; }
  .ui-page-symbol { width: 38px; height: 38px; border-radius: 11px; }
  .page-heading h1 { font-size: 20px; }
  .workspace-footer { margin: 0; padding: 16px 14px calc(90px + env(safe-area-inset-bottom)); }
  .workspace-footer > span:last-child { display: none; }

  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--topbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--line-strong);
  }
  .mobile-nav a, .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 48px;
    min-height: 46px;
    padding: 2px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }
  .mobile-nav .icon { width: 20px; height: 20px; }
  .mobile-nav .active { color: var(--primary); font-weight: 800; }
  .mobile-nav .active > [data-icon] { padding: 3px 12px; background: var(--primary-soft); border-radius: 999px; }

  .mobile-template-tabs { display: flex; margin-bottom: 14px; }
  .mobile-template-tabs button { flex: 1; min-height: 36px; }
  .template-layout.preview-mode .template-editor { display: none; }
  .template-layout:not(.preview-mode) .template-preview { display: none; }
  .range-fields, .settings-section > .helper { margin-left: 0; }
  .save-bar {
    position: sticky;
    bottom: calc(72px + env(safe-area-inset-bottom));
    padding: 12px 14px;
    margin-top: 14px;
    z-index: 10;
  }
  .more-dialog {
    margin: auto 0 0;
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  }
  .login-shell { display: flex; flex-direction: column; }
}

@media (max-width: 600px) {
  .desktop-only, .breadcrumb-badge { display: none !important; }
  .topbar { height: 52px; margin: 8px 10px 0; padding: 0 12px; }
  .topbar-theme-group { padding: 2px; border: 0; background: transparent; }
  .theme-switch-btn { padding: 5px 9px; font-size: 11px; min-height: 32px; }
  #themeToggleLabel { display: none; }
  .service-state { font-size: 11px; padding: 4px 9px; gap: 5px; }
  .account-menu summary { padding: 2px; border: 0; background: transparent; min-height: 34px; }
  .account-menu summary > [data-icon] { display: none; }
  .main-content { padding: 12px 10px; }
  .page-heading { align-items: flex-start; padding: 14px; gap: 10px; }
  .page-heading h1 { font-size: 19px; }
  .refresh-label { display: none; }
  .page-heading-actions .button { width: 38px; min-height: 38px; padding: 8px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 14px 12px; border-radius: 14px; }
  .stat-card > strong { font-size: 23px; margin: 8px 0 6px; }
  .stat-card > div:first-child { font-size: 11px; }
  .stat-icon-orb { width: 30px; height: 30px; border-radius: 8px; }
  .stat-card p { font-size: 11px; }
  .engine-panel { padding: 14px; gap: 10px; border-radius: 14px; }
  .engine-setting-btn { padding: 8px; }
  .panel { border-radius: 16px; }
  .panel-heading, .panel-body { padding: 14px; }
  .logs-table-desktop, .table-frame.pages-table, .analytics-products-desktop { display: none; }
  .mobile-records { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
  .mobile-log {
    padding: 13px;
    border-radius: 12px;
    background: var(--surface-sub);
    border: 1px solid var(--line);
  }
  .mobile-log-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mobile-log-title { font-size: 13px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
  .mobile-log-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 6px; }
  .mobile-log-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; }
  .page-cards { display: flex; flex-direction: column; gap: 10px; }
  .page-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-card); }
  .page-card-top { display: flex; align-items: flex-start; gap: 10px; }
  .page-card-info { flex: 1; min-width: 0; }
  .page-card-info > a { display: block; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
  .page-card-info > small { display: block; font-size: 11px; color: var(--subtle); margin-top: 3px; overflow-wrap: anywhere; }
  .page-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
  .page-card-actions { position: relative; }
  .page-card-actions summary { list-style: none; }
  .page-card-actions summary::-webkit-details-marker { display: none; }
  .page-card-menu { position: absolute; right: 0; top: 38px; z-index: 20; min-width: 150px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); }
  .page-card-menu button { display: flex; align-items: center; gap: 8px; padding: 9px; min-height: 38px; width: 100%; border: 0; border-radius: 8px; background: transparent; font-size: 12px; text-align: left; }
  .product-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .toolbar { padding: 12px; border-radius: 14px; }
  .product-toolbar .segmented, .analytics-toolbar .segmented { flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .product-toolbar .search-field, .analytics-toolbar .search-field { max-width: none; flex-basis: 100%; }
  .batch-schedule-group { border-right: 0; padding-right: 0; margin-right: 0; width: 100%; justify-content: flex-end; }
  .story-description, .login-flow, .brand-bottom { display: none; }
  .login-brand { padding: 24px 20px; }
  .login-side { padding: 20px 16px; }
  .login-card { padding: 22px 18px; }
}

@media (max-width: 360px) {
  .main-content { padding-left: 8px; padding-right: 8px; }
  .stat-card { padding: 12px 10px; }
  .stat-card > strong { font-size: 21px; }
  .stat-icon-orb { display: none; }
  .product-card-main { gap: 10px; padding: 12px; }
  .product-photo { width: 72px; height: 72px; }
  .product-card-footer { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
