/* =========================================================
   沫琪Frisk的小网站 · 通用样式
   所有页面共用：配色、排版、导航、卡片、页脚、动效
   ========================================================= */

/* ---------- 设计变量 ---------- */
:root {
    --primary: #22c55e;
    --primary-strong: #16a34a;
    --primary-deep: #0b7a3f;
    --primary-soft: rgba(34, 197, 94, 0.12);
    --secondary: #3b82f6;
    --accent: #f59e0b;

    --grad: linear-gradient(135deg, #4ade80 0%, #22c55e 48%, #10b981 100%);
    --grad-cool: linear-gradient(135deg, #34d399 0%, #22c55e 40%, #3b82f6 100%);
    --grad-text: linear-gradient(120deg, #0f2a1b 0%, #1a9a58 52%, #2563eb 100%);

    --text: #16231b;
    --text-light: #5c6d63;
    --text-faint: #8b9a91;

    --bg: #f3f8f4;
    --surface: #ffffff;
    --surface-2: #f6faf7;
    --surface-3: rgba(255, 255, 255, 0.72);
    --border: rgba(22, 35, 27, 0.08);
    --border-strong: rgba(22, 35, 27, 0.14);
    --header: rgba(12, 26, 19, 0.86);
    --footer: #08130e;

    --shadow-sm: 0 2px 8px rgba(16, 50, 32, 0.06);
    --shadow: 0 14px 34px rgba(16, 50, 32, 0.09);
    --shadow-lg: 0 26px 60px rgba(16, 50, 32, 0.14);

    --radius: 22px;
    --radius-sm: 14px;
    --radius-pill: 999px;
    --ease: cubic-bezier(0.16, 0.84, 0.44, 1);
    --transition: 0.28s var(--ease);
    --max: 1200px;
    --header-h: 72px;
}

[data-theme="dark"] {
    --primary-soft: rgba(34, 197, 94, 0.16);
    --grad-text: linear-gradient(120deg, #eaf6ee 0%, #6ee7a8 52%, #93c5fd 100%);

    --text: #e9f3ec;
    --text-light: #a9b8ae;
    --text-faint: #7d8d84;

    --bg: #0a100d;
    --surface: #131c17;
    --surface-2: #17231c;
    --surface-3: rgba(23, 35, 28, 0.72);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --header: rgba(8, 16, 12, 0.84);
    --footer: #060c09;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.5);
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 24px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 560px at 8% -8%, rgba(52, 211, 153, 0.18), transparent 62%),
        radial-gradient(900px 520px at 108% 2%, rgba(59, 130, 246, 0.13), transparent 58%),
        linear-gradient(180deg, #f6faf7 0%, var(--bg) 55%, #eef5f0 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(1000px 520px at 8% -8%, rgba(34, 197, 94, 0.16), transparent 62%),
        radial-gradient(900px 520px at 108% 4%, rgba(59, 130, 246, 0.1), transparent 60%),
        linear-gradient(180deg, #0b1510 0%, var(--bg) 55%, #080e0b 100%);
}

img {
    max-width: 100%;
    display: inline-block;
}

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

button,
input {
    font: inherit;
    color: inherit;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.01em;
}

p {
    margin: 0 0 0.9rem;
}

p:last-child {
    margin-bottom: 0;
}

strong {
    color: var(--primary-strong);
}

::selection {
    background: rgba(34, 197, 94, 0.28);
    color: var(--text);
}

:focus-visible {
    outline: 2px solid rgba(34, 197, 94, 0.75);
    outline-offset: 3px;
    border-radius: 6px;
}

/* 细一点的滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, 0.28);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 197, 94, 0.45);
    background-clip: padding-box;
    border: 2px solid transparent;
}

/* 粒子背景 */
#particles-js {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.55;
}

/* ---------- 加载动画 ---------- */
#loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    background: var(--bg);
    transition: opacity 0.45s ease;
}

[data-theme="dark"] #loading {
    background: #08100c;
}

#loading h2 {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    color: var(--text-faint);
}

.loader {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3px solid rgba(34, 197, 94, 0.18);
    border-top-color: var(--primary);
    border-right-color: rgba(34, 197, 94, 0.55);
    animation: spin 0.9s linear infinite;
    box-shadow: 0 0 26px rgba(34, 197, 94, 0.22);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- 顶部导航 ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background var(--transition), box-shadow var(--transition);
}

header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.6), rgba(59, 130, 246, 0.45), transparent);
    opacity: 0.75;
}

header.is-scrolled {
    background: rgba(8, 18, 13, 0.95);
    box-shadow: 0 16px 40px rgba(3, 12, 7, 0.35);
}

nav {
    width: 100%;
    max-width: calc(var(--max) + 3rem);
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
}

.logo-container img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 8px 18px rgba(0, 0, 0, 0.35);
    transition: transform var(--transition), box-shadow var(--transition);
}

.logo-container:hover img {
    transform: translateY(-2px) rotate(-4deg);
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.5), 0 10px 24px rgba(34, 197, 94, 0.35);
}

