/* 使用手册公共样式 */
:root {
  --primary: #07C160;
  --primary-light: #10D96B;
  --primary-dark: #059A4D;
  --bg-white: #FFFFFF;
  --bg-light: #F8FAFC;
  --bg-dark: #0F172A;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-white: #FFFFFF;
  --border-color: #E2E8F0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg-light); color: var(--text-primary); line-height: 1.6; }

/* 导航栏 */
.manual-nav { position: fixed; top: 0; left: 0; right: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-color); z-index: 100; }
.nav-container { max-width: 1400px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--text-primary); text-decoration: none; }
.logo i { color: var(--primary); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }

/* 主容器 */
.manual-container { display: flex; max-width: 1400px; margin: 84px auto 0; padding: 24px; gap: 24px; }

/* 侧边栏 */
.sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; background: white; border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.sidebar-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.nav-category { margin-bottom: 4px; }
.nav-category-title { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer; border-radius: 6px; transition: all 0.15s; }
.nav-category-title:hover { background: var(--bg-light); }
.nav-category-title i { font-size: 14px; width: 18px; text-align: center; color: var(--primary); }
.nav-category-title .toggle-icon { margin-left: auto; font-size: 10px; transition: transform 0.2s; }
.nav-category.collapsed .toggle-icon { transform: rotate(-90deg); }
.nav-category.collapsed .nav-items { display: none; }
.nav-items { padding-left: 12px; border-left: 2px solid var(--border-color); margin-left: 17px; margin-top: 2px; }
.nav-item { display: block; padding: 6px 10px; font-size: 12px; color: var(--text-secondary); text-decoration: none; border-radius: 4px; transition: all 0.15s; }
.nav-item:hover { background: var(--bg-light); color: var(--primary); }
.nav-item.active { background: var(--primary); color: white; }

/* 内容区 */
.content { flex: 1; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

/* 文档内容 */
.doc-content { background: white; border: 1px solid var(--border-color); border-radius: 12px; padding: 32px; line-height: 1.8; }
.doc-content h1 { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.doc-content .description { font-size: 16px; color: var(--text-secondary); margin-bottom: 24px; }
.doc-content h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 32px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.doc-content h2:first-child { margin-top: 0; }
.doc-content h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 24px 0 12px; }
.doc-content p { color: var(--text-secondary); margin-bottom: 16px; }
.doc-content ul, .doc-content ol { margin-bottom: 16px; padding-left: 24px; color: var(--text-secondary); }
.doc-content li { margin-bottom: 8px; }
.doc-content code { background: var(--bg-light); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--primary); }
.doc-content pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; }
.doc-content pre code { background: transparent; padding: 0; color: inherit; }
.doc-content blockquote { border-left: 4px solid var(--primary); padding-left: 16px; margin: 16px 0; color: var(--text-muted); }
.doc-content a { color: var(--primary); text-decoration: none; }
.doc-content a:hover { text-decoration: underline; }
.doc-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.doc-content th, .doc-content td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border-color); }
.doc-content th { background: var(--bg-light); font-weight: 600; }

