/* ==================================================
 * ukashi.github.io — 个人主页样式
 * 技术极客风 / 暗色主题
 * ================================================== */

/* CSS 变量 */
:root {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border: #30363d;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-red: #f85149;
    --accent-purple: #bc8cff;
    --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    --sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 25% 10%, rgba(88, 166, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 75% 80%, rgba(63, 185, 80, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

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

/* 扫描线动画（复古 CRT 效果） */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.02) 50%
    );
    background-size: 100% 4px;
    z-index: 1000;
    opacity: 0.6;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 16px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    font-weight: 700;
    font-size: 16px;
    color: var(--accent-green);
}

.logo .prompt {
    color: var(--accent);
    margin-right: 8px;
}

.nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    position: relative;
}

.nav a:hover {
    color: var(--accent);
}

.nav a::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s;
}

.nav a:hover::before {
    width: 100%;
}

/* Hero */
.hero {
    padding: 80px 0 60px;
}

/* Terminal 样式 */
.terminal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.terminal-header {
    background: var(--bg-tertiary);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: var(--accent-red); }
.dot.yellow { background: var(--accent-yellow); }
.dot.green { background: var(--accent-green); }

.terminal-title {
    flex: 1;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

.terminal-body {
    padding: 24px;
    font-size: 14px;
}

.terminal-body p {
    margin-bottom: 10px;
}

.prompt {
    color: var(--accent-green);
    font-weight: 700;
    margin-right: 8px;
}

.cmd {
    color: var(--accent);
}

.output {
    color: var(--text);
    padding-left: 20px;
    margin: 12px 0 20px !important;
    line-height: 2;
}

.label {
    color: var(--accent-purple);
    display: inline-block;
    min-width: 100px;
}

.output a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.output a:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

.hero-title {
    font-family: var(--sans);
    font-size: 40px;
    font-weight: 700;
    margin: 24px 0 8px;
    color: var(--text);
}

.accent {
    color: var(--accent);
    background: linear-gradient(135deg, var(--accent), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-family: var(--sans);
    color: var(--text-dim);
    font-size: 16px;
}

.cursor {
    display: inline-block;
    color: var(--accent);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.blink-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
    vertical-align: middle;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.6);
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 0 8px rgba(63, 185, 80, 0);
    }
}

/* Section 通用 */
.section {
    padding: 80px 0;
}

.section-title {
    font-family: var(--sans);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.hash {
    color: var(--accent-green);
    font-family: var(--mono);
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-text p {
    font-family: var(--sans);
    color: var(--text);
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.15);
}

.stat-num {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--mono);
}

.stat-label {
    font-family: var(--sans);
    color: var(--text-dim);
    font-size: 14px;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.skill-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.3s;
}

.skill-category:hover {
    border-color: var(--accent);
}

.skill-category h3 {
    color: var(--accent-green);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: default;
}

.tag:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.12);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-icon {
    color: var(--accent-purple);
    font-size: 20px;
    font-weight: 700;
}

.project-links {
    display: flex;
    gap: 8px;
}

.project-links a {
    color: var(--text-dim);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.project-links a:hover {
    color: var(--accent);
}

.project-title {
    font-family: var(--sans);
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.project-desc {
    font-family: var(--sans);
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.project-tech span {
    color: var(--accent-green);
    font-size: 12px;
}

.project-tech span::before {
    content: '#';
    opacity: 0.6;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -32px;
    top: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px rgba(88, 166, 255, 0.4);
}

.timeline-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.timeline-content:hover {
    border-color: var(--accent);
}

.timeline-date {
    display: inline-block;
    color: var(--accent-yellow);
    font-size: 13px;
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-family: var(--sans);
    color: var(--text);
    font-size: 17px;
    margin-bottom: 8px;
}

.timeline-content p {
    font-family: var(--sans);
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
}

/* Contact */
.contact-terminal .output {
    line-height: 2.2;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

.footer p {
    margin-bottom: 4px;
}

.heart {
    color: var(--accent-red);
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

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

.footer-tip {
    color: var(--text-dim);
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 12px;
    }

    .nav {
        gap: 12px;
        font-size: 13px;
    }

    .hero {
        padding: 40px 0 30px;
    }

    .hero-title {
        font-size: 28px;
    }

    .section {
        padding: 50px 0;
    }

    .section-title {
        font-size: 22px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .about-stats {
        flex-direction: row;
    }

    .stat-card {
        flex: 1;
    }

    .stat-num {
        font-size: 24px;
    }

    .terminal-body {
        padding: 16px;
        font-size: 13px;
    }

    .label {
        min-width: 80px;
    }

    .timeline {
        padding-left: 24px;
    }

    .timeline-marker {
        left: -24px;
        width: 14px;
        height: 14px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* 文本选中样式 */
::selection {
    background: var(--accent);
    color: var(--bg);
}
