/* ---------- CSS 变量 (主题控制) ---------- */
:root {
    /* 默认暗色主题 — 米色文字明度增强 */
    --bg-primary: #1a1029;
    --bg-secondary: rgba(30, 18, 50, 0.75);
    --text-primary: #faf0e4;
    --text-secondary: #e6dccf;
    --text-muted: #c8bcaa;
    --card-bg: rgba(45, 30, 70, 0.4);
    --card-border: rgba(255, 255, 255, 0.03);
    --shadow-color: rgba(0, 0, 0, 0.7);
    --nav-link: #d0dce8;
    --nav-link-hover: #b2e6f0;
    --brand-gradient: linear-gradient(135deg, #b8e2f0, #80d0e0);
    --tile-bg: rgba(50, 35, 80, 0.35);
    --tile-hover: rgba(60, 40, 100, 0.5);
    --tile-border: rgba(255, 255, 255, 0.02);
    --tile-icon: #7acfd6;
    --accent: #6fcbd6;
    --footer-color: #9ab0c0;
    --input-bg: transparent;
}

/* 亮色主题 */
[data-theme="light"] {
    --bg-primary: #faf0e6;
    --bg-secondary: rgba(255, 248, 240, 0.85);
    --text-primary: #1a1a1a;
    --text-secondary: #3a3a3a;
    --text-muted: #5a5a5a;
    --card-bg: rgba(255, 248, 240, 0.75);
    --card-border: rgba(0, 0, 0, 0.06);
    --shadow-color: rgba(0, 0, 0, 0.15);
    --nav-link: #3a3a3a;
    --nav-link-hover: #1a1a1a;
    --brand-gradient: linear-gradient(135deg, #4a7a8a, #2a5a6a);
    --tile-bg: rgba(255, 248, 240, 0.6);
    --tile-hover: rgba(255, 248, 240, 0.9);
    --tile-border: rgba(0, 0, 0, 0.06);
    --tile-icon: #3a7a8a;
    --accent: #3a8a9a;
    --footer-color: #6a6a6a;
    --input-bg: rgba(255, 255, 255, 0.5);
}

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

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    transition: background 0.3s ease, color 0.3s ease;
}

/* 主容器 */
.container {
    max-width: 1100px;
    width: 100%;
    background: var(--bg-secondary);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 48px 48px 32px 32px;
    padding: 2rem 2.5rem 1.5rem;
    box-shadow: 0 25px 50px -10px var(--shadow-color),
        inset 0 1px 2px rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    flex: 1;
    transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
}

/* ---------- 导航栏 ---------- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(160, 200, 255, 0.08);
    margin-bottom: 2.2rem;
}

.nav-brand {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(100, 210, 230, 0.15);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    font-weight: 500;
}

.nav-links a {
    color: var(--nav-link);
    text-decoration: none;
    font-size: 1.05rem;
    padding: 0.4rem 0.2rem;
    border-bottom: 2px solid transparent;
    transition: 0.25s ease;
    letter-spacing: 0.3px;
}

.nav-links a:hover {
    color: var(--nav-link-hover);
    border-bottom-color: var(--accent);
}

.nav-links a:last-child {
    background: rgba(90, 200, 210, 0.12);
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    border: 1px solid rgba(90, 200, 210, 0.2);
    border-bottom: none;
}

.nav-links a:last-child:hover {
    background: rgba(90, 200, 210, 0.22);
    border-color: var(--accent);
    color: #fff;
}

/* 主题切换按钮 */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--tile-bg);
    padding: 0.3rem 0.5rem;
    border-radius: 40px;
    border: 1px solid var(--card-border);
}

.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.3rem 0.5rem;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
}

.theme-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.theme-btn.active {
    color: var(--accent);
    background: rgba(90, 200, 210, 0.12);
}

/* ---------- 主体内容 ---------- */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2.8rem;
    margin: 1.2rem 0 2.8rem;
}

.hero-left {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    background: #2a1a3f;
    box-shadow: 0 10px 30px -8px var(--shadow-color),
        0 0 0 2px rgba(130, 210, 220, 0.15);
    transition: 0.3s;
}

.avatar:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px -6px var(--shadow-color),
        0 0 0 3px rgba(130, 210, 220, 0.25);
}

.nickname {
    font-size: 3.2rem;
    font-weight: 700;
    margin: 0.8rem 0 0.2rem;
    letter-spacing: -0.5px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-secondary);
    background: rgba(70, 180, 200, 0.08);
    padding: 0.3rem 1.6rem;
    border-radius: 60px;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(100, 200, 210, 0.08);
    display: inline-block;
    margin-top: 0.1rem;
}

