@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700;900&display=swap');

:root {
    --primary: #3a5670;
    --primary-light: #6b8aab;
    --primary-glow: rgba(58, 86, 112, 0.12);
    --accent: #c4903a;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 4px 10px -6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.15);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --switch-bg: #e2e8f0;
    --switch-dot: #fff;
    --switch-icon: '☀️';
}
body.dark {
    --primary: #b8c4d4;
    --primary-light: #d4dce4;
    --primary-glow: rgba(184, 196, 212, 0.12);
    --accent: #e8eef5;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --bg: #0b1120;
    --bg-alt: #1a2332;
    --border: #2d3a4a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.5);
    --switch-bg: #334155;
    --switch-dot: #d0d7e2;
    --switch-icon: '🌙';
}
/* Dark mode overrides */
body.dark { background: var(--bg); color: var(--text); }
body.dark nav { background: rgba(11,17,32,0.88); }
body.dark .hero {
    background:
        radial-gradient(ellipse at center,
            rgba(5, 10, 24, 0.35) 0%,
            rgba(5, 10, 24, 0.20) 30%,
            rgba(5, 10, 24, 0.05) 60%,
            rgba(5, 10, 24, 0.30) 100%
        ),
        url("moon-night.jpg") center/cover no-repeat;
    background-color: #050a18;
}
body.dark .hero::before {
    background: radial-gradient(ellipse at 50% 50%, transparent 0%, rgba(5,10,24,0.15) 100%);
}
body.dark .greeting,
body.dark .tagline {
    color: rgba(220, 226, 232, 0.85);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}
body.dark .intro {
    color: rgba(220, 226, 232, 0.7);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}
