:root {
  --white: #ffffff;
  --bg: #fafafa;
  --bg-subtle: #f5f5f5;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #1a1a1a;
  --accent-hover: #333333;
  --accent-fg: #ffffff;
  --primary: #2563eb;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --error-bg: #fef2f2;
  --success-bg: #f0fdf4;
  --warning-bg: #fffbeb;
  --danger-bg: #fef2f2;
  --legal-banner-h: 0px;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --landing-gradient: linear-gradient(180deg, #f6fbf7 0%, #fafcfa 40%, var(--bg) 100%);
  --modal-overlay: rgba(0, 0, 0, 0.2);
  --focus-ring: rgba(26, 26, 26, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.06);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --carousel-ease: 0.72s cubic-bezier(0.33, 1, 0.68, 1);
  --slide-w: clamp(260px, 52vw, 640px);
  --slide-gap: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 240px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --white: #1e1e1e;
  --bg: #141414;
  --bg-subtle: #252526;
  --border: #3c3c3c;
  --border-light: #2d2d2d;
  --text: #cccccc;
  --text-secondary: #9d9d9d;
  --text-muted: #6e6e6e;
  --accent: #ffffff;
  --accent-hover: #e0e0e0;
  --accent-fg: #1a1a1a;
  --primary: #4fc1ff;
  --primary-light: rgba(79, 193, 255, 0.12);
  --success: #4ec9b0;
  --warning: #dcdcaa;
  --danger: #f48771;
  --danger-hover: #e06c5a;
  --error-bg: #3a2020;
  --success-bg: #1a2e24;
  --warning-bg: #2e2a1a;
  --danger-bg: #3a2020;
  --nav-bg: rgba(30, 30, 30, 0.9);
  --landing-gradient: linear-gradient(180deg, #141a16 0%, #161816 40%, var(--bg) 100%);
  --modal-overlay: rgba(0, 0, 0, 0.55);
  --focus-ring: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* 勿对根元素设 scroll-behavior:smooth —— 会与触控板/滚轮抢动画，造成「滑一下卡住、连滑几次才动」 */
  overflow-x: clip;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition) !important;
}

body.landing-page {
  background: var(--landing-gradient);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ── Legal Banner ── */
.legal-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* 勿用 min-height: var(--legal-banner-h)，会与测量脚本形成循环 */
  padding: 8px 16px;
  background: #fef08a;
  border-bottom: 1px solid #facc15;
  color: #713f12;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
}

.legal-banner-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
  line-height: 1;
}

.legal-banner-text {
  max-width: 960px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body:has(.legal-banner) .nav {
  top: var(--legal-banner-h);
}

body:has(.legal-banner) {
  overflow-x: hidden;
}

body:has(.legal-banner).landing-page {
  padding-top: calc(64px + var(--legal-banner-h));
}

body:has(.legal-banner).landing-page #features,
body:has(.legal-banner).landing-page #ai,
body:has(.legal-banner).landing-page #pricing {
  scroll-margin-top: calc(64px + var(--legal-banner-h) + 16px);
}

body:has(.legal-banner) .sidebar {
  top: var(--legal-banner-h);
  bottom: auto;
  height: calc(100vh - var(--legal-banner-h));
}

body:has(.legal-banner) .dashboard-layout {
  min-height: calc(100vh - var(--legal-banner-h));
  padding-top: 0;
  box-sizing: border-box;
}

body:has(.legal-banner) .main-content {
  padding-top: 32px;
  min-height: calc(100vh - var(--legal-banner-h));
}

