/* ============================================================
   calcbox.top 全局统一样式表
   版本：2.0
   更新时间：2026-06-13
   
   配色规范：
   - 主色：#4080FF
   - 背景：#f5f7fa（浅灰）、#ffffff（白色）
   - 文字：#333（主）、#666（辅助）
   - 边框：#e5e7eb
   ============================================================ */

/* ========== CSS 变量定义 ========== */
:root {
    /* 主色调 */
    --primary: #4080FF;
    --primary-light: #6ba3ff;
    --primary-dark: #2d6bff;
    
    /* 背景色 */
    --bg-main: #f5f7fa;
    --bg-white: #ffffff;
    
    /* 文字色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    
    /* 边框色 */
    --border-color: #e5e7eb;
    
    /* 功能色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ========== 暗色模式变量覆盖 ========== */
/* 仅当 <html data-theme="dark"> 时生效，不影响浅色页面 */
[data-theme="dark"] {
    /* 主色调 —— 保持一致，确保品牌色统一 */
    --primary: #4080FF;
    --primary-light: #6ba3ff;
    --primary-dark: #2d6bff;

    /* 背景色 —— slate 色阶，层次分明 */
    --bg-main: #0f172a;       /* 深色页面背景（slate-900） */
    --bg-white: #1e293b;      /* 卡片/面板背景（slate-800） */

    /* 文字色 —— 浅色文字，满足 WCAG AA 对比度 */
    --text-primary: #f1f5f9;  /* 主文字（slate-100），对比度 > 12:1 */
    --text-secondary: #94a3b8;/* 次要文字（slate-400），对比度 ~5.9:1 */
    --text-muted: #64748b;    /* 静音文字（slate-500），用于占位/提示 */

    /* 边框色 */
    --border-color: #334155;  /* 暗色边框（slate-700） */

    /* 功能色 —— 暗色背景下提亮，保证可读性 */
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    /* 阴影 —— 暗色模式下加深，增强层次感 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);

    /* 圆角 —— 保持不变 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* 暗色模式：页脚背景修正
   :root 中 .footer 用 var(--text-primary) 做背景（浅色模式 = #333 深色），
   暗色模式下 --text-primary 反转为浅色，需单独指定深色背景 */
[data-theme="dark"] .footer {
    background: #0f172a;
    border-top: 1px solid var(--border-color);
}

/* ========== 全局样式重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 顶部导航栏 ========== */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo i {
    font-size: 24px;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primary);
    background: rgba(64, 128, 255, 0.05);
}

.nav-links a.active {
    color: var(--primary);
    background: rgba(64, 128, 255, 0.1);
}

/* ========== 主容器 ========== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 84px 20px 40px;
}

/* ========== 首屏宣传区（Hero） ========== */
.hero-section {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, var(--bg-white) 0%, #f0f5ff 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--text-primary);
}

.hero-feature i {
    color: var(--success);
    font-size: 18px;
}

/* ========== 工具分类区 ========== */
.category-section {
    margin-bottom: 48px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.category-header i {
    font-size: 28px;
    color: var(--primary);
}

.category-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: auto;
}

/* ========== 工具卡片网格 ========== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* ========== 工具卡片 ========== */
.tool-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(64, 128, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.tool-card:hover .tool-icon {
    background: rgba(64, 128, 255, 0.15);
    transform: scale(1.1);
}

.tool-icon i {
    font-size: 28px;
    color: var(--primary);
}

.tool-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========== 通用按钮样式 ========== */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--border-color);
}

/* ========== 通用表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64, 128, 255, 0.1);
}

/* ========== 页脚样式 ========== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

.beian {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.beian a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 14px;
}

.beian a:hover {
    color: white;
    text-decoration: underline;
}

/* ========== 响应式：平板 ========== */
@media (max-width: 1024px) {
    .nav-links {
        gap: 2px;
    }
    
    .nav-links a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* ========== 响应式：手机 ========== */
@media (max-width: 768px) {
    .nav {
        height: 56px;
    }
    
    .nav-links {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    .main-container {
        padding: 76px 16px 30px;
    }
    
    .hero-section {
        padding: 40px 20px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-features {
        gap: 16px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    
    .tool-card {
        padding: 20px 12px;
    }
    
    .tool-icon {
        width: 48px;
        height: 48px;
    }
    
    .tool-icon i {
        font-size: 22px;
    }
    
    .tool-card h3 {
        font-size: 14px;
    }
    
    .tool-card p {
        font-size: 12px;
    }
}
