:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-subtle: #eef2ff;
  --primary-border: #c7d2fe;
  --primary-glow: rgba(79, 70, 229, 0.15);
  --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #818cf8;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --success: #10b981;
  --success-subtle: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #f59e0b;
  --warning-subtle: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-subtle: #fef2f2;
  --danger-border: #fecaca;
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 30px -10px rgba(79, 70, 229, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  color: var(--text-main);
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(124, 58, 237, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(224, 231, 255, 0.2) 0px, transparent 50%);
  background-attachment: fixed;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }

.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 60px;
}

/* --- Modern Header Navigation --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 800;
}

.brand-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--success-subtle);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(0.9); opacity: 0; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-subtle);
  border-color: #cbd5e1;
  color: var(--text-main);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
}
.btn-danger-ghost:hover {
  background: var(--danger-subtle);
}

/* --- Auth Layout (Unauthenticated) --- */
.auth-container {
  display: flex;
  flex-direction: column;
  gap: 56px;
  min-height: calc(100vh - 180px);
  padding: 16px 0 60px;
}

.auth-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 440px);
  gap: 48px;
  align-items: flex-start;
}

@media (max-width: 980px) {
  .auth-hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

.auth-hero {
  padding-right: 12px;
}

@media (max-width: 980px) {
  .auth-hero {
    padding-right: 0;
  }
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
  border: 1px solid var(--primary-border);
}

.badge-sparkle {
  display: inline-block;
  animation: sparkleTwinkle 2.4s ease-in-out infinite;
}

@keyframes sparkleTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.25) rotate(15deg); }
}

.auth-hero-title {
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 18px;
}

.auth-hero-title span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.auth-hero p.intro {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 620px;
}

.auth-hero p.intro strong {
  color: var(--text-main);
}

/* CTA Row in Hero */
.auth-cta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.btn-hero-cta {
  height: 46px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 0.2s ease;
}

.btn-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
}

.btn-hero-guide {
  height: 46px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.btn-hero-guide:hover {
  background: var(--surface-subtle);
  border-color: #cbd5e1;
  color: var(--primary);
  transform: translateY(-1px);
}

/* Trust Tags Row */
.trust-tags-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.trust-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.trust-tag i {
  color: var(--success);
  font-size: 13px;
}

/* Beginner 3 Steps Box */
.beginner-steps-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.beginner-steps-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-brand);
}

.beginner-steps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.beginner-steps-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 7px;
}

.beginner-steps-title i {
  color: var(--primary);
}

.beginner-steps-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.beginner-steps-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

@media (max-width: 680px) {
  .beginner-steps-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .b-step-arrow {
    display: none !important;
  }
}

