/* ========================================
   Signal Decoder - Dark Cosmic Theme
   ======================================== */

:root {
  --bg-primary: #05070a;
  --bg-secondary: #0a0f1a;
  --bg-card: rgba(15, 22, 38, 0.75);
  --bg-card-solid: #0f1623;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --cat-emotional: #8b5cf6;
  --cat-gaming: #3b82f6;
  --cat-workplace: #06b6d4;
  --cat-lifestyle: #f59e0b;
  --cat-popculture: #ec4899;
  --cat-aitech: #6366f1;
  --cat-other: #9ca3af;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ========================================
   Splash Screen
   ======================================== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
              var(--bg-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.splash-screen.active {
  opacity: 1;
  pointer-events: all;
}

.splash-content {
  text-align: center;
  position: relative;
}

.splash-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
}

.splash-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.splash-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
  animation: pulse 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* ========================================
   App Layout
   ======================================== */
.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 20% 10%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
              radial-gradient(ellipse at 80% 90%, rgba(59, 130, 246, 0.1) 0%, transparent 45%),
              radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 60%),
              var(--bg-primary);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.app:not(.hidden) {
  opacity: 1;
}

/* Header */
.header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(5, 7, 10, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 32px;
  height: 32px;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.lang-option {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.lang-option.active {
  background: rgba(139, 92, 246, 0.25);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Main Layout */
.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  min-height: 0;
  position: relative;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  padding: 24px 16px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(5, 7, 10, 0.3);
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.category-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  margin-top: auto;
}

.auto-detect-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  margin-top: 4px;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

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

/* ========================================
   Visual Stage
   ======================================== */
.visual-stage {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nebula-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 70% 60%, rgba(59, 130, 246, 0.1) 0%, transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 30%);
  animation: nebulaFloat 20s ease-in-out infinite;
}

@keyframes nebulaFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2%, -2%) scale(1.02); }
  66% { transform: translate(-2%, 1%) scale(0.98); }
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 50px 80px, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 130px 120px, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 200px 50px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 250px 150px, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 300px 90px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 350px 30px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 400px 120px, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 450px 70px, rgba(255,255,255,0.4), transparent);
  background-size: 500px 200px;
  opacity: 0.6;
  animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.4; }
  100% { opacity: 0.8; }
}

/* Idle State */
.idle-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  transition: all var(--transition-slow);
  z-index: 10;
}

.idle-state.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

.planet {
  position: relative;
  width: 160px;
  height: 160px;
}

.planet-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(139, 92, 246, 0.5), rgba(59, 130, 246, 0.2) 50%, transparent 70%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    inset 0 0 40px rgba(139, 92, 246, 0.2),
    0 0 60px rgba(139, 92, 246, 0.2);
  animation: planetRotate 30s linear infinite;
}

.planet-ring {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: ringRotate 20s linear infinite;
}

