/* style.css - 沙巴体育官网完整样式 */
/* 全局重置与基础变量 */
:root {
    --primary: #1a1a2e;
    --secondary: #e94560;
    --accent: #0f3460;
    --light: #f5f5f5;
    --dark: #0d0d1a;
    --card-bg: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.12);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius: 16px;
    --transition: 0.3s ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --max-width: 1200px;
    --hero-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --card-gradient: linear-gradient(145deg, rgba(233, 69, 96, 0.15), rgba(15, 52, 96, 0.2));
}

/* 暗色模式变量 */
[data-theme="dark"] {
    --primary: #0d0d1a;
    --secondary: #ff6b81;
    --accent: #1a3a6b;
    --light: #e0e0e0;
    --dark: #f0f0f0;
    --card-bg: rgba(0, 0, 0, 0.3);
    --glass: rgba(0, 0, 0, 0.4);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --hero-gradient: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 50%, #0a0a15 100%);
    --card-gradient: linear-gradient(145deg, rgba(255, 107, 129, 0.12), rgba(26, 58, 107, 0.18));
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--primary);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #ff8a9e;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--primary);
}
::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #d63850;
}

/* 导航栏 */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(233, 69, 96, 0.2);
    transition: background var(--transition);
}

[data-theme="dark"] header {
    background: rgba(13, 13, 26, 0.9);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav > div:first-child a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--light);
}

nav > div:first-child a span {
    background: linear-gradient(90deg, var(--secondary), #ff8a9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

nav ul li a {
    color: var(--light);
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: background var(--transition), color var(--transition);
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width var(--transition);
}

nav ul li a:hover::after,
nav ul li a:focus::after {
    width: 60%;
}

nav ul li a:hover {
    background: var(--glass);
    color: var(--secondary);
}

#darkModeToggle, #menuToggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: background var(--transition), transform var(--transition);
    color: var(--light);
    line-height: 1;
}

#darkModeToggle:hover, #menuToggle:hover {
    background: var(--glass);
    transform: scale(1.1);
}

#menuToggle {
    display: none;
    font-size: 1.6rem;
}

/* 按钮通用 */
button, [role="button"] {
    cursor: pointer;
    border: none;
    font-family: var(--font);
    transition: all var(--transition);
}

/* Hero 区域 */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hero-gradient);
    position: relative;
    overflow: hidden;
    padding: 6rem 1.5rem 4rem;
    text-align: center;
}

#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(233, 69, 96, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 70% 80%, rgba(15, 52, 96, 0.1) 0%, transparent 50%);
    animation: heroGlow 15s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2%, 2%) rotate(3deg); }
}

#hero > div {
    position: relative;
    z-index: 1;
    max-width: 800px;
    animation: fadeInUp 1s ease;
}

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

#hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, var(--secondary), #ff8a9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

#hero p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#hero div > div {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

#hero a[role="button"] {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
    transition: transform var(--transition), box-shadow var(--transition);
}

#hero a[role="button"]:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.6);
}

#hero a[role="button"]:last-child {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
    color: var(--light);
}

#hero a[role="button"]:last-child:hover {
    border-color: var(--secondary);
    background: rgba(233, 69, 96, 0.1);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.2);
}

/* 通用 section 样式 */
section {
    padding: 5rem 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

section h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--secondary), #ff8a9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

section p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
}

/* About 区域 */
#about > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

#about > div > div {
    background: var(--card-gradient);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

#about > div > div:nth-child(1) { animation-delay: 0.1s; }
#about > div > div:nth-child(2) { animation-delay: 0.2s; }
#about > div > div:nth-child(3) { animation-delay: 0.3s; }

#about > div > div:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

#about > div > div h3 {
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

#about > div > div p {
    text-align: left;
    margin: 0;
    font-size: 0.95rem;
}

/* Products 区域 */
#products > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

#products article {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

#products article:nth-child(1) { animation-delay: 0.1s; }
#products article:nth-child(2) { animation-delay: 0.2s; }
#products article:nth-child(3) { animation-delay: 0.3s; }
#products article:nth-child(4) { animation-delay: 0.4s; }

#products article:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    border-color: rgba(233, 69, 96, 0.3);
}

#products article h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

#products article p {
    text-align: left;
    margin: 0;
    font-size: 0.95rem;
}

/* Features 区域 */
#features > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

#features > div > div {
    background: var(--card-gradient);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    text-align: center;
}