/* 控制台：锁定窗口滚动，只滚主内容，避免顶栏横幅留白变成「上面一段空白」 */
html:has(.dashboard-layout) {
  height: 100%;
  overflow: hidden;
}
body:has(.dashboard-layout) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}
body:has(.dashboard-layout):has(.legal-banner) {
  padding-top: var(--legal-banner-h);
}
body:has(.dashboard-layout) .dashboard-layout {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body:has(.dashboard-layout) .main-content {
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

body:has(.legal-banner) .legal-page {
  padding-top: calc(64px + var(--legal-banner-h) + 32px);
  min-height: 100vh;
}

body:has(.legal-banner) .editor-layout {
  position: fixed;
  top: var(--legal-banner-h);
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  margin-top: 0;
  max-height: none;
}

body.editor-body-page {
  overflow: hidden;
  height: 100vh;
}

body.editor-body-page .editor-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body.editor-body-page .legal-banner {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  flex-shrink: 0;
  z-index: 50;
}

body.editor-body-page:has(.legal-banner) .editor-layout {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
}

html:has(body.editor-body-page) {
  overflow: hidden;
}

body:has(.legal-banner) .error-page,
body:has(.legal-banner) .auth-page {
  padding-top: var(--legal-banner-h);
}

[data-theme="dark"] .legal-banner {
  background: #422006;
  border-bottom-color: #854d0e;
  color: #fef08a;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: 64px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 0.9rem; color: var(--text-secondary); transition: color var(--transition); }
.nav-links a:hover { color: var(--text); }

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

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-subtle); border-color: var(--border); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }

/* ── Hero ── */
.hero {
  padding: 160px 24px 100px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 24px;
}

.hero h1 strong { font-weight: 600; }

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Sections ── */
.section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.section-alt {
  background: var(--white);
  max-width: 100%;
  padding: 80px 24px;
}
.section-alt-inner { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { font-size: 2rem; font-weight: 300; letter-spacing: -0.02em; margin-bottom: 12px; }
.section-header p { color: var(--text-secondary); font-size: 1.05rem; }

/* ── Feature Cards ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px; height: 48px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.feature-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ── Pricing ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.pricing-card .plan-name { font-size: 0.875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.pricing-card .plan-price { font-size: 2.5rem; font-weight: 300; margin-bottom: 4px; }
.pricing-card .plan-price span { font-size: 1rem; color: var(--text-muted); }
.pricing-card .plan-desc { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 32px; }

.pricing-features { list-style: none; text-align: left; margin-bottom: 32px; }
.pricing-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pricing-features li::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--success); border-radius: 50%; flex-shrink: 0; }

/* ── CTA ── */
.cta {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 64px 32px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.cta h2 { font-size: 1.75rem; font-weight: 300; margin-bottom: 12px; }
.cta p { color: var(--text-secondary); margin-bottom: 32px; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer-inner { max-width: 1200px; margin: 0 auto; text-align: left; }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--text); }

/* ── Legal / Help Pages ── */
.legal-page {
  padding: calc(64px + 32px) 24px 80px;
  min-height: 100vh;
  box-sizing: border-box;
}

.legal-container {
  max-width: 720px;
  margin: 0 auto;
}

.legal-container-wide {
  max-width: 960px;
}

.legal-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.legal-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.legal-breadcrumb a:hover { color: var(--primary); }

.legal-breadcrumb-sep { opacity: 0.45; }

.legal-lead {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.legal-doc-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.legal-doc-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.legal-doc-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.legal-doc-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.legal-doc-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.legal-related {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.legal-related h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.legal-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legal-related li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.legal-related li:last-child { border-bottom: none; }

.legal-related a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.legal-related a:hover { text-decoration: underline; }

.legal-related span { color: var(--text-muted); }

.legal-ordered {
  margin: 12px 0;
  padding-left: 24px;
}

.legal-ordered li {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 6px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
  text-align: left;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--text); }

.footer-copy {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.legal-back {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  transition: color var(--transition);
}

.legal-back:hover { color: var(--text); }

.legal-container h1 {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 40px;
}

.legal-section {
  margin-bottom: 36px;
}

.legal-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.legal-section p,
.legal-section li {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.legal-section ul {
  margin: 12px 0;
  padding-left: 20px;
}

.legal-section li { margin-bottom: 6px; }

.legal-section a {
  color: var(--primary);
  text-decoration: underline;
}

.legal-section code {
  font-size: 0.875em;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.faq-list { display: grid; gap: 16px; }

.faq-item {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.faq-item h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.faq-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.feedback-form {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
}

.feedback-form select,
.feedback-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition);
}

.feedback-form select:focus,
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.appeal-form textarea { min-height: 160px; line-height: 1.65; }

.main-content--appeal-standalone {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  padding: 32px 40px;
  box-sizing: border-box;
}

.appeal-banned-card {
  max-width: 640px;
}

.appeal-info-card {
  display: block;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 20px;
  padding: 18px 20px;
}

.appeal-info-card strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 12px;
  color: var(--danger);
}

.appeal-info-rows {
  display: grid;
  gap: 10px;
}

.appeal-info-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.appeal-info-label {
  color: var(--text-muted);
}

.appeal-info-value {
  color: var(--text);
  font-weight: 500;
}

.appeal-reason-text {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 400;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 640px) {
  .appeal-info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 768px) {
  .main-content--appeal-standalone {
    margin-left: 0;
    width: 100%;
    padding: 24px 16px;
    padding-top: 64px;
  }
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp var(--transition-slow) both;
}
.animate-in.delay-1 { animation-delay: 0.08s; }
.animate-in.delay-2 { animation-delay: 0.16s; }
.animate-in.delay-3 { animation-delay: 0.24s; }

.feature-card,
.pricing-card,
.site-card,
.faq-item {
  transition: transform var(--transition), box-shadow var(--transition);
}

/* ── Invite Page ── */
.invite-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 36px;
  text-align: center;
}

.invite-card-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.invite-code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.invite-code-value {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  color: var(--text);
  background: var(--bg-subtle);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.invite-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.invite-rules { display: grid; gap: 16px; }

.invite-rule-item {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: box-shadow var(--transition);
}
.invite-rule-item:hover { box-shadow: var(--shadow); }

.invite-rule-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 6px;
}

.panel-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: -8px 0 20px;
}

.invite-inline {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.invite-inline-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.invite-inline .invite-code-box {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.invite-inline .invite-code-value {
  font-size: 1.375rem;
  padding: 10px 18px;
}

.invite-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.invite-stat {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.invite-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.invite-stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.invite-stat-reward {
  font-size: 1rem;
  line-height: 1.4;
}

.panel-card .invite-rules {
  margin-top: 4px;
}

.panel-card .invite-rule-item {
  padding: 16px 18px;
}

.invite-code-box-secondary {
  margin-top: 10px;
  margin-bottom: 0;
}

.invite-code-value-sm {
  font-size: 1.125rem;
  letter-spacing: 0.08em;
}

.invite-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 2px 10px;
}

.invite-settings-form {
  display: grid;
  gap: 16px;
  max-width: 420px;
  margin-bottom: 20px;
}

.invite-settings-form .form-row label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.invite-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}

.invite-input-mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
}

.invite-legacy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.invite-legacy-code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

@media (max-width: 640px) {
  .invite-stats { grid-template-columns: 1fr; }
  .invite-inline .invite-code-box { flex-direction: column; align-items: stretch; }
}

.plan-quota {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.plan-quota-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.plan-quota-item span:last-child {
  color: var(--text);
  font-weight: 500;
}

/* ── Auth ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  box-sizing: border-box;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-card h1 { font-size: 1.5rem; font-weight: 500; margin-bottom: 8px; text-align: center; }
.auth-card .subtitle { text-align: center; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.8125rem; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  background: var(--white);
  color: var(--text);
}
.form-group input:focus { outline: none; border-color: var(--accent); }

.form-group select,
.z2z-bind-select {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: border-color var(--transition);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
}

.form-group select:focus,
.z2z-bind-select:focus {
  outline: none;
  border-color: var(--accent);
}

.z2z-bind-select {
  width: auto;
  min-width: 140px;
  max-width: 220px;
  padding: 8px 12px;
  font-size: 0.8125rem;
}

.form-error {
  background: var(--error-bg);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  margin-bottom: 20px;
}

.form-success {
  background: var(--success-bg);
  color: var(--success);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  margin-bottom: 20px;
}

.auth-footer { text-align: center; margin-top: 24px; font-size: 0.875rem; color: var(--text-secondary); }
.auth-footer a { color: var(--accent); font-weight: 500; }

/* ── Dashboard Layout ── */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: clip;
  background: linear-gradient(180deg, #eef7f8 0%, #f4f8fa 28%, var(--bg) 100%);
}

[data-theme="dark"] .dashboard-layout {
  background: linear-gradient(180deg, #12181a 0%, #141414 28%, var(--bg) 100%);
}

.dash-topbar {
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px 0;
}

.dash-topbar-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  min-height: 52px;
  padding: 6px 10px 6px 14px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.dash-topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
  padding-right: 4px;
}

.dash-topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: visible;
  padding: 2px 0;
}

.dash-topnav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.dash-topnav-item:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.dash-topnav-item.is-active {
  background: linear-gradient(135deg, #2ec4b6 0%, #20a8d8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(32, 168, 216, 0.28);
}

.dash-topnav-item.is-active .dash-topnav-icon,
.dash-topnav-item.is-active .dash-topnav-chevron {
  opacity: 1;
}

.dash-topnav-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.dash-topnav-chevron {
  flex-shrink: 0;
  opacity: 0.65;
  margin-left: -2px;
}

.dash-topnav-item--badge {
  position: relative;
}

.dash-topnav-badge.notif-badge {
  position: static;
  margin-left: 2px;
  flex-shrink: 0;
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.dash-topnav-badge.notif-badge.has-unread,
.dash-topnav-badge.notif-badge:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dash-topnav-item.is-active .dash-topnav-badge.notif-badge {
  background: rgba(255, 255, 255, 0.92);
  color: #0d9488;
}

.dash-topnav-dropdown {
  flex-shrink: 0;
}

.dash-topnav-panel {
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
}

.dash-topnav-panel-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.dash-topnav-panel-item:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.dash-topnav-panel-item.is-active {
  background: color-mix(in srgb, #20a8d8 12%, var(--bg-subtle));
  color: var(--text);
  font-weight: 500;
}

.dash-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dash-topbar-member-btn {
  display: none;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, #20a8d8 35%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, #20a8d8 8%, var(--white));
  color: #0d9488;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dash-topbar-member-btn:hover {
  background: color-mix(in srgb, #20a8d8 14%, var(--white));
}

.dash-topbar-theme .theme-toggle {
  width: 34px;
  height: 34px;
}

.dash-topbar-user {
  position: relative;
}

.dash-topbar-user .sidebar-user {
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  gap: 8px;
}

.dash-topbar-user .sidebar-user-text {
  max-width: 100px;
}

.dash-topbar-user .sidebar-user-name {
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-topbar-user .sidebar-user-plan {
  font-size: 0.6875rem;
}

.dash-topbar-user .sidebar-user-wrap .sidebar-user-menu {
  top: calc(100% + 8px);
  bottom: auto;
  left: auto;
  right: 0;
  min-width: 200px;
  transform-origin: top right;
  transform: translateY(-8px) scale(0.98);
}

.dash-topbar-user .sidebar-user-wrap.open .sidebar-user-menu {
  transform: translateY(0) scale(1);
}

.dash-topbar-user .sidebar-user-wrap.closing .sidebar-user-menu {
  transform: translateY(-8px) scale(0.98);
}

.dash-topbar-ad {
  margin-top: 10px;
  width: max-content;
  max-width: 100%;
}

.dash-topbar-ad .sidebar-ad {
  margin: 0;
}

.dash-topbar-ad .sidebar-ad-link {
  border-radius: 12px;
}

.dash-mobile-nav {
  display: none;
}

.dash-nav-toggle {
  display: none;
}

.dash-sidebar-backdrop {
  display: none;
}

/* legacy sidebar (admin / fallback) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--border-light);
  padding: 24px 16px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
  box-sizing: border-box;
}

body:has(.legal-banner) .sidebar {
  top: var(--legal-banner-h);
  height: calc(100dvh - var(--legal-banner-h));
}

.sidebar .logo {
  flex-shrink: 0;
  margin-bottom: 24px;
  padding: 0 8px;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-right: 2px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  transition: all var(--transition);
}
.sidebar-nav a:hover { background: var(--bg-subtle); color: var(--text); }
.sidebar-nav a.active { background: var(--bg-subtle); color: var(--text); font-weight: 500; }
.sidebar-nav a .icon { width: 20px; text-align: center; font-size: 1rem; }

.sidebar-nav-primary {
  margin-bottom: 4px;
}

.sidebar-nav-group--overview {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.sidebar-nav-children--primary a {
  padding: 10px 12px;
  font-size: 0.875rem;
}

.sidebar-nav-with-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-nav-badge.notif-badge {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
  display: none;
}

.sidebar-nav-badge.notif-badge.has-unread,
.sidebar-nav-badge.notif-badge:not([hidden]) {
  display: inline-flex;
}

.sidebar-nav-group {
  margin-top: 4px;
  border: none;
}

.sidebar-nav-primary + .sidebar-nav-group,
.sidebar-nav-group + .sidebar-nav-group,
.sidebar-nav-group + .sidebar-nav-group--flat:not(.sidebar-nav-group--overview) {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.sidebar-nav-group summary {
  list-style: none;
}

.sidebar-nav-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm);
}

.sidebar-nav-label:hover {
  color: var(--text-secondary);
  background: var(--bg-subtle);
}

.sidebar-nav-label--static {
  cursor: default;
  padding-bottom: 2px;
}

.sidebar-nav-label--static:hover {
  background: transparent;
  color: var(--text-muted);
}

.sidebar-nav-chevron {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav-group[open] > summary .sidebar-nav-chevron {
  transform: rotate(45deg);
}

.sidebar-nav-children a {
  padding: 8px 12px 8px 18px;
  font-size: 0.8125rem;
}

.sidebar-nav-group--flat .sidebar-nav-children {
  margin-top: 0;
}

/* ── 通知中心页面（参照 demo-notifications.html）── */
.notif-center-page {
  width: 100%;
  max-width: none;
}

.notif-center-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.notif-center-breadcrumb a:hover {
  color: var(--text);
}

.notif-center-breadcrumb span:last-child {
  color: var(--text-secondary);
}

.notif-center-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.notif-center-toolbar h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.notif-center-toolbar p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.notif-center-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notif-center-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.notif-center-metric {
  padding: 14px 18px;
  border-right: 1px solid var(--border-light);
}

.notif-center-metric:last-child {
  border-right: none;
}

.notif-center-metric .lbl {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notif-center-metric .num {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.notif-center-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

.notif-center-filter {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 12px;
}

.notif-center-filter-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.notif-center-filter-list {
  list-style: none;
  padding: 6px;
  margin: 0;
}

.notif-center-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  font-family: inherit;
}

.notif-center-filter-item:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.notif-center-filter-item.is-active {
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 600;
}

.notif-center-filter-count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 999px;
}

.notif-center-filter-item.is-active .notif-center-filter-count {
  background: var(--white);
}

.notif-center-filter-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 10px;
  list-style: none;
}

.notif-center-list-panel {
  width: 100%;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
}

.notif-center-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.notif-center-list-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notif-center-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
}

.notif-center-chip:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.notif-center-chip.is-active {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
}

[data-theme="dark"] .notif-center-chip.is-active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.notif-center-group-label {
  padding: 10px 16px 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.notif-center-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.12s ease;
}

.notif-center-item:last-child {
  border-bottom: none;
}

.notif-center-item:hover {
  background: var(--bg-subtle);
}

.notif-center-item.is-unread {
  background: #f0f4ff;
}

.notif-center-item.is-unread:hover {
  background: #e8eeff;
}

[data-theme="dark"] .notif-center-item.is-unread {
  background: rgba(79, 193, 255, 0.08);
}

[data-theme="dark"] .notif-center-item.is-unread:hover {
  background: rgba(79, 193, 255, 0.12);
}

.notif-center-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  background: var(--bg-subtle);
}

.notif-center-icon svg {
  width: 18px;
  height: 18px;
}

.notif-center-icon--system { background: #e8f0fe; }
.notif-center-icon--site { background: #e8f5e9; }
.notif-center-icon--billing { background: #fff3e0; }
.notif-center-icon--security { background: #fce4ec; }

.notif-center-body {
  min-width: 0;
}

.notif-center-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.notif-center-title {
  font-size: 0.8125rem;
  font-weight: 600;
}

.notif-center-tag {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.notif-center-content {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-center-side {
  text-align: right;
  flex-shrink: 0;
}

.notif-center-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.notif-center-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin: 6px 0 0 auto;
}

.notif-center-item:not(.is-unread) .notif-center-dot {
  display: none;
}

.notif-center-time-mobile {
  display: none;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.notif-center-empty {
  padding: 48px 24px;
  text-align: center;
}

.notif-center-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.notif-center-empty-icon svg {
  width: 28px;
  height: 28px;
}

.notif-center-empty p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.notif-center-list-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .notif-center-layout {
    grid-template-columns: 1fr;
  }

  .notif-center-filter {
    position: static;
  }

  .notif-center-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
  }

  .notif-center-filter-head {
    display: none;
  }

  .notif-center-filter-divider {
    display: none;
  }

  .notif-center-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .notif-center-metric:nth-child(2) {
    border-right: none;
  }

  .notif-center-metric {
    border-bottom: 1px solid var(--border-light);
  }

  .notif-center-metric:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  .notif-center-item {
    grid-template-columns: 32px 1fr;
  }

  .notif-center-side {
    display: none;
  }

  .notif-center-time-mobile {
    display: block;
  }
}

.sidebar-footer { flex-shrink: 0; border-top: 1px solid var(--border-light); padding-top: 16px; overflow: visible; }
.sidebar-notifications { position: relative; margin-bottom: 12px; z-index: 2; }
.sidebar-notif-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--white); color: var(--text-secondary); font-size: 0.8125rem; cursor: pointer;
}
.sidebar-notif-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.sidebar-notif-icon {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-notif-label {
  flex: 1; text-align: left; font-weight: 500; color: var(--text-primary);
}

/* 侧栏通知：固定浮层，从侧栏右侧弹出，避免被侧栏裁切 */
#dash-notif-panel.sidebar-notif-panel {
  position: fixed;
  top: auto;
  right: auto;
  left: calc(var(--sidebar-width) + 10px);
  bottom: 20px;
  width: 320px;
  max-height: min(420px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 350;
  transform-origin: bottom left;
  transform: translateX(-10px) scale(0.98);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#dash-notif-wrap.open #dash-notif-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

#dash-notif-panel .dropdown-header {
  flex-shrink: 0;
}

#dash-notif-panel .notif-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.membership-alert {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--primary-light); border: 1px solid var(--primary);
  color: var(--text);
  font-size: 0.875rem;
}
.membership-alert--urgent {
  background: var(--danger-bg);
  border-color: var(--danger);
}
.membership-alert--urgent strong { color: var(--danger); }
.membership-alert strong { white-space: nowrap; }
.analytics-bars { display: flex; align-items: flex-end; gap: 12px; min-height: 100px; }
.analytics-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.analytics-bar { width: 100%; max-width: 40px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 4px; }
.analytics-bar-item span { font-size: 0.6875rem; color: var(--text-muted); }
.editor-ai-panel .ai-input-area { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.editor-ai-panel .ai-input-area input { flex: 1; min-width: 120px; }
.sidebar-user-wrap { width: 100%; position: relative; }
.sidebar-user-wrap .sidebar-user-menu {
  position: absolute;
  left: 0;
  right: auto;
  top: auto;
  bottom: calc(100% + 8px);
  min-width: 100%;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transform-origin: bottom center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.94);
  transition:
    opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.34, 1.25, 0.64, 1),
    visibility 0.22s;
  pointer-events: none;
}
.sidebar-user-wrap.open .sidebar-user-menu,
.sidebar-user-wrap.closing .sidebar-user-menu {
  visibility: visible;
}
.sidebar-user-wrap.open .sidebar-user-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.sidebar-user-wrap.closing .sidebar-user-menu {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 1, 1),
    transform 0.2s cubic-bezier(0.4, 0, 1, 1),
    visibility 0.18s;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  font-size: 0.8125rem;
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-user:hover { background: var(--bg-subtle); }
.sidebar-user-wrap.open .sidebar-user {
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--border-light);
}
.sidebar-user-text { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-plan {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 2px;
}
.sidebar-user-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1), color 0.2s ease;
}
.sidebar-user-wrap.open .sidebar-user-chevron {
  transform: rotate(180deg);
  color: var(--text-secondary);
}
.sidebar-user-menu { padding: 6px; overflow: hidden; }
.sidebar-user-wrap.open .sidebar-user-menu > * {
  animation: userMenuItemIn 0.24s cubic-bezier(0.34, 1.15, 0.64, 1) both;
}
.sidebar-user-wrap.open .sidebar-user-menu > *:nth-child(1) { animation-delay: 0.04s; }
.sidebar-user-wrap.open .sidebar-user-menu > *:nth-child(2) { animation-delay: 0.07s; }
.sidebar-user-wrap.open .sidebar-user-menu > *:nth-child(3) { animation-delay: 0.10s; }
.sidebar-user-wrap.open .sidebar-user-menu > *:nth-child(4) { animation-delay: 0.13s; }
.sidebar-user-wrap.open .sidebar-user-menu > *:nth-child(5) { animation-delay: 0.16s; }
@keyframes userMenuItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.sidebar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.sidebar-user-menu-item:hover {
  background: var(--bg-subtle);
  color: var(--text);
  transform: translateX(2px);
}
.sidebar-user-menu-danger:hover { color: var(--danger); }
.sidebar-user-menu-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 6px;
}
.sidebar-user-menu-logout { margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .sidebar-user-wrap .sidebar-user-menu,
  .sidebar-user-wrap.closing .sidebar-user-menu,
  .sidebar-user-chevron,
  .sidebar-user-menu-item,
  .sidebar-user-wrap.open .sidebar-user-menu > * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  .sidebar-user-wrap.open .sidebar-user-menu > * { opacity: 1; }
}
.sidebar-user .avatar {
  width: 32px; height: 32px;
  background: var(--bg-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
}

.main-content {
  flex: 1;
  min-height: 0;
  padding: 24px 32px 40px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  animation: dash-page-in 0.34s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes dash-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .main-content {
    animation: none !important;
  }
}

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

.page-header h1 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; }
.page-header p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }

.page-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.panel-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

.panel-card-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.input-disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.info-rows { display: grid; gap: 12px; font-size: 0.875rem; }

.info-row {
  display: flex;
  justify-content: space-between;
}

.info-row span:first-child { color: var(--text-muted); }

.side-panel {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.side-panel-highlight {
  border-color: var(--primary);
  background: var(--primary-light);
}

.side-panel h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.side-panel p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.side-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.side-stat:last-of-type { border-bottom: none; }
.side-stat strong { color: var(--text); font-weight: 600; }

.side-list {
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.side-list li::before {
  content: '·';
  margin-right: 8px;
  color: var(--text-muted);
}

.side-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-examples code {
  display: block;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--primary);
}

.side-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-links a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.side-links a:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.side-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
}

.stat-card .label { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .value { font-size: 1.75rem; font-weight: 300; letter-spacing: -0.02em; }

.console-stats { max-width: none; margin-bottom: 0; }

.sites-stats {
  max-width: none;
  margin-bottom: 28px;
}

.console-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.console-body > .console-section {
  margin: 0;
  min-width: 0;
}

.console-body > .console-section--full {
  grid-column: 1 / -1;
}

.service-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.service-stat {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm, 8px);
}

.service-stat-val {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.service-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border-light);
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
}

