/* ===== MK体育 - 完整样式表 ===== */
/* 主题变量 */
:root {
    --primary: #1a3a6b;
    --primary-light: #2a5a9b;
    --primary-dark: #0a1628;
    --accent: #e63946;
    --accent-hover: #c92e3a;
    --text: #e0e6ed;
    --text-muted: #8899aa;
    --bg: #0a1628;
    --bg-card: #111d35;
    --bg-card-hover: #1a2d4f;
    --border: #1e3350;
    --gradient-1: linear-gradient(135deg, #1a3a6b 0%, #0a1628 100%);
    --gradient-2: linear-gradient(135deg, #e63946 0%, #c92e3a 100%);
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --radius: 12px;
    --transition: 0.3s ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== 全局重置 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

/* ===== 链接 ===== */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: #ff6b7a;
}

/* ===== 图片 ===== */
img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== 标题 ===== */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 1.3;
    color: #fff;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

p {
    margin: 0 0 1rem;
}

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--gradient-2);
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230,57,70,0.4);
    color: #fff;
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

/* ===== 区块 ===== */
.section {
    padding: 80px 0;
    transition: background var(--transition);
}
.section-title {
    text-align: center;
    margin-bottom: 50px;
}
.section-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 10px auto 0;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

/* ===== 网格系统 ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* ===== 辅助类 ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 20px; }

/* ===== 头部导航 ===== */
header[role="banner"] {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,22,40,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}
header[role="banner"] .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    padding-bottom: 12px;
}
header[role="banner"] a[aria-label="MK体育首页"] {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}
header[role="banner"] nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
header[role="banner"] nav a {
    color: var(--text);
    font-size: 0.95rem;
    position: relative;
    padding: 4px 0;
}
header[role="banner"] nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}
header[role="banner"] nav a:hover::after {
    width: 100%;
}
#themeToggle {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
    transition: transform var(--transition);
}
#themeToggle:hover {
    transform: rotate(15deg);
}

/* ===== Hero 区域 ===== */
#hero {
    padding: 100px 0 80px;
    background: var(--gradient-1);
    position: relative;
    overflow: hidden;
}
#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230,57,70,0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: pulseGlow 4s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
#hero .container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
#hero h1 {
    margin-bottom: 20px;
}
#hero h1 span {
    color: var(--accent);
}
#hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 30px;
}
#hero .btn-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
#hero .mockup {
    display: flex;
    justify-content: center;
    align-items: center;
}
#hero .mockup-box {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 24px;
    background: linear-gradient(145deg, #1a3a6b, #0a1628);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
#hero .mockup-box p {
    margin-top: 16px;
    font-size: 1rem;
}

/* ===== About 区域 ===== */
#about {
    background: var(--bg);
}

/* ===== Features 区域 ===== */
#features {
    background: var(--bg-card);
}
#features .card svg {
    margin: 0 auto 16px;
    display: block;
}

/* ===== Download 区域 ===== */
#download .download-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}
#download .download-cards .card {
    min-width: 200px;
}
#download .download-cards .card .btn {
    width: 100%;
    justify-content: center;
}
#download .qr-code {
    display: inline-block;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 10px;
    transition: transform var(--transition);
}
#download .qr-code:hover {
    transform: scale(1.05);
}

/* ===== HowTo 区域 ===== */
#howto {
    background: var(--bg-card);
}
#howto .grid-3 {
    counter-reset: step;
}
#howto .card {
    position: relative;
    padding-left: 50px;
}
#howto .card::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 30px;
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

/* ===== FAQ 区域 ===== */
#faq .faq-list {
    max-width: 800px;
    margin: 0 auto;
}
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    transition: border-color var(--transition);
}
.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color var(--transition);
}
.faq-question:hover {
    color: var(--accent);
}
.faq-question span:last-child {
    font-size: 1.2rem;
    transition: transform 0.3s;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 8px;
}
.faq-answer p {
    padding: 8px 0;
}

/* ===== Resources 区域 ===== */
#resources {
    background: var(--bg-card);
}
#resources article.card a {
    color: var(--accent);
    font-weight: 600;
    display: inline-block;
    transition: transform var(--transition);
}
#resources article.card a:hover {
    transform: translateX(4px);
}

