/* ==========================================================================
   AuraSnap Documentation & Feature Guide Stylesheet (guide.css)
   Apple Pro Studio Clean Light Edition (Unified with style.css)
   ========================================================================== */

/* 基础与整体容器 */
.docs-body {
  background-color: #f8fafc;
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 113, 227, 0.05), transparent 70%),
    radial-gradient(ellipse 60% 40% at 85% 45%, rgba(56, 189, 248, 0.04), transparent 60%);
  background-attachment: fixed;
}

/* 顶部文档导航条 (Apple 浅色高透毛玻璃) */
.docs-navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  z-index: 100;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.docs-nav-inner {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.docs-nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  font-size: 1.1rem;
}

.docs-brand-img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease;
}

.docs-brand:hover .docs-brand-img {
  transform: scale(1.05);
}

.docs-brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #0071e3, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.docs-nav-divider {
  width: 1px;
  height: 18px;
  background: rgba(15, 23, 42, 0.14);
}

.docs-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

/* 搜索框 */
.docs-search-container {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.docs-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

.docs-search-input-wrap:focus-within {
  background: #ffffff;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.docs-search-icon {
  color: #64748b;
  margin-right: 0.6rem;
  flex-shrink: 0;
}

.docs-search-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: #0f172a;
  outline: none;
}

.docs-search-input::placeholder {
  color: #94a3b8;
}

.docs-search-shortcut {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  font-family: var(--font-mono, monospace);
  user-select: none;
}

/* 顶部右侧按钮 */
.docs-nav-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.docs-nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.docs-nav-link-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.docs-nav-primary-btn {
  background: #0071e3;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.docs-nav-primary-btn:hover {
  background: #0077ed !important;
  transform: translateY(-1px);
}

/* 移动端侧边栏切换按钮 */
.docs-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 0.4rem;
  color: #0f172a;
  cursor: pointer;
}

/* 主内容布局：两栏式 */
.docs-layout {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex: 1;
  position: relative;
}

/* 左侧 Sticky 侧边栏 */
.docs-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 1.8rem 1.2rem 2.5rem 1.5rem;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(10px);
}

.docs-sidebar-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 1rem;
  padding-left: 0.6rem;
}

.docs-nav-tree {
  list-style: none;
}