.service-item:last-child { border-bottom: none; }

.service-item strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}

.service-item span:not(.badge) {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.service-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.service-empty p { margin-bottom: 12px; }

.quick-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  color: var(--text);
  font-size: 0.8125rem;
  background: var(--bg-subtle);
  transition: border-color .15s, background .15s;
}

.quick-entry:hover {
  border-color: var(--primary);
  background: var(--white);
}

.quick-entry-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--border-light);
  color: var(--primary);
}

.quick-entry-icon svg {
  display: block;
}

.template-more-hint {
  margin-top: 12px;
  margin-bottom: 0;
}

.template-more-hint a {
  color: var(--primary);
  text-decoration: none;
}

.template-more-hint a:hover {
  text-decoration: underline;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.market-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.market-card-preview {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
}

.market-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s ease;
}

.market-card:hover .market-card-preview img {
  transform: scale(1.03);
}

.market-card-body {
  padding: 16px 20px 0;
}

.market-card-actions {
  margin-top: auto;
  padding: 12px 20px 20px;
}

.market-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.market-card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.market-card-body p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.market-badge {
  display: inline-block;
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-light, rgba(13,148,136,.12));
  color: var(--primary);
  margin-bottom: 8px;
}

.access-password-panel { max-width: 420px; }

.access-password-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  cursor: pointer;
}