body.dark .hero h1 {
    background: linear-gradient(180deg, #ffffff 0%, #e8eef5 40%, #b8c4d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
body.dark .intro::before {
    background: linear-gradient(90deg, transparent, rgba(200, 215, 230, 0.7) 50%, transparent);
    box-shadow: 0 0 12px rgba(200, 215, 230, 0.4);
}
body.dark .about-card, body.dark .blog-card, body.dark .game-card, body.dark .comment-item, body.dark .comment-form-wrap { background: var(--bg-alt); }
body.dark .comment-input, body.dark .comment-submit-btn, body.dark .editor-content, body.dark .editor-title, body.dark .editor-tags {
    background: var(--bg); color: var(--text); border-color: var(--border);
}
body.dark .modal-box, body.dark .crop-box { background: var(--bg-alt); }
body.dark .comment-body code { background: #1e293b; color: #e2e8f0; }
body.dark .game-card { background: var(--bg-alt); }
body.dark footer { border-color: var(--border); }
body.dark .comments-section { color: var(--text); }
body.dark .blog-write-btn { background: var(--primary); }
body.dark .tag { background: rgba(184, 196, 212, 0.15); color: #d4dce4; }
body.dark .blog-card-summary { color: var(--text-light); }
body.dark input, body.dark textarea { color: var(--text); }
body.dark input::placeholder, body.dark textarea::placeholder { color: #475569; }
body.dark .toast { background: #1e293b; color: #e2e8f0; }
body.dark .write-page { background: var(--bg); }
body.dark .write-editor-wrap { background: transparent; }
body.dark .write-content, body.dark .write-title, body.dark .write-tags { background: transparent; color: var(--text); }
body.dark .write-tags { background: var(--bg-alt); }
body.dark .write-toolbar { border-color: var(--border); }
body.dark .tb-btn:hover { background: var(--bg-alt); }
body.dark .tool-btn { background: var(--bg-alt); color: var(--text); }
body.dark .tool-btn:hover { background: var(--bg); }
body.dark .write-preview blockquote { background: var(--bg-alt); }
body.dark .write-preview code { background: var(--bg-alt); color: #f87171; }
body.dark .game-cover { opacity: 0.8; }
body.dark .upload-box { background: var(--bg); }
/* Theme toggle */
.theme-toggle {
    background: none; border: none; font-size: 1.1rem; cursor: pointer;
    padding: 4px 8px; border-radius: 6px; transition: background 0.15s;
    margin-left: 0.5rem; line-height: 1;
}
.theme-toggle:hover { background: var(--bg-alt); }

/* Language Switcher */
.lang-switcher {
    display: inline-flex;
    gap: 2px;
    margin: 0 0.3rem;
}
.lang-btn {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 2px 6px;
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 3px;
    font-weight: 500;
    transition: all 0.15s;
}
.lang-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 页面淡入 */
body {
  animation: pageIn 0.5s ease;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    z-index: 100;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links { display: flex; gap: 1.8rem; align-items: center; }
.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0;
    position: relative;
    transition: color 0.2s;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: width 0.25s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a:hover,
.nav-links a.active { color: var(--primary); }

/* Hero — light mode: 雪山 + 深墨字 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    background:
        radial-gradient(ellipse at center,
            rgba(255, 255, 255, 0.20) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            rgba(0, 0, 0, 0.15) 80%,
            rgba(0, 0, 0, 0.30) 100%
        ),
        url("mountain.jpg") center/cover no-repeat;
    background-color: #dce3ea;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.20) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.20) 100%);
    pointer-events: none;
}

/* -- 蜡笔小新 · 右下角悬浮陪伴（固定定位，不抢 Hero） -- */
.shinchan-float {
    position: fixed;
    right: clamp(14px, 2vw, 30px);
    bottom: clamp(14px, 2vw, 30px);
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    animation: floatBob 3.6s ease-in-out infinite;
}
.shinchan-float .shinchan { pointer-events: auto; }
@keyframes floatBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}
.shinchan { position: relative; width: clamp(92px, 9vw, 118px); }
.shinchan img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 14px 34px rgba(58,86,112,0.28);
}
.shinchan canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mascot-tip {
    font-size: 0.72rem;
    color: #fff;
    background: rgba(58,86,112,0.92);
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(58,86,112,0.35);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.shinchan-float:hover .mascot-tip { opacity: 1; transform: translateY(0); }
.shinchan.shake { animation: shinchanShake 0.5s ease; }
@keyframes shinchanShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-5px) rotate(-3deg); }
  50% { transform: translateX(5px) rotate(3deg); }
  75% { transform: translateX(-4px) rotate(-2deg); }
}
@media (max-width: 860px) {
    .hero { flex-direction: column; }
    .hero-content { order: 1; }
    .shinchan-float { right: 10px; bottom: 10px; }
    .shinchan { width: 84px; }
}

.greeting {
    font-size: 1.1rem;
    color: rgba(30, 43, 56, 0.90);
    margin-bottom: 0.5rem;
    letter-spacing: 0.18em;
    font-weight: 500;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(170deg, #1e2b38 0%, #3a5670 50%, #4a6a85 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.tagline {
    font-size: 1.15rem;
    color: rgba(30, 43, 56, 0.85);
    margin-bottom: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
}

.hero h1, .hero .greeting, .hero .tagline, .hero .intro {
    font-family: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', serif;
}
.intro {
    font-size: 1.1rem;
    color: rgba(40, 55, 72, 0.85);
    max-width: 480px;
    margin: 0.7rem auto 0;
    font-style: italic;
    letter-spacing: 0.18em;
    font-weight: 600;
}
.intro::before {
    content: '';
    display: block;
    width: 30px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(58,86,112,0.65) 30%, rgba(74,106,133,0.65) 70%, transparent);
    margin: 0 auto 0.6rem;
    border-radius: 1px;
}

/* About */
.about, .skills, .contact { padding: 5rem 2rem; }
.about h2, .skills h2, .contact h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--text);
    letter-spacing: -0.01em;
}
.about h2::after, .skills h2::after, .contact h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    margin: 0.6rem auto 0;
}

.about-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.about-card > p {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.info-item {
    text-align: center;
    padding: 1.3rem 0.8rem;
    border-radius: 12px;
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
    cursor: default;
}

.info-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(58,86,112,0.10);
    background: var(--bg);
}

.info-item .label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.info-item .value {
    font-weight: 600;
    color: var(--text);
    font-family: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', serif;
    font-size: 0.95rem;
}

/* Skills */
.skills {
    background: var(--bg-alt);
}

.skill-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.skill-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.skill-icon { font-size: 2.8rem; margin-bottom: 0.8rem; }
.skill-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; color: var(--text); font-weight: 700; }
.skill-card p { font-size: 0.85rem; color: var(--text-light); line-height: 1.6; }

