:root {
  --bg: #f4f4f6;
  --panel: #fefefe;
  --text: #1a1a2e;
  --text-secondary: #52525b;
  --text-muted: #8b8b96;
  --text-meta: #9494a0;
  --border: #ececf0;
  --border-subtle: #f4f4f6;
  --accent: #1a1a2e;
  --accent-hover: #2d2d44;
  --card-bg: #f3f4f7;
  --card-hover: #eceff4;
  --danger: #c4342d;
  --focus-ring: rgba(99, 91, 255, 0.35);
  --font-en: -apple-system, "SF Pro Display", "Inter", sans-serif;
  --font-zh: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 32px;
  --preview-frame-radius: 18px;
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 26, 46, 0.06);
  --shadow-lg: 0 12px 40px rgba(26, 26, 46, 0.1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-zh);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(26, 26, 46, 0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(26, 26, 46, 0.2); }

.hidden { display: none !important; }

/* ── Views ── */
.view {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* ── Home (auto-redirect stub) ── */
.view-home { display: none; }

/* ── Books list (Figma-style) ── */
.view-books {
  padding: 48px clamp(32px, 4vw, 58px) 64px;
  width: 100%;
  min-height: 100%;
  background: #ffffff;
}
.view-books.theme-soft { background: #f6f7fa; }

/* ── Top bar ── */
.vb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}
.vb-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vb-logo-icon {
  height: 33px;
  width: auto;
  display: block;
}
.vb-logo-text {
  font-family: 'Montserrat', var(--font-en);
  font-weight: 800;
  font-size: 32px;
  color: #000;
  letter-spacing: -0.02em;
}
.vb-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vb-notify {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8e8e8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}
.vb-notify:hover { background: #ddd; }
.vb-notify-icon {
  width: 20px;
  height: 20px;
  display: block;
}
.vb-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.vb-menu-btn {
  height: 40px;
  padding: 0 16px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 26px;
  font-family: 'Montserrat', var(--font-en);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.vb-menu-btn:hover { background: #333; }

.vb-trash-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-family: var(--font-zh);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.vb-trash-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: #fafafe;
}
.vb-trash-btn.has-items {
  border-color: #d6cfe7;
  color: #4f3b78;
  background: #f3eefe;
}
.vb-trash-count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #4f3b78;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.menu-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 2800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease-out-quint);
}

.vb-global-menu {
  width: min(440px, 94vw);
  height: 100%;
  overflow: auto;
  border-left: 1px solid var(--border);
  background: #ffffff;
  box-shadow: -22px 0 48px rgba(16, 24, 40, 0.18);
  padding: 12px 12px 14px;
  transform: translate3d(28px, 0, 0);
  opacity: 0.94;
  will-change: transform, opacity;
  transition: transform 380ms var(--ease-out-quint), opacity 320ms var(--ease-out-quint);
}

.menu-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.menu-drawer-overlay.is-open .vb-global-menu {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.menu-drawer-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
}

.menu-drawer-overlay.is-closing .vb-global-menu {
  transform: translate3d(24px, 0, 0);
  opacity: 0.94;
}

.menu-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.menu-drawer-title {
  font-family: 'Montserrat', var(--font-en);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.menu-close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, transform 120ms var(--ease-out-quart), background 120ms ease;
}

.menu-close-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: #fafafe;
  transform: scale(1.04);
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.menu-drawer-overlay.is-open .menu-section {
  animation: menuSectionIn 360ms var(--ease-out-quint) both;
}
.menu-drawer-overlay.is-open .menu-section:nth-of-type(2) { animation-delay: 40ms; }
.menu-drawer-overlay.is-open .menu-section:nth-of-type(3) { animation-delay: 80ms; }
.menu-section:last-of-type { border-bottom: none; padding-bottom: 8px; }
.menu-section-title {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

@keyframes menuSectionIn {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.menu-search-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.menu-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.menu-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}
.menu-search-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  padding: 8px 10px;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 180ms var(--ease-out-quint), transform 180ms var(--ease-out-quint);
}
.menu-search-item:hover {
  border-color: var(--accent);
  background: #f8f8fc;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  transform: translate3d(0, -0.5px, 0);
}
.menu-search-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.menu-search-item-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.menu-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
  padding: 10px 12px;
  font-size: 12px;
  text-align: center;
}
.menu-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.menu-action-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 10px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 180ms var(--ease-out-quint), box-shadow 180ms var(--ease-out-quint);
}
.menu-action-btn:hover {
  border-color: var(--accent);
  background: #f8f8fc;
  color: var(--text);
  box-shadow: 0 10px 16px rgba(15, 23, 42, 0.05);
  transform: translate3d(0, -0.5px, 0);
}
.menu-action-btn-wide {
  width: 100%;
}
.menu-inline-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.menu-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.menu-segmented {
  display: inline-flex;
  gap: 6px;
}
.menu-seg-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 170ms var(--ease-out-quint);
}
.menu-seg-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translate3d(0, -0.5px, 0);
}
.menu-seg-btn.active {
  border-color: var(--accent);
  background: #1f2233;
  color: #fff;
}
.menu-status {
  min-height: 18px;
  padding: 8px 8px 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.menu-status.success { color: #1f7a53; }
.menu-status.error { color: #c4342d; }

@media (prefers-reduced-motion: reduce) {
  .menu-drawer-overlay,
  .menu-drawer-overlay .vb-global-menu,
  .menu-drawer-overlay .menu-section,
  .menu-search-item,
  .menu-action-btn,
  .menu-seg-btn,
  .menu-close-btn {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ── Hero section ── */
.vb-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
}
.vb-hero-text { flex: 1; min-width: 0; }
.vb-greeting {
  font-family: 'Montserrat', var(--font-en);
  font-weight: 600;
  font-size: clamp(36px, 5vw, 60px);
  color: #000;
  line-height: 1.15;
  margin-bottom: 4px;
}
.vb-subheading {
  font-family: 'Montserrat', var(--font-en);
  font-weight: 600;
  font-size: clamp(36px, 5vw, 60px);
  color: #000;
  line-height: 1.15;
  margin-bottom: 28px;
}
.vb-pills { display: flex; gap: 12px; flex-wrap: wrap; }
.vb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 100px;
  font-family: 'Montserrat', var(--font-en);
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  color: #000;
  border: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.vb-pill:hover {
  filter: brightness(0.98);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.vb-pill:active {
  transform: translateY(1px);
}
.vb-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.vb-pill.active {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12), 0 10px 24px rgba(15, 23, 42, 0.12);
}
.vb-pill-green { background: #d4f0e3; }
.vb-pill-purple { background: #dfe0fe; }
.vb-pill-yellow { background: #fff4cc; }
.vb-pill-orange { background: #ffc09f; }
.vb-pill-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
}
.vb-pill-num-green { background: #b1e0cb; }
.vb-pill-num-purple { background: #c4c6ed; }
.vb-pill-num-yellow { background: #ffe5a1; }
.vb-pill-num-orange { background: #ffad85; }
.vb-hero-art {
  flex-shrink: 0;
  width: clamp(200px, 40%, 500px);
  border-radius: 20px;
  overflow: hidden;
}
.vb-hero-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  object-fit: cover;
}

/* ── Section bar (tabs + create) ── */
.vb-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.vb-tabs {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  position: relative;
}
.vb-tab {
  font-family: 'Montserrat', var(--font-en);
  font-weight: 600;
  font-size: 20px;
  color: #bcbcbc;
  background: none;
  border: none;
  padding: 0 0 8px;
  cursor: pointer;
  transition: color 0.25s ease;
  position: relative;
}
.vb-tab.active { color: #000; }
.vb-tab:hover:not(.active) { color: #888; }
.vb-tab-indicator {
  position: absolute;
  bottom: 0;
  height: 3px;
  background: #000;
  border-radius: 2px;
  transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* ── Book grid transition ── */
.book-grid {
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.book-grid.fade-out {
  opacity: 0;
  transform: translateY(6px);
}
.vb-empty {
  transition: opacity 0.2s ease;
}
.vb-empty.fade-out { opacity: 0; }
.vb-btn-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 39px;
  font-family: 'Montserrat', var(--font-en);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.vb-btn-create span { font-size: 20px; }
.vb-btn-create:hover { background: #333; box-shadow: var(--shadow-md); }
.vb-btn-create:active { transform: scale(0.97); }

/* ── Book grid (Figma-style cards) ── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 21px;
}
.view-books.cards-compact .book-grid { gap: 14px; }

.book-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 20px;
  min-height: 170px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.18s, box-shadow 0.28s cubic-bezier(0.16,1,0.3,1), transform 0.1s, background 0.15s;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.view-books.cards-compact .book-card {
  border-radius: 16px;
  padding: 16px;
  min-height: 148px;
}
.book-card:hover {
  border-color: rgba(0, 0, 0, 0.06);
  background: var(--card-hover);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.book-card:active { transform: translateY(0); }
.book-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

.book-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}
.view-books.cards-compact .book-card-top { margin-bottom: 22px; }
.book-card .emoji { font-size: 40px; line-height: 1; }

.book-card-menu {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  margin: -6px -4px 0 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.book-card-menu:hover { background: rgba(0,0,0,0.06); }
.book-card-dots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}
.book-card-dots span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #000;
}

.book-card-title {
  font-family: 'Montserrat', var(--font-en);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  color: #000;
  margin-bottom: 6px;
}
.book-card-date {
  font-weight: 400;
  font-size: 13px;
  line-height: 1.3;
  color: #8f8f8f;
}
.book-card-pages {
  font-size: 12px;
  color: #8f8f8f;
  margin-top: 2px;
}

/* ── Book list empty state ── */
.vb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}
.vb-empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.7;
}
.vb-empty-title {
  font-family: 'Montserrat', var(--font-en);
  font-weight: 600;
  font-size: 20px;
  color: #000;
  margin-bottom: 8px;
}
.vb-empty-desc {
  font-size: 14px;
  color: #8f8f8f;
  line-height: 1.6;
}

/* ── Workspace: two-panel ── */
.view-workspace {
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
}

.workspace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.workspace-top h1 {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 28px;
  line-height: 36px;
  letter-spacing: -0.02em;
}
.workspace-top .current-book {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}
.workspace-actions { display: flex; align-items: center; flex-shrink: 0; gap: 8px; }

.btn-outline {
  font-family: var(--font-zh);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.btn-outline:hover { background: var(--bg); color: var(--text); border-color: #d8d8de; }
.btn-outline:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

.app-content {
  flex: 1;
  display: flex;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

/* ── Resize handles between panels ── */
.resize-handle {
  width: 8px;
  flex-shrink: 0;
  cursor: col-resize;
  position: relative;
  z-index: 5;
  background: transparent;
  transition: background 150ms;
  margin: 0 1px;
}
.resize-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 32px;
  border-radius: 1px;
  background: var(--border);
  opacity: 0;
  transition: opacity 150ms, height 150ms;
}
.resize-handle:hover::after,
.resize-handle.active::after {
  opacity: 1;
  height: 48px;
}
.resize-handle:hover {
  background: rgba(99, 102, 241, 0.06);
}
.resize-handle.active {
  background: rgba(99, 102, 241, 0.10);
}
.resize-handle.active::after {
  background: #6366f1;
}
body.resizing {
  cursor: col-resize !important;
  user-select: none !important;
}
body.resizing * {
  cursor: col-resize !important;
}
body.resizing iframe {
  pointer-events: none !important;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  height: 100%;
}

.panel-header {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}
.panel-header h2 {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
  min-height: 0;
}
.panel-preview .panel-body {
  overflow: hidden;
  display: flex;
}

/* Page list panel */
.panel-pages { flex: 0 0 220px; min-width: 140px; max-width: 400px; }
.panel-pages .panel-body { display: flex; flex-direction: column; }
.panel-audit .panel-body { display: flex; flex-direction: column; }

.page-list {
  list-style: none;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  background: var(--bg);
}
.page-card:hover { background: var(--border); }
.page-card.active { border-color: var(--accent); background: rgba(26, 26, 46, 0.04); }
.page-card.pinned { background: #fefce8; }
.page-card.pinned.active { border-color: var(--accent); background: #fef9c3; }

.page-card-body { flex: 1; min-width: 0; }
.page-card-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.page-card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.page-card-menu {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: -2px -4px 0 4px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4c4cc;
  transition: background 0.12s, color 0.12s;
}
.page-card:hover .page-card-menu { color: #a1a1aa; }
.page-card-menu:hover { background: rgba(0,0,0,0.06); color: var(--text); }

.page-card-pin {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}
.page-card-figma {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #1e1e1e;
  color: #fff;
  pointer-events: none;
  letter-spacing: 0;
}
.page-card-react {
  position: absolute;
  bottom: 6px;
  right: 30px;
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #4f46e5;
  color: #fff;
  pointer-events: none;
  letter-spacing: 0;
}
.page-card-row2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.page-card-row2 .page-card-date { margin-top: 0; }
.page-card-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  padding: 3px 4px;
  border-radius: 2px;
  white-space: nowrap;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.page-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
}

.btn-add-page {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-zh);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-add-page:hover { background: var(--bg); color: var(--text); }

/* Analysis panel */
.panel-audit { flex: 0 0 280px; min-width: 200px; max-width: 500px; }
.panel-audit .panel-body { padding: 0; }

/* Mid panel tabs */
.mid-tabs-header {
  gap: 6px;
}
.mid-tabs {
  display: flex;
  gap: 0;
  background: var(--bg);
  border-radius: 6px;
  padding: 2px;
}
.mid-tab {
  padding: 3px 10px;
  border: none;
  background: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-zh);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.mid-tab:hover { color: var(--text-secondary); }
.mid-tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.btn-reaudit {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-zh);
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-reaudit:hover { background: var(--bg); color: var(--text); }

.audit-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

/* ═══ Design Scoring Dashboard ═══ */
.dash-wrap {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ── Dashboard Hero (Review & Comments style) ── */
.dash-hero {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.dash-hero-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  min-width: 130px;
  flex-shrink: 0;
}
.dash-big-score {
  font-family: var(--font-en);
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1.5px;
}
.dash-stars {
  display: flex;
  gap: 2px;
  margin-top: 6px;
}
.dash-star {
  font-size: 18px;
  line-height: 1;
}
.dash-star.full { color: #f59e0b; }
.dash-star.half { color: #f59e0b; opacity: 0.5; }
.dash-star.empty { color: #d1d5db; }
.dash-review-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dash-hero-right {
  flex: 1;
  padding: 14px 12px 10px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.dash-eval-title {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.dash-eval-row {
  margin-bottom: 14px;
}
.dash-eval-row:last-child { margin-bottom: 0; }
.dash-eval-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.dash-eval-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 10px;
}
.dash-eval-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.dash-eval-pct {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.dash-eval-grade {
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
  color: var(--text-muted);
}
.dash-eval-grade b { font-weight: 700; }
.dash-eval-bar {
  height: 8px;
  border-radius: 4px;
  background: #f3f4f6;
  overflow: hidden;
}
.dash-eval-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease-out;
}

/* ── Score ring (shared, used by PRD panel) ── */
.dash-overall-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(
    var(--score-color) calc(var(--score-pct) * 3.6deg),
    var(--border) calc(var(--score-pct) * 3.6deg)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.dash-overall-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--panel);
}
.dash-overall-num {
  position: relative;
  z-index: 1;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 22px;
  color: var(--text);
}
.dash-overall-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.dash-overall-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.dash-overall-band {
  font-size: 12px;
  font-weight: 700;
}

/* ── Score cards (shared, used by PRD panel) ── */
.dash-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.dash-card:last-child { border-bottom: none; }
.dash-card-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.dash-card-body {
  flex: 1;
  min-width: 0;
}
.dash-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.dash-card-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 3px;
}
.dash-card-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease-out;
}
.dash-card-detail {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.dash-card-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 36px;
}
.dash-card-num {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
}
.dash-card-sub {
  font-size: 9px;
  font-weight: 500;
  margin-top: 1px;
}

/* shared issue styles (used by PRD panel) */
.dash-issues {
  border-top: 1px solid var(--border);
  padding: 8px 0 4px;
}
.dash-issues-title {
  padding: 4px 14px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.dash-issue {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
}
.dash-issue:last-child { border-bottom: none; }
.dash-issue-sev {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}
.dash-issue-text {
  flex: 1;
  line-height: 1.5;
}

/* ── Key Findings (full list) ── */
.dash-findings {
  border-top: 1px solid var(--border);
  padding: 10px 0 6px;
}
.dash-findings-title {
  padding: 0 14px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-findings-count {
  font-size: 11px;
  font-weight: 600;
  background: #6366f1;
  color: #fff;
  padding: 0 6px;
  border-radius: 10px;
  line-height: 18px;
}
.dash-finding-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}
.dash-finding-card:last-child { border-bottom: none; }
.dash-finding-sev {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}
.dash-finding-text {
  flex: 1;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-issues-more {
  padding: 4px 14px 8px;
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Health Banner ── */
.dash-health-warn {
  display: flex;
  gap: 10px;
  margin: 0 14px 10px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  align-items: flex-start;
}
.dash-health-icon { font-size: 18px; flex-shrink: 0; line-height: 1.2; }
.dash-health-body { flex: 1; min-width: 0; }
.dash-health-title {
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 3px;
}
.dash-health-desc {
  font-size: 11px;
  line-height: 1.6;
  color: #a16207;
}
.dash-health-good {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 14px 10px;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 12px;
  color: #166534;
}

/* ═══ UX Spec Panel ═══ */
.uxs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
  gap: 8px;
  color: var(--text-muted);
}
.uxs-report { padding: 16px 14px; }
.uxs-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.uxs-overall {
  flex-shrink: 0;
  text-align: center;
  padding: 12px 16px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.uxs-overall-score {
  font-family: 'Montserrat', var(--font-en);
  font-weight: 700;
  font-size: 36px;
  line-height: 1;
}
.uxs-overall-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}
.uxs-dims { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.uxs-dim-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 3px;
}
.uxs-dim-score { font-weight: 600; }
.uxs-dim-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.uxs-dim-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.uxs-gaps, .uxs-suggestions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.uxs-gaps-title, .uxs-suggestions-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.uxs-gaps-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 600;
  padding: 0 5px;
  margin-left: 4px;
}
.uxs-suggestions-title .uxs-gaps-count { background: #eff6ff; color: #2563eb; }
.uxs-gap-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  border-radius: 6px;
  margin-bottom: 2px;
}
.uxs-gap-item:hover { background: var(--bg); }
.uxs-gap-icon { font-size: 14px; flex-shrink: 0; }
.uxs-gap-text { line-height: 1.4; }
.uxs-allgood {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: #16a34a;
  margin-top: 12px;
}

/* ═══ PRD Panel ═══ */
#prdBody {
  display: flex;
  flex-direction: column;
  position: relative;
}
#prdBody.hidden { display: none; }

.prd-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
  min-height: 0;
  overflow: hidden;
}
.prd-page-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.prd-tool-spacer { flex: 1; }
.prd-tool-doc,
.prd-tool-doc:hover,
.prd-tool-btn.prd-tool-doc.active {
  flex-shrink: 0;
  background: var(--panel);
  color: var(--text);
  border-color: #d8d8de;
  font-weight: 600;
}
.prd-tool-doc:focus,
.prd-tool-btn:focus {
  outline: none;
}
.prd-tool-doc:focus-visible,
.prd-tool-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.prd-tool-btn {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-zh);
  color: var(--text-muted);
  transition: background 120ms, color 120ms;
}
.prd-tool-btn:hover { background: var(--bg); color: var(--text); }
.prd-tool-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
}
.prd-btn-generate {
  background: #111;
  color: #fff;
  border-color: #111;
  font-weight: 600;
}
.prd-btn-generate:hover { background: #333; color: #fff; }

.prd-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  container-type: inline-size;
}

/* Empty state */
.prd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px 24px 100px;
  text-align: center;
}
.prd-upload-cta {
  margin-top: 6px;
  padding: 10px 20px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-zh);
  color: var(--text-secondary);
  transition: border-color 150ms, background 150ms, color 150ms;
}
.prd-upload-cta:hover {
  border-color: var(--accent);
  background: #f8f7ff;
  color: var(--accent);
}
.prd-upload-hint {
  font-size: 10px;
  color: #b4b4b4;
}

.figma-progress {
  margin-top: 12px;
  width: 200px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.figma-progress-bar {
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  animation: figmaSlide 1.5s ease-in-out infinite;
}
@keyframes figmaSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Edit mode */
.prd-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 12px 14px 96px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  background: var(--panel);
}
.prd-textarea::placeholder { color: var(--text-muted); }

/* Rendered PRD view */
.prd-render {
  padding: 14px 14px 96px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}
.prd-doc-layout {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.prd-doc-index {
  position: sticky;
  top: 14px;
  align-self: start;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fcfcfd 0%, #f8f8fb 100%);
  box-shadow: var(--shadow-sm);
}
.prd-index-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding: 0 4px;
}
.prd-index-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prd-index-item {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-size: 11px;
  line-height: 1.35;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms, color 120ms, transform 120ms;
}
.prd-index-item:hover {
  background: rgba(26, 26, 46, 0.05);
  color: var(--text);
}
.prd-index-item.active {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}
.prd-index-item.level-1 {
  font-weight: 700;
  color: var(--text);
}
.prd-index-item.level-3 {
  padding-left: 18px;
  font-size: 10px;
}
.prd-doc-main {
  min-width: 0;
}
.prd-fab-stack {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 4;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(228, 228, 231, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 36px rgba(24, 24, 27, 0.14);
}
.prd-fab {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 10px 24px rgba(24, 24, 27, 0.12);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 140ms, box-shadow 140ms, background 140ms, color 140ms, border-color 140ms;
}
.prd-fab::after {
  content: attr(aria-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17,17,17,0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(24, 24, 27, 0.16);
  transition: opacity 120ms, transform 120ms;
}
.prd-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(24, 24, 27, 0.16);
  background: #fff;
}
.prd-fab:hover::after,
.prd-fab:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.prd-fab.active {
  background: #fef3c7;
  border-color: #ca8a04;
  color: #92400e;
}
.prd-fab.prd-fab-generate {
  background: #111;
  color: #fff;
  border-color: #111;
}
.prd-fab.prd-fab-generate:hover {
  background: #333;
}
.prd-fab:disabled,
.prd-fab.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 6px 16px rgba(24, 24, 27, 0.08);
}
.prd-doc {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prd-doc [data-prd-section-id] {
  scroll-margin-top: 18px;
}
.prd-doc-header h1 {
  margin: 0;
}
.prd-summary-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prd-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prd-render h1, .prd-render h2, .prd-render h3 {
  font-weight: 700;
  color: var(--text);
}
.prd-render h1 { font-size: 16px; margin: 14px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.prd-render h2 { font-size: 14px; margin: 12px 0 5px; }
.prd-render h3 { font-size: 13px; margin: 10px 0 4px; }
.prd-render p { margin: 4px 0; }
.prd-render ul, .prd-render ol { padding-left: 18px; margin: 4px 0; }
.prd-render li { margin: 2px 0; }
.prd-render code {
  background: var(--bg);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: 'SF Mono', monospace;
  font-size: 12px;
}
.prd-render blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  color: var(--text-secondary);
  margin: 6px 0;
}
.prd-render hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.prd-render strong { font-weight: 700; }
.prd-render em { font-style: italic; color: var(--text-secondary); }
.prd-render a {
  color: var(--accent);
  text-decoration: none;
}
.prd-render a:hover { text-decoration: underline; }
.prd-placeholder-note {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}
.prd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}
.prd-table td {
  border: 1px solid var(--border);
  padding: 5px 8px;
  vertical-align: top;
}
.prd-table tr:first-child td { font-weight: 600; background: var(--bg); }
.prd-meta-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
}
.prd-meta-card.compact {
  background: linear-gradient(180deg, #fcfcfd 0%, #f9fafb 100%);
}
.prd-meta-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.prd-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.prd-meta-item {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}
.prd-meta-key {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.prd-meta-value {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
  margin: 0;
}

/* Inline analysis callouts in rendered PRD */
.prd-gap-callout {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid;
  font-size: 11px;
  line-height: 1.5;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.prd-gap-callout.gap-critical { border-color: #dc2626; background: #fef2f2; color: #991b1b; }
.prd-gap-callout.gap-major    { border-color: #ca8a04; background: #fefce8; color: #854d0e; }
.prd-gap-callout.gap-minor    { border-color: #2563eb; background: #eff6ff; color: #1e40af; }
.prd-gap-callout.gap-info     { border-color: #6b7280; background: #f9fafb; color: #374151; }
.prd-gap-icon { flex-shrink: 0; font-size: 13px; }
.prd-gap-body { flex: 1; }
.prd-gap-title { font-weight: 600; }
.prd-gap-fix { color: #16a34a; margin-top: 2px; }

@container (max-width: 440px) {
  .prd-doc-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .prd-doc-index {
    position: sticky;
    top: 0;
    z-index: 2;
    overflow-x: auto;
    padding: 8px;
  }
  .prd-index-title {
    margin-bottom: 6px;
  }
  .prd-index-list {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .prd-index-item {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .prd-index-item.level-3 {
    padding-left: 8px;
  }
}

/* Analysis summary bar */
.prd-analysis-inline {
  padding: 0;
  background: var(--panel);
  flex-shrink: 0;
  overflow-y: auto;
}
.prd-inline-summary {
  padding: 12px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prd-doc-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.prd-analysis-inline .prd-summary-stack {
  gap: 8px;
}
.prd-dash-summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}
.prd-dash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.prd-dash-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-en);
}
.prd-dash-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.prd-dash-chip-num {
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-en);
}
.prd-dash-chip-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.prda-summary-chips {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.prda-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Status bar */
.prd-status-bar {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}
.prd-status-bar.hidden { display: none; }
.prd-status {
  font-size: 10px;
  color: var(--text-muted);
}

/* ═══ PRD Analysis Report ═══ */
.prd-analysis { padding: 0; }
.prda-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.prda-score {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
}
.prda-meta { flex: 1; min-width: 0; }
.prda-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.prda-detail {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}
.prda-pass {
  padding: 20px 14px;
  text-align: center;
  color: #16a34a;
  font-weight: 500;
  font-size: 13px;
}
.prda-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
.prda-count {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
}
.prda-findings {
  padding: 4px 0;
}
.prda-finding {
  padding: 8px 14px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
}
.prda-finding:last-child { border-bottom: none; }
.prda-finding-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.prda-sev {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
}
.prda-cat {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.prda-finding-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.prda-finding-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
}
.prda-finding-fix {
  font-size: 11px;
  color: #16a34a;
  font-weight: 500;
  margin-top: 3px;
}

/* Preview panel */
.panel-preview { flex: 1 1 0; min-width: 300px; }
.panel-header-preview {
  height: auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 0 !important;
}
.preview-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  flex-shrink: 0;
}
.preview-sub-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 16px 8px;
  border-top: 1px solid var(--border);
}
.preview-sub-toolbar.hidden { display: none !important; }
.btn-sub-tool {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-zh);
  color: var(--text-muted);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.btn-sub-tool:hover { background: var(--bg); color: var(--text); }
.btn-sub-tool.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  width: 100%;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px;
  text-align: center;
}

/* Shared empty state tokens */
.empty-emoji {
  font-size: 40px;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}
.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.empty-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.65;
  margin-top: 4px;
}

.preview-body-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.preview-frame {
  border: 1px solid var(--border);
  border-radius: var(--preview-frame-radius);
  background: #fff;
  overflow: hidden;
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  flex-shrink: 0;
}
.device-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-en);
  font-weight: 500;
  letter-spacing: 0.3px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  pointer-events: none;
  z-index: 10;
  opacity: 0.75;
}
/* ── Export Float Button ── */
.export-float {
  position: absolute;
  right: 10px;
  bottom: 36px;
  z-index: 12;
}
.export-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.export-btn:hover { background: #fff; color: var(--text); border-color: #d4d4d8; }
.export-menu {
  position: absolute;
  bottom: 32px;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  padding: 4px 0;
  min-width: 110px;
}
.export-opt {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.export-opt:hover { background: var(--bg); }
.export-opt.disabled,
.export-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
}

/* ── Compare View ── */
.compare-view {
  display: flex;
  width: 100%;
  height: 100%;
  background: var(--bg);
}
.compare-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.compare-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.compare-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}
.compare-frame-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.compare-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid var(--border);
  border-radius: var(--preview-frame-radius);
  background: #fff;
  transform-origin: center center;
}

.proto-btn-group {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
}
.proto-compare-btn {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.proto-compare-btn:hover { background: var(--bg); color: var(--text-secondary); }
.proto-compare-btn.active {
  background: #fef3c7;
  border-color: #ca8a04;
  color: #92400e;
}
.proto-btn-group > .seg-solo {
  border-radius: 8px;
}
.proto-btn-group > .seg-start {
  border-radius: 8px 0 0 8px;
}
.proto-btn-group > .seg-mid {
  border-radius: 0;
}
.proto-btn-group > .seg-end {
  border-radius: 0 8px 8px 0;
}
.proto-btn-group > .seg-with-next {
  border-right: none;
}

.btn-heatmap {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-zh);
  color: var(--text-secondary);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-heatmap:hover { background: var(--bg); color: var(--text); }
.btn-heatmap:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.btn-heatmap.active {
  background: #fef3c7;
  border-color: #ca8a04;
  color: #92400e;
}

/* ── Dialog ── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: dialog-bg-in 180ms ease-out;
}
@keyframes dialog-bg-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dialog-box {
  background: var(--panel);
  border-radius: 16px;
  padding: 28px;
  width: 400px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  animation: dialog-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.dialog-box h3 {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.dialog-input {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  font-family: var(--font-zh);
  outline: none;
  background: var(--bg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.dialog-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }

/* ── Create project option cards ── */
.dialog-box-create { width: 440px; }
.create-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.create-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-zh);
  transition: border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.2s;
}
.create-option:hover {
  border-color: var(--accent);
  background: #f0f0f4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.create-option:active { transform: translateY(0); }
.create-option-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.create-option-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}
.create-option-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  line-height: 1.4;
}

/* ── PRD upload in create dialog ── */
.create-prd-upload { margin-top: 10px; }
.create-prd-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.create-prd-dropzone:hover { border-color: var(--accent); background: #f8f8fc; }
.create-prd-dropzone.dragover { border-color: var(--accent); background: #f0f0ff; }
.create-prd-icon { font-size: 28px; }
.create-prd-hint { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.create-prd-formats { font-size: 11px; color: var(--text-muted); }
.create-prd-attached {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}
.create-prd-file-icon { font-size: 16px; }
.create-prd-file-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.create-prd-remove {
  width: 22px; height: 22px;
  border: none; background: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.create-prd-remove:hover { background: #fee2e2; color: #dc2626; }

.figma-url-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-family: var(--font-en), var(--font-zh);
  color: var(--text);
  outline: none;
  background: var(--bg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.figma-url-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.figma-url-input::placeholder { color: #a1a1aa; }
/* Add page option cards */
.add-page-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.add-page-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms, background 120ms;
}
.add-page-opt:hover {
  border-color: var(--accent);
  background: #f8f7ff;
}
.apo-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}
.apo-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.apo-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
  display: block;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.dialog-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-family: var(--font-zh);
  cursor: pointer;
  font-weight: 500;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.dialog-btn:active { transform: scale(0.97); }
.dialog-btn-cancel { background: var(--bg); color: var(--text-secondary); }
.dialog-btn-cancel:hover { background: var(--border); color: var(--text); }
.dialog-btn-confirm { background: var(--accent); color: #f8f8fa; }
.dialog-btn-confirm:hover { background: var(--accent-hover); }
.dialog-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.dialog-hint code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--font-en);
  color: var(--text-secondary);
}

.trash-dialog-box {
  width: min(620px, 92vw);
  padding: 24px;
}
.trash-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.trash-dialog-title {
  margin: 0 !important;
  font-size: 22px;
}
.trash-dialog-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.trash-head-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.trash-head-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: #fafafe;
}
.trash-head-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.trash-head-btn.danger {
  color: #a13329;
}
.trash-head-btn.danger:hover {
  border-color: #f0cac7;
  color: #8d241d;
  background: #fff6f6;
}
.trash-dialog-hint {
  margin: 0 0 10px;
}
.trash-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  background: var(--bg);
}
.trash-book-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(54vh, 440px);
  overflow-y: auto;
  padding-right: 2px;
}
.trash-book-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px 14px;
}
.trash-book-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.trash-book-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.trash-book-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.trash-action-btn {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.trash-action-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: #fafafe;
}
.trash-action-btn.danger {
  color: #a13329;
}
.trash-action-btn.danger:hover {
  border-color: #f0cac7;
  color: #8d241d;
  background: #fff6f6;
}

.health-dialog-box {
  width: min(760px, 94vw);
  max-height: min(82vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
}
.health-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.health-dialog-title {
  margin: 0 !important;
  font-size: 21px;
}
.health-dialog-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.health-dialog-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.health-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.health-stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 10px 9px;
}
.health-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}
.health-stat-value {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.health-stat-value.warn {
  color: #b45309;
}
.health-stat-value.error {
  color: #b42318;
}
.health-loading {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  background: var(--bg);
}
.health-results-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  background: var(--bg);
}
.health-results-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}
.health-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
}
.health-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.health-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.health-item-count {
  border-radius: 999px;
  background: #eceef8;
  color: #4f5a92;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}
.health-issue-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.health-issue-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.health-issue-kind {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}
.health-issue-kind.link {
  background: #eceef8;
  color: #4f5a92;
}
.health-issue-kind.missing_asset {
  background: #ffe8d8;
  color: #b45309;
}
.health-issue-kind.http_404 {
  background: #fee2e2;
  color: #b42318;
}
.health-issue-kind.blank_risk {
  background: #fef3c7;
  color: #a16207;
}
.health-issue-target {
  margin-left: 4px;
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--text-muted);
}
@media (max-width: 920px) {
  .health-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.workflow-dialog-hint {
  margin-bottom: 10px;
}
.workflow-project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 2px 2px 0;
}
.workflow-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  background: var(--bg);
}
.workflow-project-item {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  padding: 12px 14px;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease, box-shadow 160ms ease;
  position: relative;
  z-index: 0;
}
.workflow-project-item:hover {
  border-color: var(--accent);
  background: #f8f8fc;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: none;
  z-index: 1;
}
.workflow-project-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.workflow-project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.workflow-project-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.workflow-project-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.workflow-project-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.workflow-page-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.4;
}
.workflow-page-chip.more {
  background: var(--bg);
  color: var(--text-muted);
}

/* ── Popover menu ── */
.popover {
  position: fixed;
  z-index: 2000;
  min-width: 140px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  animation: popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popover-in {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.popover-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-zh);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.popover-item:hover { background: var(--bg); color: var(--text); }
.popover-item.danger { color: var(--danger); }
.popover-item.danger:hover { background: #fef2f2; color: #991b1b; }
.popover-divider { height: 1px; background: var(--border); margin: 4px 8px; }
.popover-label {
  padding: 4px 12px 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.popover-status-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px 10px;
}
.popover-status-btn {
  display: flex;
  align-items: stretch;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.12s ease-out;
}
.popover-status-btn:hover { opacity: 1; }
.popover-status-btn.current { opacity: 1; }
.popover-status-btn:not(.current) { opacity: 0.9; }
.popover-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 24px;
  padding: 0 4px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  box-shadow: none;
}
.popover-status-btn.current .popover-status-pill {
  box-shadow: none;
}

/* ── Version button ── */
.btn-version {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  padding: 0;
}
.btn-version:hover { background: var(--bg); }
.version-dropdown { position: relative; }
.version-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 2000;
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  animation: popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
}
.version-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-zh);
  font-size: 12px;
  color: var(--text-secondary);
  transition: background 0.12s;
}
.version-item:hover { background: var(--bg); }
.version-label { font-weight: 500; color: var(--text); }
.version-time { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.version-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Finding Cards Interactive ── */
.dash-finding-card {
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}
.dash-finding-card:hover { background: rgba(0,0,0,0.03); }
.dash-finding-card:active { transform: scale(0.98); }
.finding-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.finding-action-btn {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  padding: 0;
}
.finding-action-btn:hover { background: var(--bg); }
.finding-action-btn.active { background: #16a34a; color: #fff; border-color: #16a34a; }
.dash-finding-card.ignored { opacity: 0.4; text-decoration: line-through; }
.dash-finding-card.resolved { opacity: 0.5; }
.dash-finding-card.resolved .dash-finding-sev { background: #16a34a !important; }

/* ── Heatmap Report Panel ── */
.hm-report {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 16px;
  width: 232px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
  font-family: var(--font-zh);
  animation: hm-slide-up 0.25s ease-out;
}
@keyframes hm-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.hm-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
}
.hm-close {
  width: 22px; height: 22px;
  border: none; background: rgba(0,0,0,0.05);
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #71717a;
  transition: background 0.12s;
}
.hm-close:hover { background: rgba(0,0,0,0.1); }

.hm-score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.hm-score-num {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 36px;
  line-height: 1;
}
.hm-score-label {
  font-size: 12px;
  color: #a1a1aa;
  font-weight: 500;
}

.hm-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  gap: 1px;
  margin-bottom: 10px;
}
.hm-seg { border-radius: 3px; min-width: 4px; }
.hm-seg.good { background: #22c55e; }
.hm-seg.warn { background: #eab308; }
.hm-seg.fail { background: #ef4444; }

.hm-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.hm-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #3f3f46;
}
.hm-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.hm-dot.good { background: #22c55e; }
.hm-dot.warn { background: #eab308; }
.hm-dot.fail { background: #ef4444; }

.hm-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 10px 0;
}

.hm-section { margin-bottom: 8px; }
.hm-sec-title {
  font-size: 11px;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.hm-sec-value { font-size: 12px; color: #3f3f46; }
.hm-pass { color: #16a34a; }
.hm-warn-text { color: #ca8a04; }

.hm-reach-bar-wrap {
  display: flex;
  height: 16px;
  border-radius: 4px;
  overflow: hidden;
  gap: 1px;
  margin-bottom: 4px;
}
.hm-rb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  min-width: 16px;
  border-radius: 3px;
}
.hm-rb.easy { background: #22c55e; }
.hm-rb.ok   { background: #eab308; }
.hm-rb.hard { background: #ef4444; }

.hm-reach-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #a1a1aa;
}

.hm-footer {
  font-size: 10px;
  color: #a1a1aa;
  line-height: 1.4;
}

/* ── UX Analyzer Panel ── */
.panel-analyzer .panel-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ── User Journey Map (Swimlane Edition) ── */
.journey-view {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: jny-in 280ms ease-out;
}
@keyframes jny-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── User Flow View (ECharts-powered) ── */
.userflow-view {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: linear-gradient(180deg, #fcfcfd 0%, #f6f6f8 100%);
  animation: jny-in 280ms ease-out;
  container-type: inline-size;
}
.uf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  padding: 48px;
  text-align: center;
}
.uf-empty-icon  { font-size: 40px; opacity: 0.7; }
.uf-empty-title { font-weight: 600; font-size: 15px; color: var(--text); }
.uf-empty-desc  { font-size: 13px; color: var(--text-muted); }
.uf-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.uf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}
.uf-head-compact {
  gap: 8px;
  padding: 12px 14px 10px;
}
.uf-head-copy { min-width: 0; }
.uf-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.uf-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.uf-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3efff;
  border: 1px solid #e2dcfb;
  color: #5a538c;
  font-size: 10px;
  font-weight: 600;
}
.uf-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.uf-legend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.uf-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 600;
}
.uf-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
}
.uf-legend-flow {
  background: #ece8ff;
  border-color: #dcd4ff;
  color: #4b4583;
}
.uf-legend-stage {
  background: #f3efff;
  border-color: #e2dcfb;
  color: #5a538c;
}
.uf-legend-step {
  background: #ffffff;
  border-color: #dedfea;
  color: #27293a;
}
.uf-legend-decision {
  background: #fff4dc;
  border-color: #f2dfb0;
  color: #8a6220;
}
.uf-legend-success {
  background: #e7f5ec;
  border-color: #cfe6d9;
  color: #2f6a4f;
}
.uf-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.uf-stat {
  min-width: 76px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.uf-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}
.uf-stat-value {
  margin-top: 4px;
  font-family: var(--font-en);
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
}
.uf-chart-wrap {
  flex: 1 1 auto;
  min-height: 360px;
  padding: 10px;
  display: flex;
}
.uf-chart-surface {
  position: relative;
  flex: 1;
  min-height: 320px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f7f7fa 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), var(--shadow-sm);
  overflow: hidden;
}
.uf-chart-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.uf-chart-hint {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(236, 236, 240, 0.92);
  color: var(--text-muted);
  font-size: 10px;
  backdrop-filter: blur(12px);
}
.uf-chart-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(224, 226, 235, 0.92);
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}
.uf-chart-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease;
}
.uf-chart-btn:hover {
  background: #f0f1f6;
}
.uf-chart-btn:active {
  background: #e6e8f0;
}
.uf-chart {
  width: 100%;
  height: 100%;
  min-height: 320px;
}
@container (max-width: 640px) {
  .uf-head {
    padding: 10px 12px 8px;
  }
  .uf-title {
    font-size: 14px;
  }
  .uf-sub {
    font-size: 10px;
  }
  .uf-chart-wrap {
    padding: 8px;
    min-height: 320px;
  }
  .uf-chart-surface {
    border-radius: 12px;
    min-height: 280px;
  }
  .uf-chart-hint {
    display: none;
  }
  .uf-chart {
    min-height: 280px;
  }
}

/* Wrap */
.jny-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: var(--font-zh);
}

/* Header */
.jny-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
  gap: 12px;
}
.jny-head-left { min-width: 0; }
.jny-head-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jny-head-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.jny-hd-ftag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 3px;
  background: #1e1e1e;
  color: #fff;
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 700;
  flex-shrink: 0;
}
.jny-head-stats {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.jny-stat {
  text-align: center;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  min-width: 44px;
}
.jny-stat-n {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  font-family: var(--font-en);
  line-height: 1.2;
}
.jny-stat-l {
  font-size: 9px;
  color: #94a3b8;
  margin-top: 1px;
}
.jny-st-pain            { background: #fff7ed; }
.jny-st-pain .jny-stat-n { color: #f97316; }
.jny-st-opp             { background: #eff6ff; }
.jny-st-opp .jny-stat-n  { color: #3b82f6; }
.jny-st-gap             { background: #fef2f2; }
.jny-st-gap .jny-stat-n  { color: #dc2626; }

/* Body (scroll container) */
.jny-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.jny-body:active { cursor: grabbing; }
.jny-matrix {
  display: flex;
  flex-direction: column;
}

/* ── Lanes ── */
.jny-lane {
  display: flex;
  border-bottom: 1px solid #f1f5f9;
}
.jny-lane:last-child { border-bottom: none; }

.jny-lane-hd {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 76px;
  min-width: 76px;
  padding: 10px 6px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-right: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.jny-lane-hd-s {
  padding: 0;
  height: 28px;
  min-height: 28px;
}
.jny-lh-i { font-size: 15px; line-height: 1; }
.jny-lh-t {
  font-size: 9px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.2;
}
.jny-lane-bd {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

/* Lane: Stages */
.jny-lane-stages { background: #fff; }
.jny-lane-stages .jny-lane-bd {
  padding: 8px 8px;
  gap: 4px;
  align-items: center;
}
.jny-stg-block {
  flex-shrink: 0;
  padding: 0 2px;
}
.jny-stg-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.jny-stg-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
}
.jny-stg-name { letter-spacing: 0.3px; }
.jny-stg-cnt {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.55;
}

/* Lane: Step numbers */
.jny-lane-nums {
  border-bottom: none;
  background: #fff;
}
.jny-lane-nums .jny-lane-bd { height: 30px; }
.jny-nums-bd {
  position: relative;
  align-items: center;
}
.jny-nums-track {
  position: absolute;
  top: 50%;
  height: 2px;
  background: #e2e8f0;
  border-radius: 1px;
  transform: translateY(-50%);
}
.jny-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jny-num-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-en);
  background: #fff;
  position: relative;
  z-index: 1;
  transition: transform 180ms ease;
}
.jny-num-dot:hover { transform: scale(1.15); }

/* Lane: Actions */
.jny-lane-actions { background: #fff; }
.jny-lane-actions .jny-lane-bd {
  padding: 8px 0;
  align-items: flex-start;
}
.jny-act-cell {
  flex-shrink: 0;
  padding: 0 6px;
}
.jny-act-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: default;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.jny-act-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}
.jny-act-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.jny-act-emoji { font-size: 18px; line-height: 1; }
.jny-act-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}
.jny-act-title {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jny-act-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
}

/* Lane: Emotion Curve */
.jny-lane-emotion {
  background: #fff;
  border-bottom: 1px solid #e2e8f0 !important;
}
.jny-curve-wrap {
  position: relative;
  overflow: visible;
}
.jny-curve-svg {
  display: block;
}
.jny-pt-ring {
  transition: stroke-width 180ms ease;
}
.jny-pt:hover .jny-pt-ring {
  stroke-width: 3.5;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.15));
}
.jny-pt-emo {
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}
.jny-pt:hover .jny-pt-emo { opacity: 1; }

/* Tooltip */
.jny-tip {
  position: absolute;
  z-index: 20;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 8px;
  padding: 8px 12px;
  pointer-events: none;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 150ms ease;
  font-size: 12px;
  line-height: 1.5;
}
.jny-tip.visible { opacity: 1; }
.jny-tip-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.jny-tip-row strong {
  font-weight: 600;
  font-size: 12px;
}
.jny-tip-emo { font-size: 16px; line-height: 1; }
.jny-tip-badge {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}
.jny-tip-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 1px;
}

/* Lane: Findings */
.jny-lane-finds { background: #fafbfc; }
.jny-lane-finds .jny-lane-bd {
  padding: 8px 0;
  align-items: flex-start;
}
.jny-find-cell {
  flex-shrink: 0;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.jny-fc {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.4;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.jny-fc:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.jny-fc-i {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.3;
}
.jny-fc-issue {
  background: #fff7ed;
  color: #c2410c;
  border-left: 3px solid #f97316;
}
.jny-fc-opp {
  background: #eff6ff;
  color: #1d4ed8;
  border-left: 3px solid #3b82f6;
}
.jny-fc-gap {
  background: #fef2f2;
  color: #b91c1c;
  border-left: 3px solid #ef4444;
  border-style: solid solid solid dashed;
}

/* Footer */
.jny-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.jny-foot-leg {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.jny-leg {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #64748b;
}
.jny-ld {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.jny-ld-dash {
  background: none !important;
  border: 1.5px dashed #d4d4d8;
}
.jny-foot-hint {
  font-size: 10px;
  color: #cbd5e1;
  letter-spacing: 0.5px;
}

/* Empty state */
.jny-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 13px;
  gap: 12px;
}
.jny-empty-icon { font-size: 40px; opacity: 0.4; }
.jny-empty-text { font-weight: 500; }

/* ── Component / Library Side Panel ── */
.preview-main {
  width: 100%;
  height: 100%;
  display: flex;
  overflow: hidden;
  position: relative;
}

.preview-main .preview-body-inner {
  flex: 1;
  min-width: 0;
}

.comp-side-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: comp-slide-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes comp-slide-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.comp-side-header {
  height: 44px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
}

.comp-side-title {
  font-size: 13px;
  font-weight: 600;
  color: #18181b;
}

.comp-side-close {
  width: 24px; height: 24px;
  border: none; background: transparent;
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #a1a1aa;
  transition: background 0.12s, color 0.12s;
}
.comp-side-close:hover { background: #f4f4f5; color: #18181b; }

.comp-side-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.comp-side-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.comp-side-tab {
  flex: 1;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  transition: color 0.12s, border-color 0.12s;
  font-family: var(--font-zh);
}
.comp-side-tab:hover { color: #3f3f46; }
.comp-side-tab.active {
  color: #18181b;
  border-bottom-color: #18181b;
  font-weight: 600;
}

.comp-group { margin-bottom: 16px; }
.comp-group-label {
  font-size: 10px;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.comp-group-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0 5px;
  border-radius: 8px;
  line-height: 16px;
}

.comp-card {
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #f4f4f5;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 17px;
}
.comp-card-name {
  font-weight: 600;
  color: #18181b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.comp-card-count {
  background: #f4f4f5;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  color: #70707b;
  font-weight: 600;
  margin-left: auto;
}
.comp-card-id {
  color: #a1a1aa;
  font-family: "Inter", monospace;
  font-size: 11px;
  margin-top: 2px;
}
.comp-card-variant {
  color: #8248f3;
  font-size: 11px;
  margin-top: 2px;
}

/* Library usage stats */
.lib-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.lib-stat-card {
  padding: 12px;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #f4f4f5;
  text-align: center;
}

.lib-stat-num {
  font-family: "Inter", var(--font-en);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.lib-stat-num.green { color: #16a34a; }
.lib-stat-num.orange { color: #ca8a04; }
.lib-stat-num.purple { color: #8248f3; }
.lib-stat-num.blue { color: #2563eb; }

.lib-stat-label {
  font-size: 11px;
  color: #a1a1aa;
  margin-top: 4px;
  font-weight: 500;
}

.lib-bar-wrap {
  margin-bottom: 16px;
}
.lib-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: #3f3f46;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.lib-bar-track {
  height: 8px;
  border-radius: 4px;
  background: #f4f4f5;
  overflow: hidden;
}
.lib-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease-out;
}
.lib-bar-fill.green { background: #22c55e; }
.lib-bar-fill.purple { background: #8248f3; }
.lib-bar-fill.blue { background: #3b82f6; }

.lib-comp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f4f4f5;
  font-size: 12px;
}
.lib-comp-row:last-child { border-bottom: none; }
.lib-comp-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lib-comp-name {
  flex: 1;
  font-weight: 500;
  color: #3f3f46;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-comp-count {
  font-family: "Inter", monospace;
  font-size: 11px;
  color: #a1a1aa;
  font-weight: 600;
  flex-shrink: 0;
}
.lib-comp-pct {
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  width: 38px;
  text-align: right;
}

/* ═══ Solution Copilot (方案推演) ═══ */
.solution-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
  text-align: center;
  background: var(--card-bg);
  border-radius: 12px;
  margin: 16px;
  border: 1px dashed var(--border);
}
.solution-cta {
  margin-top: 24px;
  padding: 10px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #131316 0%, #3f3f46 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}
.solution-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.solution-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.solution-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: slideUpFade 0.4s ease forwards;
  opacity: 0;
}
.solution-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.solution-tag {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  margin-bottom: 12px;
}
.solution-tag.ux { background: #fef2f2; color: #dc2626; }
.solution-tag.logic { background: #eff6ff; color: #2563eb; }
.solution-tag.visual { background: #fdf4ff; color: #4f46e5; }
.solution-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.solution-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}
.solution-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.solution-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  transition: all 0.2s;
}
.solution-opt:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}
.solution-opt-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.solution-opt-right {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.solution-chat {
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.solution-chat-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  background: var(--card-bg);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.solution-chat-input:focus {
  background: #fff;
  border-color: var(--accent);
}
.solution-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}
.solution-chat-send:active {
  transform: scale(0.92);
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ A11y Checker (removed – basic checks in ux-audit + heatmap) ═══ */