.b-step-item {
  background: var(--surface-subtle);
  border: 1px solid #edf2f7;
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.b-step-item:hover {
  background: #ffffff;
  border-color: var(--primary-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.b-step-item.highlight {
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
  border-color: #ddd6fe;
}

.b-step-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: #e0e7ff;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.b-step-item.highlight .b-step-badge {
  background: #7c3aed;
  color: #ffffff;
}

.b-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.b-step-item.highlight .b-step-icon {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #6d28d9;
}

.b-step-content strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.b-step-content span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.b-step-arrow {
  color: #cbd5e1;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Auth Card Right */
.auth-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 32px;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.auth-card-top-tip {
  font-size: 11px;
  font-weight: 600;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 6px 12px;
  border-radius: 6px;
  text-align: center;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.auth-tab {
  height: 42px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.auth-tab.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.input-field {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-switch-prompt {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
}

.form-switch-prompt a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.form-switch-prompt a:hover {
  color: var(--primary-hover);
}

.form-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  font-size: 13px;
  margin-top: 14px;
  display: none;
}
.form-error:not(:empty) { display: block; }

/* XingTui explainer box in register */
.xingtui-beginner-explainer {
  background: #fffbeb;
  border-left: 3px solid #d97706;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 11px;
  color: #92400e;
  line-height: 1.5;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.xingtui-beginner-explainer i {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ========================================================
   Section Headers for Showcase, Comparison, FAQ
======================================================== */
.section-title-wrap {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 36px;
}

.section-subheading {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-heading {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-intro {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================================
   Comparison Section: Traditional vs PanSD
======================================================== */
.auth-comparison-section {
  padding: 40px 0 20px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 780px) {
  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.compare-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 28px;
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.compare-card-bad {
  border-color: #f1f5f9;
  background: #fafafa;
}

.compare-card-good {
  border: 2px solid #818cf8;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfe 100%);
  box-shadow: 0 16px 36px -10px rgba(79, 70, 229, 0.16);
}

.compare-glow-banner {
  position: absolute;
  top: -12px;
  right: 28px;
  background: var(--gradient-brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.compare-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.compare-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.compare-icon-wrap.bad {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
}

.compare-icon-wrap.good {
  background: #ecfdf5;
  color: #10b981;
  border: 1px solid #a7f3d0;
}

.compare-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
}

.compare-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.compare-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.compare-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.compare-list li i {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.compare-list li strong {
  display: block;
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 2px;
}

.compare-list li span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========================================================
   4 Core Advantages Quad Grid
======================================================== */
.auth-features-section {
  padding: 20px 0;
}

.features-quad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 980px) {
  .features-quad-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .features-quad-grid {
    grid-template-columns: 1fr;
  }
}

.feature-quad-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.22s ease;
  box-shadow: var(--shadow-sm);
}

.feature-quad-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-lg);
}

.f-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  margin-bottom: 16px;
}

.f-icon-sky { background: #e0f2fe; color: #0284c7; }
.f-icon-indigo { background: #e0e7ff; color: #4338ca; }
.f-icon-emerald { background: #dcfce7; color: #16a34a; }
.f-icon-amber { background: #fef3c7; color: #d97706; }

.feature-quad-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.feature-quad-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================================
   FAQ Accordion Section
======================================================== */
.auth-faq-section {
  padding: 20px 0;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.faq-item:hover {
  border-color: #cbd5e1;
}

.faq-item.active {
  border-color: var(--primary-border);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
}

.faq-question {
  width: 100%;
  padding: 18px 20px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.18s ease;
}

.faq-question:hover {
  background: #f8fafc;
}

.faq-q-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-chevron {
  font-size: 13px;
  color: var(--text-subtle);
  transition: transform 0.25s ease;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  padding: 0 20px;
  background: #ffffff;
}

.faq-item.active .faq-answer {
  max-height: 400px;
  padding: 0 20px 20px 20px;
}

.faq-answer p {
  font-size: 14px;
  color: #475569;
  line-height: 1.7;
  border-top: 1px dashed #e2e8f0;
  padding-top: 14px;
}

.faq-answer p strong {
  color: var(--primary);
}

/* ========================================================
   Bottom CTA Banner
======================================================== */
.auth-bottom-cta {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
  border-radius: var(--radius-xl);
  padding: 40px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  box-shadow: 0 16px 36px -10px rgba(49, 46, 129, 0.4);
  position: relative;
  overflow: hidden;
}

.auth-bottom-cta::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -40px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.b-cta-content {
  max-width: 580px;
  position: relative;
  z-index: 1;
}

.b-cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffd885;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
}

.b-cta-content h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
  color: #ffffff;
}

.b-cta-content p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.b-cta-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.btn-cta-white {
  height: 46px;
  padding: 0 22px;
  background: #ffffff;
  color: #312e81;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.btn-cta-white:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.btn-cta-outline {
  height: 46px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.btn-cta-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ========================================================
   Beginner Guide Modal Styles (#beginnerGuideModal)
======================================================== */
.beginner-guide-flow {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.guide-step-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.guide-step-card.highlight {
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
  border-color: #c4b5fd;
}

.guide-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.guide-step-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e0e7ff;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guide-step-tag.good {
  background: #10b981;
  color: #ffffff;
}

.guide-step-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.guide-step-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.guide-sub-box {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.guide-sub-text p {
  font-size: 12px;
  color: #334155;
  line-height: 1.6;
  margin: 2px 0;
}

.guide-info-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #3730a3;
  margin-top: 10px;
}

/* --- Dashboard View (Logged In) --- */
.dashboard-container {
  display: none;
  animation: fadeIn 0.35s ease forwards;
}
.dashboard-container.visible { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Dashboard Hero Banner --- */
.dashboard-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: #ffffff;
  margin-bottom: 24px;
  box-shadow: 0 12px 30px -10px rgba(49, 46, 129, 0.4);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 24px;
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.hero-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.hero-greeting h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.partner-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.hero-referral-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 8px 6px 14px;
  border-radius: var(--radius-md);
  max-width: 630px;
  width: 100%;
}

.hero-referral-input {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  width: 100%;
  text-overflow: ellipsis;
}

.btn-copy {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-copy:hover { background: #f1f5f9; transform: translateY(-1px); }
.btn-copy.copied { background: var(--success); color: #ffffff; }

.btn-test-link {
  height: 34px;
  width: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-test-link:hover { background: rgba(255, 255, 255, 0.25); }

/* --- Modern Tab Navigation --- */
.dashboard-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.dashboard-nav::-webkit-scrollbar { display: none; }

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}

.nav-tab-btn.active {
  color: var(--primary);
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* --- KPI Metrics Grid --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kpi-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kpi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.icon-sky { background: #e0f2fe; color: #0284c7; }
.icon-violet { background: #ede9fe; color: #7c3aed; }
.icon-indigo { background: #e0e7ff; color: #4338ca; }
.icon-cyan { background: #cffafe; color: #0891b2; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-emerald { background: #d1fae5; color: #059669; }
.icon-slate { background: #f1f5f9; color: #475569; }

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 4px;
}

.kpi-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Content Grid & Panels --- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}

.panel-card.full-width {
  grid-column: 1 / -1;
}

.panel-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 14px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.panel-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Period Filter Toolbar --- */
.period-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.period-filter-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.period-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.period-btn-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.period-btn {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.period-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}
.period-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  font-weight: 700;
}

.custom-date-range-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  box-shadow: 0 0 0 2px var(--primary-glow);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.input-date {
  height: 30px;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  background: #fff;
}
.input-date:focus {
  outline: none;
  border-color: var(--primary);
}

.date-separator {
  font-size: 12px;
  color: var(--text-muted);
}

.period-filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-info-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--primary-border);
}

.period-syncing-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--warning-subtle);
  color: var(--warning);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--warning-border);
}

/* --- Interactive Multi-Type Trend Chart --- */
.chart-panel-card {
  padding: 22px 24px;
  margin-bottom: 24px;
}

.chart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.chart-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-type-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.chart-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.chart-type-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}
.chart-type-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  font-weight: 700;
}

.chart-sub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border-subtle);
}

.metric-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}
.metric-pill:hover {
  border-color: #cbd5e1;
  color: var(--text-main);
}
.metric-pill.active {
  border-color: var(--primary-border);
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.1);
}

.metric-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-all { background: var(--gradient-brand); }
.dot-sky { background: #0284c7; }
.dot-indigo { background: #4f46e5; }
.dot-cyan { background: #0891b2; }
.dot-amber { background: #d97706; }
.dot-emerald { background: #059669; }

.chart-highlights {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.highlight-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 4px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-width: 84px;
}

.highlight-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.highlight-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 350px;
  min-height: 350px;
}

.chart-canvas-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 10;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* --- Referral Customizer --- */
.referral-config-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.code-edit-form {
  display: flex;
  gap: 8px;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.step-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}

.step-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary-subtle);
  color: var(--primary);
  margin-bottom: 6px;
}

.step-card p {
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Accounts Section --- */
.account-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.account-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.account-card-item:hover {
  box-shadow: var(--shadow-sm);
}

.account-provider-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.provider-icon-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: 20px;
  color: #fff;
}

.provider-baidu { background: linear-gradient(135deg, #2932e1 0%, #1e25b0 100%); }
.provider-quark { background: linear-gradient(135deg, #ff5000 0%, #d83f00 100%); }

.account-details h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
}

.account-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}
.account-health-pill.healthy { background: var(--success-subtle); color: var(--success); }
.account-health-pill.degraded { background: var(--warning-subtle); color: var(--warning); }
.account-health-pill.waiting { background: var(--surface-subtle); color: var(--text-muted); }

/* --- Degraded Account Card Enhancements --- */
.account-card-item.is-degraded {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(180deg, #fffdfa 0%, #ffffff 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.08);
}
.account-card-item.is-degraded .account-health-pill.degraded {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  animation: pulse-health-pill 2s infinite ease-in-out;
}
@keyframes pulse-health-pill {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.98); }
}

.account-warning-alert {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 12px;
  color: #92400e;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.account-warning-alert i {
  color: #d97706;
  margin-top: 2px;
  flex-shrink: 0;
}

.btn-warning-action {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25) !important;
  transition: all 0.2s ease !important;
}
.btn-warning-action:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35) !important;
  transform: translateY(-1px);
}

/* --- Global / Overview Account Fallback Alert Banner --- */
.partner-account-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #fffbeb 0%, #fff7ed 100%);
  border: 1px solid #fde68a;
  border-left: 5px solid #f59e0b;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.08);
  animation: slideInDownAlert 0.3s ease-out;
}

@keyframes slideInDownAlert {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.alert-banner-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fef3c7;
  color: #d97706;
  font-size: 17px;
  flex-shrink: 0;
}

.alert-banner-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-banner-content p {
  font-size: 12.5px;
  color: #b45309;
  line-height: 1.45;
}

.alert-banner-content .fallback-count-badge {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 3px;
  background: #fde68a;
  color: #78350f;
  font-weight: 700;
  border-radius: 4px;
  font-size: 12px;
}

.alert-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.alert-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: #d97706;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.alert-banner-btn:hover {
  background: #b45309;
  transform: translateY(-1px);
}

.alert-banner-dismiss {
  background: transparent;
  border: none;
  color: #b45309;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.alert-banner-dismiss:hover {
  opacity: 1;
}

.kpi-sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
}

@media (max-width: 768px) {
  .partner-account-alert-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .alert-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* --- Account Binding Guided Wizard (Stepper & Panes) --- */
.account-wizard-card {
  position: relative;
  overflow: hidden;
}

.wizard-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.wizard-stepper-container {
  margin: 0 0 16px;
  padding: 10px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wizard-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  opacity: 0.55;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.wizard-step-item:hover {
  opacity: 0.85;
}

.wizard-step-item.active,
.wizard-step-item.completed {
  opacity: 1;
}

.wizard-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  position: relative;
}

.wizard-step-item.active .wizard-step-circle {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.wizard-step-item.completed .wizard-step-circle {
  background: var(--success);
  color: #ffffff;
}

.step-circle-check {
  display: none;
}

.wizard-step-item.completed .step-circle-check {
  display: inline-block;
}

.wizard-step-item.completed .step-circle-num {
  display: none;
}

.wizard-step-meta {
  display: flex;
  flex-direction: column;
}

.wizard-step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.wizard-step-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.wizard-step-connector {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 12px;
  transition: all 0.3s ease;
  border-radius: 1px;
}

.wizard-step-connector.completed {
  background: var(--success);
}

.wizard-step-connector.active {
  background: linear-gradient(90deg, var(--primary) 0%, #a5b4fc 100%);
}

.wizard-body {
  position: relative;
}

.wizard-pane {
  display: none;
  animation: wizardFadeSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.wizard-pane.active {
  display: block;
}

@keyframes wizardFadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-pane-header {
  margin-bottom: 20px;
}

.wizard-pane-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-pane-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Compact Provider Selection Cards (Step 1) */
.wizard-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .wizard-provider-grid {
    grid-template-columns: 1fr;
  }
}

.wizard-provider-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.wizard-provider-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.wizard-provider-card.selected {
  border-color: var(--primary);
  background: #fbfbfe;
  box-shadow: 0 0 0 1px var(--primary), 0 4px 14px rgba(79, 70, 229, 0.08);
}

.provider-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.provider-info-block {
  flex: 1;
  min-width: 0;
}

.provider-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.provider-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.provider-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-badge-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.provider-badge-tag.tag-bound {
  background: var(--success-subtle);
  color: var(--success);
}

.provider-badge-tag.tag-unbound {
  background: #f1f5f9;
  color: #64748b;
}

.provider-badge-radio {
  font-size: 20px;
  color: #cbd5e1;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.wizard-provider-card.selected .provider-badge-radio {
  color: var(--primary);
}

.step1-auth-hint {
  margin-top: 14px;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Auth Mode Segmented Tab Switcher (Step 2) */
.wizard-auth-switcher {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

.auth-switch-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-switch-btn:hover {
  color: var(--text-main);
}

.auth-switch-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tag-recommend {
  font-size: 10px;
  font-weight: 700;
  background: #fee2e2;
  color: #ef4444;
  padding: 1px 6px;
  border-radius: 4px;
}

/* Mode Selection Cards */
.wizard-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

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

.wizard-mode-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s ease;
}

.wizard-mode-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wizard-mode-card.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.02);
  box-shadow: 0 0 0 1px var(--primary);
}

.mode-card-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mode-radio-icon {
  font-size: 16px;
  color: #cbd5e1;
  margin-top: 2px;
  transition: color 0.2s ease;
}

.wizard-mode-card.selected .mode-radio-icon {
  color: var(--primary);
}

.mode-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.badge-recommend {
  font-size: 10px;
  font-weight: 700;
  background: #fee2e2;
  color: #ef4444;
  padding: 1px 6px;
  border-radius: 4px;
}

.badge-manual {
  font-size: 10px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  padding: 1px 6px;
  border-radius: 4px;
}

.mode-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 360px;
}

/* Actions Bar */
.wizard-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.wizard-selected-summary {
  font-size: 13px;
  color: var(--text-muted);
}

/* Step 2: Context Alert & Guides */
.wizard-context-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #3730a3;
  flex-wrap: wrap;
  gap: 8px;
}

.context-alert-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-link-action {
  background: transparent;
  border: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-link-action:hover {
  text-decoration: underline;
}

/* QR Guide Steps */
.qr-guide-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.qr-guide-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

.qr-guide-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-guide-arrow {
  color: #cbd5e1;
  font-size: 14px;
}

/* QR Center Canvas Card */
.qr-display-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 26px 22px;
  text-align: center;
  max-width: 460px;
  margin: 0 auto;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.qr-code-frame {
  position: relative;
  width: 204px;
  height: 204px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 6px;
}

.qr-frame-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
}

.qr-frame-loading i {
  font-size: 30px;
  color: var(--primary);
}

.qr-frame-success {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 10;
}

.animated-check {
  font-size: 52px;
  color: #10b981;
  animation: checkPulse 0.4s ease;
}

@keyframes checkPulse {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 16px;
  font-weight: 700;
  color: #059669;
  margin: 4px 0 0;
}

.success-name {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.qr-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 16px 0 10px;
}

.status-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.qr-refresh-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.qr-success-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 20px;
  gap: 16px;
  flex-wrap: wrap;
  animation: wizardFadeSlide 0.3s ease;
}

.success-card-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.success-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #d1fae5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.success-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 2px;
}

.success-card-desc {
  font-size: 12px;
  color: #047857;
}

/* Cookie Mode UI */
.cookie-help-collapse {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.monospace-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

/* Step 3: Identity Summary & Form */
.account-identity-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.summary-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.summary-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.wizard-form-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.security-assurance-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 24px;
}

.security-shield-icon {
  font-size: 20px;
  color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.security-assurance-box strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 2px;
}

.security-assurance-box p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Step 4 / Success Transition Canvas */
.wizard-success-canvas {
  text-align: center;
  padding: 40px 20px;
  max-width: 560px;
  margin: 0 auto;
}

.wizard-success-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #10b981;
  font-size: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.1);
  animation: checkPulse 0.4s ease;
}

.wizard-success-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 8px;
}

.wizard-success-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 28px;
}

