/* =========================================
   1. 全局变量与重置 (Global Variables & Reset)
   ========================================= */
:root {
    /* 品牌色系 */
    --primary: #2563eb;       /* 现代科技蓝 */
    --primary-dark: #1e40af;  /* 深蓝悬停 */
    --primary-light: #eff6ff; /* 浅蓝背景 */
    
    /* 功能色系 */
    --secondary: #64748b;     /* 次要文字 */
    --accent: #f59e0b;        /* 金色点缀 */
    --success: #10b981;       /* 成功绿 */
    --error: #ef4444;         /* 错误红 */
    
    /* 基础色系 */
    --bg: #f8fafc;            /* 页面背景 */
    --surface: #ffffff;       /* 卡片背景 */
    --text: #1e293b;          /* 主文字 */
    --text-light: #64748b;    /* 次要文字 */
    --border: #e2e8f0;        /* 边框 */
    
    /* 阴影与效果 */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
    
    /* 尺寸 */
    --radius: 12px;
    --radius-lg: 16px;
    --container: 1200px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   2. 布局与容器 (Layout & Container)
   ========================================= */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* 页面内容动效容器 */
.page-content {
    opacity: 0; /* 由 JS 控制显示 */
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   3. 导航栏 (Navbar)
   ========================================= */
.navbar {
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 移动端菜单按钮 (隐藏式，如需可开启) */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* =========================================
   4. Hero 区域 (Home & Products)
   ========================================= */
/* 首页 Hero */
.hero {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    padding: 100px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 3rem;
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 产品页 Hero */
.hero-products {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero-products h1 { color: white; }
.hero-products p { color: rgba(255, 255, 255, 0.9); }

/* =========================================
   5. 按钮样式 (Buttons)
   ========================================= */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 14px 36px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.23);
}

.btn-primary:active {
    transform: translateY(0);
}

/* =========================================
   6. 办理流程 (Process Flow)
   ========================================= */
.process-section {
    padding: 80px 20px;
    background: var(--surface);
}

.process-steps {
    display: flex;
    justify-content: space-between;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    flex-wrap: wrap;
    gap: 20px;
}

/* 连接线 */
.process-steps::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
    display: none; /* 移动端隐藏 */
}

@media(min-width: 768px) {
    .process-steps::before { display: block; }
}

.step-item {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
    min-width: 140px;
    margin: 20px 0;
}

.step-icon {
    width: 80px;
    height: 80px;
    background: var(--surface);
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.step-item:hover .step-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-glow);
}

.step-title {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 1rem;
}

.step-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 箭头指示 */
.step-arrow {
    display: none;
    position: absolute;
    top: 30px;
    right: -25px;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: bold;
}

@media(min-width: 768px) {
    .step-arrow { display: block; }
}

.step-item:last-child .step-arrow {
    display: none;
}

/* =========================================
   7. 产品卡片 (Product Cards)
   ========================================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 20px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

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

.product-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    align-self: flex-start;
    margin-bottom: 15px;
}

.product-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text);
}

.product-desc {
    color: var(--text-light);
    margin-bottom: 20px;
    flex-grow: 1;
    font-size: 0.95rem;
}

.product-features {
    margin-bottom: 25px;
    background: var(--bg);
    padding: 15px;
    border-radius: 8px;
}

.product-features li {
    margin-bottom: 8px;
    color: #555;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.product-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
    margin-right: 8px;
    font-size: 1.1rem;
}

.btn-product {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
}

.btn-product:hover {
    background: var(--primary-dark);
}

/* =========================================
   8. 弹窗 Modal (核心交互)
   ========================================= */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/*激活状态*/
.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: var(--error);
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 5px;
}

.modal-header p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* =========================================
   FAQ 手风琴样式 (修复版)
   ========================================= */
.faq-section { background: var(--bg); }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { background: #fff; margin-bottom: 15px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid var(--border); }
.faq-question { padding: 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--text); transition: 0.3s; user-select: none; }
.faq-question:hover { background: #f9fafb; color: var(--primary); }
.faq-question i { transition: transform 0.3s ease; color: var(--primary); font-size: 0.9rem; }
.faq-item.active .faq-question i { transform: rotate(180deg); }
.faq-item.active .faq-question { color: var(--primary); background: #f0f7ff; }

/* 修复核心：移除固定高度，使用 max-height 过渡 */
.faq-answer { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1); /* 使用贝塞尔曲线让收缩更自然 */
    padding: 0 20px; 
    color: var(--text-light); 
    line-height: 1.8; 
    background: #fff;
}

.faq-content-inner {
    padding: 0 0 20px 0; /* 内边距放在这里，避免影响 max-height 计算 */
}

/* 激活状态由 JS 控制 max-height */

/* =========================================
   9. 表单样式 (Forms)
   ========================================= */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

/* =========================================
   表单下拉框优化
   ========================================= */
select.form-control {
    appearance: none; /* 移除默认箭头 */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230056b3%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
    padding-right: 40px; /* 为箭头留出空间 */
}

select.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* 选项样式 */
select.form-control option {
    padding: 10px;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s;
    background: var(--bg);
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--surface);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-submit:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    display: none;
    padding: 10px;
    border-radius: 6px;
}

.form-message.success {
    color: #065f46;
    background: #d1fae5;
    display: block;
}

.form-message.error {
    color: #991b1b;
    background: #fee2e2;
    display: block;
}

/* =========================================
   10. 页脚 (Footer)
   ========================================= */
.footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 60px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer p {
    margin-bottom: 10px;
}

.footer strong {
    color: white;
}

/* =========================================
   首页增强样式 (Home Enhancements)
   ========================================= */

/* 徽章样式 */
.badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }

/* 步骤流程优化 */
.process-steps { display: flex; justify-content: space-between; max-width: 1000px; margin: 0 auto; position: relative; flex-wrap: wrap; gap: 20px; }
.process-steps::before { content: ''; position: absolute; top: 40px; left: 60px; right: 60px; height: 2px; background: #e2e8f0; z-index: 0; display: none; }
@media(min-width: 768px) { .process-steps::before { display: block; } }
.step-item { position: relative; z-index: 1; text-align: center; flex: 1; min-width: 140px; margin: 20px 0; }
.step-icon { width: 80px; height: 80px; background: var(--surface); border: 2px solid var(--primary); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-size: 1.5rem; font-weight: 800; box-shadow: var(--shadow); transition: all 0.3s ease; }
.step-item:hover .step-icon { background: var(--primary); color: white; transform: scale(1.1); box-shadow: var(--shadow-glow); }
.step-title { font-weight: 700; margin-bottom: 5px; font-size: 1rem; }
.step-desc { font-size: 0.85rem; color: var(--text-light); }

/* =========================================
   11. 移动端适配 (Responsive)
   ========================================= */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    
    .nav-links { display: none; } /* 简化版：移动端隐藏菜单，实际项目可加汉堡菜单 */
    .mobile-menu-btn { display: block; }
    
    .process-steps {
        flex-direction: column;
        align-items: center;
    }
    
    .process-steps::before { display: none; }
    
    .step-item {
        width: 100%;
        margin-bottom: 30px;
    }
    
    .step-arrow { display: none !important; }
    
    .modal-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links { display: none; } /* 简化版：实际项目建议加 JS 切换 */
    .mobile-menu-btn { display: block; }
    .hero h1 { font-size: 2rem; }
    .section-title h2 { font-size: 2rem; }
    .info-grid { grid-template-columns: 1fr; }
    .process-steps { flex-direction: column; align-items: center; }
    .process-steps::before { display: none; }
}