/* Contact */
.contact { background: var(--bg-alt); }
.contact-intro { text-align: center; color: var(--text-light); margin-bottom: 2rem; font-size: 1rem; }

.contact-btn {
    display: inline-block;
    padding: 0.8rem 2.2rem;
    background: linear-gradient(135deg, var(--primary), #3a5670);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(58,86,112,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58,86,112,0.4);
    opacity: 0.95;
}

.thanks-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 1.5rem;
    font-style: italic;
}

/* Quote Marquee */
.quote-marquee {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.quote-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    color: #fff;
    background: var(--primary);
    border-radius: 3px;
    white-space: nowrap;
    letter-spacing: 0.08em;
}
.quote-track {
    display: inline-block;
    padding: 0.6rem 0 0.6rem 5.5rem;
    animation: marquee-scroll 130s linear infinite;
}
.quote-item {
    color: var(--text-light);
    font-size: 0.92rem;
    letter-spacing: 0.05em;
    padding: 0 0.3rem;
}
.quote-sep {
    color: var(--border);
    padding: 0 0.6rem;
    font-size: 0.7rem;
    vertical-align: middle;
    opacity: 0.6;
}
@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.quote-marquee:hover .quote-track {
    animation-play-state: paused;
}

/* Leaderboard Section */
.leaderboard-section {
    padding: 4rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}
