/* ========== 基础变量 - 二次元可爱风 ========== */
:root {
    --bg: #fef6ff;
    --card-bg: #ffffff;
    --text: #4a3f5c;
    --text-secondary: #9b8fb0;
    --border: #f0e0f5;
    --primary: #e891cf;
    --primary-dark: #d672b8;
    --primary-light: #fdf0f8;
    --accent: #a78bfa;
    --accent-light: #ede9fe;
    --pink: #f472b6;
    --pink-light: #fce7f3;
    --sky: #7dd3fc;
    --mint: #6ee7b7;
    --peach: #fdba74;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 12px rgba(196,140,200,.12);
    --shadow-hover: 0 8px 28px rgba(196,140,200,.22);
    --header-h: 64px;
    --tab-h: 46px;
    --max-w: 1280px;
    --transition: .25s cubic-bezier(.4,0,.2,1);
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 15% 10%, rgba(232,145,207,.10) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 30%, rgba(167,139,250,.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(125,211,252,.08) 0%, transparent 50%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--pink); text-decoration: none; }
button { cursor: pointer; font: inherit; border: none; background: none; }
img { display: block; max-width: 100%; }

/* ========== 布局 ========== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; width: 100%; }
.main-content { flex: 1; padding-bottom: 40px; }

/* ========== Header ========== */
.header {
    background: linear-gradient(135deg, #e891cf 0%, #a78bfa 50%, #7dd3fc 100%);
    color: #fff;
    height: var(--header-h);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 3px 16px rgba(167,139,250,.25);
    overflow: hidden;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 12px;
}
.logo {
    font-size: 1.35rem;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: .5px;
    text-shadow: 0 1px 4px rgba(0,0,0,.10);
}
.header-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stat-chip {
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(4px);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .82rem;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.18);
}
.stat-chip b { font-weight: 700; }
.stat-chip.last-update { background: rgba(255,255,255,.30); }

/* ========== Tab bars ========== */
.tab-bar {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    z-index: 90;
}
.type-bar     { top: var(--header-h); z-index: 92; }
.filter-bar   { top: calc(var(--header-h) + var(--tab-h)); z-index: 91; }

.tab-inner {
    display: flex;
    gap: 4px;
    height: var(--tab-h);
    align-items: stretch;
    overflow-x: auto;
}
.tab {
    padding: 0 20px;
    font-size: .92rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2.5px solid transparent;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--primary-dark); background: var(--primary-light); }
.tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
    font-weight: 700;
    background: var(--primary-light);
}
.type-bar .tab.active {
    color: var(--pink);
    border-bottom-color: var(--pink);
    background: var(--pink-light);
}

/* ========== Loading ========== */
.loading, .empty-state {
    text-align: center;
    padding: 80px 0;
    color: var(--text-secondary);
    font-size: 1rem;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state p { font-size: 1.1rem; }

/* ========== 卡片网格 ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    padding-top: 20px;
}

/* ========== 视频卡片 ========== */
.video-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
    border: 1px solid rgba(240,224,245,.5);
}
.video-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.video-cover {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    background: linear-gradient(135deg, #fce7f3, #ede9fe);
    overflow: hidden;
}
.video-cover img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.video-card:hover .video-cover img { transform: scale(1.06); }

.video-duration {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(74,63,92,.78);
    color: #fff;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: .75rem;
    backdrop-filter: blur(4px);
}
.video-rank {
    position: absolute;
    top: 8px; left: 8px;
    background: linear-gradient(135deg, var(--pink), var(--accent));
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(244,114,182,.3);
}
.video-rank.top3 {
    background: linear-gradient(135deg, #f472b6, #e879f9, #a78bfa);
    font-size: .92rem;
    width: 34px; height: 34px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(244,114,182,.4);
}

.video-info { padding: 12px 14px 16px; }
.video-title {
    font-size: .92rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    margin-bottom: 8px;
    min-height: 2.6em;
}
.video-title a { color: var(--text); }
.video-title a:hover { color: var(--primary-dark); text-decoration: none; }

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    color: var(--text-secondary);
}
.video-up { color: var(--primary-dark); font-weight: 600; }
.video-stats-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: .78rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.video-stats-row span {
    background: var(--primary-light);
    padding: 1px 7px;
    border-radius: 6px;
}

/* ========== UP主卡片 ========== */
.up-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition), transform var(--transition);
    border: 1px solid rgba(240,224,245,.5);
}
.up-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.up-rank {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: center;
}
.up-rank.top3 {
    background: linear-gradient(135deg, var(--pink), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
}

.up-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fce7f3, #ede9fe);
    flex-shrink: 0;
    overflow: hidden;
    border: 2.5px solid var(--primary);
    box-shadow: 0 2px 8px rgba(232,145,207,.2);
}
.up-avatar img { width: 100%; height: 100%; object-fit: cover; }

.up-info { flex: 1; min-width: 0; }
.up-name {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.up-name a { color: var(--text); }
.up-name a:hover { color: var(--primary-dark); }

.up-stats {
    display: flex;
    gap: 14px;
    margin-top: 5px;
    font-size: .84rem;
    color: var(--text-secondary);
}
.up-follower {
    font-weight: 700;
    color: var(--pink);
    background: var(--pink-light);
    padding: 1px 10px;
    border-radius: 10px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 28px 0 8px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    font-size: .88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    padding: 0 10px;
    font-weight: 500;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }
.page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(167,139,250,.3);
}
.page-btn:disabled { opacity: .35; cursor: not-allowed; }

.page-info { font-size: .85rem; color: var(--text-secondary); margin: 0 8px; }

/* ========== Footer ========== */
.footer {
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--border);
    padding: 18px 0;
    text-align: center;
    font-size: .82rem;
    color: var(--text-secondary);
    margin-top: auto;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; justify-content: center; height: auto; padding: 10px 16px; }
    .header { height: auto; }
    .header-stats { justify-content: center; }
    .type-bar     { top: auto; position: relative; }
    .filter-bar   { top: auto; position: relative; }
    .card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .up-card { padding: 14px; gap: 10px; }
    .up-avatar { width: 44px; height: 44px; }
}
@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .stat-chip { font-size: .75rem; padding: 2px 8px; }
}