.planet-ring::before {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

@keyframes planetRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes ringRotate {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

.idle-text {
  text-align: center;
  max-width: 420px;
}

.idle-text h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.idle-text p {
  font-size: 14px;
  color: var(--text-secondary);
}

.idle-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
}

.idle-hint svg {
  width: 16px;
  height: 16px;
}

/* Bubble Field */
.bubble-field {
  position: absolute;
  inset: 40px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.bubble-field.active {
  opacity: 1;
  pointer-events: all;
}

.bubble {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 30px rgba(255, 255, 255, 0.05),
    0 4px 20px rgba(0, 0, 0, 0.3);
  animation: bubbleFloat 6s ease-in-out infinite;
  padding: 16px;
  min-width: 100px;
  min-height: 100px;
}

.bubble:hover {
  transform: scale(1.08);
  z-index: 30;
}

.bubble.selected {
  transform: scale(1.12);
  z-index: 35;
  box-shadow:
    inset 0 0 40px rgba(255, 255, 255, 0.1),
    0 0 40px var(--bubble-glow, rgba(139, 92, 246, 0.5));
}

.bubble-heat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 4px;
}

.bubble-heat svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.bubble-word {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  line-height: 1.2;
}

.bubble-pinyin {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.bubble-meaning {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
  max-width: 140px;
  line-height: 1.3;
}

.bubble-category {
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

.stage-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 12px;
  backdrop-filter: blur(8px);
  z-index: 25;
  transition: opacity var(--transition-normal);
}

.stage-hint svg {
  width: 16px;
  height: 16px;
}

/* Try It Panel */
.try-it-panel {
  padding: 24px;
  border-left: 1px solid var(--border-subtle);
  background: rgba(5, 7, 10, 0.3);
}

.try-it-panel h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.try-it-panel p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.try-it-actions {
  display: flex;
  gap: 10px;
}

.try-it-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.try-it-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.try-it-btn svg {
  width: 18px;
  height: 18px;
}

/* ========================================
   Input Bar
   ======================================== */
.input-bar {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(5, 7, 10, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 20px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.text-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  height: 40px;
}

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

.explode-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
  transition: all var(--transition-fast);
}

.explode-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
}

.explode-btn svg {
  width: 18px;
  height: 18px;
}

.input-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 11px;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   Detail Panel
   ======================================== */
.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.detail-panel.active .detail-backdrop {
  opacity: 1;
}

.detail-card {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px 32px 32px;
  box-shadow: var(--shadow-card);
  transform: translateY(100%);
  transition: transform var(--transition-normal);
}

.detail-panel.active .detail-card {
  transform: translateY(0);
}

.detail-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.detail-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.detail-close svg {
  width: 18px;
  height: 18px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-right: 40px;
}

.detail-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-word {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.detail-pronounce {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-pinyin {
  font-size: 16px;
  color: var(--text-secondary);
}

.speak-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.speak-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: var(--text-primary);
}

.speak-btn svg {
  width: 14px;
  height: 14px;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.popularity {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.fire-icons {
  display: flex;
  gap: 2px;
}

.fire-icons svg {
  width: 16px;
  height: 16px;
  fill: #f59e0b;
}

.fire-icons svg.empty {
  fill: rgba(255, 255, 255, 0.15);
}

.heat-value {
  color: #fbbf24;
  font-weight: 600;
}

.detail-meaning {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 500;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-tag.category {
  background: rgba(139, 92, 246, 0.12);
}

.detail-tag.trending {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.detail-tag.common {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.detail-tag.risk {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.detail-tag.risk-safe {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

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

.info-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.info-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.info-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.example-zh {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.example-en {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.detail-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.info-pill {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.pill-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.pill-icon svg {
  width: 16px;
  height: 16px;
}

.info-pill strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.info-pill p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.detail-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.detail-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.detail-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.detail-action-btn.active {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.3);
  color: #f472b6;
}

.detail-action-btn svg {
  width: 16px;
  height: 16px;
}

/* ========================================
   Menu Panel
   ======================================== */
.menu-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.menu-panel.active .menu-backdrop {
  opacity: 1;
}

.menu-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-card-solid);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.menu-panel.active .menu-drawer {
  transform: translateX(0);
}

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

.menu-title {
  font-size: 18px;
  font-weight: 600;
}

.menu-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.menu-close svg {
  width: 18px;
  height: 18px;
}

.menu-nav {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.menu-item svg {
  width: 18px;
  height: 18px;
}

.menu-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
}

.menu-content-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-secondary);
}

.menu-content-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-text {
  display: flex;
  flex-direction: column;
}

.history-word {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* ========================================
   Share Modal
   ======================================== */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.share-modal.active .share-backdrop {
  opacity: 1;
}

.share-card {
  position: relative;
  width: 90%;
  max-width: 420px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transform: scale(0.9);
  opacity: 0;
  transition: all var(--transition-normal);
}

.share-modal.active .share-card {
  transform: scale(1);
  opacity: 1;
}

.share-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.share-close svg {
  width: 16px;
  height: 16px;
}

.share-card-inner {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  margin-bottom: 20px;
}

.share-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.share-logo {
  width: 24px;
  height: 24px;
}

.share-card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.share-card-word {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.share-card-meaning {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.share-card-divider {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  margin: 20px auto;
}

.share-card-tagline {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.download-btn:hover {
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.download-btn svg {
  width: 18px;
  height: 18px;
}

/* ========================================
   Toast
   ======================================== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  background: rgba(15, 22, 35, 0.95);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  z-index: 500;
  transition: all var(--transition-normal);
}

.toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 180px 1fr;
  }

  .try-it-panel {
    display: none;
  }
}

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

  .sidebar {
    position: absolute;
    left: 0;
    top: 64px;
    bottom: 0;
    width: 200px;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 50;
    background: var(--bg-card-solid);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .header {
    padding: 0 16px;
  }

  .brand-tagline {
    display: none;
  }

  .input-bar {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .input-wrapper {
    width: 100%;
  }

  .input-actions {
    width: 100%;
    justify-content: space-between;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-footer {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
    gap: 12px;
  }

  .detail-meta {
    align-items: flex-start;
  }

  .detail-word {
    font-size: 28px;
  }

  .bubble {
    min-width: 80px;
    min-height: 80px;
    padding: 12px;
  }

  .bubble-word {
    font-size: 15px;
  }

  .bubble-meaning {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .splash-title {
    font-size: 26px;
  }

  .idle-text h2 {
    font-size: 18px;
  }

  .planet {
    width: 120px;
    height: 120px;
  }

  .menu-drawer {
    width: 100%;
    max-width: 100%;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