/* 分类卡片网格 */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 24px; }
.category-card { display: block; background: white; border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; text-decoration: none; transition: all 0.2s; }
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-icon { width: 48px; height: 48px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.card-icon i { font-size: 24px; color: white; }
.category-card h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.category-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.card-count { font-size: 12px; color: var(--primary); font-weight: 500; }

/* 文档列表 */
.doc-list { margin-top: 16px; }
.doc-item { display: flex; align-items: center; padding: 16px; background: var(--bg-light); border-radius: 8px; margin-bottom: 8px; text-decoration: none; transition: all 0.2s; }
.doc-item:hover { background: white; box-shadow: var(--shadow-sm); }
.doc-item .doc-icon { width: 40px; height: 40px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-right: 12px; }
.doc-item .doc-icon i { color: white; font-size: 16px; }
.doc-item .doc-info { flex: 1; }
.doc-item .doc-info h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.doc-item .doc-info p { font-size: 12px; color: var(--text-secondary); margin: 0; }
.doc-item > i { color: var(--text-muted); }

/* 代码块 */
.code-block { background: #1e293b; border-radius: 8px; padding: 16px; margin-bottom: 16px; overflow-x: auto; }
.code-block pre { margin: 0; background: transparent; padding: 0; }
.code-block code { color: #e2e8f0; background: transparent; }

/* 提示框 */
.tip, .warning { padding: 16px; border-radius: 8px; margin: 16px 0; display: flex; align-items: flex-start; gap: 12px; }
.tip { background: rgba(7, 193, 96, 0.1); border-left: 4px solid var(--primary); }
.tip i { color: var(--primary); }
.warning { background: rgba(245, 158, 11, 0.1); border-left: 4px solid #f59e0b; }
.warning i { color: #f59e0b; }
.tip p, .warning p { margin: 0; color: var(--text-secondary); }

/* 图片占位符 */
.image-placeholder { background: var(--bg-light); border: 2px dashed var(--border-color); border-radius: 8px; padding: 40px; text-align: center; margin: 16px 0; }
.image-placeholder i { font-size: 32px; color: var(--text-muted); margin-bottom: 8px; display: block; }
.image-placeholder span { color: var(--text-muted); font-size: 14px; }

/* 文档图片 */
.doc-image { margin: 20px 0; text-align: center; }
.doc-image img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: var(--shadow-md); }
.doc-image .image-caption { margin-top: 8px; font-size: 13px; color: var(--text-muted); }

/* 文档底部导航 */
.doc-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.doc-footer .nav-links { display: flex; justify-content: space-between; }
.doc-footer .nav-links a { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-secondary); font-size: 14px; transition: all 0.15s; }
.doc-footer .nav-links a:hover { background: var(--primary); color: white; }
.doc-footer .nav-links a.next { margin-left: auto; }

/* 响应式 */
@media (max-width: 900px) { 
  .sidebar { display: none; } 
  .manual-container { padding: 16px; } 
  .doc-content { padding: 20px; }
  .category-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { 
  .doc-content h1 { font-size: 24px; } 
  .doc-footer .nav-links { flex-direction: column; gap: 8px; }
  .nav-links { gap: 16px; }
}

/* ===== 移动端深度优化 ===== */
@media (max-width: 768px) {
  /* 隐藏PC导航 */
  .navbar-nav,
  .navbar-cta,
  .navbar-mobile-toggle {
    display: none !important;
  }
  
  /* 简化顶部导航 */
  .navbar {
    height: 56px;
  }
  
  .navbar-container {
    height: 56px;
    padding: 0 16px;
  }
  
  .navbar-brand {
    font-size: 16px;
  }
  
  .navbar-brand .logo {
    width: 28px;
    height: 28px;
  }
  
  /* 主体容器 */
  body {
    padding-bottom: 70px;
  }
  
  .manual-container {
    margin-top: 56px;
    padding: 12px;
  }
  
  /* 文档内容 */
  .doc-content {
    padding: 16px;
    border-radius: 12px;
  }
  
  .doc-content h1 {
    font-size: 20px !important;
    margin-bottom: 16px;
  }
  
  .doc-content h2 {
    font-size: 17px !important;
    margin-top: 24px;
    margin-bottom: 12px;
  }
  
  .doc-content h3 {
    font-size: 15px !important;
    margin-top: 20px;
    margin-bottom: 10px;
  }
  
  .doc-content p,
  .doc-content li {
    font-size: 14px;
  }
  
  .doc-content ul,
  .doc-content ol {
    padding-left: 20px;
  }
  
  /* 代码块 */
  .code-block {
    padding: 12px;
    font-size: 12px;
    margin: 12px 0;
    border-radius: 6px;
  }
  
  .code-block code {
    font-size: 12px;
  }
  
  /* 内联代码 */
  .doc-content code {
    font-size: 13px;
    padding: 2px 6px;
  }
  
  /* 提示框 */
  .tip, .warning {
    padding: 12px;
    margin: 12px 0;
  }
  
  .tip p, .warning p {
    font-size: 13px;
  }
  
  /* 图片 */
  .doc-image img {
    border-radius: 6px;
  }
  
  .image-placeholder {
    padding: 24px;
  }
  
  /* 分类网格 */
  .category-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  .doc-item {
    padding: 12px;
  }
  
  .doc-item .doc-icon {
    width: 36px;
    height: 36px;
  }
  
  .doc-item .doc-info h3 {
    font-size: 13px;
  }
  
  .doc-item .doc-info p {
    font-size: 11px;
  }
  
  /* 文档底部导航 */
  .doc-footer {
    margin-top: 24px;
    padding-top: 12px;
  }
  
  .doc-footer .nav-links a {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  /* 首页分类卡片 */
  .category-card {
    padding: 16px;
  }
  
  .category-card h2 {
    font-size: 16px !important;
  }
  
  .category-card p {
    font-size: 13px;
  }
}

/* ===== 底部APP导航栏样式 ===== */
.mobile-tabbar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0));
    z-index: 10000;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
  }
  
  .mobile-tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    text-decoration: none;
    color: #64748b;
    transition: all 0.2s ease;
    border-radius: 12px;
    min-width: 48px;
    position: relative;
  }
  
  .mobile-tabbar-item:active {
    transform: scale(0.95);
  }
  
  .mobile-tabbar-item.active {
    color: #07C160;
  }
  
  .mobile-tabbar-item i {
    font-size: 20px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
  }
  
  .mobile-tabbar-item.active i {
    transform: scale(1.1);
  }
  
  .mobile-tabbar-item span {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
  }
  
  /* 中间突出按钮 */
  .mobile-tabbar-item.center {
    margin-top: -24px;
    background: linear-gradient(135deg, #07C160, #10D96B);
    color: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 0;
    box-shadow: 0 4px 16px rgba(7, 193, 96, 0.4);
  }
  
  .mobile-tabbar-item.center i {
    font-size: 22px;
    margin-bottom: 0;
  }
  
  .mobile-tabbar-item.center span {
    display: none;
  }
  
  .mobile-tabbar-item.center:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.4);
  }
}

/* 超小屏幕 */
@media (max-width: 374px) {
  .mobile-tabbar-item {
    padding: 6px 8px;
    min-width: 40px;
  }
  
  .mobile-tabbar-item i {
    font-size: 18px;
  }
  
  .mobile-tabbar-item span {
    font-size: 9px;
  }
  
  .mobile-tabbar-item.center {
    width: 44px;
    height: 44px;
    margin-top: -20px;
  }
}
