/* 抖音热点二创雷达 · 现代化专业设计系统 (CSS) */

:root {
  --bg-app: #0f141c;
  --bg-surface: #181f2a;
  --bg-card: #1e2638;
  --bg-card-hover: #252f44;
  --bg-subtle: #242e40;
  
  --border-subtle: #2b364c;
  --border-focus: #3b82f6;
  --border-active: #4f46e5;
  
  --text-main: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --brand: #ff5733;
  --brand-light: rgba(255, 87, 51, 0.15);
  --brand-hover: #ff7043;
  
  --good: #10b981;
  --good-light: rgba(16, 185, 129, 0.15);
  
  --hot: #f59e0b;
  --hot-light: rgba(245, 158, 11, 0.15);
  
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  
  --purple: #8b5cf6;
  --purple-light: rgba(139, 92, 246, 0.15);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
  transition: all 0.15s ease;
}

input, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, textarea:focus {
  border-color: var(--brand);
}

.hidden {
  display: none !important;
}

/* ==================== 顶部导航栏 ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  background: rgba(15, 20, 28, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1720px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand);
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand-badge {
  font-size: 11px;
  padding: 2px 6px;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 4px;
  font-weight: 600;
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-pill:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-green {
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}

.dot-amber {
  background: var(--hot);
  box-shadow: 0 0 8px var(--hot);
}

.dot-red {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.dot-gray {
  background: var(--text-muted);
}

.update-clock {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
}

.countdown {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 按钮风格 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-weight: 550;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-ghost {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}

.btn-basket {
  position: relative;
}

.badge {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
}

/* 悬浮更新胶囊（防位移核心） */
.update-pill {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--brand);
  border-radius: 30px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.btn-pill-action {
  background: var(--brand);
  color: #fff;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 600;
}

.btn-pill-close {
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px;
}

/* ==================== 响应式三栏工作台 ==================== */
.workbench {
  max-width: 1720px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  gap: 20px;
  align-items: start;
}

/* 左侧控制栏 */
.sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 72px;
}

.sidebar-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.block-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.help-tip {
  cursor: help;
  color: var(--text-muted);
}

.seg {
  display: flex;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.seg button {
  flex: 1;
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
  border-right: 1px solid var(--border-subtle);
}

.seg button:last-child {
  border-right: none;
}

.seg button.on {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

.seg-vertical {
  flex-direction: column;
}

.seg-vertical button {
  border-right: none;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.seg-vertical button:last-child {
  border-bottom: none;
}

.scope-input-wrapper input {
  width: 100%;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
}

.chip.on {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}

.chip-hot.on {
  background: var(--hot-light);
  color: var(--hot);
  border-color: var(--hot);
}

.chip-good.on {
  background: var(--good-light);
  color: var(--good);
  border-color: var(--good);
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.switch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
}

.switch-item input {
  accent-color: var(--brand);
}

/* ==================== 中间主视区 ==================== */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* 统计条 */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.stat-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.stat-val {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.c-good { color: var(--good); }
.c-hot { color: var(--hot); }
.c-mute { color: var(--text-muted); }

/* 工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding-left: 32px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-mode-seg {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.view-mode-seg button {
  padding: 4px 8px;
  font-size: 11px;
}

.view-mode-seg button.on {
  background: var(--brand);
  color: #fff;
  border-radius: 4px;
}

/* 全榜走势折叠栏 */
.trend-collapse {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.trend-summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trend-tip-text {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: normal;
}

.board-chart-container {
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
}

/* ==================== 卡片流 (Feed) ==================== */
.feed-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.radar-card:hover {
  border-color: var(--text-muted);
}

.radar-card.open {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.radar-card.is-blocked {
  opacity: 0.55;
  background: #151a24;
}

.card-summary {
  padding: 12px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
}

.card-rank {
  flex: 0 0 28px;
  height: 28px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
}

.card-rank.top-rank {
  background: var(--brand-light);
  color: var(--brand);
}

.card-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
}

.thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
}

.card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-word {
  font-size: 15px;
  font-weight: 650;
  color: #fff;
}

.card-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 1.5px 7px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.tag-hot { background: var(--hot-light); color: var(--hot); }
.tag-surge { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.tag-good { background: var(--good-light); color: var(--good); }
.tag-scope { background: var(--purple-light); color: var(--purple); font-weight: 600; }
.tag-hook { border: 1px dashed var(--brand); color: var(--brand); }

.card-score-box {
  flex: 0 0 90px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.score-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
}

.score-progress {
  width: 100%;
  height: 4px;
  background: var(--bg-app);
  border-radius: 2px;
  overflow: hidden;
}

.score-progress-bar {
  height: 100%;
  background: var(--brand);
}

.card-action-bar {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-icon-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-icon-tag:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-icon-tag.active {
  border-color: var(--brand);
  color: var(--brand);
}

/* 分镜展开详情区 (三幕结构) */
.card-detail-pane {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: #141a24;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.story-board-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.story-act {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.act-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
}

.act-body {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.45;
}

.detail-prompt-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  color: #e2e8f0;
  font-family: monospace;
  white-space: pre-wrap;
  line-height: 1.5;
}

.detail-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 12px;
}

.kv-item b {
  color: var(--text-muted);
  margin-right: 6px;
}

.detail-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.feedback-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

.copy-btns {
  display: flex;
  gap: 6px;
}

/* ==================== 官方热点宝区 ==================== */
.hotspot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

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

.hotspot-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==================== 右侧抽屉 (选题箱) ==================== */
.workbench-drawer {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
}

.drawer-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  font-size: 13.5px;
}

.drawer-count {
  background: var(--brand-light);
  color: var(--brand);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
}

.drawer-content {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.basket-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
}

.basket-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.basket-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.basket-card-word {
  font-weight: 600;
  color: #fff;
}

.btn-remove-basket {
  color: var(--text-muted);
  font-size: 12px;
}

.btn-remove-basket:hover {
  color: var(--danger);
}

/* ==================== 模态弹窗系统 ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  width: 480px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
  font-size: 15px;
  font-weight: 650;
}

.modal-close {
  color: var(--text-muted);
  font-size: 14px;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 10px 18px;
  background: var(--bg-app);
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

.hotspot-status-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 4px;
}

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

.qr-container {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.qr-image {
  width: 170px;
  height: 170px;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px;
}

.cookie-textarea {
  width: 100%;
  height: 110px;
  resize: vertical;
}

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

.form-group label {
  font-size: 12px;
  color: var(--text-secondary);
}

.form-tip {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ==================== 全局 Tooltip 与 Toast ==================== */
.chart-tooltip {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  background: rgba(15, 20, 28, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11.5px;
  box-shadow: var(--shadow-md);
  color: #fff;
  transition: opacity 0.1s ease, transform 0.1s ease;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2100;
  background: var(--bg-card);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  color: #fff;
  animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 响应式断点适配 */
@media (max-width: 1200px) {
  .workbench {
    grid-template-columns: 220px 1fr;
  }
  .workbench-drawer {
    display: none;
  }
}

@media (max-width: 768px) {
  .workbench {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}
