/* ============================================================
   极简日式浅色主题
   - 米白纸感底 + 衬线大标题 + 细线分割 + 莫兰迪色图标
   - 默认浅色,支持暗色模式(.dark-mode)
   ============================================================ */

:root {
    --bg-base: #faf7f2;
    --bg-soft: #f3ede3;
    --bg-card: #ffffff;
    --bg-card-hover: #fcfaf6;

    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-muted: #9a9a9a;

    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-default: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.18);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.04);

    --accent: #1e3a5f;        /* 藏青 */
    --accent-soft: #e8eef5;   /* 藏青浅底 */
    --highlight: #c8553d;     /* 朱红点睛 */

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
    --font-sans: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.dark-mode {
    --bg-base: #18181c;
    --bg-soft: #1e1e24;
    --bg-card: #232329;
    --bg-card-hover: #2a2a32;

    --text-primary: #ececec;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);

    --accent: #8ab4d8;
    --accent-soft: rgba(138, 180, 216, 0.14);
    --highlight: #d47b6b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    min-height: 100vh;
    color: var(--text-primary);
    background: var(--bg-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.4s ease, color 0.4s ease;
    position: relative;
}

/* 顶部极淡渐变(纸感氛围) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-base) 35%, var(--bg-base) 100%);
    pointer-events: none;
}

/* 极淡的纸纹噪点 */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 1.5rem 3rem;
    position: relative;
}

/* glass 类在新主题下退化为普通卡片(由各 section 自身样式接管) */
.glass { background: var(--bg-card); }

/* ---------- Hero 区 ---------- */
.hero-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* 顶部细线装饰 */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2.5rem;
    right: 2.5rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.theme-toggle-wrapper {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(15deg);
}

.theme-toggle i {
    position: absolute;
    transition: var(--transition);
    font-size: 0.95rem;
}

.sun-icon { opacity: 1; transform: translateY(0) rotate(0); }
.moon-icon { opacity: 0; transform: translateY(20px) rotate(-90deg); }
.dark-mode .sun-icon { opacity: 0; transform: translateY(-20px) rotate(90deg); }
.dark-mode .moon-icon { opacity: 1; transform: translateY(0) rotate(0); }

.profile-area {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    margin-bottom: 2rem;
}

.avatar-ring {
    position: relative;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
}

/* 去掉渐变旋转光环,改为静态细环 */
.avatar-glow { display: none; }

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 1px var(--border-default), var(--shadow-sm);
}

.status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: var(--highlight);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    z-index: 2;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 85, 61, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(200, 85, 61, 0); }
}

.greeting-block {
    flex: 1;
    min-width: 0;
}

.greeting-text {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.greeting-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ---------- 统计行 ---------- */
.stats-row {
    display: flex;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border-subtle);
}

/* ---------- 导航区 ---------- */
.nav-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.section-title i {
    color: var(--accent);
    font-size: 0.95rem;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 0.75rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    background: var(--bg-card-hover);
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.nav-link:hover::before { opacity: 1; }

.nav-link:hover {
    transform: translateY(-3px);
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.nav-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-subtle);
}

.nav-link:hover .nav-icon {
    transform: scale(1.06);
    box-shadow: var(--shadow-sm);
}

/* 莫兰迪色系:低饱和柔和底色 */
.icon-blue   { background: #e8eef5; color: #4a6a8a; }
.icon-purple { background: #ece8f2; color: #6a5a8a; }
.icon-pink   { background: #f5e8ea; color: #a05a6a; }
.icon-green  { background: #e8f0ea; color: #4a7a5a; }
.icon-orange { background: #f5ede0; color: #a07a4a; }
.icon-cyan   { background: #e8eff2; color: #4a7a8a; }
.icon-yellow { background: #f4f0e0; color: #8a7a3a; }
.icon-red    { background: #f5e8e8; color: #a04a4a; }

.dark-mode .icon-blue   { background: rgba(122, 156, 198, 0.16); color: #9ab4d4; }
.dark-mode .icon-purple { background: rgba(170, 150, 198, 0.16); color: #b4a4d4; }
.dark-mode .icon-pink   { background: rgba(212, 150, 160, 0.16); color: #d4a4b0; }
.dark-mode .icon-green  { background: rgba(150, 198, 168, 0.16); color: #9ac4a8; }
.dark-mode .icon-orange { background: rgba(212, 180, 140, 0.16); color: #d4b48c; }
.dark-mode .icon-cyan   { background: rgba(150, 198, 212, 0.16); color: #9ac4d4; }
.dark-mode .icon-yellow { background: rgba(212, 200, 140, 0.16); color: #d4c88c; }
.dark-mode .icon-red    { background: rgba(212, 150, 150, 0.16); color: #d49a9a; }

.nav-text {
    font-size: 0.88rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    z-index: 1;
    letter-spacing: 0.2px;
    transition: var(--transition);
}

.nav-link:hover .nav-text {
    color: var(--text-primary);
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.footer-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-heart {
    color: var(--highlight);
    animation: heartbeat 1.5s ease-in-out infinite;
    display: inline-block;
    font-size: 0.85rem;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.footer-year {
    color: var(--text-muted);
    opacity: 0.6;
}

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

/* ---------- 二维码弹窗(浅色版) ---------- */
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qr-modal.active {
    display: flex;
    animation: qrFadeIn 0.25s ease both;
}

.qr-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.qr-modal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 300px;
    padding: 2rem 1.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.qr-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qr-modal-close:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    transform: rotate(90deg);
}

.qr-modal-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.qr-canvas {
    display: inline-block;
    padding: 0.85rem;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    line-height: 0;
    margin-bottom: 1rem;
}

.qr-canvas img,
.qr-canvas canvas {
    display: block;
    width: 200px !important;
    height: 200px !important;
}

.qr-modal-tip {
    color: var(--text-muted);
    font-size: 0.82rem;
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .container {
        padding: 2.5rem 1rem 2rem;
    }

    .hero-section {
        padding: 1.75rem 1.5rem 1.5rem;
    }

    .hero-section::before {
        left: 1.5rem;
        right: 1.5rem;
    }

    .nav-section {
        padding: 1.5rem;
    }

    .profile-area {
        gap: 1.25rem;
    }

    .greeting-text {
        font-size: 1.6rem;
    }

    .avatar-ring {
        width: 68px;
        height: 68px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .nav-link {
        padding: 1rem 0.5rem;
    }

    .nav-icon {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .nav-text {
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .greeting-text {
        font-size: 1.4rem;
    }

    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 360px) {
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