.docs-nav-item {
  margin-bottom: 0.25rem;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.docs-nav-link:hover {
  background: rgba(0, 113, 227, 0.06);
  color: #0071e3;
}

.docs-nav-link.active {
  background: #0071e3;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.2);
}

.docs-nav-num {
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  opacity: 0.75;
  width: 18px;
  flex-shrink: 0;
}

.docs-nav-link.active .docs-nav-num {
  opacity: 1;
  color: #ffffff;
}

/* 主内容正文区 (纯净白底优雅卡片式) */
.docs-content-container {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3.5rem 6rem;
  background: #ffffff;
  border-left: 1px solid rgba(15, 23, 42, 0.04);
}

.docs-hero-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.docs-main-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.docs-subtitle-lead {
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.docs-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.docs-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.docs-stat-chip svg {
  color: #0071e3;
}

/* 章节通用排版 */
.docs-section {
  margin-bottom: 4.5rem;
  scroll-margin-top: 80px;
}

.docs-section-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.docs-subsection-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #0f172a;
  margin: 1.8rem 0 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-paragraph {
  font-size: 0.96rem;
  line-height: 1.75;
  color: #334155;
  margin-bottom: 1.2rem;
}

/* 列表与项目条目 */
.docs-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.docs-list-item {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.85rem;
  font-size: 0.94rem;
  line-height: 1.65;
  color: #334155;
}

.docs-list-item strong {
  color: #0f172a;
}

.docs-list-item::before {
  content: "•";
  position: absolute;
  left: 0.4rem;
  top: 0;
  color: #0071e3;
  font-weight: bold;
  font-size: 1.1rem;
}

/* 子列表 */
.docs-sublist {
  list-style: none;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 1rem;
}

.docs-sublist-item {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  color: #475569;
}

.docs-sublist-item::before {
  content: "–";
  position: absolute;
  left: 0.2rem;
  color: #64748b;
}

/* 键帽 macOS Keycap Styling */
kbd, .kbd-key {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-bottom: 2px solid #94a3b8;
  border-radius: 5px;
  padding: 2px 7px;
  margin: 0 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  vertical-align: middle;
  line-height: 1.3;
}

/* 徽标 Badge / Tag */
.badge-ver {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.badge-ver.badge-core {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

.badge-ver.badge-sky {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.badge-ver.badge-blue {
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
}

.badge-ver.badge-emerald {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.badge-ver.badge-purple {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

.badge-ver.badge-rose {
  background: rgba(225, 29, 72, 0.12);
  color: #e11d48;
}

/* Apple 风格 Callout 提示框 */
.docs-callout {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 0.9rem;
  font-size: 0.92rem;
  line-height: 1.6;
}

.docs-callout-icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  margin-top: 1px;
}

.docs-callout-content strong {
  display: block;
  font-size: 0.94rem;
  margin-bottom: 0.2rem;
  color: #0f172a;
}

.docs-callout-info {
  background: rgba(0, 113, 227, 0.06);
  border: 1px solid rgba(0, 113, 227, 0.2);
  color: #0369a1;
}
.docs-callout-info .docs-callout-icon {
  color: #0071e3;
}

/* 结构卡片与网格 */
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.docs-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: all 0.15s ease;
}

.docs-card:hover {
  border-color: rgba(15, 23, 42, 0.2);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
  transform: translateY(-2px);
}

.docs-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-card-desc {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.6;
}

/* OCR 工具栏 UI 模拟组件 */
.ocr-toolbar-preview {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #0f172a;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: center;
}

.ocr-toolbar-preview-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
}

.ocr-tool-pill {
  font-size: 0.82rem;
  font-weight: 500;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  user-select: none;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ocr-tool-pill:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ocr-tool-pill-ai {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(168, 85, 247, 0.25));
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-weight: 600;
}

/* 第 15 节交互式快捷键速查表 */
.cheatsheet-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cheatsheet-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cheatsheet-tab-btn {
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cheatsheet-tab-btn:hover {
  background: rgba(0, 113, 227, 0.08);
  color: #0071e3;
}

.cheatsheet-tab-btn.active {
  background: #0071e3;
  color: #ffffff !important;
  font-weight: 600;
  border-color: #0071e3;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.2);
}

.cheatsheet-search {
  max-width: 240px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 8px;
  color: #0f172a;
  outline: none;
}

.cheatsheet-search:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.15);
}

.docs-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.docs-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.docs-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  color: #334155;
  vertical-align: middle;
  line-height: 1.5;
}

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

.docs-table tbody tr:hover td {
  background: rgba(0, 113, 227, 0.03);
}

.docs-table .td-scene {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.docs-table .td-action {
  font-weight: 600;
  color: #0f172a;
}

/* 返回顶部按钮 */
.docs-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.15s ease;
  z-index: 90;
}

.docs-back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.docs-back-to-top:hover {
  background: #0071e3;
  color: #ffffff;
  border-color: #0071e3;
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.35);
}

/* Toast 提示 */
.docs-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

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

/* 响应式断点 */
@media (max-width: 1024px) {
  .docs-sidebar {
    position: fixed;
    top: 60px;
    left: -320px;
    width: 300px;
    height: calc(100vh - 60px);
    z-index: 99;
    background: #ffffff;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.16);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .docs-sidebar.open {
    left: 0;
  }

  .docs-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .docs-content-container {
    padding: 2rem 2rem 5rem;
  }
}

@media (max-width: 768px) {
  .docs-nav-title, .docs-search-shortcut {
    display: none;
  }

  .docs-search-container {
    max-width: 220px;
  }

  .docs-main-title {
    font-size: 1.85rem;
  }

  .docs-content-container {
    padding: 1.5rem 1rem 4rem;
  }

  .docs-section-title {
    font-size: 1.4rem;
  }

  .cheatsheet-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .cheatsheet-search {
    width: 100%;
    max-width: none;
  }
}
