/* ==========================================================================
   Notion Precision Theme System — GPT 50 Visual Prompts Master
   Complete Reverse Engineering with Detail Modal & Live Prompt Tester
   ========================================================================== */

:root {
  --bg-page: #191919;
  --bg-card: #202020;
  --bg-card-hover: #262626;
  --bg-subtle: #252525;
  --bg-modal: #222222;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.18);
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent-blue: #38bdf8;
  --accent-blue-hover: #0284c7;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-purple: #c084fc;
  --accent-red: #f43f5e;
  --code-bg: rgba(255, 255, 255, 0.06);
  --code-text: #f43f5e;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.8);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', SFMono-Regular, Consolas, Monaco, monospace;
}

[data-theme="light"] {
  --bg-page: #ffffff;
  --bg-card: #f9f9f8;
  --bg-card-hover: #f1f1ef;
  --bg-subtle: #ebeae8;
  --bg-modal: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 0, 0, 0.16);
  --text-primary: #191919;
  --text-secondary: #555555;
  --text-muted: #888888;
  --code-bg: rgba(235, 87, 87, 0.08);
  --code-text: #eb5757;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==========================================================================
   Header & TOC Bar
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(25, 25, 25, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}
[data-theme="light"] .top-nav {
  background-color: rgba(255, 255, 255, 0.92);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.notion-icon {
  font-size: 22px;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.version-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

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

.agency-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.agency-badge-link:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

.theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}
.theme-btn:hover {
  background-color: var(--bg-card-hover);
}

/* TOC Navigation Bar */
.toc-bar {
  border-top: 1px solid var(--border-color);
  background-color: rgba(20, 20, 20, 0.85);
  overflow-x: auto;
  white-space: nowrap;
}
[data-theme="light"] .toc-bar {
  background-color: rgba(245, 245, 245, 0.85);
}

.toc-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  gap: 16px;
}

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.toc-link:hover, .toc-link.active {
  color: var(--accent-blue);
  background-color: rgba(56, 189, 248, 0.1);
}

/* ==========================================================================
   Page Layout & Hero
   ========================================================================== */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-cover-banner {
  height: 140px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #9333ea 100%);
  position: relative;
  overflow: hidden;
}

.title-wrapper {
  margin-top: -40px;
  padding-left: 20px;
}

.hero-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.main-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.3;
}

.subtitle-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   Block Card & Common Components
   ========================================================================== */
.block-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.card-header-icon {
  margin-bottom: 20px;
}

.sec-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--accent-blue);
  margin-bottom: 8px;
}
.sec-badge.glow {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
}
.sec-badge.error {
  background-color: rgba(244, 63, 94, 0.15);
  color: var(--accent-red);
}
.sec-badge.success {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.section-subtext {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* 30초 요약 그리드 */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.step-col {
  display: flex;
  gap: 14px;
  padding: 18px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--accent-blue);
  color: #000;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.time-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
}

/* Callout Box */
.callout-box {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
}
.callout-box.warning-callout {
  background-color: rgba(245, 158, 11, 0.08);
  border-left-color: var(--accent-gold);
}
.callout-box.info-callout {
  background-color: rgba(56, 189, 248, 0.08);
  border-left-color: var(--accent-blue);
}

.callout-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.callout-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.callout-text p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Section 1: 영상 속 명령어 4개 쇼케이스
   ========================================================================== */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}
@media (max-width: 1024px) {
  .showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

.showcase-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.showcase-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.showcase-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.showcase-cmd {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-blue);
}

