/* ============================================================
   个人小站 - 暗色主题样式
   配色: 黑灰底 + 白字 + 橙色(#f0a500 / #ff6b35) + 蓝色(#00a8ff / #4da6ff)
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1a1a2e;
    --bg-card-hover: #1e2433;
    --border-color: #30363d;
    --border-light: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-orange: #f0a500;
    --accent-orange-bright: #ff6b35;
    --accent-blue: #00a8ff;
    --accent-blue-bright: #4da6ff;
    --accent-pink: #ff6b9d;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --glow-orange: rgba(240, 165, 0, 0.3);
    --glow-blue: rgba(0, 168, 255, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.25s ease;
    --max-width: 1100px;
}

/* ---------- 全局重置 ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-blue-bright); }

code {
    background: rgba(255,255,255,0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-orange);
}

img { max-width: 100%; display: block; }

/* ---------- 顶部 ---------- */
.site-header {
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
    overflow: hidden;
}

.header-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 200px;
    background: radial-gradient(ellipse at center,
                rgba(240,165,0,0.12) 0%,
                rgba(0,168,255,0.06) 50%,
                transparent 70%);
    pointer-events: none;
}

.site-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-blue-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.site-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 8px;
    letter-spacing: 4px;
    position: relative;
    z-index: 1;
}

/* ---------- 容器 ---------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ---------- 板块 ---------- */
.section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bilibili-title {
    border-bottom-color: var(--accent-blue);
    color: var(--accent-blue-bright);
}

.title-icon { font-size: 1.4rem; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-color);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.card-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* ---------- 个人信息 ---------- */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-full {
    grid-column: 1 / -1;
}

.profile-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.highlight-orange { color: var(--accent-orange); }
.highlight-blue { color: var(--accent-blue-bright); }

/* ---------- 游戏卡片 ---------- */
.game-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #161628 100%);
}

.game-card-inner {
    display: flex;
    gap: 28px;
    align-items: center;
}

.game-logo-box {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--glow-orange));
}

#game-cs2 .game-logo {
    filter: drop-shadow(0 0 8px var(--glow-blue));
}

.game-info {
    flex: 1;
}

.game-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.game-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.game-rank {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.rank-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 60px;
}

.rank-value {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.game-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---------- OC 画廊 ---------- */
.oc-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-pink);
}

.oc-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
}

.oc-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: transform var(--transition), border-color var(--transition);
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
}

.oc-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-pink);
}

.oc-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.oc-empty {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.oc-placeholder svg {
    max-width: 200px;
}

/* ---------- B站 链接 ---------- */
.bili-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.bili-link-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

.bili-link-item:hover {
    border-color: var(--accent-blue);
    background: #1a2740;
    box-shadow: 0 0 20px var(--glow-blue);
    transform: translateY(-2px);
}

.live-link:hover {
    border-color: var(--accent-orange);
    background: #2a2018;
    box-shadow: 0 0 20px var(--glow-orange);
}

.bili-link-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,168,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.live-icon {
    background: rgba(240,165,0,0.15);
    color: var(--accent-orange);
}

.bili-link-label {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

.live-badge {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    white-space: nowrap;
}

.live-badge.live-on {
    background: rgba(248,81,73,0.2);
    color: var(--accent-red);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.bili-link-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: transform var(--transition);
}

.bili-link-item:hover .bili-link-arrow {
    transform: translateX(4px);
    color: var(--accent-blue);
}

.live-link:hover .bili-link-arrow {
    color: var(--accent-orange);
}

.bili-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.bili-info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.bili-info-value {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ---------- 视频网格 ---------- */
.video-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.video-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

/* 视频卡片 */
.video-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    cursor: pointer;
}

.video-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.video-card-cover {
    position: relative;
    aspect-ratio: 16/9;
    background: #111;
    overflow: hidden;
}

.video-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.video-card:hover .video-card-cover img {
    transform: scale(1.05);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.video-card-body {
    padding: 14px;
}

.video-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    color: var(--text-primary);
    min-height: 2.6em;
}

.video-card-meta {
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.video-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-card-date {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 骨架屏 */
.video-skeleton {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
    animation: skeletonShimmer 1.8s infinite;
    animation-delay: var(--delay, 0s);
}

.video-skeleton::before {
    content: '';
    display: block;
    aspect-ratio: 16/9;
    background: linear-gradient(90deg, #1a1a2e 25%, #222240 50%, #1a1a2e 75%);
    background-size: 200% 100%;
}

.video-skeleton::after {
    content: '';
    display: block;
    height: 60px;
    margin: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #1a1a2e 25%, #222240 50%, #1a1a2e 75%);
    background-size: 200% 100%;
}

@keyframes skeletonShimmer {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* 错误状态 */
.video-error {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.btn-retry {
    margin-top: 14px;
    padding: 10px 28px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
    transition: background var(--transition), transform var(--transition);
}

.btn-retry:hover {
    background: var(--accent-blue-bright);
    transform: translateY(-1px);
}

/* ---------- 页脚 ---------- */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-light);
}

/* ============================================================ */
/*  响应式                                                         */
/* ============================================================ */

@media (max-width: 768px) {
    .site-title { font-size: 2rem; }
    .profile-grid { grid-template-columns: repeat(2, 1fr); }

    .game-card-inner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .game-logo-box {
        width: 80px;
        height: 80px;
    }

    .game-rank {
        justify-content: center;
    }

    .bili-links-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .oc-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.6rem; }
    .section-title { font-size: 1.3rem; }
    .profile-grid { grid-template-columns: 1fr; }
    .card { padding: 18px; }
    .video-grid { grid-template-columns: 1fr; }
    .oc-gallery { grid-template-columns: repeat(2, 1fr); }
}
