/* ==========================================================================
   Galgame 评论与评分分析台 — Round 3: Premium Product Design
   Direction: 40% Linear · 30% Stripe · 20% Apple · 10% Steam
   Keywords: Premium, Editorial, Precision, Calm, High-density, Quiet Luxury
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Semantic Design Tokens (4px / 8px Spacing Scale)
   -------------------------------------------------------------------------- */

:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Core Surfaces */
  --bg-canvas: #101114;
  --bg-surface: #181A20;
  --bg-surface-secondary: #22252D;
  --bg-surface-hover: #1E2129;
  --bg-surface-active: #272B35;
  --bg-scrim: rgba(8, 9, 12, 0.76);

  /* Borders */
  --border-subtle: #23262F;
  --border-default: #2D3039;
  --border-strong: #3E424F;

  /* Typography Ink */
  --text-primary: #F1F2F5;
  --text-body-secondary: #B4B8C4;
  --text-secondary: #969BA8;
  --text-inverse: #101114;

  /* Brand Accent */
  --accent: #939BEC;
  --accent-hover: #A6ADF2;
  --accent-soft: rgba(147, 155, 236, 0.14);
  --accent-border: rgba(147, 155, 236, 0.34);

  /* Semantic Status & Reputation */
  --success: #63C6A4;
  --success-soft: rgba(99, 198, 164, 0.13);
  --success-border: rgba(99, 198, 164, 0.30);

  --warning: #DFAD56;
  --warning-soft: rgba(223, 173, 86, 0.13);
  --warning-border: rgba(223, 173, 86, 0.30);

  --danger: #E07070;
  --danger-soft: rgba(224, 112, 112, 0.13);
  --danger-border: rgba(224, 112, 112, 0.30);

  /* Chart Palette (Unified Low-Saturation Slate-Indigo + Semantic Comments) */
  --chart-bar: #3B4054;
  --chart-bar-hover: #58607C;
  --chart-bar-active: #939BEC;
  --chart-grid: rgba(255, 255, 255, 0.055);
  --chart-axis: #2D3039;

  --sent-pos: #63C6A4;
  --sent-neu: #DFAD56;
  --sent-neg: #E07070;
  --sent-tech: #7C89A3;
  --sent-noise: #4B5164;

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.32);
  --shadow-tooltip: 0 10px 28px rgba(0, 0, 0, 0.48);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.62);

  /* Skeleton */
  --skeleton-base: #1E2129;
  --skeleton-shine: #282C37;

  /* Spacing Scale (4px / 8px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Typography */
  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
}

[data-theme="light"] {
  color-scheme: light;

  /* Core Surfaces */
  --bg-canvas: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-surface-secondary: #F0F1F5;
  --bg-surface-hover: #F3F4F8;
  --bg-surface-active: #E8EAF0;
  --bg-scrim: rgba(24, 27, 35, 0.46);

  /* Borders */
  --border-subtle: #ECEEF2;
  --border-default: #E5E7EB;
  --border-strong: #CBD0DA;

  /* Typography Ink */
  --text-primary: #181B23;
  --text-body-secondary: #4D5361;
  --text-secondary: #686E7C;
  --text-inverse: #FFFFFF;

  /* Brand Accent */
  --accent: #626AC4;
  --accent-hover: #525AB3;
  --accent-soft: rgba(98, 106, 196, 0.10);
  --accent-border: rgba(98, 106, 196, 0.28);

  /* Semantic Status & Reputation */
  --success: #258A72;
  --success-soft: rgba(37, 138, 114, 0.10);
  --success-border: rgba(37, 138, 114, 0.26);

  --warning: #B7791F;
  --warning-soft: rgba(183, 121, 31, 0.10);
  --warning-border: rgba(183, 121, 31, 0.26);

  --danger: #C54B4B;
  --danger-soft: rgba(197, 75, 75, 0.10);
  --danger-border: rgba(197, 75, 75, 0.26);

  /* Chart Palette */
  --chart-bar: #B8BECE;
  --chart-bar-hover: #8C94AE;
  --chart-bar-active: #626AC4;
  --chart-grid: rgba(24, 27, 35, 0.06);
  --chart-axis: #DCE0E8;

  --sent-pos: #258A72;
  --sent-neu: #C68A2E;
  --sent-neg: #C85555;
  --sent-tech: #64748B;
  --sent-noise: #BFC6D2;

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(24, 27, 35, 0.04);
  --shadow-card-hover: 0 8px 24px rgba(24, 27, 35, 0.08);
  --shadow-tooltip: 0 10px 28px rgba(24, 27, 35, 0.12);
  --shadow-modal: 0 24px 64px rgba(24, 27, 35, 0.20);

  /* Skeleton */
  --skeleton-base: #ECEEF2;
  --skeleton-shine: #F5F6F9;
}