.wizard-success-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Data Tables --- */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

thead th {
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-subtle); }

.table-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.cloud-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.cloud-baidu { background: #e0e7ff; color: #3730a3; }
.cloud-quark { background: #ffedd5; color: #c2410c; }
.cloud-aliyun { background: #e0f2fe; color: #0369a1; }
.cloud-115 { background: #fef3c7; color: #b45309; }
.cloud-lanzou { background: #dcfce7; color: #15803d; }
.cloud-uc { background: #f3e8ff; color: #6b21a8; }
.cloud-xunlei { background: #fee2e2; color: #b91c1c; }

.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}
.status-tag.success { background: var(--success-subtle); color: var(--success); }
.status-tag.empty { background: var(--surface-subtle); color: var(--text-muted); }
.status-tag.failed { background: var(--danger-subtle); color: var(--danger); }
.status-tag.partial { background: var(--warning-subtle); color: var(--warning); }

/* --- Private Resources Toolbar --- */
.resource-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.resource-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 280px;
  max-width: 560px;
}

.resource-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 13px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.search-input-wrapper .search-input {
  padding-left: 36px;
  padding-right: 32px;
  height: 40px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.search-input-wrapper .search-clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: 0;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
  display: grid;
  place-items: center;
  transition: color 0.15s ease;
}
.search-input-wrapper .search-clear-btn:hover { color: var(--text-main); }

.filter-select-wrapper .filter-select {
  height: 40px;
  width: 145px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding-right: 28px;
}

/* Table Checkbox & Custom Badges */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
}

tbody tr.row-selected td {
  background: var(--primary-subtle) !important;
}

.tag-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
  margin-top: 3px;
}

.passcode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.passcode-badge:hover {
  border-color: var(--primary-border);
  background: var(--primary-subtle);
  color: var(--primary);
}

/* --- Modal Dialog System --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-backdrop:not([hidden]) {
  display: flex !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.05);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.modal-sm {
  max-width: 520px;
}

.modal-dialog.modal-lg {
  max-width: 720px;
}

@keyframes modalZoomIn {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 16px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
}
.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  gap: 12px;
}

.modal-footer-note {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* --- Smart Paste Recognition Box --- */
.smart-paste-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(124, 58, 237, 0.04) 100%);
  border: 1px dashed var(--primary-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.smart-paste-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.smart-paste-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
}

.smart-paste-tip {
  color: var(--text-muted);
  font-size: 11px;
}

.smart-paste-input-group {
  display: flex;
  gap: 8px;
}

.smart-paste-input-group .input-field {
  height: 38px;
  font-size: 13px;
}

.field-flash {
  animation: fieldHighlight 1.5s ease-out;
}

@keyframes fieldHighlight {
  0% { background: #e0e7ff; box-shadow: 0 0 0 3px var(--primary-glow); }
  100% { background: #ffffff; }
}

/* --- Aligned Form Grid --- */
.resource-form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.resource-form-grid .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

.resource-form-grid .col-12 { grid-column: span 12; }
.resource-form-grid .col-8 { grid-column: span 8; }
.resource-form-grid .col-6 { grid-column: span 6; }
.resource-form-grid .col-4 { grid-column: span 4; }

.required-star {
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}

/* --- CSV Dropzone & Guide --- */
.csv-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.csv-dropzone:hover, .csv-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.csv-drop-icon {
  font-size: 32px;
  color: var(--primary);
  opacity: 0.8;
}

.csv-drop-text {
  font-size: 13px;
  color: var(--text-main);
}

.csv-drop-text strong {
  color: var(--primary);
}

.csv-file-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
}

.csv-clear-btn {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  padding: 2px;
  display: grid;
  place-items: center;
}

.csv-format-guide {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.csv-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.btn-copy-format {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.btn-copy-format:hover {
  background: var(--primary-subtle);
}

.csv-format-code {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 12px;
  overflow-x: auto;
  color: var(--text-main);
  margin-bottom: 6px;
}

.csv-guide-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Toast Notifications --- */
.toast-box {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 19999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-box.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
  .auth-container { grid-template-columns: 1fr; gap: 36px; }
  .auth-hero { padding-right: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .account-cards-grid { grid-template-columns: 1fr; }
  .account-form-grid { grid-template-columns: 1fr 1fr; }
  .resource-toolbar-left { max-width: 100%; }
}

@media (max-width: 640px) {
  .app-shell { padding: 12px 14px 40px; }
  .navbar { padding: 10px 14px; margin-bottom: 18px; }
  .brand-tag { display: none; }
  .dashboard-hero { padding: 20px; }
  .hero-layout { flex-direction: column; align-items: flex-start; }
  .hero-referral-box { width: 100%; }
  .kpi-grid { grid-template-columns: 1fr; }
  .account-form-grid { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr; }
  .toast-box { left: 16px; right: 16px; bottom: 16px; }
  
  .resource-toolbar-left { flex-direction: column; align-items: stretch; }
  .filter-select-wrapper .filter-select { width: 100%; }
  .resource-toolbar-right { width: 100%; justify-content: stretch; }
  .resource-toolbar-right .btn { flex: 1; }
  .resource-form-grid .col-8,
  .resource-form-grid .col-6,
  .resource-form-grid .col-4 { grid-column: span 12; }
  .modal-dialog { max-height: 96vh; margin: 8px; }

  /* Mobile Period Filter & Chart Adjustments */
  .period-filter-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .period-filter-left { flex-direction: column; align-items: stretch; }
  .period-btn-group { width: 100%; justify-content: space-between; overflow-x: auto; }
  .period-btn { padding: 5px 8px; font-size: 11px; }
  .custom-date-range-box { flex-wrap: wrap; }
  .chart-panel-header { flex-direction: column; align-items: flex-start; }
  .chart-type-switcher { width: 100%; justify-content: space-between; }
  .chart-type-btn { flex: 1; justify-content: center; }
  .chart-sub-toolbar { flex-direction: column; align-items: stretch; }
  .chart-highlights { width: 100%; justify-content: space-between; }
  .chart-canvas-wrapper { height: 280px; min-height: 280px; }
}

/* ============================================================
 * XingTui Alliance Onboarding Guide & Registration Components
 * ============================================================ */
.xingtui-pre-reg-card {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.6) 0%, rgba(255, 251, 235, 0.9) 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px -2px rgba(245, 158, 11, 0.12);
  transition: all 0.2s ease;
}
.xingtui-pre-reg-card:hover {
  border-color: #fcd34d;
  box-shadow: 0 6px 16px -2px rgba(245, 158, 11, 0.18);
}

.xingtui-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.xingtui-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: #d97706;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.xingtui-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.xingtui-card-body {
  display: flex;
  gap: 14px;
  align-items: center;
}

.xingtui-steps {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #78350f;
  line-height: 1.6;
}

.xingtui-step-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 5px;
}
.xingtui-step-line:last-child {
  margin-bottom: 0;
}

.xingtui-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #f59e0b;
  color: #ffffff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.xingtui-code-highlight {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px dashed #f59e0b;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: #b45309;
  cursor: pointer;
  user-select: all;
  transition: background 0.15s ease;
}
.xingtui-code-highlight:hover {
  background: #fffbeb;
  border-color: #d97706;
}

.xingtui-thumb-preview {
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.xingtui-thumb-preview:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}
.xingtui-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.xingtui-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(1px);
}
.xingtui-thumb-preview:hover .xingtui-thumb-overlay {
  opacity: 1;
}

.wizard-xingtui-alert {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
}
.wizard-xingtui-alert-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.wizard-xingtui-alert i.fa-shield {
  color: #f59e0b;
  font-size: 16px;
  flex-shrink: 0;
}

.xingtui-modal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 24px;
  align-items: start;
}
@media (max-width: 640px) {
  .xingtui-modal-body {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
}
.xingtui-poster-big-wrapper {
  text-align: center;
}
.xingtui-poster-big-wrapper img {
  width: 100%;
  max-width: 240px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
}
.xingtui-modal-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.xingtui-modal-content p.desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.xingtui-flow-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.xingtui-flow-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  line-height: 1.5;
}
.xingtui-flow-item strong {
  color: var(--text-main);
}
.xingtui-flow-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Hero Poster Button --- */
.hero-referral-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-md);
  max-width: 640px;
  width: 100%;
  box-sizing: border-box;
}

