/**
 * KenEasy WaveForge - Stylesheet
 * Strict adherence to KenEasy Design Tokens (Pink, Blue, Dark Glass & Emerald Accents)
 */

:root {
  --pink: #fb7299;
  --pink-strong: #ff4f7e;
  --blue: #00aeec;
  --emerald: #10b981;
  --emerald-deep: #059669;
  --bg: #0b0c0f;
  --panel: rgba(24, 27, 33, 0.75);
  --panel-2: rgba(32, 36, 44, 0.55);
  --panel-hover: rgba(40, 45, 55, 0.7);
  --text: #f4f7fb;
  --muted: #8d9aa9;
  --border: rgba(48, 54, 65, 0.55);
  --border-focus: rgba(0, 174, 236, 0.6);
  --brand-gradient: linear-gradient(135deg, #fb7299, #00aeec);
  --brand-gradient-hover: linear-gradient(135deg, #ff4f7e, #18c5ff);
  --glow-pink: rgba(251, 114, 153, 0.25);
  --glow-blue: rgba(0, 174, 236, 0.25);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 15%, var(--glow-pink) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, var(--glow-blue) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(11, 12, 15, 0.7);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 4px 14px var(--glow-pink);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

.lang-switch {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn.active {
  background: var(--brand-gradient);
  color: #fff;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}

.btn-github:hover {
  border-color: var(--blue);
  background: var(--panel-hover);
}

/* App Main Container */
.app-container {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 72px);
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .stage-column {
    order: -1;
  }
  .controls-sidebar {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 12px 16px;
  }
  .brand-text p {
    display: none;
  }
  .app-container {
    padding: 12px;
    gap: 16px;
  }
  .modal-card {
    padding: 20px 16px;
  }
}

/* Sidebar Controls */
.controls-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 6px;
}

.panel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}

.panel-card:hover {
  border-color: rgba(251, 114, 153, 0.3);
}

.panel-card h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* File Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 22px 16px;
  text-align: center;
  background: var(--panel-2);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--pink);
  background: rgba(251, 114, 153, 0.08);
}

.drop-zone.has-file {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.05);
}

.drop-zone.loading {
  opacity: 0.65;
  pointer-events: none;
  border-color: var(--blue);
  box-shadow: 0 0 16px var(--glow-blue);
}

.drop-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.drop-hint {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}

.drop-subtext {
  font-size: 11px;
  color: var(--muted);
}

.drop-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.btn-secondary {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--panel-hover);
  border-color: var(--blue);
}

.btn-demo {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald);
  color: var(--emerald);
}

.btn-demo:hover {
  background: rgba(16, 185, 129, 0.3);
}

button:disabled,
.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Audio Info Bar */
.audio-info-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 12px;
}

.audio-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-meta strong {
  color: var(--emerald);
}

.btn-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
}

.btn-clear:hover {
  color: var(--pink);
}

/* Grid Pill Button Selectors */
.pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pill-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.pill-grid.grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

.pill-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pill-btn .pill-icon {
  font-size: 18px;
}

.pill-btn .pill-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.pill-btn .pill-sub {
  font-size: 10px;
  color: var(--muted);
}

.pill-btn:hover {
  border-color: var(--blue);
  background: var(--panel-hover);
}

.pill-btn.active {
  border-color: var(--pink);
  background: rgba(251, 114, 153, 0.15);
  box-shadow: 0 0 14px var(--glow-pink);
}

.pill-btn.active .pill-label {
  color: var(--pink);
}

/* Form Fields & Sliders */
.field-group {
  margin-bottom: 12px;
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.field-label .val-tag {
  color: var(--blue);
  font-weight: 600;
}

.text-input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 8px var(--glow-blue);
}

.range-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: var(--panel-2);
  height: 6px;
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-gradient);
  cursor: pointer;
  box-shadow: 0 0 8px var(--glow-pink);
}

.range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-gradient);
  cursor: pointer;
  box-shadow: 0 0 8px var(--glow-pink);
  border: none;
}

.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.toggle-group label {
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--panel-2);
  border: 1px solid var(--border);
  transition: .3s;
  border-radius: 20px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--muted);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background: var(--brand-gradient);
  border-color: transparent;
}

input:checked + .slider-round:before {
  transform: translateX(18px);
  background-color: #fff;
}

/* Timeline & Trimming UI */
.timeline-wrapper {
  margin: 12px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
  height: 52px;
  background: var(--panel-2);
  user-select: none;
  touch-action: none;
}

#timeline-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  border-radius: var(--radius-md);
}

/* Semi-transparent masks for excluded audio */
.trim-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(11, 12, 15, 0.72);
  pointer-events: none;
}
.trim-mask-left {
  left: 0;
  width: 0%;
}
.trim-mask-right {
  right: 0;
  width: 0%;
}

