/* ============================================
   康润新能源官网 - 公共样式
   深色科技风 · #0a0e17 主背景 · #00d4aa 主色调
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2b3d;
    --accent: #00d4aa;
    --accent-dark: #00b894;
    --accent-glow: rgba(0, 212, 170, 0.15);
    --gold: #f0c040;
    --text-primary: #e8edf5;
    --text-secondary: #8b9cc0;
    --text-muted: #5a6a8a;
    --border: #1e2d42;
    --border-light: #2a3a52;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-accent: 0 0 30px rgba(0, 212, 170, 0.1);
    --transition: 0.3s ease;
    --max-width: 1200px;
    --header-height: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Header --- */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--header-height);
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), box-shadow var(--transition);
}
.header.scrolled {
    background: rgba(10, 14, 23, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 700; color: var(--text-primary); }
.logo-img { height: 35px; width: auto; display: block; position: relative; top: 5px; }
.logo-icon { font-size: 28px; }
.logo-text { background: linear-gradient(135deg, var(--accent), var(--gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; }
.nav { display: flex; gap: 32px; }
.nav-link {
    color: var(--text-secondary); font-size: 15px; font-weight: 500;
    position: relative; padding: 4px 0; transition: color var(--transition);
}
.nav-link::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
    background: var(--accent); transition: width var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Nav Dropdown */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-trigger { cursor: pointer; }
.nav-dropdown-trigger::after { display: none !important; }
.nav-arrow { font-size: 10px; margin-left: 4px; transition: transform var(--transition); display: inline-block; }
.nav-dropdown-menu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    min-width: 180px; padding: 8px 0; z-index: 100;
    background: rgba(26, 35, 50, 0.98); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    opacity: 0; visibility: hidden;
    transition: all 0.25s ease;
    pointer-events: none;
    padding-top: 12px; margin-top: -4px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1; visibility: visible; pointer-events: auto;
}
.nav-dropdown:hover .nav-arrow { transform: rotate(180deg); }
.nav-dropdown-item {
    display: block; padding: 10px 20px;
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    transition: all var(--transition); white-space: nowrap;
}
.nav-dropdown-item:hover {
    color: var(--accent); background: var(--accent-glow);
}
.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: var(--transition); }

/* --- Sections --- */
.section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-tag {
    display: inline-block; padding: 4px 16px; border-radius: 20px;
    background: var(--accent-glow); color: var(--accent);
    font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    margin-bottom: 16px;
}
.section-title {
    font-size: 36px; font-weight: 700; margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.section-desc { color: var(--text-secondary); font-size: 16px; max-width: 600px; margin: 0 auto; }

/* --- Cards --- */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
    transition: all var(--transition);
}
.card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
    transform: translateY(-4px);
}
.card-icon {
    width: 56px; height: 56px; border-radius: var(--radius-sm);
    background: var(--accent-glow); display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin-bottom: 20px;
}
.card-title { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.card-desc { color: var(--text-secondary); font-size: 14px; line-height: 1.8; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; cursor: pointer;
    border: none; transition: all var(--transition);
    -webkit-appearance: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-primary);
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(0, 212, 170, 0.4); transform: translateY(-2px); }
.btn-outline {
    background: transparent; border: 1px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover { background: var(--accent-glow); }

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* --- Footer --- */
.footer {
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    padding: 64px 0 0;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.5fr; gap: 32px; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.footer-desc { color: var(--text-secondary); font-size: 14px; line-height: 1.8; }
.footer-col h4 { font-size: 16px; margin-bottom: 20px; color: var(--text-primary); }
.footer-col a { display: block; color: var(--text-secondary); font-size: 14px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--accent); }
.footer-col p { color: var(--text-secondary); font-size: 14px; margin-bottom: 6px; }
.footer-bottom {
    margin-top: 40px; padding: 20px 0; border-top: 1px solid var(--border);
    text-align: center; color: var(--text-muted); font-size: 13px;
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--accent); }

/* --- Main Content Offset --- */
.main { padding-top: var(--header-height); }

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.6s ease forwards; }