.access-password-toggle input { width: 16px; height: 16px; }

.site-seo-form { max-width: 520px; }
.site-seo-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 8px);
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
}

.site-favicon-field {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.site-favicon-preview {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle, var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.site-favicon-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-favicon-empty {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--bg-subtle, var(--bg));
}

.site-favicon-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.console-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.console-sections--single {
  grid-template-columns: 1fr;
}

.console-section {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
}

.console-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.console-section-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.btn-text {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition);
}

.btn-text:hover { color: var(--accent); }

.promo-grid { display: flex; flex-direction: column; gap: 12px; }

.promo-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.promo-card:hover {
  border-color: var(--border);
  background: var(--bg-subtle);
}

.promo-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.promo-card h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.promo-card p { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }

.activity-list { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-item:first-child { padding-top: 0; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-text { font-size: 0.875rem; color: var(--text); line-height: 1.5; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.activity-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
}

.site-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── Site Cards ── */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.site-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

.site-card:hover { box-shadow: var(--shadow); }

.site-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.site-card h3 { font-size: 1rem; font-weight: 600; }
.site-card .domain { font-size: 0.8125rem; color: var(--primary); margin-bottom: 8px; }
.site-card .desc { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 16px; }
.site-card-actions { display: flex; gap: 8px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-suspended { background: var(--danger-bg); color: var(--danger); }
.badge-building { background: var(--warning-bg); color: var(--warning); }
.badge-order-pending { background: var(--warning-bg); color: var(--warning); }
.badge-order-paid { background: var(--success-bg); color: var(--success); }
.badge-order-cancelled, .badge-order-expired { background: var(--bg-muted); color: var(--text-muted); }
.badge-order-refunded { background: var(--danger-bg); color: var(--danger); }

/* ── Custom domains ── */
.domain-panel { margin-bottom: 24px; }
.domain-bind-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.domain-bind-form input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: var(--white);
  color: var(--text);
}
.domain-upgrade-hint {
  padding: 16px;
  background: var(--warning-bg);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.domain-list { display: grid; gap: 10px; margin-bottom: 16px; }
.domain-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--bg-subtle);
  transition: border-color var(--transition);
}
.domain-card.active { border-color: var(--primary); }
.domain-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.domain-card-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.domain-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.domain-detail-panel {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  margin-top: 8px;
}
.domain-target-hint {
  padding: 12px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  margin-bottom: 16px;
  color: var(--text-secondary);
}
.dns-summary { font-size: 0.875rem; color: var(--text-secondary); margin: 0 0 14px; }
.dns-section { margin-bottom: 14px; }
.dns-section-title { font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.dns-footnote { font-size: 0.75rem; color: var(--text-muted); margin: 4px 0 0; }
.dns-records-compact th,
.dns-records-compact td { padding: 8px 10px; }
.dns-step-block { margin-bottom: 20px; }
.dns-step-block h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dns-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.dns-records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-bottom: 8px;
}
.dns-records-table th,
.dns-records-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
.dns-records-table th {
  background: var(--bg-subtle);
  font-weight: 500;
  color: var(--text-secondary);
}
.dns-value { word-break: break-all; }
.dns-muted { color: var(--text-muted); font-size: 0.75rem; margin-top: 2px; }
.dns-note, .dns-option-title { font-size: 0.8125rem; color: var(--text-secondary); margin: 8px 0; }
.dns-option-title { font-weight: 600; color: var(--text); }
.domain-verify-result { margin-top: 16px; }
.verify-line {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.8125rem;
  background: var(--bg-subtle);
}
.verify-line.ok { background: var(--success-bg); }
.verify-line.pending { background: var(--warning-bg); }
.verify-line > span { font-weight: 700; flex-shrink: 0; }
.dns-warn { color: var(--warning); margin-top: 4px; }
.badge-domain-active { background: var(--success-bg); color: var(--success); }
.badge-domain-ownership_pending,
.badge-domain-resolution_pending,
.badge-domain-pending { background: var(--warning-bg); color: var(--warning); }

.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; color: var(--text-muted); display: flex; justify-content: center; }
.empty-state .icon svg { display: block; }
.empty-state h3 { font-size: 1.125rem; font-weight: 500; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }

/* ── Tables ── */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 0.875rem; }
th { background: var(--bg-subtle); font-weight: 500; color: var(--text-secondary); font-size: 0.8125rem; }
tr:not(:last-child) td { border-bottom: 1px solid var(--border-light); }
td { color: var(--text-secondary); }

/* ── Editor ── */
.editor-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body.editor-body-page .editor-layout {
  height: auto;
}

.editor-topbar {
  height: 48px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.editor-topbar .site-info { display: flex; align-items: center; gap: 12px; font-size: 0.875rem; min-width: 0; flex-shrink: 1; }
.editor-topbar .site-info strong,
.editor-topbar .site-info .domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.editor-topbar .site-info .domain { color: var(--primary); }

.editor-toolbar { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.editor-entry-warning {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  color: #92400e;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: 0.8125rem;
  line-height: 1.45;
  flex-shrink: 0;
}
.editor-entry-warning[hidden] { display: none; }
.editor-entry-warning svg { flex: 0 0 auto; }
.editor-entry-warning code {
  padding: 1px 5px;
  color: #78350f;
  background: rgba(245, 158, 11, 0.12);
  border-radius: 4px;
}
[data-theme="dark"] .editor-entry-warning {
  color: #fde68a;
  background: #422006;
  border-bottom-color: #713f12;
}
[data-theme="dark"] .editor-entry-warning code {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.18);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: none; background: transparent;
  border-radius: 6px; cursor: pointer;
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.icon-btn.has-dirty { color: var(--primary); }

.sidebar-actions { display: flex; gap: 2px; position: relative; z-index: 2; }

.sidebar-new-panel {
  min-width: 0 !important;
  width: 148px;
  padding: 6px 0;
  right: 0;
  left: auto;
  z-index: 320;
}

.editor-sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  z-index: 2;
  overflow: visible;
  flex-shrink: 0;
}

.dropdown-wrap { position: relative; }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  pointer-events: none;
}

.dropdown-wrap.open .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.notif-panel { width: 320px; max-height: 400px; display: flex; flex-direction: column; }

.dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem; font-weight: 600;
}

.btn-text {
  background: none; border: none; color: var(--primary);
  font-size: 0.75rem; cursor: pointer;
}

.notif-list { overflow-y: auto; flex: 1; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.8125rem; }

.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-subtle); }
.notif-item.unread { background: var(--primary-light); }
.notif-title { font-size: 0.8125rem; font-weight: 600; margin-bottom: 4px; }
.notif-content { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; }
.notif-time { font-size: 0.6875rem; color: var(--text-muted); margin-top: 4px; }

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: white;
  font-size: 0.625rem; font-weight: 600;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: none;
  align-items: center; justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-sizing: border-box;
}
.notif-badge.has-unread,
.notif-badge:not([hidden]) {
  display: flex;
}
.notif-badge[hidden] {
  display: none !important;
}
.sidebar-notif-icon .notif-badge { top: -6px; right: -8px; }