.logo-container h1 {
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    white-space: nowrap;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav li {
    position: relative;
}

nav a {
    display: block;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-pill);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.93rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition), transform var(--transition);
}

nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
}

nav a.active {
    color: #03150b;
    background: var(--grad);
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.theme-toggle,
.mobile-menu-btn,
#toggleSidebar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.theme-toggle:hover,
.mobile-menu-btn:hover,
#toggleSidebar:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-2px);
}

.theme-toggle i {
    font-size: 1.02rem;
    transition: transform 0.45s var(--ease);
}

.theme-toggle:hover i {
    transform: rotate(24deg);
}

.mobile-menu-btn {
    display: none;
}

.mobile-menu-btn i {
    font-size: 1.1rem;
}

/* ---------- 主体 ---------- */
main {
    flex: 1;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.6rem 1.5rem 4.5rem;
    animation: pageIn 0.7s var(--ease) both;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- 页面标题 ---------- */
.page-header {
    max-width: 860px;
    margin: 0.4rem auto 2.8rem;
    text-align: center;
}

.page-header h1 {
    font-size: clamp(1.95rem, 4.2vw, 2.8rem);
    font-weight: 800;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-wrap: balance;
}

.page-header h2 {
    display: inline-block;
    margin: 0.85rem 0.25rem 0;
    padding: 0.32rem 0.95rem;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.page-header p {
    max-width: 720px;
    margin: 0.9rem auto 0;
    color: var(--text-light);
    font-size: 0.98rem;
}

.page-header::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    margin: 1.5rem auto 0;
    border-radius: 99px;
    background: var(--grad);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.5);
}

/* ---------- 内容卡片 ---------- */
.content-card,
.content-section {
    position: relative;
    padding: clamp(1.5rem, 3vw, 2.4rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.content-card::before,
.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--grad-cool);
    opacity: 0.9;
}

.content-card h2,
.content-section h2 {
    position: relative;
    margin-bottom: 1.2rem;
    padding-bottom: 0.7rem;
    font-size: 1.42rem;
    border-bottom: 1px solid var(--border);
}

.content-card h2::after,
.content-section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 56px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad);
}

.content-card h3 {
    position: relative;
    margin: 1.8rem 0 1rem;
    padding-left: 0.9rem;
    font-size: 1.18rem;
}

.content-card h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.32em;
    width: 4px;
    height: 1em;
    border-radius: 4px;
    background: var(--grad);
}

.content-card h2 i,
.content-section h2 i {
    margin-right: 0.45rem;
    color: var(--primary);
    font-size: 0.95em;
}

.content-card p,
.content-section p {
    color: var(--text-light);
}

.content-section {
    margin-bottom: 1.75rem;
}

.content-section > p {
    line-height: 1.85;
}

.content-section ul {
    margin: 1.1rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.content-section li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.95rem;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-light);
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.62rem;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: var(--primary-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

[data-theme="dark"] .feature-tag {
    color: #86efac;
}

.feature-image {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 2.4rem;
    margin-top: 2.4rem;
}

.feature-image img {
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-image img:hover {
    transform: scale(1.015);
    box-shadow: var(--shadow-lg);
}

.feature-text h2 {
    margin-bottom: 0.9rem;
    font-size: 1.5rem;
    color: var(--text);
}

.feature-text p {
    margin-bottom: 0.7rem;
}

/* ---------- 分隔线 ---------- */
hr {
    height: 1px;
    width: min(100%, 520px);
    margin: 1.6rem auto;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.divider {
    height: 1px;
    margin: 1.6rem 0;
    border: 0;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.35), transparent);
}

/* ---------- 首页 Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(4.5rem, 11vw, 8rem) 1.5rem;
    text-align: center;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    background-image:
        linear-gradient(120deg, rgba(5, 18, 12, 0.82) 0%, rgba(6, 16, 12, 0.55) 55%, rgba(8, 20, 28, 0.72) 100%),
        url('../images/background/hero-bg.png');
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 320px at 18% 18%, rgba(74, 222, 128, 0.22), transparent 70%),
        radial-gradient(520px 340px at 82% 78%, rgba(59, 130, 246, 0.18), transparent 70%);
    z-index: -1;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
    pointer-events: none;
}

.hero-text {
    display: inline-block;
    max-width: min(760px, 92%);
    padding: clamp(1.8rem, 4.5vw, 3.2rem) clamp(1.4rem, 4.5vw, 3.4rem);
    border-radius: 26px;
    background: rgba(7, 18, 13, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

.hero h1 {
    font-size: clamp(2rem, 5.2vw, 3.4rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    text-wrap: balance;
}

.hero h1::after {
    content: '';
    display: block;
    width: 74px;
    height: 4px;
    margin: 1.15rem auto 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #4ade80, #38bdf8);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.65);
}

.hero p {
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(0.95rem, 2vw, 1.12rem);
    letter-spacing: 0.02em;
}

/* ---------- 首页卡片 ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2.6rem 0 0.5rem;
}

.card {
    position: relative;
    overflow: hidden;
    padding: 2.2rem 1.8rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--grad-cool);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s var(--ease);
}

.card:hover {
    transform: translateY(-7px);
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: var(--shadow);
}

.card:hover::before {
    transform: scaleX(1);
}

.card > a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.card h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
    font-size: 1.28rem;
    color: var(--text);
}

.card h2 i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--primary-soft);
    border: 1px solid rgba(34, 197, 94, 0.22);
    color: var(--primary-strong);
    font-size: 1rem;
}

[data-theme="dark"] .card h2 i {
    color: #86efac;
}

.card p {
    margin: 0.25rem 0;
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.7;
}

.card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--grad);
    color: #04220f;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.35);
}

/* ---------- 页脚 ---------- */
footer {
    position: relative;
    margin-top: 1rem;
    padding: 3rem 1.5rem 2.6rem;
    background: var(--footer);
    color: rgba(255, 255, 255, 0.68);
    text-align: center;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.6), rgba(59, 130, 246, 0.5), transparent);
}