/* ===== Tablet 1024px ===== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

/* ===== Mobile 768px ===== */
@media (max-width: 768px) {
    :root { --header-height: 56px; }

    .container { padding: 0 16px; }
    .section { padding: 48px 0; }
    .section-header { margin-bottom: 36px; }
    .section-title { font-size: 24px; }
    .section-desc { font-size: 14px; }

    /* 导航 */
    .nav { display: none; }
    .nav.open {
        display: flex; flex-direction: column;
        position: absolute; top: var(--header-height); left: 0; right: 0;
        background: rgba(17, 24, 39, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 8px 16px; gap: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 32px rgba(0,0,0,0.5);
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }
    .nav.open .nav-link {
        padding: 14px 0;
        font-size: 16px;
        border-bottom: 1px solid var(--border);
    }
    .nav.open .nav-link:last-child { border-bottom: none; }
    .nav.open .nav-dropdown { border-bottom: 1px solid var(--border); }
    .nav.open .nav-dropdown-trigger { padding: 14px 0; font-size: 16px; border-bottom: none; color: var(--text-secondary); }
    .nav.open .nav-dropdown-menu {
        position: static; transform: none; opacity: 1; visibility: visible;
        pointer-events: auto; background: none; border: none; box-shadow: none;
        padding: 0 0 0 20px; backdrop-filter: none;
        display: none;
    }
    .nav.open .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .nav.open .nav-dropdown-item {
        padding: 10px 0; font-size: 14px;
        border-bottom: 1px solid rgba(30,45,66,0.5);
    }
    .nav.open .nav-dropdown-item:last-child { border-bottom: none; }
    .nav.open .nav-dropdown-item:hover { background: none; }
    .menu-toggle { display: flex; }

    /* Grid - 平板用2列，手机1列 */
    .grid-2 { grid-template-columns: 1fr; gap: 16px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

    /* Card */
    .card { padding: 20px; }
    .card-title { font-size: 17px; }
    .card:hover { transform: none; }

    /* Button */
    .btn { padding: 10px 20px; font-size: 14px; }

    /* Footer */
    .footer { padding: 40px 0 0; }
    .footer-bottom { font-size: 12px; margin-top: 24px; padding: 16px 0; }
}

/* ===== Narrow Mobile 540px — 渐进收缩，覆盖390-540px区间 ===== */
@media (max-width: 540px) {
    .container { padding: 0 14px; }
    .section { padding: 36px 0; }
    .section-title { font-size: 22px; }
    .section-header { margin-bottom: 28px; }

    .logo { font-size: 20px; gap: 7px; }
    .logo-img { height: 28px; top: 4px; }

    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 14px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

    .card { padding: 18px; }
    .card-title { font-size: 17px; }
    .card-desc { font-size: 13px; }

    .btn { padding: 10px 18px; font-size: 14px; }

    .footer { padding: 36px 0 0; }
    .footer-col h4 { font-size: 15px; margin-bottom: 16px; }
    .footer-col a, .footer-col p { font-size: 13px; }
    .footer-bottom { font-size: 12px; }
}

/* ===== Small Mobile 480px ===== */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .section { padding: 28px 0; }
    .section-title { font-size: 20px; }
    .section-header { margin-bottom: 24px; }

    .logo { font-size: 18px; gap: 6px; }
    .logo-img { height: 24px; top: 3px; }
    .logo-icon { font-size: 22px; }

    /* 小屏强制单列 */
    .grid-2 { grid-template-columns: 1fr; gap: 12px; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 12px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }

    .card { padding: 16px; }
    .card-icon { width: 44px; height: 44px; font-size: 22px; margin-bottom: 12px; }
    .card-title { font-size: 16px; margin-bottom: 8px; }
    .card-desc { font-size: 13px; line-height: 1.6; }

    .btn { padding: 10px 16px; font-size: 13px; border-radius: 6px; }

    .footer { padding: 32px 0 0; }
    .footer-logo { font-size: 16px; }
    .footer-col h4 { font-size: 15px; margin-bottom: 14px; }
    .footer-col a, .footer-col p { font-size: 13px; }
    .footer-bottom { font-size: 11px; }
}

/* ===== Extra Small 360px ===== */
@media (max-width: 360px) {
    .container { padding: 0 10px; }
    .section { padding: 24px 0; }
    .section-title { font-size: 18px; }
    .section-tag { font-size: 11px; padding: 3px 12px; }

    .logo { font-size: 16px; gap: 4px; }
    .logo-img { height: 20px; top: 2px; }

    .grid-2, .grid-3, .grid-4 { gap: 10px; }
    .footer-grid { grid-template-columns: 1fr; gap: 16px; }

    .card { padding: 14px; }
    .card-icon { width: 38px; height: 38px; font-size: 18px; margin-bottom: 10px; }
    .card-title { font-size: 15px; margin-bottom: 6px; }
    .card-desc { font-size: 12px; line-height: 1.5; }

    .btn { padding: 8px 14px; font-size: 12px; }

    .footer { padding: 24px 0 0; }
    .footer-col h4 { font-size: 14px; margin-bottom: 10px; }
    .footer-col a, .footer-col p { font-size: 12px; margin-bottom: 6px; }
    .footer-bottom { font-size: 10px; }
}