.editor-menu-panel {
  width: 260px;
  padding: 8px 0;
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.editor-menu-panel::-webkit-scrollbar { display: none; }

.menu-item-highlight { color: var(--success); font-weight: 500; }

.menu-user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.menu-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-subtle); display: flex;
  align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.875rem;
}
.menu-username { font-weight: 600; font-size: 0.875rem; }
.menu-upgrade { font-size: 0.75rem; color: var(--primary); transition: color var(--transition); }
.menu-upgrade:hover { color: var(--accent); }

.menu-divider { height: 1px; background: var(--border-light); margin: 4px 0; }

.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 16px; border: none; background: none;
  font-size: 0.8125rem; color: var(--text);
  cursor: pointer; transition: background var(--transition);
  text-decoration: none;
}
.menu-item:hover { background: var(--bg-subtle); }

.menu-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.menu-toggle .toggle-icon svg {
  display: none;
}

.menu-toggle.is-on .toggle-icon svg {
  display: block;
}

.editor-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text); color: var(--bg);
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.8125rem; z-index: 300;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}
.editor-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.editor-upload-progress {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 305;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}
.editor-upload-progress.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.editor-upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: var(--text);
}
.editor-upload-progress-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-upload-progress-pct {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.editor-upload-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}
.editor-upload-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  transition: width 0.15s ease-out;
}

.file-tree { flex: 1; overflow-y: auto; padding: 6px 4px 8px; user-select: none; }
.file-tree-empty {
  padding: 16px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px calc(6px + var(--tree-depth, 0) * 12px);
  border-radius: 4px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text-secondary);
  min-height: 26px;
  box-sizing: border-box;
}
.file-item:hover { background: var(--bg-subtle); color: var(--text); }
.file-item.active { background: var(--primary-light); color: var(--primary); }
.file-item.selected:not(.active) { outline: 1px solid var(--border-light); }
.file-item .file-icon { display: flex; align-items: center; flex-shrink: 0; }
.file-item .file-icon .fi { width: 16px; height: 16px; }
.file-item .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-twistie {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0.85;
}
.file-twistie.spacer { visibility: hidden; }
.file-folder .file-twistie .twistie-icon {
  transition: transform 0.12s ease;
  transform: rotate(0deg);
}
.file-folder.is-expanded .file-twistie .twistie-icon {
  transform: rotate(90deg);
}

.editor-tab .tab-icon { display: flex; align-items: center; }
.editor-tab .tab-icon .fi { width: 14px; height: 14px; }

.editor-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

.editor-sidebar {
  width: 260px;
  background: var(--white);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: visible;
}

/* ── 编辑器布局模式 ── */
.layout-mode-panel {
  width: 280px;
  min-width: 280px !important;
  padding: 14px 14px 16px;
  right: 0;
  left: auto;
  background: #1a1b1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: #c8c9cc;
}

.layout-mode-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #a0a2a8;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.layout-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.layout-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #24262b;
  color: #c8c9cc;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.layout-mode-card:hover {
  background: #2a2d33;
  color: #e8e9eb;
  transform: translateY(-1px);
}

.layout-mode-card:active {
  transform: translateY(0) scale(0.98);
}

.layout-mode-card.is-active {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #24262b;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
  animation: layout-card-pop 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes layout-card-pop {
  0% { transform: scale(1); }
  35% { transform: scale(0.96); }
  70% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.layout-mode-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 72 / 52;
}

.layout-mode-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}

.layout-mode-thumb .lm-frame {
  fill: #2e3138;
  stroke: #3a3d45;
  stroke-width: 1;
}

.layout-mode-thumb .lm-side,
.layout-mode-thumb .lm-side-2 {
  fill: #4b5568;
}

.layout-mode-thumb .lm-bar {
  fill: #3b82f6;
}

.layout-mode-thumb .lm-main {
  fill: #93c5fd;
  opacity: 0.85;
}

.layout-mode-card.is-active .layout-mode-thumb .lm-bar {
  fill: #2563eb;
}

.layout-mode-card.is-active .layout-mode-thumb .lm-main {
  fill: #60a5fa;
}

.layout-mode-label {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
}

.editor-preview {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-left: 1px solid var(--border-light);
  overflow: hidden;
}

.editor-preview-header {
  height: 36px;
  padding: 0 10px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.editor-preview-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.editor-preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  min-height: 0;
}

/* 布局面板过渡（不用 display:none，才能做出动画） */
.editor-body > .editor-sidebar,
.editor-body > .editor-main,
.editor-body > .editor-preview {
  transition:
    flex 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    min-width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    max-width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    border-width 0.3s ease,
    border-color 0.3s ease,
    margin 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.3s ease;
  will-change: flex, width, opacity, transform;
}

.editor-layout.layout-switching .editor-body > .editor-sidebar,
.editor-layout.layout-switching .editor-body > .editor-main,
.editor-layout.layout-switching .editor-body > .editor-preview {
  pointer-events: none;
}

.editor-layout .editor-pane-collapsed {
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  border-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  transform: scale(0.98);
}

.editor-layout[data-layout-mode="files"] .editor-main,
.editor-layout[data-layout-mode="files"] .editor-preview,
.editor-layout[data-layout-mode="files-preview"] .editor-main,
.editor-layout[data-layout-mode="editor-preview"] .editor-sidebar {
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  border-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

.editor-layout[data-layout-mode="files"] .editor-main,
.editor-layout[data-layout-mode="files-preview"] .editor-main {
  transform: translateX(12px) scale(0.98);
}

.editor-layout[data-layout-mode="files"] .editor-preview,
.editor-layout[data-layout-mode="editor-preview"] .editor-sidebar {
  transform: translateX(-10px) scale(0.98);
}

/* files：仅文件管理器 */
.editor-layout[data-layout-mode="files"] .editor-sidebar {
  width: auto;
  flex: 1 1 auto;
  border-right-color: transparent;
  opacity: 1;
  transform: none;
}

/* files-preview：文件 + 预览 */
.editor-layout[data-layout-mode="files-preview"] .editor-sidebar {
  width: min(360px, 38vw);
  flex: 0 0 min(360px, 38vw);
  opacity: 1;
  transform: none;
}
.editor-layout[data-layout-mode="files-preview"] .editor-preview {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  opacity: 1;
  transform: none;
  border-left-width: 1px;
}

/* editor-preview：编辑 + 预览 */
.editor-layout[data-layout-mode="editor-preview"] .editor-main {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  opacity: 1;
  transform: none;
}
.editor-layout[data-layout-mode="editor-preview"] .editor-preview {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  opacity: 1;
  transform: none;
  border-left-width: 1px;
}

/* full：文件 + 编辑 + 预览 */
.editor-layout[data-layout-mode="full"] .editor-sidebar {
  width: 220px;
  flex: 0 0 220px;
  opacity: 1;
  transform: none;
}
.editor-layout[data-layout-mode="full"] .editor-main {
  flex: 1.1 1 0;
  min-width: 0;
  max-width: none;
  opacity: 1;
  transform: none;
}
.editor-layout[data-layout-mode="full"] .editor-preview {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  opacity: 1;
  transform: none;
  border-left-width: 1px;
}

@media (max-width: 900px) {
  .editor-layout[data-layout-mode="full"] .editor-sidebar {
    width: 180px;
    flex-basis: 180px;
  }
  .layout-mode-panel {
    width: min(280px, calc(100vw - 24px));
    min-width: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editor-body > .editor-sidebar,
  .editor-body > .editor-main,
  .editor-body > .editor-preview,
  .layout-mode-card {
    transition: none !important;
    animation: none !important;
  }
  .editor-layout[data-layout-mode] .editor-main,
  .editor-layout[data-layout-mode] .editor-preview,
  .editor-layout[data-layout-mode] .editor-sidebar {
    transform: none !important;
  }
}

.file-context-menu {
  position: fixed;
  z-index: 300;
  min-width: 168px;
  padding: 6px 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.file-context-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 0.8125rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.file-context-menu button:hover { background: var(--bg-subtle); }
.file-context-menu button.danger { color: var(--danger); }
.file-context-menu button.danger:hover { background: var(--danger-bg); }
.file-context-menu .ctx-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--border-light);
}

.editor-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.editor-tabs {
  height: 36px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  flex-shrink: 0;
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border-light);
  cursor: pointer;
  white-space: nowrap;
  background: var(--bg-subtle);
  transition: background var(--transition);
}
.editor-tab.active { background: var(--white); color: var(--text); }
.editor-tab .close-tab { opacity: 0; font-size: 0.75rem; margin-left: 4px; }
.editor-tab:hover .close-tab { opacity: 0.5; }

.editor-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  min-height: 28px;
  padding: 0 12px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
}
.editor-breadcrumb[hidden] { display: none !important; }
.editor-breadcrumb .bc-sep {
  color: var(--border);
  margin: 0 2px;
  user-select: none;
  flex-shrink: 0;
}
.editor-breadcrumb .bc-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 160px;
  padding: 2px 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  flex-shrink: 0;
}
.editor-breadcrumb .bc-item:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
.editor-breadcrumb .bc-current {
  color: var(--text);
  cursor: default;
  font-weight: 500;
}
.editor-breadcrumb .bc-current:hover { background: transparent; }
.editor-breadcrumb .bc-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.75;
}
.editor-breadcrumb .bc-icon svg { width: 12px; height: 12px; }

