/* ===== 晨光 Morning Light — 小红书数据分析系统 ===== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&display=swap');

:root {
  /* Core palette — 暖象牙底 */
  --color-bg: #FAF6EF;
  --color-bg-elevated: #FFFFFF;
  --color-bg-subtle: #F3ECDF;
  --color-bg-hover: #F3ECDF;
  --color-card: #FFFFFF;
  --color-card-hover: #FFF8EE;
  --color-border: #EDE2D2;
  --color-border-subtle: #DECDB6;
  --color-border-focus: #DECDB6;

  /* Accent — 珊瑚橙主色 */
  --color-primary: #F26E3F;
  --color-primary-hover: #D9552A;
  --color-primary-muted: #FDE3D8;
  --color-primary-glow: rgba(242, 110, 63, 0.22);

  /* Secondary accent — 青绿辅色 */
  --color-accent: #0F9488;
  --color-accent-hover: #0B7A70;
  --color-accent-muted: #D2F0EC;

  /* 暖阳黄点缀 */
  --color-highlight: #F5A623;

  /* Text */
  --color-text: #3D372F;
  --color-text-sec: #8B7F71;
  --color-text-muted: #B8AC9C;
  --color-text-inverse: #FFFFFF;

  /* Semantic */
  --color-success: #2E9E5B;
  --color-success-muted: rgba(46, 158, 91, 0.12);
  --color-danger: #D64545;
  --color-danger-muted: rgba(214, 69, 69, 0.12);
  --color-info: #2F86C8;
  --color-info-muted: rgba(47, 134, 200, 0.12);

  /* Metric */
  --color-metric-bg: #FFF8EE;

  /* Chart colors — 晨光 6 色板 */
  --color-chart-1: #F26E3F;
  --color-chart-2: #0F9488;
  --color-chart-3: #F5A623;
  --color-chart-4: #7FB069;
  --color-chart-5: #4E9BD4;
  --color-chart-6: #D985A7;

  /* Typography */
  --font-display: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family: 'Archivo', -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(93,64,32,.06);
  --shadow-card-hover: 0 2px 6px rgba(93,64,32,.06), 0 8px 24px rgba(93,64,32,.08);
  --shadow-glow: 0 4px 16px rgba(242,110,63,0.18);

  /* Layout */
  --max-width: 960px;
  --nav-height: 56px;

  /* Animation */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-in: 200ms;
  --duration-out: 150ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--nav-height);
  padding-bottom: 60px;
  min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }

::selection {
  background: var(--color-primary-muted);
  color: var(--color-primary);
}

/* ===== Staggered card animations ===== */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: cardIn 0.4s var(--ease-out) both;
}
.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 60ms; }
.card:nth-child(3) { animation-delay: 120ms; }
.card:nth-child(4) { animation-delay: 180ms; }
.card:nth-child(5) { animation-delay: 240ms; }
.card:nth-child(6) { animation-delay: 300ms; }
.card:nth-child(7) { animation-delay: 360ms; }
.card:nth-child(8) { animation-delay: 420ms; }

/* ===== 导航栏 ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
}

.nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text-sec);
  text-decoration: none;
  font-size: 20px;
  margin-right: 8px;
  border-radius: 8px;
  transition: all var(--duration-in);
}

.nav-back:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.nav-title {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.nav-tabs-desktop {
  display: none;
  margin-left: auto;
  gap: 2px;
}

.nav-tab {
  color: var(--color-text-sec);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--duration-in);
  letter-spacing: -0.01em;
}

.nav-tab:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.nav-tab.active {
  color: var(--color-text);
  background: var(--color-primary-muted);
  font-weight: 600;
}

@media (min-width: 768px) {
  .nav-tabs-desktop { display: flex; }
  .nav { padding: 0 24px; }
}

/* ===== 页面容器 ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}

@media (min-width: 768px) {
  .container { padding: 24px; }
}

/* ===== 卡片 ===== */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color var(--duration-in), box-shadow var(--duration-in);
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== 指标网格 ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
}

.metric-card {
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  transition: all var(--duration-in);
}

.metric-card:hover {
  border-color: var(--color-border-subtle);
  box-shadow: 0 0 0 1px var(--color-border-subtle);
}