.showcase-visual {
  height: 100px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Visual Mockups */
.visual-mindmap .root-node {
  background: var(--accent-blue);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-full);
}
.visual-mindmap .visual-branch {
  position: absolute;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
}
.branch-1 { top: 10px; left: 10px; color: #38bdf8; }
.branch-2 { top: 10px; right: 10px; color: #10b981; }
.branch-3 { bottom: 10px; left: 10px; color: #f59e0b; }
.branch-4 { bottom: 10px; right: 10px; color: #c084fc; }

.visual-sketchnote {
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
}
.sketch-line {
  font-size: 10px;
  width: 90%;
  color: var(--text-secondary);
  border-bottom: 1px dotted rgba(255,255,255,0.15);
  padding-bottom: 2px;
}
.line-header {
  font-weight: 700;
  color: var(--accent-gold);
}

.visual-webtoon {
  gap: 4px;
  padding: 6px;
}
.cut-box {
  flex: 1;
  height: 80px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text-muted);
}
.cut-box.highlight {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background-color: rgba(192, 132, 252, 0.1);
}

.visual-journeymap .path-curve {
  display: flex;
  gap: 8px;
}
.path-stop {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
}

.showcase-card h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.showcase-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
  flex: 1;
}

.showcase-best {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  background-color: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.showcase-actions {
  display: flex;
  gap: 6px;
}

.btn-showcase-detail {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-blue);
  color: #000;
  font-weight: 700;
  font-size: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-showcase-detail:hover {
  background-color: var(--accent-blue-hover);
}

.btn-showcase-link, .btn-showcase-copy {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-showcase-link:hover, .btn-showcase-copy:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   Master Setup Prompt Section
   ========================================================================== */
.setup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
}
@media (max-width: 640px) {
  .setup-header {
    flex-direction: column;
  }
}

.setup-title-box h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.setup-title-box p {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-copy-master {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background-color: var(--accent-gold);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-copy-master:hover {
  background-color: #d97706;
  transform: translateY(-1px);
}

.prompt-code-container {
  background-color: #121212;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  max-height: 280px;
  overflow-y: auto;
}
[data-theme="light"] .prompt-code-container {
  background-color: #f4f4f3;
}

.prompt-code-container pre code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ==========================================================================
   Interactive Toolbar & Search
   ========================================================================== */
.commands-section-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sec-title-row h2 {
  font-size: 22px;
  font-weight: 800;
}

.interactive-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 12px 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s;
}
.search-box input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.btn-clear-search {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
}

/* Filter Tabs */
.filter-tabs-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tab {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-tab:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}
.filter-tab.active {
  background-color: var(--accent-blue);
  color: #000;
  border-color: var(--accent-blue);
  font-weight: 700;
}

/* View Switcher Row */
.view-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.result-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.view-toggle-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.view-toggle-btn.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

/* ==========================================================================
   Cards Grid View & Card Component
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.command-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}
.command-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-cmd-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-cmd-name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-blue);
}

.ratio-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.badge-image {
  background-color: rgba(192, 132, 252, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(192, 132, 252, 0.3);
}
.badge-text {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.card-full-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.card-meta-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-category-tag, .card-best-tag {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
}

.card-best-tag {
  color: var(--accent-gold);
}

/* Card Action Buttons */
.card-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.btn-card-action {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-card-action.btn-detail {
  flex: 1;
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.3);
}
.btn-card-action.btn-detail:hover {
  background-color: var(--accent-blue);
  color: #000;
}

.btn-card-action.btn-link, .btn-card-action.btn-copy {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}
.btn-card-action.btn-link:hover, .btn-card-action.btn-copy:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

/* ==========================================================================
   Table View
   ========================================================================== */
.table-container {
  overflow-x: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.styled-table th, .styled-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.styled-table th {
  background-color: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-secondary);
}

.styled-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.code-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-blue);
}
.code-badge.clickable {
  cursor: pointer;
  text-decoration: underline;
}
.code-badge.clickable:hover {
  color: var(--accent-gold);
}

.table-desc-text strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.table-desc-text p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

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

.table-actions-cell {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.btn-table-action {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  cursor: pointer;
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  transition: all 0.2s;
}
.btn-table-action.btn-detail {
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.3);
}
.btn-table-action.btn-detail:hover {
  background-color: var(--accent-blue);
  color: #000;
}
.btn-table-action:hover {
  background-color: var(--bg-card-hover);
}

/* ==========================================================================
   Section 8: 공식 링크 확인 (OpenAI Official Guides)
   ========================================================================== */
.official-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 768px) {
  .official-links-grid {
    grid-template-columns: 1fr;
  }
}

.official-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.official-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.official-icon {
  font-size: 28px;
}

.official-title-box h4 {
  font-size: 15px;
  font-weight: 700;
}

.official-meta {
  font-size: 12px;
  color: var(--accent-blue);
}

.official-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.official-url-row code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}

.official-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-official-open {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-blue);
  color: #000;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
}
.btn-official-open:hover {
  background-color: var(--accent-blue-hover);
}

.btn-official-copy {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-official-copy:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   Command Detail Modal & Live Interactive Prompt Tester
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.detail-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: 90%;
  max-width: 780px;
  max-height: 90vh;
  background-color: var(--bg-modal);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.detail-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-inner {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

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

.modal-cmd-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.modal-cmd-code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-blue);
}

.modal-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.modal-ratio-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.modal-full-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s;
}
.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-sec-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.modal-sec-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal-desc-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.modal-detail-box {
  font-size: 13px;
  color: var(--text-secondary);
  background-color: rgba(0, 0, 0, 0.2);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  line-height: 1.55;
}

.modal-best-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--accent-gold);
}

/* Tester Section in Modal */
.tester-sec-box {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
  border-color: rgba(56, 189, 248, 0.3);
}

.tester-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.tester-icon {
  font-size: 24px;
}

.tester-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.tester-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

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

.tester-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s;
}
.tester-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

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

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

.sample-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sample-chip {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.sample-chip:hover {
  background-color: var(--accent-blue);
  color: #000;
  border-color: var(--accent-blue);
}

.prompt-preview-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #111111;
  margin-bottom: 14px;
  overflow: hidden;
}
[data-theme="light"] .prompt-preview-wrap {
  background-color: #f3f3f2;
}

.preview-header {
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.preview-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.prompt-preview-pre {
  padding: 12px;
  max-height: 140px;
  overflow-y: auto;
}

.prompt-preview-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: 1.55;
}

.tester-actions-row {
  display: flex;
  gap: 10px;
}

.btn-primary-action {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-blue);
  color: #000;
  font-weight: 700;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary-action:hover {
  background-color: var(--accent-blue-hover);
}

.btn-secondary-action {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary-action:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

/* Deep link share row */
.deeplink-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.deeplink-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.btn-deeplink-copy {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-deeplink-copy:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

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

/* Related Chips */
.related-chips-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.related-cmd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.related-cmd-chip:hover {
  background-color: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* ==========================================================================
   Checklist & Essentials
   ========================================================================== */
.essentials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .essentials-grid {
    grid-template-columns: 1fr;
  }
}

.essential-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.item-num {
  font-size: 20px;
  color: var(--accent-gold);
  line-height: 1;
}

.item-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.item-body p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}
.check-row:hover {
  background-color: var(--bg-card-hover);
}

.custom-chk {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-green);
  cursor: pointer;
}

.check-label {
  font-size: 13.5px;
  color: var(--text-primary);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-popup {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background-color: rgba(16, 185, 129, 0.95);
  color: #000;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}
.toast-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.page-footer {
  text-align: center;
  padding: 32px 0 10px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-links {
  margin: 12px 0;
}

.footer-links a {
  color: var(--accent-blue);
  text-decoration: none;
  margin: 0 4px;
}
.footer-links a:hover {
  text-decoration: underline;
}

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