#monaco-container {
  flex: 1;
  position: relative;
  min-height: 0;
}
.monaco-boot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  background: var(--white);
  z-index: 1;
  pointer-events: none;
}

.editor-ai-panel {
  position: fixed;
  width: 380px;
  height: min(640px, calc(100vh - 72px));
  max-width: min(380px, calc(100vw - 24px));
  right: 16px;
  top: 64px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
  transition:
    opacity var(--transition),
    transform var(--transition),
    visibility var(--transition);
  pointer-events: none;
  z-index: 90;
}

.editor-layout.ai-open .editor-ai-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.editor-ai-panel.dragging {
  transition: none;
  user-select: none;
}

.icon-btn.active { background: var(--primary-light); color: var(--primary); }

.ai-panel-header {
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ai-panel-header:active { cursor: grabbing; }
.ai-panel-title { flex: 1; min-width: 0; }
.ai-model-tag {
  font-size: 0.6875rem; font-weight: 400; color: var(--text-muted);
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-settings-btn,
.ai-close-btn {
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--text-muted); border-radius: 4px; display: flex;
  flex-shrink: 0;
}
.ai-settings-btn:hover,
.ai-close-btn:hover { background: var(--bg-subtle); color: var(--primary); }

.ai-settings-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45); display: flex;
  align-items: center; justify-content: center; padding: 16px;
}
.ai-settings-overlay[hidden] { display: none; }
.ai-settings-box {
  width: 100%; max-width: 480px; max-height: 90vh;
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border-light);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.ai-settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.ai-settings-header h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.ai-settings-body {
  padding: 20px; overflow-y: auto; flex: 1;
}
.ai-settings-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border-light);
}
.ai-settings-loading { color: var(--text-muted); font-size: 0.875rem; text-align: center; padding: 24px; }
.ai-settings-upgrade {
  text-align: center; padding: 24px 16px;
}
.ai-settings-upgrade p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 16px; }
.ai-settings-field { margin-bottom: 16px; }
.ai-settings-field label {
  display: block; font-size: 0.8125rem; font-weight: 500; margin-bottom: 6px;
}
.ai-settings-field select,
.ai-settings-field input[type="text"],
.ai-settings-field input[type="password"],
.ai-settings-field textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border-light);
  border-radius: var(--radius); font-size: 0.875rem; background: var(--white);
}
.ai-settings-field textarea { min-height: 100px; resize: vertical; font-family: inherit; }
.ai-settings-field input[type="range"] { width: 100%; }
.ai-settings-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.ai-settings-toggle {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  font-size: 0.875rem;
}
.ai-settings-toggle input { width: 16px; height: 16px; }
.ai-settings-section {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light);
}
.ai-settings-section-title {
  font-size: 0.8125rem; font-weight: 600; margin-bottom: 12px; color: var(--text-secondary);
}

.ai-messages { flex: 1; overflow-y: auto; padding: 16px; contain: content; }
.ai-message { margin-bottom: 16px; font-size: 0.8125rem; line-height: 1.6; }
.ai-message.user { text-align: right; }
.ai-message .bubble {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 90%;
  text-align: left;
  overflow-wrap: anywhere;
}
.ai-message.user .bubble { background: var(--primary); color: #ffffff; }
.ai-message.assistant .bubble { background: var(--bg-subtle); color: var(--text); }
.ai-message .bubble.ai-bubble-rich {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
  width: 100%;
}
.ai-message .ai-prose {
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-code-block {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  max-width: 100%;
}
.ai-code-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.ai-code-lang {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 500;
  color: var(--text-secondary);
}
.ai-code-toolbar-spacer { flex: 1; }
.ai-code-copy {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.4;
}
.ai-code-copy:hover {
  background: var(--white);
  color: var(--primary);
}
.ai-code-copy.copied { color: var(--primary); }
.ai-message .ai-code {
  margin: 0;
  padding: 10px 12px;
  border-radius: 0;
  background: transparent;
  border: 0;
  overflow-x: auto;
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.ai-message .ai-code code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  white-space: inherit;
}

.ai-thinking .ai-thinking-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 0;
  box-shadow: none;
}
.ai-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 14px;
}
.ai-typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.45;
  animation: ai-typing-bounce 1.2s ease-in-out infinite;
}
.ai-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.ai-typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 0.95; }
}

.ai-demo-wrap {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 160px;
  transition: box-shadow var(--transition);
}

.ai-demo-wrap .ai-reply-bubble {
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top left;
  transition: opacity var(--transition), transform var(--transition);
}

.ai-demo-wrap.demo-active .ai-reply-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ai-loading-dots {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.ai-loading-dots[hidden] {
  display: none;
  opacity: 0;
  transform: translateY(4px);
}

.ai-reply-text {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  transition: opacity 0.3s ease;
}

.ai-dot {
  display: inline-block;
  animation: ai-dot-bounce 1.2s ease-in-out infinite;
}

.ai-dot:nth-child(1) { animation-delay: 0s; }
.ai-dot:nth-child(2) { animation-delay: 0.15s; }
.ai-dot:nth-child(3) { animation-delay: 0.3s; }

.ai-reply-bubble.typing::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--text-muted);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: ai-cursor-blink 0.9s step-end infinite;
}

.ai-reply-bubble.done::after { display: none; }

@keyframes ai-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

@keyframes ai-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.ai-input-area {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
}
.ai-input-area input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}
.ai-input-area input:focus { outline: none; border-color: var(--accent); }

/* ── Subdomain Input ── */
.subdomain-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.subdomain-input input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-size: 0.9rem;
}
.subdomain-input input:focus { outline: none; }
.subdomain-input .suffix {
  padding: 10px 14px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.875rem;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Custom Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-box {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: center center;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  pointer-events: none;
}

.modal-overlay.show .modal-box {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.modal-body {
  padding: 16px 24px 8px;
}

.modal-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-submessage {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

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

.modal-input {
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.modal-input.shake {
  animation: modalShake 0.4s ease;
}

@keyframes modalShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
}

/* ── Error Page ── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  position: relative;
}
.error-page .code { font-size: 6rem; font-weight: 200; color: var(--border); line-height: 1; }
.error-page h1 { font-size: 1.5rem; font-weight: 400; margin: 16px 0 8px; }
.error-page p { color: var(--text-secondary); margin-bottom: 32px; }

.verify-required-page .verify-required-card {
  max-width: 480px;
  text-align: center;
}

.verify-required-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.verify-required-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ── Theme Toggle ── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.theme-toggle-btn .theme-icon-sun,
.theme-toggle-btn .theme-icon-moon {
  width: 16px;
  height: 16px;
}

.theme-toggle-btn .theme-icon-sun { display: none; }
.theme-toggle-btn .theme-icon-moon { display: block; }

[data-theme="dark"] .theme-toggle-btn .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-toggle-btn .theme-icon-moon { display: none; }

.auth-page .theme-toggle-btn {
  position: absolute;
  top: 24px;
  right: 24px;
}

.error-page .theme-toggle-btn {
  position: absolute;
  top: 24px;
  right: 24px;
}

.editor-toolbar .theme-toggle-btn {
  width: 32px;
  height: 32px;
}

.sidebar-theme {
  margin-top: 8px;
}

.sidebar-theme .theme-toggle-btn {
  width: 100%;
  height: 36px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.sidebar-theme .theme-toggle-btn::after {
  content: '暗黑模式';
}

[data-theme="dark"] .sidebar-theme .theme-toggle-btn::after {
  content: '浅色模式';
}

/* ── Membership Modal ── */
.member-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.member-overlay.show { opacity: 1; visibility: visible; }

.member-modal {
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: center center;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  position: relative;
}

.member-overlay.show .member-modal {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.member-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.member-user { display: flex; align-items: center; gap: 12px; }

.member-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.875rem;
}

.member-user-info h2 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 2px; }
.member-user-info p { font-size: 0.75rem; color: var(--text-muted); }

.member-plan-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.member-plan-badge.is-pro { background: var(--primary-light); color: var(--primary); }

.member-close {
  width: 32px; height: 32px;
  border: none; background: transparent;
  border-radius: 6px; cursor: pointer;
  color: var(--text-muted);
  font-size: 1.25rem; line-height: 1;
  transition: all var(--transition);
}

.member-close:hover { background: var(--bg-subtle); color: var(--text); }

.member-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.member-left {
  padding: 24px;
  overflow-y: auto;
  border-right: 1px solid var(--border-light);
}

.member-tabs { display: flex; gap: 8px; margin-bottom: 24px; }

.member-tab {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.member-tab:hover { border-color: var(--border); background: var(--bg-subtle); }
.member-tab.active { border-color: var(--primary); background: var(--primary-light); }
.member-tab .tab-name { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 2px; }
.member-tab .tab-desc { font-size: 0.75rem; color: var(--text-muted); }
.member-tab.active .tab-desc { color: var(--primary); }

.billing-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.billing-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.billing-card {
  position: relative;
  padding: 16px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}

.billing-card:hover { border-color: var(--border); }
.billing-card.active { border-color: var(--primary); background: var(--primary-light); }
.billing-card .period { font-size: 0.8125rem; font-weight: 500; margin-bottom: 8px; }
.billing-card .price { font-size: 1.5rem; font-weight: 300; letter-spacing: -0.02em; }
.billing-card .unit-price { font-size: 0.6875rem; color: var(--text-muted); margin-top: 4px; }

.billing-card .save-tag {
  position: absolute;
  top: -8px; right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  background: var(--success);
  color: white;
}

.features-title { font-size: 0.8125rem; font-weight: 600; margin-bottom: 12px; }

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.feature-item svg { width: 14px; height: 14px; color: var(--success); flex-shrink: 0; }

.member-right {
  padding: 24px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.checkout-plan {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.checkout-name { font-size: 1.125rem; font-weight: 600; margin-bottom: 20px; }

.checkout-price-box {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.checkout-discount { color: var(--success); }

.checkout-row.total {
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.checkout-row.total .amount {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--primary);
}

.checkout-btn { width: 100%; padding: 14px; margin-bottom: 12px; margin-top: 4px; }

.pay-methods { margin-bottom: 16px; }

.pay-methods-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pay-methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pay-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 10px 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pay-method:hover:not(.is-disabled):not(:disabled) {
  border-color: var(--border);
  background: var(--bg-subtle);
}

.pay-method.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.pay-method.is-disabled,
.pay-method:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border-light);
}

.pay-method-name { font-weight: 500; }

.pay-method-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pay-method-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.pay-method-tag {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.checkout-note {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

.checkout-note a { color: var(--primary); text-decoration: none; }

.compare-link {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--primary);
  margin-top: auto;
  padding-top: 16px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
}

.compare-table { display: none; margin-top: 16px; font-size: 0.75rem; }
.compare-table.show { display: block; }
.compare-table table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.compare-table th { font-weight: 500; color: var(--text-muted); }
.compare-table td:first-child, .compare-table th:first-child { text-align: left; }
.compare-table .highlight { color: var(--primary); font-weight: 600; }

.menu-upgrade { cursor: pointer; }

/* 模板选择（创建站点）— 小正方形卡片网格 */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 540px;
}
.template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.template-card:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border-light));
  background: var(--white);
}
.template-card input { position: absolute; opacity: 0; pointer-events: none; }
.template-card-preview {
  aspect-ratio: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  box-sizing: border-box;
}
.template-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  padding: 8px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.template-card-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px 12px;
  text-align: center;
  min-width: 0;
}
.template-card strong {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.template-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 2px 6px;
  border-radius: 999px;
  line-height: 1.2;
}
.template-card.is-selected,
.template-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, var(--bg));
}
.template-card.is-selected .template-card-preview,
.template-card:has(input:checked) .template-card-preview {
  background: color-mix(in srgb, var(--primary) 6%, var(--bg-subtle));
}