.metric-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.metric-ratio {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.metric-ratio.up { color: var(--color-success); }
.metric-ratio.down { color: var(--color-danger); }

/* ===== 进度条 ===== */
.progress-track {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
  width: 0%;
}

/* ===== 状态标记 ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

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

.status-badge.idle { background: var(--color-bg-hover); color: var(--color-text-muted); }
.status-badge.idle .dot { background: var(--color-text-muted); }
.status-badge.running { background: var(--color-primary-muted); color: var(--color-primary); }
.status-badge.running .dot { background: var(--color-primary); animation: pulse 1.5s infinite; }
.status-badge.completed { background: var(--color-success-muted); color: var(--color-success); }
.status-badge.completed .dot { background: var(--color-success); }
.status-badge.failed { background: var(--color-danger-muted); color: var(--color-danger); }
.status-badge.failed .dot { background: var(--color-danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-display);
  border: none;
  cursor: pointer;
  transition: all var(--duration-in);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== 快捷入口卡片 ===== */
.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: all var(--duration-in);
}

.link-card:hover {
  border-color: var(--color-border-subtle);
  box-shadow: var(--shadow-card-hover);
}

.link-card-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.link-card-count {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.link-card-arrow {
  font-size: 20px;
  color: var(--color-text-muted);
  transition: transform var(--duration-in);
}

.link-card:hover .link-card-arrow {
  color: var(--color-primary);
  transform: translateX(2px);
}

/* ===== 笔记卡片（移动端列表） ===== */
.note-card {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: all var(--duration-in);
}

.note-card:hover {
  border-color: var(--color-border-subtle);
  box-shadow: var(--shadow-card-hover);
}

.note-card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.note-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.genre-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-primary-muted);
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

.note-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.note-stat {
  text-align: center;
}

.note-stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.note-stat-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* ===== 笔记表格（桌面端） ===== */
.note-table-wrap { display: none; }

@media (min-width: 768px) {
  .note-cards { display: none; }
  .note-table-wrap { display: block; }
}

.note-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.note-table th {
  background: var(--color-bg-subtle);
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
}

.note-table td {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-sec);
}

.note-table tbody tr:last-child td {
  border-bottom: none;
}

.note-table tr:hover td {
  background: var(--color-bg-hover);
}

.note-table a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--duration-in);
}

.note-table a:hover {
  color: var(--color-primary);
}

/* ===== 排序控件 ===== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.notes-summary {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-muted);
}

.sort-bar label {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.sort-select {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg-subtle);
  cursor: pointer;
  transition: border-color var(--duration-in);
}

.sort-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-muted);
}

/* ===== 详情页标题 ===== */
.detail-header {
  margin-bottom: 16px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ===== 图表区域 ===== */
.chart-section {
  margin-top: 8px;
}

.chart-container {
  position: relative;
  height: 250px;
}

@media (min-width: 768px) {
  .chart-container { height: 300px; }
}

/* ===== 图表容器 ===== */
.chart-wrap {
  position: relative;
  height: 250px;
}

@media (min-width: 768px) {
  .chart-wrap { height: 300px; }
}

/* 指标筛选药丸 */
.chart-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.chart-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  transition: all var(--duration-in);
  font-family: var(--font-family);
}

.chart-pill:hover {
  border-color: var(--color-border-subtle);
  color: var(--color-text-sec);
}

.chart-pill.active {
  border-color: currentColor;
  background: var(--color-bg-hover);
  font-weight: 600;
}

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

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 15px;
  color: var(--color-text-sec);
}

/* ===== 加载状态 ===== */
.loading {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(93,64,32,0.18);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== 底部导航栏（移动端） ===== */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--color-border);
  z-index: 100;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color var(--duration-in);
}

.bottom-nav-item.active {
  color: var(--color-primary);
}

.bottom-nav-item svg { flex-shrink: 0; }

/* 桌面端隐藏底部导航 */
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ===== 导出简报 ===== */
.briefing-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.briefing-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.briefing-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.briefing-metric-item {
  text-align: center;
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
}

.briefing-section {
  margin-top: 14px;
}

.briefing-section-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.briefing-note-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 6px 0;
  color: var(--color-text-sec);
}

.success-text { color: var(--color-success); }
.danger-text { color: var(--color-danger); }

/* ===== 数据完备性 ===== */
.completeness-date {
  margin-bottom: 10px;
}

.completeness-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (min-width: 768px) {
  .completeness-grid { grid-template-columns: repeat(6, 1fr); }
}

.completeness-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.check-ok {
  color: var(--color-success);
  font-size: 18px;
  font-weight: 700;
}

.check-fail {
  color: var(--color-danger);
  font-size: 18px;
  font-weight: 700;
}

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

.completeness-val {
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-display);
  color: var(--color-text);
}

.completeness-result {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
}

.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.history-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--color-card);
}

