/* Google AI Studio 官方设计规范变量（带老旧检查器颜色保底） */
:root {
  --google-font: -apple-system, BlinkMacSystemFont, "Google Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --google-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bg-page: #ffffff;
  --bg-sidebar: #ffffff;
  --border-subtle: #e0e2ec;
  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-muted: #747775;
  --m3-pill-bg: #c2e7ff;
  --m3-pill-text: #001d35;
  --google-blue: #0b57d0;
  --callout-bg: #edf2fa;
  --code-dark-bg: #1e1f20;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f1f1f;
  color: var(--text-primary);
  background: #ffffff;
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  width: 100vw;
  overflow-x: hidden;
}

/* 顶部 Google 官方顶栏：100% 铺满横向视口 */
.top-nav {
  height: 64px;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e0e2ec;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-left { display: flex; align-items: center; gap: 32px; }
.brand-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #1f1f1f; color: var(--text-primary); font-size: 18px; font-weight: 500; }
.brand-icon { width: 24px; height: 24px; color: #0b57d0; color: var(--google-blue); }
.brand-title span { color: #747775; color: var(--text-muted); font-weight: 400; font-size: 15px; margin-left: 2px; }
.nav-links { display: flex; gap: 20px; }
.nav-link { text-decoration: none; font-size: 14px; font-weight: 500; color: #444746; color: var(--text-secondary); padding: 6px 12px; border-radius: 9999px; transition: all 0.15s; }
.nav-link:hover { background: #f0f4f9; color: #1f1f1f; color: var(--text-primary); }
.nav-link.active { background: #e8f0fe; color: #0b57d0; color: var(--google-blue); }
.cta-button {
  background: #1f1f1f;
  color: #ffffff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 9999px;
  transition: background 0.15s;
}
.cta-button:hover { background: #333333; }

/* 容器横向拉满 */
.docs-container {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 64px);
  position: relative;
}

/* 左侧导航栏：强力居左贴边 */
.sidebar-nav {
  width: 280px;
  border-right: 1px solid #e0e2ec;
  border-right: 1px solid var(--border-subtle);
  background: #ffffff;
  background: var(--bg-sidebar);
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  left: 0;
}
.sidebar-search { padding: 16px 20px 10px; }
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #f0f4f9;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  transition: all 0.2s;
}
.search-input-wrap:focus-within {
  background: #ffffff;
  border-color: #0b57d0;
  border-color: var(--google-blue);
  box-shadow: 0 0 0 2px rgba(11, 87, 208, 0.15);
}
.search-icon { color: #747775; color: var(--text-muted); margin-right: 8px; }
.search-input-wrap input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 13px;
  background: transparent;
  font-family: inherit;
}
.search-shortcut {
  font-size: 11px;
  background: #ffffff;
  border: 1px solid #e0e2ec;
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  color: #747775;
  color: var(--text-muted);
}

.sidebar-tree {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
}
/* 拉开大分类模块之间的间距（组内紧凑，组间疏朗） */
.nav-group {
  margin-bottom: 28px;
}
.nav-group:last-child {
  margin-bottom: 12px;
}

/* 大分类标题：更清淡柔和的浅灰蓝色，与深色正文明显区分 */
.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.06em;
  padding: 2px 16px 8px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 400;
  color: #334155;
  text-decoration: none;
  border-radius: 9999px;
  margin-bottom: 2px;
  transition: all 0.15s;
}

/* 顺手美化左侧栏滚动条为极简 5px 细条 */
.sidebar-tree::-webkit-scrollbar {
  width: 5px;
}
.sidebar-tree::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 9999px;
}
.sidebar-tree::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}
.nav-item:hover { background: #f0f4f9; color: #1f1f1f; color: var(--text-primary); }
.nav-item.active {
  background: #c2e7ff !important;
  background: var(--m3-pill-bg) !important;
  color: #001d35 !important;
  color: var(--m3-pill-text) !important;
  font-weight: 600;
}

/* 中间主阅读区 */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 40px 60px 100px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.docs-content-wrapper {
  width: 100%;
  max-width: 900px;
}

.breadcrumbs {
  font-size: 13px;
  color: #747775;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 400;
}

/* Markdown 排版系统 */
.markdown-body h1 {
  font-size: 38px;
  font-weight: 500;
  color: #1f1f1f;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.markdown-body h2 {
  font-size: 24px;
  font-weight: 500;
  color: #1f1f1f;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f0f4f9;
  padding-bottom: 10px;
}
.markdown-body h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1f1f1f;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}
.markdown-body p {
  font-size: 15.5px;
  color: #444746;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.75;
}
.markdown-body ul, .markdown-body ol {
  margin-left: 24px;
  margin-bottom: 22px;
  font-size: 15px;
  color: #444746;
  color: var(--text-secondary);
  line-height: 1.75;
}
.markdown-body li { margin-bottom: 8px; }

/* 🌟 1:1 复刻 Gemini 官网蓝色 Callout 提示框 */
.callout-card {
  background: #edf2fa;
  background: var(--callout-bg);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.callout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1e3a8a;
}
.callout-prompt-box {
  background: #1e1f20;
  background: var(--code-dark-bg);
  border-radius: 12px;
  padding: 16px 20px;
  color: #e3e3e3;
  font-family: monospace;
  font-family: var(--google-mono);
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  overflow-x: auto;
}

/* 纯圆 Google 官方黑按钮 */
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f1f1f;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 9999px;
  margin: 16px 0;
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}
.google-btn:hover { background: #333333; }

/* 代码块 */
.code-block-wrap {
  position: relative;
  background: #1e1f20;
  background: var(--code-dark-bg);
  border-radius: 12px;
  margin: 20px 0 28px 0;
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #2a2b2d;
  color: #c4c7c5;
  font-size: 12px;
  font-family: monospace;
  font-family: var(--google-mono);
}
.copy-btn {
  background: transparent;
  border: none;
  color: #c4c7c5;
  font-size: 12px;
  cursor: pointer;
}
.copy-btn:hover { color: #ffffff; }
.code-block-wrap pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-size: 13.5px;
  font-family: monospace;
  font-family: var(--google-mono);
  color: #e3e3e3;
}

/* 表格 */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.markdown-body th, .markdown-body td {
  border: 1px solid #e0e2ec;
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  text-align: left;
}
.markdown-body th { background: #f8fafc; font-weight: 600; color: #1f1f1f; color: var(--text-primary); }

/* 🌟 右侧大纲栏：强力居右贴边 */
.on-this-page {
  width: 260px;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  padding: 40px 24px;
  flex-shrink: 0;
  right: 0;
  border-left: 1px solid #e0e2ec;
  border-left: 1px solid var(--border-subtle);
}
.toc-header {
  font-size: 11px;
  font-weight: 600;
  color: #747775;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  letter-spacing: 0.06em;
}
.toc-links a {
  display: block;
  text-decoration: none;
  font-size: 13px;
  color: #444746;
  color: var(--text-secondary);
  padding: 6px 0;
  line-height: 1.45;
  transition: all 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-links a:hover { color: #0b57d0; color: var(--google-blue); }
.toc-links a.active {
  color: #0b57d0 !important;
  color: var(--google-blue) !important;
  font-weight: 500;
  border-left: 2px solid #0b57d0;
  border-left: 2px solid var(--google-blue);
  padding-left: 10px;
  margin-left: -12px;
}

@media (max-width: 1180px) { .on-this-page { display: none; } }
@media (max-width: 768px) {
  .sidebar-nav { position: fixed; left: -280px; z-index: 99; transition: left 0.25s; }
  .sidebar-nav.open { left: 0; }
  .docs-main { padding: 24px 16px; }
}


/* ==================== 1. 补齐左下角运行状态栏样式 ==================== */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid #e0e2ec;
  font-size: 12px;
  color: #747775;
  background: #ffffff;
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-indicator .dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  flex-shrink: 0;
}

/* ==================== 2. Google 风格淡蓝媒体画框（图片 & 视频统一装裱） ==================== */
.media-frame {
  background: #edf2fa;
  background: linear-gradient(145deg, #edf2fa 0%, #f4f7fc 100%);
  border: 1px solid #d2e3fc;
  border-radius: 16px;
  padding: 20px 24px;
  margin: 26px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
}

.media-frame img,
.markdown-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(224, 226, 236, 0.9);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  background: #ffffff;
}

.media-frame video,
.markdown-body video {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  background: #0f172a;
}

.media-caption {
  margin-top: 12px;
  font-size: 12.5px;
  color: #444746;
  text-align: center;
  line-height: 1.4;
}

/* 将标准 Markdown 引用块 (>) 直接渲染为 Google AI Studio 淡蓝提示卡片 */
.markdown-body blockquote {
  background: #edf2fa;
  border-left: 4px solid #0b57d0;
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 24px 0;
  color: #1e3a8a;
  font-size: 14.5px;
  line-height: 1.7;
}
.markdown-body blockquote p {
  margin-bottom: 0;
  color: #1e3a8a;
}

/* ==================== 3. Google 官网同款二级可折叠子文件夹样式 ==================== */
.nav-folder {
  margin-bottom: 2px;
}

.nav-folder-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 14px 7px 16px;
  font-size: 13.5px;
  font-weight: 400;
  color: #334155;
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
}
.nav-folder-toggle:hover {
  background: #f0f4f9;
  color: #1f1f1f;
}
/* 保持平静的普通字体与颜色，不再加粗也不再变蓝 */
.nav-folder.has-active > .nav-folder-toggle {
  color: #334155;
  font-weight: 400;
}

.nav-folder-chevron {
  width: 14px;
  height: 14px;
  color: #747775;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.nav-folder.open > .nav-folder-toggle .nav-folder-chevron {
  transform: rotate(90deg);
}

/* 三级子文章缩进 + 左侧细竖线（1:1 复刻 Gemini 截图红框效果） */
.nav-folder-children {
  display: none;
  margin: 2px 0 6px 20px;
  padding-left: 10px;
  border-left: 1px solid #e0e2ec;
}
.nav-folder.open > .nav-folder-children {
  display: block;
}
.nav-folder-children .nav-item {
  font-size: 13px;
  padding: 7px 14px;
}