/* ========================================
   Base — CSS 变量、重置、工具类
   所有页面最先加载
   ======================================== */

/* ── CSS 变量 ── */
:root {
    --bg-primary: #faf7f2;
    --bg-secondary: #f3efe8;
    --bg-card: #ffffff;
    --bg-hover: #f0ebe2;
    --text-primary: #2d2d35;
    --text-secondary: #5c5c68;
    --text-muted: #8e8e98;
    --accent-primary: #4f8af7;
    --accent-secondary: #9b6ff6;
    --accent-success: #10b981;
    --accent-warning: #e5980b;
    --accent-danger: #ef4444;
    --accent-pink: #ec4899;
    --border-color: #e5e0d8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.06), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --nav-height: 70px;
    --footer-height: auto;

    --gradient-primary: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --gradient-warning: linear-gradient(135deg, var(--accent-warning), #f97316);
    --gradient-success: linear-gradient(135deg, var(--accent-success), #059669);

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
}

/* ── 全局重置 ── */
*, html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

/* ── 背景装饰淡入（由 PageLoader 触发 .loaded）── */
.bg-decoration { opacity: 0; transition: opacity 1s ease; }
.loaded .bg-decoration { opacity: 1; }

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; height: auto; }

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 选中文本 ── */
::selection { background: rgba(79, 138, 247, 0.2); color: var(--text-primary); }

/* ========================================
   布局工具类
   ======================================== */
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-row     { display: flex; align-items: center; }
.flex-col     { display: flex; flex-direction: column; }
.inline-flex  { display: inline-flex; align-items: center; }

.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.gap-xl  { gap: var(--space-xl); }

.hidden { display: none !important; }

/* ========================================
   卡片基类
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}
.card-overflow { overflow: hidden; }
.card-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

/* ========================================
   排版工具类
   ======================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }

.title-lg { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.title-md { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); }
.desc-text { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

/* ========================================
   标签
   ======================================== */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-hover);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.tag:hover { background: var(--accent-primary); color: white; }
.tag-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }

.sdk-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(79, 138, 247, 0.1);
    color: #4f8af7;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 12px;
}

/* ========================================
   图标盒子
   ======================================== */
.icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}
.icon-box-primary { background: var(--gradient-primary); color: white; }
.icon-box-warning { background: var(--gradient-warning); color: white; }
.icon-box-success { background: var(--gradient-success); color: white; }

/* ── 图标渐变色变体（全站共享）── */
.icon-gradient.blue   { background: linear-gradient(135deg, #4f8af7, #06b6d4); }
.icon-gradient.orange { background: linear-gradient(135deg, #e5980b, #ef4444); }
.icon-gradient.green  { background: linear-gradient(135deg, #10b981, #06b6d4); }
.icon-gradient.purple { background: linear-gradient(135deg, #a855f7, #6366f1); }

/* ========================================
   分隔线
   ======================================== */
.divider-b { border-bottom: 1px solid var(--border-color); }
.divider-t { border-top: 1px solid var(--border-color); }

/* ========================================
   间距
   ======================================== */
.section-gap { margin-bottom: 80px; }
.section-pad { padding: 30px; }

/* ========================================
   过渡
   ======================================== */
.trans-fast   { transition: all var(--transition-fast); }
.trans-normal { transition: all var(--transition-normal); }
.trans-slow   { transition: all var(--transition-slow); }

/* ========================================
   背景渐变
   ======================================== */
.bg-gradient-primary { background: var(--gradient-primary); color: white; }

/* ========================================
   背景装饰（全站共用）
   ======================================== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    top: -200px;
    right: -200px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    bottom: 10%;
    left: -100px;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    top: 40%;
    right: 10%;
}

/* ========================================
   按钮样式（全站共用）
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    transition: box-shadow var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 138, 247, 0.3);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(79, 138, 247, 0.4); }

.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }

.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); }

@media (max-width: 768px) {
    .btn { width: 100%; }
}

@media (max-width: 480px) {
    .gradient-orb { filter: blur(60px); opacity: 0.3; }
    .orb-1 { width: 300px; height: 300px; }
    .orb-2 { width: 200px; height: 200px; }
    .orb-3 { width: 150px; height: 150px; }
}