/* ===== Contact 区域 ===== */
#contact .contact-grid {
    max-width: 700px;
    margin: 0 auto;
}
#contact .contact-grid .card h3 {
    margin-bottom: 8px;
}
#contact .contact-grid .card p:first-of-type {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

/* ===== Footer ===== */
footer[role="contentinfo"] {
    background: var(--primary-dark);
    border-top: 1px solid var(--border);
    padding: 40px 0 20px;
    transition: background var(--transition), border-color var(--transition);
}
footer[role="contentinfo"] .footer-grid {
    margin-bottom: 30px;
}
footer[role="contentinfo"] h4 {
    margin-bottom: 12px;
    color: #fff;
}
footer[role="contentinfo"] ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
footer[role="contentinfo"] ul li {
    margin-bottom: 4px;
}
footer[role="contentinfo"] ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color var(--transition);
}
footer[role="contentinfo"] ul li a:hover {
    color: var(--accent);
}
footer[role="contentinfo"] .footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ===== 返回顶部按钮 ===== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 99;
    transition: all var(--transition);
    opacity: 0;
    transform: translateY(20px);
}
#backToTop.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}
#backToTop:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(230,57,70,0.5);
}

/* ===== 滚动动画 ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 暗色模式切换过渡 ===== */
body, .card, .section, header[role="banner"], footer[role="contentinfo"],
.faq-item, #download .qr-code, #hero .mockup-box {
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), box-shadow var(--transition);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    #hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    #hero p {
        margin-left: auto;
        margin-right: auto;
    }
    #hero .btn-group {
        justify-content: center;
    }
    #hero .mockup-box {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 50px 0;
    }
    .container {
        padding: 0 16px;
    }
    header[role="banner"] .container {
        flex-wrap: wrap;
    }
    header[role="banner"] nav {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 8px;
    }
    header[role="banner"] nav a {
        font-size: 0.85rem;
    }
    #hero {
        padding: 80px 0 60px;
    }
    #hero .mockup-box {
        width: 220px;
        height: 220px;
    }
    #hero .mockup-box svg {
        width: 60px;
        height: 60px;
    }
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    #download .download-cards {
        flex-direction: column;
        align-items: center;
    }
    #download .download-cards .card {
        width: 100%;
        max-width: 300px;
    }
    .faq-question {
        font-size: 0.95rem;
    }
    footer[role="contentinfo"] .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    header[role="banner"] a[aria-label="MK体育首页"] {
        font-size: 1.1rem;
    }
    header[role="banner"] nav {
        gap: 8px;
    }
    header[role="banner"] nav a {
        font-size: 0.8rem;
    }
    #hero h1 {
        font-size: 1.8rem;
    }
    #hero p {
        font-size: 1rem;
    }
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .card {
        padding: 20px;
    }
    .section-title {
        margin-bottom: 30px;
    }
    .section-title h2 {
        font-size: 1.5rem;
    }
    footer[role="contentinfo"] .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 打印样式 ===== */
@media print {
    header[role="banner"], footer[role="contentinfo"], #backToTop, #themeToggle {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
    .card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* ===== 选择文本样式 ===== */
::selection {
    background: var(--accent);
    color: #fff;
}

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

/* ===== 焦点样式 ===== */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== 暗色模式额外优化 ===== */
[data-theme="light"] {
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2f5;
    --text: #1a1a2e;
    --text-muted: #555;
    --border: #ddd;
}
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3,
[data-theme="light"] h4, [data-theme="light"] h5, [data-theme="light"] h6 {
    color: #1a1a2e;
}
[data-theme="light"] header[role="banner"] {
    background: rgba(245,247,250,0.95);
}
[data-theme="light"] header[role="banner"] a[aria-label="MK体育首页"] {
    color: #1a1a2e;
}
[data-theme="light"] #hero {
    background: linear-gradient(135deg, #e8edf5 0%, #d0d8e8 100%);
}
[data-theme="light"] #hero .mockup-box {
    background: linear-gradient(145deg, #ffffff, #e8edf5);
    border-color: #ccc;
}
[data-theme="light"] footer[role="contentinfo"] {
    background: #e8edf5;
}
[data-theme="light"] footer[role="contentinfo"] h4 {
    color: #1a1a2e;
}