.hero-referral-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.hero-referral-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-hero-poster {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-hero-poster:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.45);
}

/* ============================================================
   Poster Workshop & Poster Generator Modal Styles
   ============================================================ */

/* --- Poster Workshop Banner in Overview --- */
.poster-workshop-banner {
  background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 50%, #eff6ff 100%);
  border: 1px solid rgba(219, 39, 119, 0.2);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.poster-workshop-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(219, 39, 119, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.poster-workshop-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
}
.poster-workshop-info {
  flex: 1;
  min-width: 0;
}
.poster-workshop-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #be185d;
  background: #fce7f3;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.poster-workshop-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.poster-workshop-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
  max-width: 720px;
}
.poster-workshop-features {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.poster-workshop-features span {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.poster-workshop-features span i {
  color: #db2777;
}
.btn-poster-launch {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 10px 18px !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.3) !important;
  white-space: nowrap !important;
  border: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0;
}
.btn-poster-launch:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(219, 39, 119, 0.4) !important;
}

/* --- Poster Generator Modal --- */
.poster-modal-dialog {
  max-width: 860px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  margin: auto !important;
}
.poster-modal-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  padding: 18px 20px;
  max-height: calc(88vh - 75px);
  overflow-y: auto;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

.poster-controls-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}
/* Category Tab Switcher */
.poster-category-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 12px;
}
.poster-cat-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.poster-cat-tab:hover {
  color: var(--text-main, #0f172a);
  background: rgba(255, 255, 255, 0.7);
}
.poster-cat-tab.active {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.poster-cat-tab[data-cat="partner"].active {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.poster-cat-tab[data-cat="search"].active {
  color: #4338ca;
  background: #eef2ff;
  border-color: #c7d2fe;
}
.poster-cat-tab .cat-count-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
}

.poster-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}
.poster-badge-hint {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fdf2f8;
  color: #db2777;
}
.poster-badge-hint.badge-partner {
  background: #fef3c7;
  color: #b45309;
}
.poster-badge-hint.badge-search {
  background: #fdf2f8;
  color: #db2777;
}

/* Template Grid & Cards */
.poster-template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 290px;
  overflow-y: auto;
  overflow-x: hidden !important;
  padding-right: 4px;
  box-sizing: border-box;
}
.poster-tpl-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
}
.poster-tpl-card:hover {
  border-color: #a5b4fc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.poster-tpl-card.active {
  border-color: #ec4899;
  background: #fdf4ff;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}
.poster-tpl-card.active::after {
  content: '\f00c';
  font-family: FontAwesome;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: #ec4899;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(236, 72, 153, 0.3);
}

.poster-tpl-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
}
.poster-tpl-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.poster-tpl-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  background: rgba(15, 23, 42, 0.85);
  color: #fbcfe8;
  border: 1px solid rgba(244, 114, 182, 0.4);
}
.poster-tpl-info {
  margin-top: 6px;
  padding: 2px 2px;
}
.poster-tpl-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster-tpl-tag {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Copywriting Box */
.poster-copy-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-sizing: border-box;
  width: 100%;
}
.poster-copy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.btn-copy-text-sm {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  padding: 3px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-copy-text-sm:hover {
  background: var(--primary-subtle);
  border-color: var(--primary-border);
}
.poster-copy-content {
  font-size: 12px;
  line-height: 1.6;
  color: #334155;
  background: #ffffff;
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  word-break: break-all;
  user-select: all;
  box-sizing: border-box;
}

/* Right Column: Poster Preview */
.poster-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}
.poster-preview-wrapper {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  box-sizing: border-box;
}
.poster-preview-img {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  display: block;
}
.poster-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  z-index: 10;
  text-align: center;
  padding: 12px;
}
.poster-loading-overlay i {
  font-size: 26px;
  color: #f472b6;
}

