/* ============================================================
   IDIXEE 官网公共样式（全站复用）
   适用页面：index / manual / privacy-policy / user-agreement
   各页面独有样式仍保留在对应页面的 <style> 内
   ============================================================ */

/* ===== 全局变量 ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #4361ee;
    --primary-light: #eef2ff;
    --accent: #4cc9f0;
    --border: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* ===== 通用容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 导航栏 ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    padding: 19px 0;
    padding-top: calc(19px + constant(safe-area-inset-top));
    padding-top: calc(19px + env(safe-area-inset-top));
}
nav.scrolled {
    padding: 12px 0;
    padding-top: calc(12px + constant(safe-area-inset-top));
    padding-top: calc(12px + env(safe-area-inset-top));
    border-bottom-color: var(--border);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-img {
    height: 38px;
    width: auto;
    display: block;
}
.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: var(--transition);
}
.nav-links a:hover {
    color: var(--primary);
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
}
.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* ===== 移动端侧边菜单 ===== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: var(--transition);
    padding: calc(80px + constant(safe-area-inset-top)) 30px 30px;
    padding: calc(80px + env(safe-area-inset-top)) 30px 30px;
}
.mobile-menu.active {
    right: 0;
}
.mobile-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.mobile-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
}
.close-menu {
    position: absolute;
    top: calc(24px + constant(safe-area-inset-top));
    top: calc(24px + env(safe-area-inset-top));
    right: 24px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
}
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== 移动端换行适配 ===== */
.mobile-br {
    display: none;
}
@media (max-width: 768px) {
    .mobile-br {
        display: block;
        margin: 10px 0;
    }
}

/* ===== 页脚（基础样式，定位/布局差异由各页面覆盖） ===== */
footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    padding-bottom: calc(20px + constant(safe-area-inset-bottom));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

/* ===== 返回顶部 ===== */
.back-top {
    position: fixed;
    right: 32px;
    bottom: calc(90px + constant(safe-area-inset-bottom));
    bottom: calc(90px + env(safe-area-inset-bottom));
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
}
.back-top.show {
    opacity: 1;
    visibility: visible;
}
.back-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(67, 97, 238, 0.28);
}
@media (max-width: 768px) {
    .back-top {
        right: 16px;
        bottom: calc(80px + constant(safe-area-inset-bottom));
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ===== 响应式：窄屏折叠导航 ===== */
@media (max-width: 1100px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
}