#features > div > div:nth-child(1) { animation-delay: 0.05s; }
#features > div > div:nth-child(2) { animation-delay: 0.1s; }
#features > div > div:nth-child(3) { animation-delay: 0.15s; }
#features > div > div:nth-child(4) { animation-delay: 0.2s; }
#features > div > div:nth-child(5) { animation-delay: 0.25s; }
#features > div > div:nth-child(6) { animation-delay: 0.3s; }

#features > div > div:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

#features > div > div h3 {
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

#features > div > div p {
    text-align: center;
    margin: 0;
    font-size: 0.95rem;
}

/* FAQ 区域 */
#faq > div {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

details {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    transition: all var(--transition);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

details[open] {
    border-color: rgba(233, 69, 96, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

summary {
    padding: 1.2rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--light);
    transition: color var(--transition);
    user-select: none;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-size: 1.4rem;
    color: var(--secondary);
    transition: transform var(--transition);
    font-weight: 300;
}

details[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

details[open] summary {
    color: var(--secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

details p {
    padding: 1rem 1.5rem;
    margin: 0;
    text-align: left;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.15);
}

/* HowTo 区域 */
#howto ol {
    max-width: 700px;
    margin: 0 auto;
    padding-left: 1.5rem;
    counter-reset: step;
    list-style: none;
}

#howto ol li {
    counter-increment: step;
    padding: 1rem 1rem 1rem 3rem;
    margin-bottom: 0.8rem;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

#howto ol li::before {
    content: counter(step);
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

#howto ol li:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#howto ol li strong {
    color: var(--secondary);
}

/* Resources 区域 */
#resources > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

#resources article {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

#resources article:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

#resources article h3 {
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

#resources article p {
    text-align: left;
    margin: 0 0 1rem;
    font-size: 0.9rem;
    flex: 1;
}

#resources article a {
    align-self: flex-start;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    background: var(--secondary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background var(--transition), transform var(--transition);
}

#resources article a:hover {
    background: #d63850;
    transform: scale(1.05);
}

/* Contact 区域 */
#contact > p {
    margin-bottom: 2rem;
}

#contact address {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    font-style: normal;
}

#contact address > div {
    background: var(--card-gradient);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    text-align: center;
}

#contact address > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

#contact address h3 {
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

#contact address p, #contact address a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin: 0;
}

#contact address a {
    color: var(--secondary);
    font-weight: 500;
}

#contact address a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 1.5rem 1.5rem;
}

footer > div:first-child {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
}

footer h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer ul li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: color var(--transition);
}

footer ul li a:hover {
    color: var(--secondary);
}

footer > div:last-child {
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

footer > div:last-child p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0.3rem 0;
}

/* 滚动动画 - 通用 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    section {
        padding: 4rem 1.2rem;
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 1rem 0;
        border-bottom: 1px solid rgba(233, 69, 96, 0.2);
        gap: 0.5rem;
    }

    nav ul.active {
        display: flex;
    }

    nav ul li {
        width: 100%;
        text-align: center;
    }

    nav ul li a {
        display: block;
        padding: 0.8rem;
        border-radius: 0;
    }

    #menuToggle {
        display: inline-block;
    }

    #hero {
        padding: 5rem 1rem 3rem;
    }

    #hero h1 {
        font-size: 2rem;
    }

    #hero p {
        font-size: 1rem;
    }

    #hero a[role="button"] {
        padding: 0.8rem 1.8rem;
        font-size: 0.95rem;
    }

    section {
        padding: 3rem 1rem;
    }

    #about > div,
    #products > div,
    #features > div,
    #resources > div,
    #contact address {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    #howto ol li {
        padding: 0.9rem 0.9rem 0.9rem 2.8rem;
        font-size: 0.9rem;
    }

    #howto ol li::before {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
        left: 0.8rem;
    }

    footer > div:first-child {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    footer > div:last-child p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    nav {
        padding: 0.6rem 1rem;
    }

    nav > div:first-child a {
        font-size: 1.1rem;
    }

    #hero h1 {
        font-size: 1.8rem;
    }

    #hero p {
        font-size: 0.95rem;
    }

    #hero a[role="button"] {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    section h2 {
        font-size: 1.6rem;
    }

    section p {
        font-size: 0.95rem;
    }

    #about > div > div,
    #products article,
    #features > div > div,
    #resources article,
    #contact address > div {
        padding: 1.5rem;
    }

    details summary {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }

    details p {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }

    footer {
        padding: 2rem 1rem 1rem;
    }

    footer > div:first-child {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* 辅助功能 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 焦点样式 */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* 暗色模式切换过渡 */
body, header, section, footer, .card, article, details, div {
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}