/* ==========================================================
   代码探索者 · wbsys.cn
   单屏个人主页样式
   ========================================================== */

/* ---------- CSS 变量（主题） ---------- */
:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;

    --nav-height: 68px;
    --radius: 14px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色主题（默认） */
:root,
:root[data-theme="dark"] {
    --bg: #0b0f19;
    --bg-card: #151d30;
    --bg-terminal: #0d1424;
    --text: #e6eaf2;
    --text-sub: #9aa4b8;
    --primary: #5eead4;
    --accent: #818cf8;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --glow-1: rgba(94, 234, 212, 0.16);
    --glow-2: rgba(129, 140, 248, 0.16);
}

/* 浅色主题 */
:root[data-theme="light"] {
    --bg: #f6f8fb;
    --bg-card: #ffffff;
    --bg-terminal: #0d1424; /* 终端卡片保持深色 */
    --text: #1c2333;
    --text-sub: #5b6478;
    --primary: #0d9488;
    --accent: #6366f1;
    --border: rgba(28, 35, 51, 0.1);
    --shadow: 0 10px 30px rgba(28, 35, 51, 0.08);
    --glow-1: rgba(45, 212, 191, 0.18);
    --glow-2: rgba(99, 102, 241, 0.14);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;

    /* 单屏布局：内容不满一屏时页脚固定在底部 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::selection { background: var(--primary); color: #0b0f19; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ---------- 导航栏 ---------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    z-index: 1000;
    transition: background var(--transition), box-shadow var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--border);
}

.nav-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-icon {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
    border-radius: 8px;
    padding: 3px 8px;
}

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

.theme-toggle {
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: transform var(--transition);
}

.theme-toggle:hover { transform: rotate(15deg) scale(1.08); }

:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: none; }

/* ---------- Hero（唯一主区块） ---------- */
.hero {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--nav-height) + 40px) 0 60px;
    overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; pointer-events: none; }

.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
    opacity: 0.6;
}

.glow {
    position: absolute;
    width: 480px; height: 480px;
    border-radius: 50%;
    filter: blur(100px);
}

.glow-1 { top: -120px; left: -80px; background: var(--glow-1); }
.glow-2 { bottom: -160px; right: -80px; background: var(--glow-2); }

.hero-container {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
}

.hero-hello {
    font-family: var(--font-mono);
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.hero-name {
    font-size: clamp(2.6rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    background: linear-gradient(120deg, var(--text) 30%, var(--primary) 70%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle { font-size: 1.3rem; font-weight: 600; margin-bottom: 14px; }

.highlight {
    color: var(--primary);
    font-family: var(--font-mono);
}

.hero-desc {
    color: var(--text-sub);
    max-width: 480px;
    margin-bottom: 28px;
}

.hero-meta {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    color: var(--text-sub);
    font-size: 0.92rem;
}

/* 终端卡片 */
.hero-terminal {
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    transform: perspective(1200px) rotateY(-4deg);
    transition: transform 0.5s ease;
}

.hero-terminal:hover { transform: perspective(1200px) rotateY(0); }

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.terminal-title {
    margin-left: 10px;
    color: #8b93a7;
    font-size: 0.8rem;
}

.terminal-body {
    padding: 20px 22px 26px;
    min-height: 240px;
    color: #c9d1d9;
    line-height: 1.9;
}

.terminal-body .t-cmd { color: #7ee787; }
.terminal-body .t-out { color: #c9d1d9; white-space: pre-wrap; }
.terminal-body .t-key { color: #79c0ff; }
.terminal-body .t-cursor {
    display: inline-block;
    width: 9px; height: 1.1em;
    background: #7ee787;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- 页脚 ---------- */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 28px 0 24px;
    text-align: center;
}

.footer-slogan {
    font-family: var(--font-mono);
    color: var(--text-sub);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.footer-beian { margin-bottom: 8px; }

.footer-beian a {
    color: var(--text-sub);
    font-size: 0.85rem;
    transition: color var(--transition);
}

.footer-beian a:hover { color: var(--primary); }

.footer-copy { color: var(--text-sub); font-size: 0.85rem; }

/* ---------- 滚动进入动画 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .hero-terminal { transform: none; }
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
