/* 电工考证刷题系统 - 前台样式 */

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:"Microsoft YaHei","PingFang SC",sans-serif; background:#f5f7fa; color:#333; line-height:1.6; }

.container { max-width:1200px; margin:0 auto; padding:0 15px; }

/* 顶部导航 */
.top-header { background:#23262E; position:sticky; top:0; z-index:100; box-shadow:0 2px 10px rgba(0,0,0,.1); }
.top-header .container { display:flex; align-items:center; justify-content:space-between; height:60px; }
.logo a { color:#fff; text-decoration:none; font-size:20px; font-weight:bold; }
.logo-icon { margin-right:5px; }
.top-nav a { color:#ccc; text-decoration:none; margin-left:25px; font-size:15px; transition:.2s; }
.top-nav a:hover, .top-nav a.active { color:#1e9fff; }
.top-right { display:flex; align-items:center; gap:10px; }
.btn-login, .btn-register { color:#ccc; text-decoration:none; padding:6px 15px; border-radius:4px; transition:.2s; }
.btn-register { background:#1e9fff; color:#fff; }
.btn-register:hover { background:#0080d0; }

.user-menu { position:relative; color:#ccc; cursor:pointer; }
.user-menu:hover .user-dropdown { display:block; }
.user-dropdown { display:none; position:absolute; right:0; top:100%; background:#fff; border-radius:4px; box-shadow:0 2px 10px rgba(0,0,0,.1); min-width:120px; }
.user-dropdown a { display:block; padding:8px 15px; color:#333; text-decoration:none; }
.user-dropdown a:hover { background:#f0f8ff; }
.vip-badge { background:linear-gradient(135deg,#f6d365,#fda085); color:#fff; padding:2px 8px; border-radius:10px; font-size:12px; margin-left:5px; }

/* 主内容 */
.main-content { min-height:calc(100vh - 120px); padding:20px 0; }

/* Hero */
.hero { background:linear-gradient(135deg,#1e9fff,#0066cc); color:#fff; padding:60px 0; text-align:center; }
.hero h1 { font-size:42px; margin-bottom:15px; }
.hero-desc { font-size:18px; opacity:.9; margin-bottom:25px; }
.hero-actions { display:flex; gap:15px; justify-content:center; }
.btn { display:inline-block; padding:12px 30px; border-radius:6px; text-decoration:none; font-size:16px; transition:.3s; }
.btn-primary { background:#ff6b35; color:#fff; }
.btn-primary:hover { background:#e85d2b; }
.btn-outline { border:2px solid #fff; color:#fff; background:transparent; }
.btn-outline:hover { background:#fff; color:#1e9fff; }

/* 统计 */
.stats-section { padding:30px 0; }
.stats-grid { display:flex; justify-content:space-around; flex-wrap:wrap; gap:20px; }
.stat-item { text-align:center; }
.stat-num { font-size:36px; font-weight:bold; color:#1e9fff; }
.stat-label { color:#666; margin-top:5px; }

/* 功能卡片 */
.section-title { font-size:28px; text-align:center; margin:40px 0 10px; color:#333; }
.section-desc { text-align:center; color:#666; margin-bottom:30px; }
.features-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:20px; margin-top:30px; }
.feature-card { background:#fff; border-radius:10px; padding:25px; box-shadow:0 2px 10px rgba(0,0,0,.05); transition:.3s; }
.feature-card:hover { transform:translateY(-5px); box-shadow:0 5px 20px rgba(0,0,0,.1); }
.feature-icon { font-size:40px; margin-bottom:10px; }
.feature-card h3 { margin-bottom:8px; color:#333; }
.feature-card p { color:#666; font-size:14px; margin-bottom:10px; }
.feature-link { color:#1e9fff; text-decoration:none; font-size:14px; }

/* 题库栏目 */
.cats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:15px; }
.cat-card { background:#fff; border-radius:8px; padding:20px; text-align:center; text-decoration:none; color:#333; transition:.2s; box-shadow:0 2px 8px rgba(0,0,0,.05); }
.cat-card:hover { transform:translateY(-3px); box-shadow:0 4px 15px rgba(0,0,0,.1); }
.cat-type { display:inline-block; background:#1e9fff; color:#fff; padding:2px 10px; border-radius:10px; font-size:12px; margin-bottom:8px; }
.cat-name { font-size:16px; font-weight:bold; }

/* CTA */
.cta-section { background:linear-gradient(135deg,#f6d365,#fda085); padding:50px 0; text-align:center; margin-top:40px; border-radius:10px; }
.cta-section h2 { font-size:28px; margin-bottom:10px; }
.cta-section p { font-size:18px; margin-bottom:20px; }
.btn-lg { padding:15px 40px; font-size:18px; }

/* 页脚 */
.footer { background:#23262E; color:#999; padding:30px 0; margin-top:40px; text-align:center; }
.footer-links a { color:#ccc; text-decoration:none; margin:0 10px; }
.footer-links a:hover { color:#fff; }

/* 认证页 */
.auth-container { display:flex; justify-content:center; align-items:center; min-height:60vh; }
.auth-box { background:#fff; border-radius:12px; padding:40px; width:400px; box-shadow:0 4px 20px rgba(0,0,0,.08); }
.auth-box h2 { text-align:center; margin-bottom:30px; color:#333; }
.form-item { margin-bottom:20px; }
.btn-auth { height:45px; font-size:16px; border-radius:6px; }
.form-footer { text-align:center; margin-top:15px; color:#666; }
.form-footer a { color:#1e9fff; text-decoration:none; }

/* 刷题 */
.practice-container { display:flex; gap:20px; }
.practice-sidebar { width:250px; background:#fff; border-radius:10px; padding:20px; height:fit-content; position:sticky; top:80px; }
.practice-sidebar h4 { margin-bottom:15px; color:#333; }
.filter-group { margin-bottom:15px; }
.filter-group label { display:block; margin-bottom:5px; color:#666; font-size:14px; }
.practice-main { flex:1; }
.question-item { background:#fff; border-radius:10px; padding:20px; margin-bottom:15px; box-shadow:0 2px 8px rgba(0,0,0,.05); }
.q-header { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.q-index { background:#1e9fff; color:#fff; width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; }
.q-type-badge { padding:2px 8px; border-radius:4px; font-size:12px; }
.q-type-badge.single { background:#e6f7ff; color:#1890ff; }
.q-type-badge.multiple { background:#f6ffed; color:#52c41a; }
.q-type-badge.judge { background:#fff7e6; color:#faad14; }
.q-cat { color:#999; font-size:13px; }
.vip-tag { background:#ff6b35; color:#fff; padding:1px 6px; border-radius:3px; font-size:12px; }
.q-stem { font-size:16px; margin-bottom:15px; line-height:1.8; }
.q-option { display:block; padding:10px 15px; margin-bottom:8px; border-radius:6px; cursor:pointer; transition:.2s; border:1px solid #eee; }
.q-option:hover { background:#f0f8ff; border-color:#1e9fff; }
.q-option input { margin-right:8px; }
.q-actions { margin-top:10px; }
.q-result { margin-top:12px; padding:12px; background:#f6ffed; border-radius:6px; }
.result-correct { color:#52c41a; font-size:15px; }
.result-analysis { margin-top:8px; color:#666; font-size:14px; }

/* 考试 */
.exam-container { max-width:800px; margin:0 auto; }
.exam-setup { background:#fff; border-radius:12px; padding:40px; text-align:center; }
.exam-config { max-width:400px; margin:30px auto; text-align:left; }
.config-row { margin-bottom:20px; }
.config-row label { display:block; margin-bottom:5px; color:#666; }
.btn-start-exam { width:100%; height:50px; font-size:18px; border-radius:8px; }
.exam-topbar { display:flex; justify-content:space-between; align-items:center; background:#fff; padding:15px 20px; border-radius:8px; margin-bottom:15px; position:sticky; top:80px; z-index:10; }
.exam-timer { font-size:18px; color:#ff6b35; font-weight:bold; }
.exam-question { background:#fff; border-radius:10px; padding:30px; margin-bottom:15px; }
.eq-type { display:inline-block; background:#e6f7ff; color:#1890ff; padding:3px 10px; border-radius:4px; font-size:13px; margin-bottom:15px; }
.eq-stem { font-size:18px; margin-bottom:20px; line-height:1.8; }
.eq-opt { display:block; padding:12px 18px; margin-bottom:10px; border:1px solid #eee; border-radius:6px; cursor:pointer; transition:.2s; }
.eq-opt:hover { background:#f0f8ff; border-color:#1e9fff; }
.exam-nav { display:flex; justify-content:space-between; background:#fff; padding:15px; border-radius:8px; }
.exam-result { background:#fff; border-radius:12px; padding:40px; text-align:center; }
.result-score { margin:30px 0; }
.score-num { font-size:72px; font-weight:bold; color:#ff6b35; }
.result-detail p { font-size:16px; margin:8px 0; }
.text-green { color:#52c41a; }
.text-red { color:#ff4d4f; }
.result-actions { margin-top:25px; display:flex; gap:15px; justify-content:center; }

/* 计算器 */
.calc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:15px; }
.calc-card { background:#fff; border-radius:10px; padding:25px; text-align:center; cursor:pointer; transition:.3s; box-shadow:0 2px 8px rgba(0,0,0,.05); }
.calc-card:hover { transform:translateY(-3px); box-shadow:0 5px 15px rgba(0,0,0,.1); }
.calc-icon { font-size:36px; margin-bottom:8px; }
.calc-name { font-size:16px; font-weight:bold; }
.calc-input-row { margin-bottom:12px; }
.calc-input-row label { display:block; margin-bottom:4px; color:#666; }
.calc-result-area { margin-top:20px; }
.calc-results { background:#f6ffed; border-radius:8px; padding:15px; }
.calc-result-item { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid #e8f5e9; }
.calc-result-item b { color:#52c41a; font-size:18px; }
.calc-error { color:#ff4d4f; padding:10px; }

/* 工程估算 */
.estimate-actions { margin-bottom:20px; }
.estimate-actions select { width:300px; }
.estimate-panel { background:#fff; border-radius:10px; padding:20px; }

/* 资料库 */
.cat-tabs { display:flex; gap:10px; margin-bottom:20px; flex-wrap:wrap; }
.cat-tab { padding:8px 18px; background:#fff; border-radius:20px; text-decoration:none; color:#666; transition:.2s; }
.cat-tab:hover, .cat-tab.active { background:#1e9fff; color:#fff; }
.material-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:15px; }
.material-card { background:#fff; border-radius:10px; padding:20px; display:flex; align-items:center; gap:15px; box-shadow:0 2px 8px rgba(0,0,0,.05); }
.m-icon { font-size:36px; }
.m-info { flex:1; }
.m-title { font-weight:bold; margin-bottom:5px; }
.m-meta { font-size:13px; color:#999; }

/* 会员 */
.member-container, .vip-container, .redeem-container { max-width:900px; margin:0 auto; }
.user-card { background:linear-gradient(135deg,#1e9fff,#0066cc); color:#fff; border-radius:12px; padding:30px; display:flex; align-items:center; gap:20px; }
.user-avatar { font-size:60px; }
.user-name { font-size:22px; font-weight:bold; }
.user-phone { opacity:.8; margin-top:3px; }
.vip-status { margin-top:8px; font-size:14px; }
.vip-active { background:rgba(255,255,255,.2); padding:4px 12px; border-radius:15px; display:inline-block; }
.vip-inactive { opacity:.8; }
.stats-grid-mini { display:flex; gap:30px; margin:20px 0; }
.mini-stat { background:#fff; border-radius:8px; padding:20px; text-align:center; flex:1; }
.mini-num { font-size:32px; font-weight:bold; color:#1e9fff; }
.mini-label { color:#666; }
.member-actions { display:flex; gap:15px; margin-top:20px; }
.action-btn { flex:1; background:#fff; border-radius:8px; padding:20px; text-align:center; text-decoration:none; color:#333; transition:.2s; }
.action-btn:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,.1); }

/* 套餐 */
.plan-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:20px; margin-top:20px; }
.plan-card { background:#fff; border-radius:12px; padding:25px; text-align:center; position:relative; transition:.3s; border:2px solid transparent; }
.plan-card:hover, .plan-card.selected { border-color:#1e9fff; transform:translateY(-5px); }
.plan-card.recommend { border-color:#ff6b35; }
.plan-badge { position:absolute; top:-12px; left:50%; transform:translateX(-50%); background:#ff6b35; color:#fff; padding:3px 15px; border-radius:10px; font-size:12px; }
.plan-name { font-size:20px; font-weight:bold; margin-bottom:10px; }
.plan-price { margin:15px 0; }
.price-currency { font-size:18px; color:#ff6b35; vertical-align:top; }
.price-num { font-size:42px; font-weight:bold; color:#ff6b35; }
.price-unit { color:#999; }
.plan-original { color:#999; text-decoration:line-through; margin-bottom:10px; }
.plan-desc { color:#666; margin-bottom:15px; }
.plan-features { list-style:none; text-align:left; margin-bottom:20px; }
.plan-features li { padding:5px 0; color:#666; }
.btn-buy { width:100%; height:42px; border-radius:6px; }

/* 支付 */
.pay-channel { background:#fff; border-radius:10px; padding:25px; margin-top:20px; text-align:center; }
.channel-list { display:flex; gap:15px; justify-content:center; margin:20px 0; }
.channel-item { padding:15px 30px; border:2px solid #eee; border-radius:8px; cursor:pointer; transition:.2s; }
.channel-item:hover, .channel-item.selected { border-color:#1e9fff; }
.btn-pay { width:200px; height:45px; border-radius:6px; }

/* 兑换 */
.redeem-box { background:#fff; border-radius:10px; padding:30px; text-align:center; }
.redeem-box input { width:100%; height:50px; font-size:18px; text-align:center; letter-spacing:2px; margin-bottom:20px; }
.redeem-tips { text-align:center; color:#999; margin-top:15px; }

/* 错题本 */
.wrong-list { margin-top:15px; }
.wrong-item { background:#fff; border-radius:8px; padding:18px; margin-bottom:12px; border-left:4px solid #ff4d4f; }
.w-header { display:flex; gap:10px; margin-bottom:8px; font-size:13px; }
.w-cat { background:#e6f7ff; color:#1890ff; padding:1px 8px; border-radius:3px; }
.w-type { color:#999; }
.w-date { color:#ccc; margin-left:auto; }
.w-stem { font-size:15px; margin-bottom:10px; }
.w-answer { font-size:14px; }
.w-your { color:#ff4d4f; margin-right:15px; }
.w-correct { color:#52c41a; }
.w-analysis { margin-top:8px; color:#666; font-size:14px; background:#fafafa; padding:8px; border-radius:4px; }

/* 空状态 */
.empty-tip { text-align:center; padding:60px; color:#999; }
.empty-tip p { font-size:18px; margin-bottom:5px; }

/* 响应式 */
@media (max-width:768px) {
    .top-nav { display:none; }
    .practice-container { flex-direction:column; }
    .practice-sidebar { width:100%; position:static; }
    .hero h1 { font-size:28px; }
    .stats-grid { gap:10px; }
    .stat-num { font-size:24px; }
    .plan-grid { grid-template-columns:1fr; }
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .header { position: relative; }
    .header .layui-container {
        flex-wrap: wrap;
        height: auto;
        padding: 16px 0 12px;
        gap: 12px;
    }
    .header .logo {
        width: calc(100% - 120px);
        font-size: 22px;
        letter-spacing: 1px;
    }
    .header .user-menu {
        position: absolute;
        top: 14px;
        right: 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    .header .nav {
        order: 3;
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .header .nav::-webkit-scrollbar { display: none; }
    .header .nav a {
        flex: 0 0 auto;
        padding: 6px 14px;
        font-size: 14px;
        white-space: nowrap;
        border-radius: 16px;
    }
    .hero { padding: 56px 0; }
    .hero h1 { font-size: 30px; }
    .hero-desc { font-size: 16px; }
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        padding: 0 24px;
        gap: 12px;
    }
    .hero-actions .btn { text-align: center; }
    .stat-num { font-size: 28px; }
    .features-grid { grid-template-columns: 1fr; }
    .cats-grid { grid-template-columns: repeat(2, 1fr); }
    .main { padding: 15px 0; }
    .layui-container { padding: 0 12px; }
}