.history-table th,
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.history-table th {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-table td {
  color: var(--color-text-sec);
  font-size: 13px;
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table tbody tr:hover td {
  background: var(--color-bg-hover);
}

/* ===== 历史快照 ===== */
.snapshot-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.snapshot-pill {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  color: var(--color-text-sec);
  transition: all var(--duration-in);
  font-family: var(--font-family);
}

.snapshot-pill:hover {
  border-color: var(--color-border-subtle);
  color: var(--color-text);
}

.snapshot-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px var(--color-primary-glow);
}

.snapshot-list {
  max-height: 400px;
  overflow-y: auto;
}

.snapshot-note {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  transition: all var(--duration-in);
}

.snapshot-note:last-child { border-bottom: none; }

.snapshot-note:hover {
  background: var(--color-bg-hover);
  border-radius: var(--radius-sm);
  padding-left: 8px;
  padding-right: 8px;
}

.snapshot-note-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.snapshot-note-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ===== 周期切换 ===== */
.period-switch { display: inline-flex; gap: 4px; margin-left: auto; }

.period-btn {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--color-border);
  color: var(--color-text-sec);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-in);
  font-family: var(--font-family);
}

.period-btn:hover {
  border-color: var(--color-border-subtle);
  color: var(--color-text);
}

.period-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ===== 排名表格 ===== */
.ranking-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ranking-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.ranking-table th {
  text-align: left;
  padding: 8px 6px;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ranking-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  color: var(--color-text-sec);
}

.ranking-table tbody tr:hover {
  background: var(--color-bg-hover);
}

.rank-num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-primary);
  min-width: 28px;
}

.score-total {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-accent);
}

.note-link {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--duration-in);
}

.note-link:hover {
  color: var(--color-primary);
}

/* ===== 内容规律 ===== */
.pattern-section { margin-bottom: 20px; }

.pattern-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.pattern-genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.pattern-genre-card {
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: border-color var(--duration-in);
}

.pattern-genre-card:hover {
  border-color: var(--color-border-subtle);
}

.pattern-genre-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
}

.pattern-genre-count {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.pattern-genre-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.pattern-metric { display: flex; flex-direction: column; min-width: 80px; }

.pattern-metric-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pattern-metric-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.pattern-time-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.pattern-time-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 70px;
  transition: border-color var(--duration-in);
}

.pattern-time-item:hover {
  border-color: var(--color-primary);
}

.pattern-time-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}

.pattern-time-count {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ===== 竞品页面 ===== */
.competitor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .competitor-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
}

.competitor-card {
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  transition: all var(--duration-in);
}

.competitor-card:hover {
  border-color: var(--color-border-subtle);
}

.competitor-card.me {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-muted);
}

.competitor-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
  margin-bottom: 4px;
}

.competitor-bio {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.competitor-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.competitor-stat { display: flex; flex-direction: column; }

.competitor-stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.competitor-stat-value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.add-competitor-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.add-competitor-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg-subtle);
  transition: all var(--duration-in);
}

.add-competitor-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-muted);
}

.add-competitor-input::placeholder {
  color: var(--color-text-muted);
}

.add-competitor-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-in);
}

.add-competitor-btn:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-glow);
}

.add-competitor-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.gap-bar-wrap { margin-bottom: 12px; }

.gap-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--color-text-sec);
}

.gap-bar-track {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.gap-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}

.gap-bar-fill.me { background: var(--color-primary); }
.gap-bar-fill.competitor { background: var(--color-accent); }

.delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all var(--duration-in);
}

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

.suggestion-list { list-style: none; padding: 0; }

.suggestion-item {
  padding: 12px 14px;
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--color-text-sec);
  line-height: 1.5;
  transition: border-color var(--duration-in);
}

.suggestion-item:hover {
  border-color: var(--color-border-subtle);
}

/* ===== 首页链接卡片增强 ===== */
.link-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .link-card-grid { grid-template-columns: 1fr; }
}

.link-card-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--duration-in);
}

.link-card-mini:hover {
  border-color: var(--color-border-subtle);
  box-shadow: 0 0 0 1px var(--color-border-subtle);
}

.link-card-mini:active {
  transform: scale(0.98);
}

.link-card-mini-icon { font-size: 24px; margin-right: 12px; }

.link-card-mini-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.link-card-mini-sub {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ===== 洞察卡片 (笔记详情页) ===== */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .insight-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

.insight-item {
  background: var(--color-metric-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  transition: border-color var(--duration-in);
}

.insight-item:hover {
  border-color: var(--color-border-subtle);
}

.insight-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.insight-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.insight-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.insight-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.insight-badge.excellent { background: var(--color-success-muted); color: var(--color-success); }
.insight-badge.good { background: var(--color-accent-muted); color: var(--color-accent); }
.insight-badge.normal { background: var(--color-bg-hover); color: var(--color-text-muted); }

/* ===== 工具类 ===== */
.text-sec { color: var(--color-text-sec); }
.text-sm { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-subtle);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}