/* 新手引导 */
.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.onboard-card {
  width: min(440px, 100%);
  background: var(--bg);
  color: var(--text);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
  margin-bottom: max(8px, env(safe-area-inset-bottom));
}
.onboard-card h2 { font-size: 1.25rem; margin: 0 0 8px; }
.onboard-card p { margin: 0 0 16px; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.55; }
.onboard-steps { margin: 0 0 18px; padding-left: 1.1rem; color: var(--text-secondary); font-size: 0.9rem; }
.onboard-steps li { margin: 6px 0; }
.onboard-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 769px) {
  .onboard-overlay { align-items: center; }
}

/* ── Responsive ── */
/* 手机端顶部导航 */
@media (max-width: 900px) {
  .dash-topbar {
    padding: 8px 12px 0;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }

  .dash-topbar.is-mobile-open {
    z-index: 1101;
  }

  .dash-topbar-inner {
    min-height: 48px;
    padding: 6px 8px 6px 12px;
    border-radius: 14px;
    position: relative;
    z-index: 2;
  }

  .dash-topnav {
    display: none;
  }

  .dash-topbar-member-btn {
    display: none !important;
  }

  .dash-topbar-user .sidebar-user-text {
    display: none;
  }

  .dash-topbar-user .sidebar-user-chevron {
    display: none;
  }

  .dash-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-subtle);
    padding: 8px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .dash-nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
  }

  .dash-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(15, 23, 42, 0.4);
  }

  .dash-sidebar-backdrop[hidden] { display: none; }

  .dash-topbar.is-mobile-open .dash-mobile-nav {
    display: block;
  }

  .dash-mobile-nav {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% - 4px);
    max-height: min(70vh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 10px;
    z-index: 3;
    pointer-events: auto;
  }

  .dash-mobile-nav-section + .dash-mobile-nav-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
  }

  .dash-mobile-nav-label {
    padding: 4px 10px 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  .dash-mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .dash-mobile-nav-item:hover {
    background: var(--bg-subtle);
    color: var(--text);
  }

  .dash-mobile-nav-item.is-active {
    background: color-mix(in srgb, #20a8d8 12%, var(--bg-subtle));
    color: var(--text);
    font-weight: 500;
  }

  .main-content {
    padding: 16px 14px 28px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .dash-topnav-item {
    padding: 8px 10px;
    font-size: 0.75rem;
    gap: 5px;
  }

  .dash-topbar-logo span {
    display: none;
  }
}

@media (min-width: 901px) {
  .dash-topbar-member-btn {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
  }
  .page-header h1 {
    font-size: 1.25rem;
    line-height: 1.3;
  }
  .editor-sidebar { width: 200px; }
  .hero { padding: 120px 16px 60px; }
  .section { padding: 48px 16px; }
  .console-sections { grid-template-columns: 1fr; }
  .console-body { grid-template-columns: 1fr; }
  .sites-stats { max-width: none; }
  :root { --slide-w: clamp(240px, 78vw, 420px); --slide-gap: 12px; }
  .ad-slide { min-height: 200px; aspect-ratio: 16 / 7; }
  .ad-slide--image { min-height: 0; aspect-ratio: auto; }
  .page-columns { grid-template-columns: 1fr; }
  .member-body { grid-template-columns: 1fr; }
  .page-header-actions { flex-wrap: wrap; }
  .member-left { border-right: none; border-bottom: 1px solid var(--border-light); }
  .billing-options { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  #dash-notif-panel.sidebar-notif-panel {
    left: 16px;
    right: 16px;
    width: auto;
    bottom: 16px;
    max-height: min(60vh, calc(100dvh - 32px));
  }
}

/* 桌面端侧栏项较多时：矮屏压缩间距，导航区内部滚动 */
@media (min-width: 769px) and (max-height: 820px) {
  .sidebar { padding-top: 16px; padding-bottom: 12px; }
  .sidebar .logo { margin-bottom: 12px; }
  .sidebar-nav a { padding: 7px 10px; font-size: 0.8125rem; }
  .sidebar-member { padding-top: 4px; }
  .sidebar-footer { padding-top: 12px; }
}

/* ── Ad Banner (single image only) ── */
.ad-banner {
  margin-bottom: 20px;
  max-width: 100%;
}

.ad-banner-card {
  width: 100%;
  max-width: 100%;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  line-height: 0;
}

.ad-banner-stage {
  position: relative;
}

.ad-banner-slide {
  display: block;
  text-decoration: none;
  line-height: 0;
}

.ad-banner-slide img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.dash-site-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--white);
}

.dash-site-notice-main {
  flex: 1;
  min-width: 0;
}