.poster-preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
}
.poster-preview-actions .btn {
  flex: 1;
  min-width: 0;
  justify-content: center;
  font-size: 12px;
  padding: 9px 8px;
  white-space: nowrap;
}
.btn-poster-dl {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 0 !important;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35) !important;
}
.btn-poster-dl:hover {
  background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%) !important;
  transform: translateY(-1px);
}
.poster-mobile-tip {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

/* ============================================================
   Comprehensive Mobile Adaptation Rules (< 768px & < 640px)
   ============================================================ */

@media (max-width: 768px) {
  /* Modal zero-overflow adaptation */
  .poster-modal-dialog {
    width: 100% !important;
    margin: 4px !important;
    max-height: 96vh !important;
    border-radius: 12px !important;
  }
  .poster-modal-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 12px 10px !important;
    max-height: calc(96vh - 60px) !important;
    overflow-x: hidden !important;
  }
  .poster-preview-col {
    order: 1 !important;
    max-width: 100% !important;
  }
  .poster-preview-wrapper {
    max-width: 220px !important;
    min-height: 290px !important;
    margin: 0 auto !important;
  }
  .poster-preview-img {
    max-height: 290px !important;
  }
  .poster-preview-actions {
    max-width: 280px !important;
    margin: 8px auto 0 !important;
  }
  .poster-controls-col {
    order: 2 !important;
    width: 100% !important;
  }
  .poster-template-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-height: 210px !important;
    gap: 8px !important;
  }
  .poster-workshop-inner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .poster-workshop-action {
    width: 100% !important;
  }
  .btn-poster-launch {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  .app-shell {
    padding: 8px 10px 36px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .navbar {
    padding: 8px 10px !important;
    margin-bottom: 12px !important;
  }
  .brand-logo {
    width: 32px !important;
    height: 32px !important;
    font-size: 15px !important;
  }
  .brand-name {
    font-size: 15px !important;
  }
  .brand-tag {
    display: none !important;
  }
  .status-badge {
    display: none !important;
  }

  /* Hero Section */
  .dashboard-hero {
    padding: 14px 12px !important;
    border-radius: 12px !important;
  }
  .hero-layout {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .hero-profile {
    gap: 10px !important;
  }
  .hero-avatar {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
  }
  .hero-greeting h1 {
    font-size: 17px !important;
  }
  .hero-desc {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  /* Hero Referral Box Mobile Stack */
  .hero-referral-box {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  .hero-referral-input-group {
    width: 100% !important;
    gap: 6px !important;
  }
  .hero-referral-input {
    font-size: 11px !important;
    width: 100% !important;
  }
  .hero-referral-btns {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .hero-referral-btns .btn-copy,
  .hero-referral-btns .btn-hero-poster {
    flex: 1 !important;
    min-width: 0 !important;
    justify-content: center !important;
    font-size: 11px !important;
    padding: 0 6px !important;
    height: 32px !important;
  }
  .btn-test-link {
    height: 32px !important;
    width: 32px !important;
    padding: 0 !important;
  }

  /* Navigation Tabs Swipable */
  .dashboard-nav {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    padding-bottom: 2px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  .dashboard-nav::-webkit-scrollbar {
    display: none !important;
  }
  .nav-tab-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
  }

  /* KPI Grid Compact 2 Columns */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .kpi-card {
    padding: 10px 8px !important;
    border-radius: 10px !important;
  }
  .kpi-value {
    font-size: 18px !important;
  }
  .kpi-label {
    font-size: 11px !important;
  }

  /* Panels and Forms */
  .panel-card {
    padding: 12px 10px !important;
    border-radius: 12px !important;
  }
  .panel-title {
    font-size: 15px !important;
  }
  .panel-subtitle {
    font-size: 11px !important;
  }
  .code-edit-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .code-edit-form input {
    width: 100% !important;
  }
  .code-edit-form button {
    width: 100% !important;
  }
  .flow-steps {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Unauthenticated Hero Mobile Rules */
  .auth-hero-title {
    font-size: 22px !important;
    line-height: 1.3 !important;
  }
  .auth-cta-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .auth-cta-row .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .roadmap-grid,
  .comparison-grid,
  .superpowers-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .account-cards-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================ */
/* Partner Drive Direct Search & Switch Toggle Styles           */
/* ============================================================ */
.partner-switch-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.partner-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.partner-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.partner-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 26px;
}

.partner-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.partner-switch input:checked + .partner-slider {
  background-color: var(--primary, #4f46e5);
}

.partner-switch input:checked + .partner-slider:before {
  transform: translateX(22px);
}

.drive-search-test-box {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 16px;
}

.drive-test-results-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.drive-test-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  gap: 12px;
}

.drive-test-item .test-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.drive-test-item .test-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