.leaderboard-section h2 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 2rem;
}
.lb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.lb-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
}
.lb-game-title {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--text);
}
.lb-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.lb-row:last-child {
    border-bottom: none;
}
.lb-rank {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}
.lb-name {
    flex: 1;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-score {
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}
.lb-placeholder {
    text-align: center;
    color: var(--text-light);
    grid-column: 1 / -1;
    padding: 2rem;
}
.lb-medal {
    font-size: 0.8rem;
    margin-right: 1px;
}
.lb-row-fold {
    display: none;
}
.lb-card.lb-expanded .lb-row-fold {
    display: flex;
}
.lb-expand-btn {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.35rem 0;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.lb-expand-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}
.lb-placeholder a {
    color: var(--primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

/* Mobile */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 1rem;
    }

    .about, .skills, .contact {
        padding: 3rem 1.5rem;
    }

    .lb-grid {
        grid-template-columns: 1fr;
    }
    .leaderboard-section {
        padding: 3rem 1rem;
    }
    .quote-item {
        font-size: 0.82rem;
    }
    .quote-label {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
        margin-left: 0.5rem;
    }
}

/* ===== Blog ===== */
.blog-page {
    padding: 6rem 2rem 4rem;
    min-height: 80vh;
}

.blog-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.blog-write-btn {
    margin-top: 1rem;
    padding: 0.55rem 1.6rem;
    background: linear-gradient(135deg, var(--primary), #3a5670);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(58,86,112,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.blog-write-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(58,86,112,0.4); }

/* 用户文章标记 */
.article-user { color: var(--primary); }

/* 发文编辑器 */
.editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInBg 0.2s ease;
}

.editor-box {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 600px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slideUp 0.25s ease;
}

.editor-box h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.editor-title {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: inherit;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.editor-title:focus, .editor-tags:focus, .editor-content:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58,86,112,0.1);
}

.editor-tags {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 0.75rem;
}

.editor-content {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    min-height: 200px;
}

.blog-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.blog-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.blog-list {
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-del-btn {
    position: absolute; top: 10px; right: 10px; width: 26px; height: 26px;
    border-radius: 50%; background: rgba(229,62,62,0.12); color: #e53e3e;
    border: none; font-size: 13px; cursor: pointer; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.blog-del-btn:hover { background: rgba(229,62,62,0.25); }
.blog-card { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow-sm); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-card-user { border-left: 3px solid var(--primary); }

.blog-card-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.tag { display: inline-block; padding: 0.2rem 0.65rem; background: rgba(58,86,112,0.07); color: var(--primary); border-radius: 20px; font-size: 0.75rem; font-weight: 600; }

.blog-card h2 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.blog-card h2 a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.blog-card h2 a:hover { color: var(--primary); }
.blog-card time { color: var(--text-light); font-size: 0.8rem; display: inline; }
.blog-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.blog-author { color: var(--primary); font-size: 0.8rem; font-weight: 600; }
.blog-card-summary { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.6rem; line-height: 1.6; }
.read-more { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.read-more:hover { color: var(--primary-light); }

/* ===== Article Detail ===== */
.article-page {
    max-width: 750px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
}

.article-not-found {
    text-align: center;
    padding: 6rem 2rem;
}

.article-not-found h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.article-not-found a {
    color: var(--primary);
    text-decoration: none;
}

.article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.article-del-btn {
    float: right;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    margin-top: -2rem;
}

.article-del-btn:hover { opacity: 1; color: #e53e3e; border-color: #e53e3e; }

.article-header time {
    color: var(--text-light);
    font-size: 0.95rem;
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
}

.article-body h3 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
    color: var(--text);
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body ul,
.article-body ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body strong {
    color: var(--text);
}

.article-body em {
    color: var(--primary);
}

.article-back {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.article-back a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.article-back a:hover {
    text-decoration: underline;
}

/* ===== Like ===== */
.article-interactions {
    max-width: 750px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.like-section {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--bg);
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.like-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.like-btn.liked {
    border-color: var(--primary);
    background: #edf1f5;
    color: var(--primary);
}

.like-icon {
    font-size: 1.2rem;
}

.like-count {
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

.like-btn.liked .like-count {
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ===== Comments ===== */
.comments-section {
    max-width: 750px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

.comments-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    color: var(--text);
}

/* 评论表单 */
.comment-form-wrap {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.comment-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.comment-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58,86,112,0.1);
}

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.comment-md-hint {
    font-size: 0.8rem;
    color: var(--text-light);
}

.comment-submit-btn {
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.comment-submit-btn:hover {
    background: var(--primary-light);
}

.comment-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.comment-error {
    color: #e53e3e;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* 加载中 */
.comments-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

/* 评论列表 */
.comment-pending {
    opacity: 0.6;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 0.6; transform: translateY(0); }
}

.comment-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 0.75rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-avatar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.comment-author-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.comment-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    word-break: break-word;
}

.comment-body code {
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.comments-empty {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-size: 0.95rem;
}

/* 评论操作按钮 */
.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.comment-action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    padding: 0.2rem 0;
    transition: color 0.15s;
}

.comment-action-btn:hover { color: var(--primary); }
.comment-action-btn.liked { color: var(--primary); font-weight: 600; }

/* 回复区 */
.comment-replies {
    margin-top: 0.6rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.comment-reply-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.comment-reply-content {
    flex: 1;
    line-height: 1.5;
    color: var(--text);
    word-break: break-word;
}

.comment-reply-actions {
    flex-shrink: 0;
}

.comment-reply-actions-inline {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.comment-replies-more {
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.3rem 0;
    user-select: none;
}

.comment-replies-more:hover { text-decoration: underline; }

/* 回复表单 */
.comment-reply-form {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.comment-input-sm {
    min-height: 50px;
    font-size: 0.9rem;
}

.comment-submit-sm {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
}

.comment-avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.comments-error {
    text-align: center;
    color: #e53e3e;
    padding: 1rem;
}

/* ===== 用户系统 ===== */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.user-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.avt-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.avt-preview-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.avt-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-avt-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-avt-actions {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.modal-avt-btn {
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text);
    width: fit-content;
}

.modal-avt-del {
    padding: 0.35rem 0.9rem;
    border: none;
    background: none;
    color: #e53e3e;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    margin-left: 0;
    width: fit-content;
}

/* 裁剪对话框 */
.crop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInBg 0.2s ease;
}

.crop-box {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 90vw;
}

.crop-box h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.crop-area {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    position: relative;
    cursor: move;
    border-radius: 50%;
    overflow: hidden;
    background: #1a1a2e;
    user-select: none;
    -webkit-user-select: none;
}

.crop-area canvas {
    display: block;
}

.crop-btns {
    margin-top: 1rem;
}

.user-name {
    color: var(--text);
    font-weight: 500;
}

.user-logout {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}

.user-logout:hover { color: #e53e3e; }

.user-login-btn {
    padding: 0.35rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.user-login-btn:hover { background: var(--primary-light); }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeInBg 0.2s ease;
}

@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: slideUp 0.25s ease;
}

.reg-modal-box {
    width: 420px;
}

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

.modal-box h3 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

.modal-hint {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.modal-input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-btns {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.modal-btn-cancel {
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

.modal-btn-ok {
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-btn-ok:hover { background: var(--primary-light); }

/* ============================================
   UX ENHANCEMENTS - 全局操作手感优化
   ============================================ */

/* -- Smooth Theme Transition -- */
body, body *, nav, .hero, .blog-card, .skill-card, .game-card, .about-card,
.lb-card, .comment-item, .comment-form-wrap, .modal-box, .crop-box, .editor-box,
.upload-box, .tag, .blog-write-btn, .contact-btn, .game-play-btn, .modal-btn-ok,
.tb-btn-publish, .gallery-upload-btn, .like-btn, .comment-submit-btn,
.comment-action-btn, .user-login-btn, .user-logout, .theme-toggle, .lang-btn,
input, textarea, .editor-title, .editor-content, .editor-tags {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease,
              box-shadow 0.3s ease, opacity 0.2s ease, transform 0.2s ease;
}

/* -- Global Active: Button press feedback -- */
button:active:not(:disabled),
a.contact-btn:active,
a.game-play-btn:active {
  transform: scale(0.96);
}

.blog-card:active { transform: scale(0.985); }

/* -- Ripple Effect -- */
.contact-btn, .blog-write-btn, .game-play-btn, .modal-btn-ok, .tb-btn-publish,
.gallery-upload-btn, .comment-submit-btn, .like-btn, .user-login-btn {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* -- Back to Top Button -- */
#backToTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 16px rgba(58,86,112,0.35);
  opacity: 0;
  transform: translateY(16px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#backToTop.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#backToTop:hover { background: var(--primary-light); transform: translateY(-2px) scale(1.05); }
#backToTop:active { transform: scale(0.9); }

/* -- Toast Notification -- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  font-family: inherit;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }

/* -- Scrolllocked Body -- */
body.scroll-locked { overflow: hidden; padding-right: var(--scrollbar-width, 0px); }

/* -- Nav Scroll Shadow -- */
nav {
  transition: box-shadow 0.3s ease;
}
nav.scrolled {
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}
body.dark nav.scrolled {
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

/* -- Scroll Reveal Animations -- */
.reveal-init {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay for grids */
.skill-card:nth-child(1) { transition-delay: 0.05s; }
.skill-card:nth-child(2) { transition-delay: 0.1s; }
.skill-card:nth-child(3) { transition-delay: 0.15s; }
.skill-card:nth-child(4) { transition-delay: 0.2s; }
.skill-card:nth-child(5) { transition-delay: 0.25s; }
.skill-card:nth-child(6) { transition-delay: 0.3s; }

/* -- Card Hover Lift -- */
.blog-card, .skill-card, .game-card, .about-card, .lb-card, .ta-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.blog-card:hover, .lb-card:hover, .ta-card:hover {
  transform: translateY(-2px);
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

/* -- Hero Entrance Animation -- */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(48px) scale(0.96); filter: blur(10px); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0); }
}
@keyframes heroBgZoom {
  from { background-size: 125%; opacity: 0.6; }
  to   { background-size: 100%; opacity: 1;   }
}
@keyframes heroMaskOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
/* 加载遮罩：图片未就绪时盖住裸背景 */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #cdd5de 0%, #dce3ea 40%, #c5cfd9 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }
.hero-animate {
  animation: heroBgZoom 3s ease-out;
  background-size: 100%;
}
.hero-animate::after {
  animation: heroMaskOut 0.5s 0.8s ease-out both;
}
.hero-animate .greeting { animation: heroFadeUp 1s 0.6s ease-out both; }
.hero-animate h1        { animation: heroFadeUp 1s 0.85s ease-out both; }
.hero-animate .intro    { animation: heroFadeUp 1s 1.15s ease-out both; }

/* 键盘提示 */
.piano-hint {
  position: fixed; top: 76px; left: 24px; z-index: 90;
  font-size: 0.75rem; color: var(--text-light); opacity: 0.6;
  font-family: 'Noto Serif SC', serif; letter-spacing: 0.05em;
  pointer-events: none;
}

/* -- Consistent Cursor -- */
button, a, .tag-pill, .comment-replies-more, .gallery-item, .like-btn,
[onclick]:not(input):not(textarea), .lb-card ol li, .game-play-btn,
.lightbox-close, .crop-area, #musicTgl {
  cursor: pointer;
}
input[type="text"], input[type="file"], textarea, [contenteditable] {
  cursor: text;
}

/* -- User Select Protection -- */
nav, button, .logo, .tag, .blog-card-tags, .article-tags, .tag-pill,
.game-cover, .lb-rank, .comment-actions, .like-section, .nav-links,
.toolbar-group, .toolbar-actions, footer, .crop-area {
  user-select: none;
  -webkit-user-select: none;
}

/* -- Focus Visible Ring -- */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible) {
  outline: none;
}

/* -- Loading Spinner for Buttons -- */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* -- Form Shake on Error -- */
.shake {
  animation: shake-anim 0.4s ease;
}
@keyframes shake-anim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* -- Like Button Heart Burst -- */
.like-btn.liked {
  animation: like-pop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes like-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* -- Comment Reply Toggle Smooth -- */
.comment-replies-all {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease;
}
.comment-reply-form {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

/* -- Lightbox zoom transition -- */
.lightbox { opacity: 0; transition: opacity 0.3s ease; }
.lightbox.active { opacity: 1; }
.lightbox img {
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.lightbox.active img { transform: scale(1); }

/* -- Modal/overlay animation consistency -- */
.editor-overlay, .modal-overlay, .crop-overlay, .upload-overlay {
  animation: fadeInBg 0.25s ease;
}
.editor-box, .modal-box, .crop-box, .upload-box {
  animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* -- Mobile Touch Areas -- */
@media (max-width: 768px) {
  button, a.game-play-btn, .tag-pill, .contact-btn, .comment-action-btn {
    min-height: 44px;
    min-width: 44px;
  }
  .nav-links a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  #backToTop {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .toast {
    bottom: 70px;
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
  }
}

/* -- Selection Color -- */
::selection {
  background: rgba(58, 86, 112, 0.2);
  color: var(--text);
}
::-moz-selection {
  background: rgba(58, 86, 112, 0.2);
  color: var(--text);
}

/* -- Scrollbar Styling -- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* -- Custom Confirm Dialog -- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInBg 0.2s ease;
}
.confirm-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 2rem;
  max-width: 380px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}
.confirm-msg {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1.2rem;
  line-height: 1.6;
  text-align: center;
}

/* -- HUD Clock Blink -- */
#hudTime blink {
  animation: hud-blink 1s step-end infinite;
}
@keyframes hud-blink {
  50% { opacity: 0; }
}

/* -- Leaf Canvas -- */
#leafCanvas { transition: opacity 0.5s ease; }

@media (max-width: 768px) {
  #hudClock {
    top: 10px;
    right: 10px;
    font-size: 11px;
    padding: 4px 10px;
  }
}
