/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 本地 Inter 字体定义 */
@font-face {
    font-family: 'Inter';
    src: url('assets/inter.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('assets/inter.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('assets/inter.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('assets/inter.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #0f0f10;
    --text-primary: #EDEDEF;
    --text-secondary: #a0a0b0;
    --nav-bg: rgba(18, 18, 20, 0.7);
    --border-color: rgba(60, 60, 70, 0.4);
    --link-hover: #ffffff;
    --underline-color: #6b6bff;
    --greeting-start: #ffffff;
    --greeting-mid: #c6c6f0;
    --greeting-end: #9f9fe0;
    --footer-text: #5f5f73;
    --main-bg-start: #1a1a22;
    --main-bg-end: #0c0c10;
    --sub-border: rgba(100, 100, 130, 0.3);
    --theme-btn-bg: rgba(60, 60, 70, 0.4);
    --theme-btn-border: rgba(120, 120, 140, 0.3);
    --theme-btn-text: #c0c0d0;
    --avatar-border: rgba(150, 150, 200, 0.3);
}

body.light-mode {
    --bg-color: #f5f5f7;
    --text-primary: #1c1c1e;
    --text-secondary: #5e5e70;
    --nav-bg: rgba(240, 240, 245, 0.8);
    --border-color: rgba(180, 180, 200, 0.6);
    --link-hover: #000000;
    --underline-color: #4a4aff;
    --greeting-start: #222222;
    --greeting-mid: #4a4a6a;
    --greeting-end: #6c6c9c;
    --footer-text: #8a8a9e;
    --main-bg-start: #eaeaf0;
    --main-bg-end: #dbdbe5;
    --sub-border: rgba(130, 130, 160, 0.3);
    --theme-btn-bg: rgba(210, 210, 230, 0.9);
    --theme-btn-border: rgba(140, 140, 170, 0.4);
    --theme-btn-text: #2d2d3a;
    --avatar-border: rgba(80, 80, 120, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color 0.3s, border-color 0.3s;
    min-height: 60px;
}

.logo-area {
    display: flex;
    align-items: center;
}

.avatar-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--avatar-border);
    transition: border-color 0.3s, opacity 0.2s;
    background-color: #3b3b5c;
}

.avatar-img:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s ease, border-color 0.2s;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    white-space: nowrap;
}

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

.nav-actions {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: var(--theme-btn-bg);
    border: 1px solid var(--theme-btn-border);
    border-radius: 40px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    color: var(--theme-btn-text);
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.theme-toggle:hover {
    background: rgba(120, 120, 160, 0.3);
    border-color: rgba(180, 180, 230, 0.6);
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    background: radial-gradient(circle at 50% 30%, var(--main-bg-start) 0%, var(--main-bg-end) 90%);
    transition: background 0.3s ease;
}

.hero {
    max-width: 1200px;
    width: 100%;
    padding: 0 10px;
}

.greeting {
    font-size: clamp(3.5rem, 16vw, 12rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(115deg, 
        var(--greeting-start) 0%, 
        var(--greeting-mid) 60%, 
        var(--greeting-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    animation: fadeScale 0.6s ease-out;
    text-shadow: 0 0 20px rgba(120, 120, 255, 0.2);
    transition: background 0.3s ease;
    word-break: break-word;
}

.sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 30rem;
    margin: 0 auto;
    border-top: 1px solid var(--sub-border);
    padding-top: 1.5rem;
    letter-spacing: 0.2px;
    transition: border-color 0.3s, color 0.3s;
    word-break: break-word;
}

@keyframes fadeScale {
    0% { opacity: 0; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

.footer {
    text-align: center;
    padding: 1.2rem;
    color: var(--footer-text);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    background-color: rgba(10, 10, 12, 0.3);
    transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}

@media (max-width: 700px) {
    .navbar {
        padding: 0.6rem 1rem;
    }

    .nav-links {
        gap: 1.2rem;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding-bottom: 2px;
    }

    .theme-toggle {
        padding: 0.3rem 0.7rem;
        font-size: 0.8rem;
    }

    .avatar-img {
        width: 36px;
        height: 36px;
    }

    .greeting {
        font-size: clamp(3rem, 14vw, 8rem);
        margin-bottom: 1rem;
    }

    .sub {
        font-size: 1rem;
        padding-top: 1.2rem;
        max-width: 90%;
    }
}

@media (max-width: 450px) {
    .navbar {
        padding: 0.5rem 0.8rem;
    }

    .nav-links {
        gap: 0.8rem;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .theme-toggle {
        padding: 0.2rem 0.6rem;
        font-size: 0.75rem;
    }

    .avatar-img {
        width: 32px;
        height: 32px;
    }

    .greeting {
        font-size: clamp(2.8rem, 13vw, 6rem);
    }

    .sub {
        font-size: 0.9rem;
        border-top-width: 1px;
    }

    .footer {
        padding: 1rem;
        font-size: 0.7rem;
    }
}

.nav-links a,
.theme-toggle {
    -webkit-tap-highlight-color: rgba(100, 100, 200, 0.2);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}