:root {
    --primary: #243B66;
    --primary-soft: #EEF4FF;
    --accent: #B91C1C;
    --accent-soft: #FEF2F2;
    --text: #243042;
    --muted: #6B7280;
    --card: rgba(255, 255, 255, 0.92);
    --border: rgba(36, 59, 102, 0.12);
    --shadow: 0 18px 45px rgba(36, 59, 102, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.9;
    background:
        radial-gradient(circle at top left, rgba(185, 28, 28, 0.095), transparent 32rem),
        radial-gradient(circle at top right, rgba(36, 59, 102, 0.14), transparent 30rem),
        linear-gradient(135deg, #F8FAFC 0%, #F2F5FA 52%, #FFF8F8 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: linear-gradient(rgba(36, 59, 102, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(36, 59, 102, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 78%);
}

.page {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 34px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 46px 48px;
    color: #fff;
    background: linear-gradient(135deg, #22365F 0%, #2B4A7F 58%, #B91C1C 145%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(36, 59, 102, 0.24);
}

.hero::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -86px;
    top: -98px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
}

.hero h1 {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0;
    font-size: clamp(1.65rem, 3.8vw, 2.6rem);
    line-height: 1.22;
    letter-spacing: -0.04em;
}

.hero p {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.05rem;
}

.content-card {
    margin-top: 28px;
    padding: 34px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.greeting {
    display: block;
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 1.8em;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.lead {
    margin: 0 0 1.5rem;
    font-size: 1.04rem;
}

.alert {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #FFF3E0;
    border-left: 4px solid var(--accent);
    border-radius: 14px;
}

ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: section;
}

ol li {
    position: relative;
    margin: 18px 0;
    padding: 24px 26px 24px 82px;
    overflow: hidden;
    counter-increment: section;
    background: linear-gradient(180deg, #FFFFFF 0%, #FCFDFF 100%);
    border: 1px solid rgba(36, 59, 102, 0.10);
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(36, 59, 102, 0.075);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

ol li::before {
    content: counter(section);
    position: absolute;
    left: 24px;
    top: 26px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), #DC2626);
    border-radius: 14px;
    box-shadow: 0 10px 20px rgba(185, 28, 28, 0.18);
}

ol li:hover {
    transform: translateY(-4px);
    border-color: rgba(185, 28, 28, 0.22);
    box-shadow: 0 18px 38px rgba(36, 59, 102, 0.13);
}

strong {
    padding: 0.12em 0.35em;
    color: var(--accent);
    font-weight: 800;
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.58), rgba(254, 242, 242, 0.98));
    border-radius: 8px;
    box-shadow: inset 0 -1px 0 rgba(185, 28, 28, 0.14);
}

a {
    color: var(--primary);
    font-weight: 650;
    text-decoration: none;
    border-bottom: 1px dashed rgba(36, 59, 102, 0.42);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(254, 242, 242, 0.78);
}

.section-title {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 42px 0 16px;
    color: var(--primary);
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}

.section-title::before {
    content: "";
    width: 8px;
    height: 28px;
    background: var(--accent);
    border-radius: 999px;
}

.reference-list {
    margin: 0;
    padding: 22px 24px 22px 44px;
    background: linear-gradient(135deg, var(--primary-soft), #FFFFFF);
    border: 1px solid rgba(36, 59, 102, 0.10);
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(36, 59, 102, 0.07);
}

.reference-list li {
    margin: 10px 0;
    padding-left: 4px;
}

.contact {
    margin: 26px 0 0;
    padding: 22px 24px;
    background: linear-gradient(135deg, var(--accent-soft), #FFFFFF);
    border: 1px solid rgba(185, 28, 28, 0.13);
    border-radius: 22px;
}

footer {
    padding: 28px 96px 0 0;
    color: var(--muted);
    text-align: center;
}

.back-home {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    color: #fff !important;
    font-weight: 750;
    background: linear-gradient(135deg, var(--accent), #DC2626);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(185, 28, 28, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-home:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #991B1B, var(--accent));
    box-shadow: 0 18px 38px rgba(185, 28, 28, 0.30);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .page {
        width: min(100% - 24px, 980px);
        padding: 22px 0 26px;
    }

    .hero {
        padding: 34px 24px;
        border-radius: 22px;
    }

    .content-card {
        padding: 22px 16px;
        border-radius: 22px;
    }

    .greeting {
        font-size: 1.45em;
    }

    ol li {
        margin: 14px 0;
        padding: 68px 18px 20px;
        border-radius: 18px;
    }

    ol li::before {
        left: 18px;
        top: 18px;
    }

    .reference-list {
        padding: 18px 18px 18px 32px;
    }

    footer {
        padding: 24px 0 74px;
    }

    .back-home {
        right: 16px;
        bottom: 16px;
        min-height: 44px;
        padding: 10px 18px;
    }
}

/* === 深色模式 === */
[data-theme="dark"] {
    --primary: #A8C4E0;
    --primary-soft: #1E2A3A;
    --accent: #E85D5D;
    --accent-soft: #2A1A1A;
    --text: #E8ECF2;
    --muted: #9CA3AF;
    --card: rgba(30, 40, 55, 0.92);
    --border: rgba(168, 196, 224, 0.15);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.30);
}

[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(232, 93, 93, 0.08), transparent 32rem),
        radial-gradient(circle at top right, rgba(50, 80, 130, 0.15), transparent 30rem),
        linear-gradient(135deg, #0F1724 0%, #141E30 52%, #1A1218 100%);
}

[data-theme="dark"] body::before {
    background-image: linear-gradient(rgba(168, 196, 224, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(168, 196, 224, 0.025) 1px, transparent 1px);
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #162035 0%, #1E3258 58%, #6B1212 145%);
    border-color: rgba(168, 196, 224, 0.12);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .hero::after {
    background: rgba(168, 196, 224, 0.06);
}

[data-theme="dark"] ol li {
    background: linear-gradient(180deg, #1C2840 0%, #1A2438 100%);
    border-color: rgba(168, 196, 224, 0.10);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.20);
}

[data-theme="dark"] ol li::before {
    background: linear-gradient(135deg, var(--accent), #C0392B);
}

[data-theme="dark"] ol li:hover {
    border-color: rgba(232, 93, 93, 0.30);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] strong {
    background: linear-gradient(180deg, rgba(42, 26, 26, 0.58), rgba(42, 26, 26, 0.98));
    box-shadow: inset 0 -1px 0 rgba(232, 93, 93, 0.20);
}

[data-theme="dark"] a {
    color: var(--primary);
    border-bottom-color: rgba(168, 196, 224, 0.35);
}

[data-theme="dark"] a:hover {
    color: var(--accent);
    background: rgba(42, 26, 26, 0.58);
}

[data-theme="dark"] .reference-list {
    background: linear-gradient(135deg, var(--primary-soft), #1C2840);
    border-color: rgba(168, 196, 224, 0.10);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .contact {
    background: linear-gradient(135deg, var(--accent-soft), #1C2840);
    border-color: rgba(232, 93, 93, 0.18);
}

/* === 主题切换按钮 === */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    backdrop-filter: blur(8px);
    transition: background 0.25s ease, transform 0.25s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.08);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

/* 全局过渡 */
body,
.hero,
.content-card,
ol li,
.reference-list,
.contact,
strong,
a,
footer {
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* === 减少动画偏好支持 === */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }

    .theme-toggle:hover {
        transform: none;
    }

    ol li:hover {
        transform: none;
    }

    .back-home:hover {
        transform: none;
    }
}