.hero-right {
    flex: 2 1 300px;
    background: var(--card-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 36px;
    padding: 2rem 2.2rem;
    border: 1px solid var(--card-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02),
        0 12px 28px -12px var(--shadow-color);
    transition: background 0.3s, border-color 0.3s;
}

.hero-right h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-right h2 i {
    color: var(--accent);
    font-size: 1.2rem;
}

.hero-right p {
    color: var(--text-secondary);
    font-size: 1.08rem;
    line-height: 1.7;
    margin-bottom: 0.2rem;
    font-weight: 350;
}

.hero-right .highlight {
    color: var(--accent);
    font-weight: 450;
}

/* ---------- 磁贴 & 随笔 ---------- */
.tiles-section {
    margin: 2.8rem 0 2rem;
}

.section-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(130, 200, 210, 0.2), transparent);
}

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.5rem;
}

.tile {
    background: var(--tile-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 28px;
    padding: 1.6rem 1.2rem 1.4rem;
    border: 1px solid var(--tile-border);
    box-shadow: 0 6px 16px -6px var(--shadow-color);
    transition: all 0.25s ease;
    text-align: center;
    cursor: default;
}

.tile:hover {
    transform: translateY(-4px);
    background: var(--tile-hover);
    border-color: rgba(130, 210, 220, 0.12);
    box-shadow: 0 14px 28px -12px var(--shadow-color);
}

.tile i {
    font-size: 2.2rem;
    color: var(--tile-icon);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.tile .tile-title {
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.tile .tile-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.4;
}

/* ---------- 随笔 ---------- */
.essays {
    margin-top: 2.5rem;
}

.essay-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.essay-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--tile-bg);
    padding: 0.8rem 1.5rem;
    border-radius: 40px;
    border: 1px solid var(--tile-border);
    transition: 0.2s;
    color: var(--text-secondary);
    text-decoration: none;
}

.essay-item:hover {
    background: var(--tile-hover);
    color: var(--text-primary);
    border-color: var(--accent);
    transform: translateX(6px);
}

.essay-item .essay-title {
    font-weight: 500;
    font-size: 1.05rem;
}

.essay-item .essay-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- 社交 ---------- */
.social-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.8rem;
    margin: 2.6rem 0 1.8rem;
    padding: 0.6rem 0;
}

.social-bar a {
    color: var(--text-muted);
    font-size: 2rem;
    transition: 0.25s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 30px;
    background: var(--tile-bg);
    backdrop-filter: blur(2px);
    border: 1px solid var(--tile-border);
    text-decoration: none;
}

.social-bar a:hover {
    color: var(--accent);
    background: var(--tile-hover);
    transform: translateY(-3px);
    border-color: var(--accent);
}

/* ---------- 页脚 ---------- */
.footer {
    text-align: center;
    font-size: 0.95rem;
    color: var(--footer-color);
    padding: 1.2rem 0 0.4rem;
    border-top: 1px solid rgba(160, 200, 220, 0.04);
    letter-spacing: 0.5px;
}

.footer span {
    color: var(--accent);
}

/* ---------- 响应式 ---------- */
@media (max-width: 780px) {
    .container {
        padding: 1.5rem 1.2rem 1rem;
        border-radius: 32px;
    }
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    .nav-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .nav-links {
        flex-wrap: wrap;
        gap: 1rem 1.5rem;
    }
    .nav-links a:last-child {
        padding: 0.2rem 1rem;
    }
    .theme-switcher {
        order: 2;
    }
    .hero {
        flex-direction: column;
        align-items: center;
        gap: 1.6rem;
    }
    .hero-right {
        width: 100%;
        padding: 1.5rem 1.2rem;
    }
    .nickname {
        font-size: 2.6rem;
    }
    .avatar {
        width: 120px;
        height: 120px;
    }
    .tiles-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
    }
    .social-bar a {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }
}

@media (max-width: 460px) {
    .container {
        padding: 1rem 0.8rem 0.8rem;
        border-radius: 24px;
    }
    .nav-brand {
        font-size: 1.6rem;
    }
    .nav-links {
        gap: 0.8rem 1.2rem;
    }
    .nav-links a {
        font-size: 0.95rem;
    }
    .nickname {
        font-size: 2.2rem;
    }
    .tagline {
        font-size: 1rem;
        padding: 0.2rem 1.2rem;
    }
    .hero-right p {
        font-size: 0.98rem;
    }
    .tiles-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    .tile {
        padding: 1.2rem 0.8rem;
    }
    .tile i {
        font-size: 1.8rem;
    }
    .essay-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        padding: 0.8rem 1rem;
    }
}