.dash-site-notice-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.dash-site-notice-content {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.dash-site-notice-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.dash-site-notice-link:hover { text-decoration: underline; }

.dash-site-notice-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.dash-site-notice-close:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.ad-carousel {
  position: relative;
  margin-bottom: 28px;
  user-select: none;
  max-width: 100%;
}

.ad-carousel-stage {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ad-carousel-viewport {
  overflow: hidden;
  padding: 40px 0 32px;
}

.ad-carousel-track {
  display: flex;
  align-items: center;
  gap: var(--slide-gap);
  width: max-content;
  min-width: 100%;
  will-change: transform;
  transition: transform var(--carousel-ease);
}

.ad-carousel-track.is-resetting {
  transition: none !important;
}

.ad-carousel-track.is-resetting .ad-slide-wrap,
.ad-carousel-track.is-resetting .ad-slide,
.ad-carousel-track.is-resetting .ad-slide-veil {
  transition: none !important;
}

.ad-slide-wrap {
  flex: 0 0 var(--slide-w);
  position: relative;
  z-index: 1;
  transition:
    transform var(--carousel-ease),
    filter var(--carousel-ease),
    opacity var(--carousel-ease);
  transform: scale(0.88);
  filter: blur(8px);
  opacity: 0;
  pointer-events: none;
}

.ad-slide-wrap.is-prev {
  transform: scale(0.92);
  filter: blur(5px);
  opacity: 0.88;
  z-index: 2;
  cursor: pointer;
  pointer-events: auto;
}

.ad-slide-wrap.is-active {
  transform: scale(1);
  filter: blur(0);
  opacity: 1;
  z-index: 5;
  pointer-events: auto;
}

.ad-slide-wrap.is-next {
  transform: scale(0.92);
  filter: blur(5px);
  opacity: 0.88;
  z-index: 2;
  cursor: pointer;
  pointer-events: auto;
}

.ad-slide-wrap.is-peek {
  transform: scale(0.88);
  filter: blur(6px);
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}

.ad-carousel:not([data-carousel-ready]) .ad-carousel-stage {
  opacity: 1;
}

.ad-carousel:not([data-carousel-ready]) .ad-slide-wrap.is-prev,
.ad-carousel:not([data-carousel-ready]) .ad-slide-wrap.is-next,
.ad-carousel:not([data-carousel-ready]) .ad-slide-wrap.is-peek {
  opacity: 0.5;
  visibility: visible;
  pointer-events: none;
}

.ad-carousel[data-carousel-ready] .ad-slide-wrap.is-active {
  opacity: 1;
  transform: scale(1);
  filter: none;
  pointer-events: auto;
}

.ad-slide {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 8;
  min-height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: box-shadow var(--carousel-ease);
}

.ad-slide--image {
  aspect-ratio: auto;
  min-height: 0;
  height: auto;
  overflow: visible;
  background: transparent;
}

.ad-slide-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* 图片广告轮播（多图）：平移居中，左右露出相邻图 */
.ad-peek {
  position: relative;
  margin-bottom: 28px;
  user-select: none;
  max-width: 100%;
}

.ad-peek-stage {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.ad-peek-viewport {
  overflow: hidden;
  padding: 0;
  position: relative;
}

.ad-peek-track {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: max-content;
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.ad-peek-track.is-resetting {
  transition: none !important;
}

.ad-peek-item {
  flex: 0 0 min(900px, calc((100vw - var(--sidebar-width) - 80px) * 0.92));
  opacity: 1;
  transition: opacity 0.35s ease;
  cursor: pointer;
}

.ad-peek-item.is-prev,
.ad-peek-item.is-next {
  opacity: 0.55;
}

.ad-peek-item.is-active {
  opacity: 1;
  cursor: default;
}

.ad-peek-link {
  display: block;
  width: 100%;
  text-decoration: none;
  line-height: 0;
  border: none;
  background: transparent;
  overflow: hidden;
}

.ad-peek-link img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.ad-peek-item.is-active .ad-peek-link img {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.ad-peek .ad-carousel-footer {
  margin-top: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .ad-peek-item {
    flex: 0 0 calc(100vw - 48px);
  }
}

.ad-slide-wrap.is-active .ad-slide {
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
}

.ad-slide-wrap.is-prev .ad-slide,
.ad-slide-wrap.is-next .ad-slide {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.ad-slide-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.ad-slide-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.12) 55%, transparent 100%);
}

.ad-slide--image-only .ad-slide-bg::after {
  background: linear-gradient(90deg, rgba(0,0,0,0.08) 0%, transparent 60%);
}

.ad-slide-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
  transition: opacity var(--carousel-ease);
}

.ad-slide-wrap.is-active .ad-slide-veil { opacity: 0; }

.ad-slide-wrap.is-prev .ad-slide-veil,
.ad-slide-wrap.is-next .ad-slide-veil,
.ad-slide-wrap.is-peek .ad-slide-veil {
  opacity: 0.4;
  background: rgba(0,0,0,0.2);
}

.ad-slide-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 8%;
  color: #fff;
  transition: opacity var(--carousel-ease), transform var(--carousel-ease);
}

.ad-slide-wrap:not(.is-active) .ad-slide-content {
  opacity: 0;
  pointer-events: none;
}

.ad-slide-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  width: fit-content;
}

.ad-slide-title {
  font-size: clamp(1.125rem, 2.2vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 6px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.15);
}

.ad-slide-desc {
  font-size: clamp(0.75rem, 1.4vw, 0.875rem);
  opacity: 0.92;
  line-height: 1.5;
  margin-bottom: 14px;
  max-width: 400px;
}

.ad-slide-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.95);
  color: #1a1a1a;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  width: fit-content;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.ad-slide-cta svg { width: 14px; height: 14px; }

.ad-carousel-btn {
  position: absolute;
  top: calc(50% - 22px);
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 1;
  transition: opacity var(--transition), transform var(--transition);
}

.ad-carousel-btn:hover { transform: translateY(-50%) scale(1.06); }

.ad-peek .ad-carousel-btn {
  z-index: 20;
}

.ad-carousel-btn--prev { left: 8px; }
.ad-carousel-btn--next { right: 8px; }
.ad-peek .ad-carousel-btn--prev { left: 12px; }
.ad-peek .ad-carousel-btn--next { right: 12px; }
.ad-carousel-btn svg { width: 18px; height: 18px; }

.ad-carousel-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -1px;
}

.ad-carousel-dots { display: flex; gap: 6px; align-items: center; }

.ad-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ad-carousel-dot.active { width: 22px; background: var(--primary); }
.ad-carousel-dot:hover:not(.active) { background: var(--text-muted); }

.ad-carousel-progress {
  width: 100px;
  height: 3px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}

.ad-carousel-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
}

.ad-carousel-status { font-size: 0.75rem; color: var(--text-muted); }

.ad-carousel-pause {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.ad-slide-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
  pointer-events: none;
}

.ad-slide--lite .ad-slide-bg { background: linear-gradient(135deg, #1d4ed8, #3b82f6 50%, #60a5fa); }
.ad-slide--lite .ad-slide-orb:nth-child(1) { width: 180px; height: 180px; background: #93c5fd; top: -50px; right: 12%; }
.ad-slide--lite .ad-slide-orb:nth-child(2) { width: 100px; height: 100px; background: #bfdbfe; bottom: -20px; right: 30%; }

.ad-slide--invite .ad-slide-bg { background: linear-gradient(135deg, #047857, #10b981 50%, #34d399); }
.ad-slide--invite .ad-slide-orb:nth-child(1) { width: 160px; height: 160px; background: #6ee7b7; top: -30px; right: 18%; }
.ad-slide--invite .ad-slide-orb:nth-child(2) { width: 90px; height: 90px; background: #a7f3d0; bottom: -10px; right: 6%; }

.ad-slide--domain .ad-slide-bg { background: linear-gradient(135deg, #6d28d9, #7c3aed 50%, #a78bfa); }
.ad-slide--domain .ad-slide-orb:nth-child(1) { width: 200px; height: 200px; background: #c4b5fd; top: -70px; right: 8%; }
.ad-slide--domain .ad-slide-orb:nth-child(2) { width: 80px; height: 80px; background: #ddd6fe; bottom: 8px; right: 38%; }

.ad-slide--ai .ad-slide-bg { background: linear-gradient(135deg, #0f172a, #1e293b 45%, #334155); }
.ad-slide--ai .ad-slide-orb:nth-child(1) { width: 140px; height: 140px; background: #4fc1ff; top: -20px; right: 16%; opacity: 0.35; }
.ad-slide--ai .ad-slide-orb:nth-child(2) { width: 90px; height: 90px; background: #818cf8; bottom: -8px; right: 4%; opacity: 0.4; }

/* Sidebar member CTA */
.sidebar-ad {
  flex-shrink: 0;
  padding: 8px 0 2px;
}

.sidebar-ad-link {
  display: block;
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.sidebar-ad-link:not(.is-static):hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.sidebar-ad-link--text {
  background: linear-gradient(135deg, #0f172a, #1e293b 55%, #334155);
  color: #f8fafc;
}

.sidebar-ad-link--image {
  width: fit-content;
  max-width: 100%;
}

.sidebar-ad-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.sidebar-ad-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
}

.sidebar-ad-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
}

.sidebar-ad-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: #f8fafc;
}

.sidebar-ad-desc {
  font-size: 0.6875rem;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.82);
}

.sidebar-ad-cta {
  margin-top: 2px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #93c5fd;
}

.sidebar-member {
  flex-shrink: 0;
  padding: 8px 0 4px;
  margin-bottom: 4px;
}

.sidebar-member-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-member-btn:hover {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
}

.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Ticket system */
.ticket-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.ticket-status-open { background: #fef3c7; color: #92400e; }
.ticket-status-in_progress { background: #dbeafe; color: #1e40af; }
.ticket-status-waiting_user { background: #fce7f3; color: #9d174d; }
.ticket-status-resolved { background: #d1fae5; color: #065f46; }
.ticket-status-closed { background: var(--bg-subtle); color: var(--text-muted); }

[data-theme="dark"] .ticket-status-open { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
[data-theme="dark"] .ticket-status-in_progress { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
[data-theme="dark"] .ticket-status-waiting_user { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
[data-theme="dark"] .ticket-status-resolved { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.ticket-msg {
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg);
}

.ticket-msg--admin {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.04);
}

.ticket-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.8125rem;
}

.ticket-msg-head strong { color: var(--text); font-weight: 500; }
.ticket-msg-head span { color: var(--text-muted); flex-shrink: 0; }

.ticket-msg-body {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ticket-reply-form { max-width: 640px; }