footer p {
    margin: 0.55rem 0;
    font-size: 0.93rem;
}

footer a {
    color: #7ee2a8;
    font-weight: 500;
    text-decoration: none;
}

footer a:hover {
    color: #a7f3c6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1.1rem;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.12rem;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.social-icons a:hover {
    transform: translateY(-4px);
    background: var(--grad);
    border-color: transparent;
    color: #04220f;
}

/* ---------- 返回顶部 ---------- */
#backToTop {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 90;
    display: none;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 15px;
    background: var(--grad);
    color: #04220f;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.4);
    transition: transform var(--transition), box-shadow var(--transition);
}

#backToTop:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(34, 197, 94, 0.5);
}

#backToTop i {
    font-size: 1.1rem;
}

/* ---------- 沫琪气泡 ---------- */
#mochiBubble {
    position: fixed;
    right: 1.5rem;
    bottom: 6rem;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    transition: transform var(--transition);
}

#mochiBubble:hover {
    transform: translateY(-3px);
}

#mochiAvatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(74, 222, 128, 0.85);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
    background: #101a14;
    transition: transform var(--transition);
}

#mochiAvatar:hover {
    transform: scale(1.08) rotate(6deg);
}

#mochiText {
    max-width: 240px;
    padding: 0.7rem 1rem;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.55;
    box-shadow: var(--shadow);
    position: relative;
}

#mochiText::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: translateY(-50%) rotate(45deg);
}

/* ---------- 滚动入场 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- 弹层提示 ---------- */
#toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    z-index: 2000;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-pill);
    background: rgba(10, 24, 16, 0.94);
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: #eafff2;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 14px);
    transition: opacity 0.3s ease, transform 0.3s var(--ease);
    white-space: nowrap;
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    nav {
        gap: 1rem;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        margin: 0;
        padding: 0.7rem 1rem 1.1rem;
        background: #0a1710;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 24px 40px rgba(2, 10, 6, 0.45);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0.25s;
    }

    nav ul.show {
        display: flex;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    nav ul a {
        padding: 0.75rem 1rem;
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.85);
        font-size: 0.98rem;
    }

    nav ul a:hover {
        transform: none;
    }

    nav ul a.active {
        background: rgba(34, 197, 94, 0.16);
        color: #86efac;
        box-shadow: none;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 64px;
    }

    nav {
        padding: 0.68rem 1rem;
        gap: 0.8rem;
    }

    .logo-container img {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    .logo-container h1 {
        font-size: 1.12rem;
    }

    .theme-toggle,
    .mobile-menu-btn,
    #toggleSidebar {
        width: 38px;
        height: 38px;
    }

    main {
        padding: 1.8rem 1rem 3.4rem;
    }

    .page-header {
        margin-bottom: 2rem;
    }

    .page-header h1 {
        font-size: clamp(1.7rem, 7vw, 2.1rem);
    }

    .feature-image {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    footer {
        padding: 2.5rem 1rem 2.2rem;
    }

    .social-icons {
        gap: 0.6rem;
    }

    .social-icons a {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    #backToTop {
        right: 1rem;
        bottom: 1rem;
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    #mochiBubble {
        right: 1rem;
        bottom: 5rem;
    }

    #mochiAvatar {
        width: 48px;
        height: 48px;
    }

    #mochiText {
        max-width: 170px;
        font-size: 0.8rem;
        padding: 0.6rem 0.85rem;
    }

    .content-card,
    .content-section {
        padding: 1.35rem 1.15rem;
        border-radius: 18px;
    }

    .card {
        padding: 1.8rem 1.35rem;
    }

    .hero {
        border-radius: 22px;
    }

    .hero h1 {
        font-size: clamp(1.4rem, 5.2vw, 1.85rem);
    }

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

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.6rem;
    }

    .hero-text {
        padding: 1.5rem 1.1rem;
        border-radius: 20px;
    }

    .features {
        gap: 1.1rem;
    }
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