/* --------------------------------------------------------------------------
   02. Base & Browser Surface Polish
   -------------------------------------------------------------------------- */

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.hidden {
  display: none !important;
}

button,
input,
select {
  font-family: inherit;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   03. Shared Button & Control Primitives
   -------------------------------------------------------------------------- */

.btn {
  height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.btn:active:not(:disabled) {
  transform: translateY(0.5px);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-primary {
  color: #101114;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  height: 32px;
  padding: 0 10px;
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
  font-size: 13px;
}

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

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn.is-loading .btn-icon svg {
  animation: spin 0.75s linear infinite;
}

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

/* --------------------------------------------------------------------------
   04. Product Header
   -------------------------------------------------------------------------- */

.product-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  background: color-mix(in srgb, var(--bg-canvas) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
}

.header-inner {
  max-width: 1800px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   05. Main Workspace & Section Rhythm
   -------------------------------------------------------------------------- */

.workspace {
  max-width: 1800px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-10) var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.section-header,
.explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-heading-group {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  flex-wrap: wrap;
  min-width: 0;
}

.section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Status Banner */
.status-banner {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: 13px;
}

.status-banner.warning {
  border-color: var(--warning-border);
  background: var(--warning-soft);
}

.status-banner.info {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   06. Analytics Overview (Collapsible)
   -------------------------------------------------------------------------- */

.analytics-section {
  display: flex;
  flex-direction: column;
}

.analytics-section.is-collapsed .section-header {
  margin-bottom: 0;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.collapsed-summary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.collapsed-summary strong {
  color: var(--text-primary);
  font-weight: 600;
  margin-right: 2px;
}

.collapsed-sep {
  width: 1px;
  height: 12px;
  background: var(--border-default);
}

.chevron-icon svg {
  transition: transform var(--duration-base) var(--ease-out);
}

.analytics-section.is-collapsed .chevron-icon svg {
  transform: rotate(180deg);
}

.analytics-collapsible {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows var(--duration-base) var(--ease-out),
    opacity var(--duration-base) var(--ease-out);
}

.analytics-section.is-collapsed .analytics-collapsible {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.analytics-collapsible-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* KPI Grid — Elevated Editorial Metric Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 2px 0;
}

.kpi-value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.kpi-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}

.kpi-sub-item {
  white-space: nowrap;
}

/* Charts Grid — Asymmetric Stripe-Inspired Analytical Panels */
.charts-grid {
  display: grid;
  grid-template-columns: 1.24fr 1fr 1fr;
  gap: var(--space-5);
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chart-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.chart-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.chart-hint {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.chart-body {
  flex: 1;
  min-height: 184px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Score Distribution Column Chart */
.score-chart-wrap {
  position: relative;
  height: 186px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.score-grid-lines {
  position: absolute;
  inset: 14px 0 26px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.score-grid-line {
  width: 100%;
  border-top: 1px dashed var(--chart-grid);
}

.score-grid-line:last-child {
  border-top: 1px solid var(--chart-axis);
}

.score-cols {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: var(--space-2);
  height: 100%;
  align-items: end;
}

.score-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  padding: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.score-col.is-dimmed {
  opacity: 0.34;
}

/* Bar-anchored value + bar stack so value sits directly above its bar */
.score-col-plot {
  width: 100%;
  height: 158px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.score-col-val {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  transition: color var(--duration-fast) var(--ease-out);
}

.score-col:hover .score-col-val,
.score-col.is-active .score-col-val {
  color: var(--text-primary);
  font-weight: 600;
}

.score-col.is-active .score-col-val {
  color: var(--accent);
}

.score-col-bar {
  width: min(74%, 36px);
  border-radius: 4px 4px 0 0;
  background: var(--chart-bar);
  transition:
    background var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.score-col:hover .score-col-bar {
  background: var(--chart-bar-hover);
}

.score-col.is-active .score-col-bar {
  background: var(--chart-bar-active);
}

.score-col-label {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score-col.is-active .score-col-label {
  color: var(--text-primary);
  font-weight: 600;
}

/* Type Distribution Horizontal Bars */
.type-chart-header {
  display: grid;
  grid-template-columns: 56px 1fr 52px 42px;
  gap: 10px;
  padding: 0 8px 6px;
  margin: 0 -8px 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.type-chart-header span:nth-child(3),
.type-chart-header span:nth-child(4) {
  text-align: right;
}

.type-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.type-bar-row {
  display: grid;
  grid-template-columns: 56px 1fr 52px 42px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.type-bar-row:hover {
  background: var(--bg-surface-secondary);
}

.type-bar-row.is-active {
  background: var(--accent-soft);
}

.type-bar-row.is-dimmed {
  opacity: 0.42;
}

.type-bar-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-bar-track {
  height: 7px;
  background: var(--bg-surface-secondary);
  border-radius: 999px;
  overflow: hidden;
}

.type-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--chart-bar);
  transition:
    background var(--duration-fast) var(--ease-out),
    width var(--duration-base) var(--ease-out);
}

.type-bar-row:hover .type-bar-fill {
  background: var(--chart-bar-hover);
}

.type-bar-row.is-active .type-bar-fill {
  background: var(--accent);
}

.type-bar-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.type-bar-avg {
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Comment Sentiment Composition */
.sentiment-viz {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sentiment-summary-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 13px;
}

.sentiment-substantive {
  color: var(--text-body-secondary);
  font-variant-numeric: tabular-nums;
}

.sentiment-substantive strong {
  color: var(--text-primary);
  font-weight: 600;
}

.sentiment-total-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.stacked-bar {
  display: flex;
  height: 12px;
  gap: 2px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface-secondary);
}

.stacked-seg {
  height: 100%;
  min-width: 3px;
  border-radius: 2px;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.stacked-seg.is-dimmed {
  opacity: 0.28;
}

.sentiment-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sent-row {
  display: grid;
  grid-template-columns: 10px 1fr auto 50px;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  transition: background var(--duration-fast) var(--ease-out);
}

.sent-row:hover,
.sent-row.is-highlighted {
  background: var(--bg-surface-secondary);
}

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

.sent-name {
  color: var(--text-body-secondary);
}

.sent-row:hover .sent-name,
.sent-row.is-highlighted .sent-name {
  color: var(--text-primary);
}

.sent-count {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.sent-pct {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Shared Floating Tooltip */
.chart-tooltip {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-primary);
  box-shadow: var(--shadow-tooltip);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-tooltip-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.chart-tooltip-meta {
  color: var(--text-secondary);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   07. Game Explorer Header & Streamlined Filter Bar
   -------------------------------------------------------------------------- */

.explorer-section {
  display: flex;
  flex-direction: column;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.results-counter {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* 3-Way Segmented View Switcher */
.view-switcher {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface-secondary);
  gap: 2px;
}

.view-btn {
  height: 30px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

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

.view-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-card);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.toolbar-primary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.search-field {
  flex: 1 1 320px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  color: var(--text-secondary);
  display: inline-flex;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13.5px;
  box-shadow: var(--shadow-card);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.search-field input::placeholder {
  color: var(--text-secondary);
}

.search-field input:hover {
  border-color: var(--border-strong);
}

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

.search-kbd {
  position: absolute;
  right: 11px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 1px 6px;
  line-height: 18px;
  pointer-events: none;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.control-select {
  display: inline-flex;
  align-items: center;
  height: 40px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  padding: 0 10px 0 12px;
  gap: 6px;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.control-select:hover {
  border-color: var(--border-strong);
}

.control-select:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.control-select label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  user-select: none;
}

.control-select select {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}

.control-select select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.filter-toggle-btn {
  height: 40px;
  padding: 0 14px;
}

.filter-toggle-btn[aria-expanded="true"],
.filter-toggle-btn.has-active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--text-primary);
}

.filter-count-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .filter-count-badge {
  color: #101114;
}

/* Collapsible Advanced Filter Panel */
.advanced-filter-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows var(--duration-base) var(--ease-out),
    opacity var(--duration-base) var(--ease-out);
}

.advanced-filter-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.advanced-filter-inner {
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 0 var(--space-5);
  transition:
    padding var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}

.advanced-filter-panel.is-open .advanced-filter-inner {
  padding: var(--space-5);
  border-color: var(--border-default);
  box-shadow: var(--shadow-card);
}

.advanced-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label,
.filter-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-field select {
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.filter-field select:hover {
  border-color: var(--border-strong);
}

.filter-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-field select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.filter-field-toggle {
  justify-content: flex-end;
}

/* Custom Crisp Toggle Switch */
.toggle-control {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.toggle-control input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-strong);
  position: relative;
  flex-shrink: 0;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition:
    transform var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.toggle-control input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-control input:checked + .toggle-track::after {
  transform: translateX(14px);
  background: #FFFFFF;
}

[data-theme="dark"] .toggle-control input:checked + .toggle-track::after {
  background: #101114;
}

.toggle-control input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Quick Type Row inside Advanced Panel */
.quick-type-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.quick-type-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.quick-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-pill {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface-secondary);
  color: var(--text-body-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.tab-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.tab-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.tab-pill-count {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.tab-pill.active .tab-pill-count {
  color: var(--accent);
}

/* Active Removable Filter Chips Bar */
.active-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-2) 0 0;
}

.active-filter-chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-size: 12px;
  color: var(--text-secondary);
}

.filter-chip strong {
  color: var(--text-primary);
  font-weight: 500;
}

.filter-chip-remove {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.filter-chip-remove:hover {
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
}

.clear-filters-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.clear-filters-btn:hover {
  background: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   08. View 1: Media Library Gallery Grid (Apple / Steam Editorial)
   -------------------------------------------------------------------------- */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--space-5);
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition:
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.game-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface-secondary);
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform var(--duration-base) var(--ease-out);
}

.game-card:hover .card-cover {
  transform: scale(1.025);
}

/* Editorial Missing-Cover Fallback */
.card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-4);
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
  text-align: center;
}

.placeholder-icon {
  color: var(--text-secondary);
  opacity: 0.65;
}

.placeholder-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-body-secondary);
}

/* Single Quiet Type Tag on Cover (minimal overlay) */
.cover-type-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(16, 17, 20, 0.72);
  color: #F1F2F5;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Card Body */
.card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.score-badge {
  flex-shrink: 0;
  min-width: 42px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}

.score-badge.score-pos {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success);
}

.score-badge.score-warn {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning);
}

.score-badge.score-neg {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}

.score-badge.score-none {
  background: var(--bg-surface-secondary);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 500;
}

.score-pos { color: var(--success); }
.score-warn { color: var(--warning); }
.score-neg { color: var(--danger); }
.score-none { color: var(--text-secondary); }

.card-reputation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 12px;
}

.sentiment-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  white-space: nowrap;
}

.sentiment-indicator::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.sent-pos { color: var(--success); }
.sent-warn { color: var(--warning); }
.sent-neg { color: var(--danger); }
.sent-none { color: var(--text-secondary); }

.origin-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.origin-tag svg {
  opacity: 0.78;
}

.card-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-body-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Thin Sentiment Ratio Bar */
.sentiment-bar {
  height: 3px;
  border-radius: 999px;
  background: var(--bg-surface-secondary);
  overflow: hidden;
  display: flex;
  gap: 1px;
}

.sb-pos { background: var(--sent-pos); }
.sb-neu { background: var(--sent-neu); }
.sb-neg { background: var(--sent-neg); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.card-footer-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.source-label {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-body-secondary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.source-label.is-multi {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.footer-ratio {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-inline-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.stat-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-inline svg {
  opacity: 0.72;
}

/* --------------------------------------------------------------------------
   09. View 2: Compact List View (Rapid Side-by-Side Comparison)
   -------------------------------------------------------------------------- */

.games-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.list-header {
  display: grid;
  grid-template-columns: 96px minmax(0, 2.4fr) 128px 140px 160px 76px;
  gap: var(--space-4);
  align-items: center;
  padding: 10px var(--space-4);
  background: var(--bg-surface-secondary);
  border-bottom: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.list-header-right {
  text-align: right;
}

.game-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 2.4fr) 128px 140px 160px 76px;
  gap: var(--space-4);
  align-items: center;
  padding: 12px var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.game-row:last-child {
  border-bottom: none;
}

.game-row:hover {
  background: var(--bg-surface-hover);
}

.row-thumb {
  width: 96px;
  height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  object-position: center 20%;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  display: block;
}

.row-thumb-empty {
  width: 96px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.row-primary {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  font-size: 12.5px;
  color: var(--text-body-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-type-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.row-type-badge {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 500;
}

.row-sentiment-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}

.row-stats-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.row-score-cell {
  display: flex;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   10. View 3: Data Table View (Deep Analysis & Column Sorting)
   -------------------------------------------------------------------------- */

.games-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

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

.data-table thead th {
  background: var(--bg-surface-secondary);
  border-bottom: 1px solid var(--border-default);
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-table thead th.col-right,
.data-table tbody td.col-right {
  text-align: right;
}

.th-sort-btn {
  border: none;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--duration-fast) var(--ease-out);
}

.th-sort-btn:hover,
.th-sort-btn.is-sorted {
  color: var(--text-primary);
}

.th-sort-btn.is-sorted {
  color: var(--accent);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

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

.data-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

.data-table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  color: var(--text-body-secondary);
  font-variant-numeric: tabular-nums;
}

.td-game {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 620px;
}

.td-thumb {
  width: 48px;
  height: 27px;
  border-radius: 4px;
  object-fit: cover;
  object-position: center 20%;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.td-thumb-empty {
  width: 48px;
  height: 27px;
  border-radius: 4px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--text-secondary);
}

.td-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.td-title {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-score {
  font-size: 14px;
  font-weight: 700;
}

.td-date {
  white-space: nowrap;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   11. Skeleton Loading States (Layout-Matched)
   -------------------------------------------------------------------------- */

.skeleton-block {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.skeleton-line {
  height: 14px;
  width: 100%;
}

.skeleton-line-sm {
  height: 12px;
  width: 62%;
}

.skeleton-line-lg {
  height: 20px;
  width: 82%;
}

/* --------------------------------------------------------------------------
   12. Pagination
   -------------------------------------------------------------------------- */

.pagination {
  margin-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-body-secondary);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

.page-status {
  margin-left: var(--space-3);
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   13. Game Detail Modal
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg-scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.modal-dialog {
  width: min(900px, 100%);
  max-height: 88vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-topbar {
  height: 48px;
  padding: 0 var(--space-4) 0 var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-topbar-meta {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

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

.modal-content {
  padding: var(--space-6);
  overflow-y: auto;
}

.modal-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.modal-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 20%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-secondary);
  display: block;
}

.modal-title {
  margin: 0 0 var(--space-3);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.modal-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.modal-score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-default);
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.modal-score-pill strong {
  font-size: 15px;
  font-weight: 700;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-3);
}

.meta-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-k {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.meta-v {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tag {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-body-secondary);
}

.modal-ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-4);
}

.modal-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-out);
}

[data-theme="dark"] .modal-ext-link {
  color: #101114;
  font-weight: 600;
}

.modal-ext-link:hover {
  background: var(--accent-hover);
}

.ext-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-default);
  background: var(--bg-surface-secondary);
  color: var(--text-body-secondary);
  transition: border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.ext-id-badge:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.modal-section {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.modal-section h3 {
  margin: 0 0 var(--space-3);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-summary-text {
  margin: 0 0 var(--space-3);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  max-width: 72ch;
}

.modal-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-3);
}

.aspect-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-body-secondary);
  font-variant-numeric: tabular-nums;
}

.aspect-chip.is-pos {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success);
}

.aspect-chip.is-warn {
  border-color: var(--warning-border);
  background: var(--warning-soft);
  color: var(--warning);
}

.aspect-chip.is-neg {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.comment-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
}

.comment-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.comment-author-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.comment-author {
  color: var(--text-primary);
  font-weight: 500;
}

.comment-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-body-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 74ch;
}

.modal-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-body-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 8px;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  padding: 64px 24px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   14. Responsive Breakpoints (2560×1440, 1920×1080, 1366×768, Tablet, Mobile)
   -------------------------------------------------------------------------- */

@media (max-width: 1440px) {
  .header-inner,
  .workspace {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
  .workspace {
    padding-top: var(--space-5);
    gap: var(--space-6);
  }
  .kpi-card {
    padding: var(--space-4) var(--space-5);
  }
  .kpi-value {
    font-size: 30px;
  }
  .chart-card {
    padding: var(--space-4) var(--space-5);
  }
  .chart-body {
    min-height: 168px;
  }
  .score-chart-wrap {
    height: 170px;
  }
  .score-col-plot {
    height: 142px;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  }
}

@media (max-width: 1200px) {
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }
  .chart-sentiment {
    grid-column: 1 / -1;
  }
  .advanced-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .header-inner,
  .workspace {
    padding-left: var(--space-5);
    padding-right: var(--space-5);
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-sentiment {
    grid-column: auto;
  }
  .list-header {
    display: none;
  }
  .game-row {
    grid-template-columns: 80px minmax(0, 1fr) auto;
  }
  .row-type-cell,
  .row-sentiment-cell,
  .row-stats-cell {
    display: none;
  }
}

@media (max-width: 768px) {
  .brand-meta {
    display: none;
  }
  .explorer-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .advanced-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
  }
  .modal-hero {
    grid-template-columns: 1fr;
  }
  .modal-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .advanced-filter-grid {
    grid-template-columns: 1fr;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
  .view-btn span {
    display: none;
  }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