/* Draggable Handles */
.trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 16px;
  margin-left: -8px;
  cursor: ew-resize;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-gradient);
  border-radius: 4px;
  box-shadow: 0 0 10px var(--glow-pink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.trim-handle:hover, .trim-handle.dragging {
  transform: scaleY(1.08) scaleX(1.15);
  box-shadow: 0 0 16px var(--pink);
}

.trim-handle .handle-bar {
  width: 2px;
  height: 18px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1px;
}

.trim-handle-left {
  left: 0%;
}
.trim-handle-right {
  left: 100%;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  pointer-events: none;
  z-index: 5;
  left: 0%;
  transition: opacity 0.2s ease;
}

.trim-inputs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.trim-input-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.trim-input-item span {
  font-size: 11px;
  color: var(--muted);
}

.trim-input-item input {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

button:focus-visible,
.btn-github:focus-visible,
.pill-btn:focus-visible,
.range-slider:focus-visible,
.trim-input-item input:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  box-shadow: 0 0 8px var(--glow-blue);
}

/* Stage Preview (Right Column) */
.stage-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.preview-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}

.canvas-wrapper {
  position: relative;
  max-height: 580px;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  aspect-ratio: 9 / 16;
}

#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Stage Control Bar (Bottom of Stage) */
.stage-control-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

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

.btn-play-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-play-hero:hover {
  border-color: var(--pink);
  background: var(--panel-hover);
}

.btn-play-hero.playing {
  background: rgba(251, 114, 153, 0.2);
  border-color: var(--pink);
  color: var(--pink);
}

.btn-export-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--glow-pink);
  transition: var(--transition);
}

.btn-export-hero:hover {
  background: var(--brand-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--glow-pink);
}

/* Export Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #12151c;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
}

.modal-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #fff;
}

.modal-card p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.export-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--panel-2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.export-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-gradient);
  transition: width 0.15s ease;
}

.export-meta-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}

.export-success-box {
  display: none;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.export-success-box h4 {
  color: #34d399;
  font-size: 15px;
  margin-bottom: 6px;
}

.export-success-box p {
  color: #a7f3d0;
  font-size: 12px;
  margin-bottom: 14px;
}

.btn-download-big {
  width: 100%;
  background: var(--emerald);
  color: #0b0c0f;
  font-weight: 700;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-download-big:hover {
  background: #34d399;
}

/* PiP Live Stream Preview inside Modal */
.pip-container {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 180px;
  margin: 0 auto 16px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

#pip-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.pip-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(11, 12, 15, 0.75);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4f7e;
  box-shadow: 0 0 8px #ff4f7e;
  animation: pulse-dot 1s infinite alternate ease-in-out;
}

@keyframes pulse-dot {
  0% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* Glass Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.glass-toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 420px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: rgba(24, 27, 33, 0.88);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.glass-toast.toast-error {
  border-color: rgba(255, 79, 126, 0.5);
  color: #ff99b3;
}

.glass-toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Hero Section (简介与词条) */
.hero-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 32px 18px;
  text-align: center;
}

.hero-copy {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--pink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kicker-spark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-gradient);
  box-shadow: 0 0 10px var(--pink);
}

.hero-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 30%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: clamp(14px, 1.8vw, 16px);
  color: var(--muted);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.hero-badge:hover {
  border-color: var(--pink);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.2);
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.hero-badge-dot.pink { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.hero-badge-dot.blue { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.hero-badge-dot.green { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

/* Supplement Section (保障词条与说明) */
.supplement-wrap {
  max-width: 1400px;
  margin: 32px auto 48px;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.trust-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition);
}

.trust-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.trust-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 10px;
}

.trust-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trust-icon-blue { background: rgba(0, 174, 236, 0.15); color: var(--blue); }
.trust-icon-pink { background: rgba(251, 114, 153, 0.15); color: var(--pink); }
.trust-icon-green { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }

.trust-card strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.trust-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Tips Panel */
.tips-panel {
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.tips-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.tips-summary::-webkit-details-marker {
  display: none;
}

.summary-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.info-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--blue);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

.summary-chevron {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  transition: transform 0.24s ease;
}

.summary-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tips-panel[open] .summary-chevron {
  transform: rotate(180deg);
}

.tips-list {
  padding: 8px 32px 24px 58px;
  list-style: disc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.tips-list li + li {
  margin-top: 8px;
}

.tips-list strong {
  color: var(--text);
}

/* Footer */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand {
  font-weight: 700;
  color: var(--text);
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--blue);
}

/* Ecosystem Matrix Button & Dialog */
.btn-matrix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-matrix:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 12px rgba(0, 174, 236, 0.25);
}

.matrix-modal-card {
  max-width: 820px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  background: rgba(18, 20, 26, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.matrix-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.matrix-modal-head h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.matrix-modal-head p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 16px 0 24px;
}

.matrix-item {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.matrix-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--pink);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.matrix-item.current {
  border-color: var(--blue);
  background: rgba(0, 174, 236, 0.08);
}

.matrix-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.matrix-icon {
  font-size: 20px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border-radius: 8px;
}

.matrix-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.matrix-item-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.matrix-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.matrix-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  .trust-grid {
    grid-template-columns: 1fr;
  }
  .hero-section {
    padding: 24px 16px 12px;
  }
  .supplement-wrap {
    padding: 0 16px;
  }
  .btn-matrix span {
    display: none;
  }
  .btn-matrix {
    padding: 6px 10px;
  }
}
