/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-base: #0f0f23;
    --bg-card: #1a1a3e;
    --bg-card-hover: #1e1e45;
    --accent: #e94560;
    --accent-dark: #c73650;
    --text-primary: #e0e0e0;
    --text-muted: #888;
    --text-dim: #555;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-faint: rgba(255, 255, 255, 0.04);
    --radius-card: 14px;
    --radius-btn: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
}

/* === Header === */
header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-base) 100%);
    padding: 10px 24px;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.logo-img {
    height: 44px;
    width: auto;
}

.version-tag {
    font-size: 10px;
    color: #555;
    text-decoration: none;
    margin-top: -6px;
}

.version-tag:hover {
    color: var(--accent);
}

/* === Footer === */
footer {
    text-align: center;
    padding: 24px 0;
}

footer a {
    font-size: 11px;
    color: #444;
    text-decoration: none;
}

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

/* === Header Search === */
.header-search {
    flex: 1;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.header-search-input {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    border: none;
    border-radius: var(--radius-btn);
    background: var(--border-subtle);
    color: var(--text-primary);
    outline: none;
    min-width: 0;
    transition: background 0.2s;
}

.header-search-input::placeholder {
    color: #666;
}

.header-search-input:focus {
    background: rgba(255, 255, 255, 0.1);
}

/* === Shared Primary Button === */
.btn-primary {
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}

.btn-primary:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.header-search-btn {
    padding: 10px 22px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* === Main Content === */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    overflow-x: hidden;
}

/* === Section Titles === */
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* === Video Grid (Library) === */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-faint);
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.video-card:active {
    transform: scale(0.97);
}

/* === Thumbnail with Duration Badge === */
.thumbnail-wrap {
    position: relative;
    overflow: hidden;
}

.video-thumbnail,
.result-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumbnail {
    transform: scale(1.03);
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* === Video Info === */
.video-info {
    padding: 12px 14px 14px;
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.video-channel {
    font-size: 13px;
    color: #777;
}

.video-views-inline {
    color: var(--text-dim);
    font-size: 11px;
}

.video-views-inline::before {
    content: "\b7";
    margin: 0 4px;
}

.video-date {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.video-views {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* === Search Results === */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-card {
    display: flex;
    gap: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 12px;
    align-items: center;
    border: 1px solid var(--border-faint);
    transition: background 0.2s;
}

.result-card:hover {
    background: var(--bg-card-hover);
}

.result-thumb-wrap {
    width: 200px;
    min-width: 200px;
    border-radius: var(--radius-btn);
    overflow: hidden;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-channel {
    font-size: 13px;
    color: #777;
}

.result-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.request-form {
    flex-shrink: 0;
}

.request-button {
    padding: 12px 24px;
    font-size: 15px;
}

/* === Pending Page === */
.pending-container {
    text-align: center;
    padding: 40px 20px;
}

.pending-card {
    max-width: 420px;
    margin: 0 auto 32px;
}

.pending-thumbnail {
    width: 100%;
    border-radius: var(--radius-card);
    margin-bottom: 16px;
}

.pending-title {
    font-size: 20px;
    margin-bottom: 4px;
}

.pending-channel {
    color: #777;
    font-size: 15px;
}

.pending-status {
    margin-top: 32px;
}

.pending-message {
    font-size: 20px;
    color: #aaa;
    margin-top: 16px;
}

.pending-hint {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 8px;
}

.spinner {
    display: inline-block;
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Watch Page === */
.watch-container {
    padding-top: 4px;
}

.video-player .video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.video-player .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.watch-info {
    margin-top: 20px;
}

.watch-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
}

.watch-channel {
    font-size: 15px;
    color: #777;
    margin-bottom: 20px;
}

/* === Denied Page === */
.denied-container {
    text-align: center;
    padding: 80px 20px;
}

.denied-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.denied-container h2 {
    color: var(--accent);
    font-size: 28px;
    margin-bottom: 12px;
}

.denied-video-title {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.denied-text {
    font-size: 16px;
    color: var(--text-dim);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 18px;
    color: #666;
}

.empty-state .empty-hint {
    font-size: 15px;
    color: #444;
    margin-top: 4px;
}

/* === Shared === */
.back-link {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 28px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-btn);
    font-size: 15px;
    font-weight: 500;
    color: #aaa;
    transition: background 0.2s;
}

.back-link:hover {
    background: var(--bg-card-hover);
}

/* === Login Page === */
.login-container {
    text-align: center;
    padding: 80px 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 300px;
    margin: 0 auto;
}

.login-form h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.login-error {
    color: var(--accent);
    font-size: 14px;
}

.pin-input {
    padding: 16px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    border: none;
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    border: 1px solid var(--border-subtle);
}

.pin-input:focus {
    border-color: rgba(233, 69, 96, 0.4);
}

.login-button {
    padding: 14px;
    font-size: 17px;
}

/* === Time's Up Page === */
.timesup-container {
    text-align: center;
    padding: 80px 20px;
}

.timesup-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.timesup-container h2 {
    color: #f0a030;
    font-size: 28px;
    margin-bottom: 12px;
}

.timesup-text {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.timesup-subtext {
    font-size: 16px;
    color: var(--text-dim);
}

/* === Schedule Banner (Index) === */
.error-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 15px;
    background: #2a1a1a;
    color: #e09090;
    border: 1px solid rgba(200, 100, 100, 0.3);
}

.error-dismiss {
    background: none;
    border: none;
    color: #e09090;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.schedule-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 15px;
    border: 1px solid var(--border-subtle);
}

.schedule-closed {
    background: #2a1a2e;
    color: #c090d0;
    border-color: rgba(160, 100, 200, 0.3);
}

.schedule-open {
    background: #1a2a1e;
    color: #80b090;
    border-color: rgba(100, 180, 120, 0.2);
}

.schedule-detail {
    font-size: 13px;
    opacity: 0.7;
}

/* === Outside Hours Page === */
.outsidehours-container {
    text-align: center;
    padding: 80px 20px;
}

.outsidehours-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.outsidehours-container h2 {
    color: #c090d0;
    font-size: 28px;
    margin-bottom: 12px;
}

.outsidehours-text {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.outsidehours-subtext {
    font-size: 16px;
    color: var(--text-dim);
}

/* === Time Budget Bar (Index) === */
.time-budget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    color: #aaa;
    border: 1px solid var(--border-subtle);
}

.time-budget-low {
    border-color: rgba(233, 69, 96, 0.3);
}

.time-budget-low span:first-child {
    color: var(--accent);
}

.time-budget-detail {
    font-size: 13px;
    color: var(--text-dim);
}

/* === Time Remaining (Watch Page) === */
.time-remaining {
    font-size: 15px;
    color: #aaa;
    margin-bottom: 12px;
}

.time-low {
    color: var(--accent);
    font-weight: 600;
}

/* === Time Warning Banners === */
.time-warning {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(240, 160, 48, 0.95);
    color: var(--bg-card);
    text-align: center;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    z-index: 200;
}

.time-critical {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(233, 69, 96, 0.95);
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    z-index: 200;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === Time's Up Overlay === */
.time-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.time-overlay-content {
    text-align: center;
}

.time-overlay-content h2 {
    color: #f0a030;
    font-size: 36px;
    margin-bottom: 12px;
}

.time-overlay-content p {
    color: var(--text-muted);
    font-size: 18px;
}

/* === Channel Sidebar === */
.index-layout {
    display: block;
}

.index-main {
    flex: 1;
    min-width: 0;
}

.channel-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: none;
    align-self: flex-start;
}

.channel-sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.channel-node {
    margin-bottom: 4px;
}

.channel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-btn);
    cursor: pointer;
    border: 1px solid var(--border-faint);
    transition: background 0.2s;
    user-select: none;
}

.channel-header:hover {
    background: var(--bg-card-hover);
}

.channel-toggle {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.channel-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-count {
    font-size: 12px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 7px;
    border-radius: 8px;
    flex-shrink: 0;
}

.channel-videos {
    display: none;
    padding: 6px 0 6px 12px;
}

.channel-node.open .channel-videos {
    display: block;
}

.mini-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.mini-card:hover {
    background: var(--border-faint);
}

.mini-thumb {
    width: 64px;
    min-width: 64px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 5px;
}

.mini-title {
    font-size: 12px;
    color: #aaa;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Channel Pills === */
.channel-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}

.channel-pills::-webkit-scrollbar {
    height: 4px;
}

.channel-pills::-webkit-scrollbar-track {
    background: transparent;
}

.channel-pills::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

@media (pointer: coarse) {
    .channel-pills {
        scrollbar-width: none;
    }
    .channel-pills::-webkit-scrollbar {
        display: none;
    }
}

.channel-pill {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-card);
    color: #aaa;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}

.channel-pill:hover {
    background: var(--bg-card-hover);
}

.channel-pill.active {
    background: rgba(233, 69, 96, 0.15);
    border-color: rgba(233, 69, 96, 0.4);
    color: var(--accent);
}

.pill-count {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: 4px;
}

.channel-pill.active .pill-count {
    color: rgba(233, 69, 96, 0.6);
}

/* === Mobile === */
@media (max-width: 768px) {
    main {
        max-width: 960px;
    }
    header {
        flex-wrap: wrap;
        padding: 8px 20px;
        gap: 8px;
    }
    .logo-img {
        height: 36px;
    }
    .header-search {
        order: 3;
        width: 100%;
    }
}

@media (min-width: 769px) {
    .header-search {
        max-width: 560px;
        margin-left: auto;
    }
}

/* === Hero Carousel === */
.hero-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 3/1;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--bg-card);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 8s ease-out;
}

.hero-slide.active img {
    transform: scale(1.08);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 15, 35, 0.95) 0%,
        rgba(15, 15, 35, 0.6) 30%,
        rgba(15, 15, 35, 0.1) 60%,
        transparent 100%
    );
    z-index: 1;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 36px;
    z-index: 2;
    transform: translateY(8px);
    opacity: 0;
    transition: transform 0.8s ease-out 0.3s, opacity 0.8s ease-out 0.3s;
}

.hero-slide.active .hero-content {
    transform: translateY(0);
    opacity: 1;
}

.hero-channel {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 8px;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-duration {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.hero-play-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 24px;
    background: rgba(233, 69, 96, 0.9);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    transition: background 0.2s;
}

.hero-slide:hover .hero-play-hint {
    background: rgba(233, 69, 96, 1);
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent #fff;
}

.hero-dots {
    position: absolute;
    bottom: 14px;
    right: 36px;
    z-index: 10;
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    padding: 0;
}

.hero-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.hero-dot.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    animation: hero-dot-progress 6s linear;
}

@keyframes hero-dot-progress {
    from { width: 0; }
    to { width: 100%; }
}

@media (max-width: 768px) {
    .hero-carousel { aspect-ratio: 21/9; border-radius: 12px; }
    .hero-title { font-size: 20px; }
    .hero-content { padding: 20px 24px; }
    .hero-dots { right: 24px; bottom: 10px; }
}

@media (max-width: 480px) {
    .hero-carousel { aspect-ratio: 16/9; border-radius: 10px; }
    .hero-title { font-size: 17px; }
    .hero-channel { font-size: 11px; }
    .hero-content { padding: 16px 18px; }
    .hero-play-hint { padding: 8px 18px; font-size: 13px; }
}

@media (max-width: 600px) {
    .result-card {
        flex-direction: column;
        align-items: stretch;
    }
    .result-thumb-wrap {
        width: 100%;
        min-width: unset;
    }
    .request-form {
        width: 100%;
    }
    .request-button {
        width: 100%;
        padding: 14px;
    }
    .video-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 0;
}
.page-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 8px;
    color: #7c8aff;
    font-weight: 600;
    transition: background 0.2s;
}
.page-btn:hover {
    background: #252550;
}
.page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === Show More Button === */
.show-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
    padding: 16px 0;
}

.show-more-btn {
    padding: 16px 64px;
    font-size: 17px;
    width: 100%;
    max-width: 400px;
}

.show-more-btn:hover {
    opacity: 0.9;
}

.show-more-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

/* === Activity Page === */
.activity-container {
    max-width: 640px;
    margin: 0 auto;
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.activity-header .section-title {
    margin-bottom: 0;
}

.back-link-small {
    font-size: 14px;
    color: #777;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    transition: background 0.2s;
}

.back-link-small:hover {
    background: var(--bg-card-hover);
}

.activity-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.activity-stat {
    flex: 1;
    text-align: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px 8px;
    border: 1px solid var(--border-faint);
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-low {
    color: var(--accent);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-bar-wrap {
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    margin-bottom: 24px;
    overflow: hidden;
}

.activity-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #f0a030 60%, var(--accent) 100%);
    border-radius: 3px;
    transition: width 0.3s;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border-faint);
    transition: background 0.2s;
}

.activity-row:hover {
    background: var(--bg-card-hover);
}

.activity-thumb {
    width: 80px;
    min-width: 80px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-channel {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.activity-time {
    font-size: 15px;
    font-weight: 600;
    color: #aaa;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Category badges on video cards */
.category-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 600;
    color: #fff;
    z-index: 2;
}
.category-edu { background: #2e7d32; }
.category-fun { background: #e65100; }

/* Category filter cards */
.cat-cards-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 8px;
}
.cat-cards-group {
    display: flex;
    gap: 8px;
    max-width: 480px;
    min-width: 0;
    flex: 1;
}
.cat-card-all {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border-subtle, #333);
    background: transparent;
    color: var(--text-muted, #aaa);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.cat-card-all.active {
    background: var(--bg-card-hover, #2a2d38);
    color: #fff;
    border-color: rgba(255,255,255,0.15);
}
.cat-card {
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    font-family: inherit;
    min-width: 0;
    flex: 1 1 0;
}
.cat-card-edu {
    background: rgba(46, 125, 50, 0.10);
    border-color: rgba(46, 125, 50, 0.25);
}
.cat-card-fun {
    background: rgba(230, 81, 0, 0.10);
    border-color: rgba(230, 81, 0, 0.25);
}
.cat-card.active.cat-card-edu { border-color: #43a047; background: rgba(46, 125, 50, 0.2); }
.cat-card.active.cat-card-fun { border-color: #ff8f00; background: rgba(230, 81, 0, 0.2); }
.cat-card-exceeded { opacity: 0.5; }
.cat-card-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.cat-card-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cat-card-edu .cat-card-name { color: #66bb6a; }
.cat-card-fun .cat-card-name { color: #ffa726; }
.cat-card-sub {
    font-size: 10px;
    color: #888;
    line-height: 1.2;
    white-space: nowrap;
}
.cat-card-exceeded .cat-card-sub { color: #e74c6f; }
.cat-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}
.cat-card-time {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.cat-card-m {
    font-size: 12px;
    color: #888;
    font-weight: 400;
}
.cat-card-bar {
    display: block;
    margin-top: 4px;
    height: 6px;
    width: 40px;
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    overflow: hidden;
}
.cat-card-bar-fill {
    display: block;
    height: 100%;
    border-radius: 2px;
}
.cat-card-edu .cat-card-bar-fill { background: #43a047; }
.cat-card-fun .cat-card-bar-fill { background: #ff8f00; }
.cat-card-activity {
    flex-shrink: 0;
    font-size: 16px;
    text-decoration: none;
    opacity: 0.45;
    transition: opacity 0.2s;
}
.cat-card-activity:hover { opacity: 0.8; }

/* Activity category headers */
.activity-category-header {
    padding: 12px 0 4px;
    font-size: 0.95em;
    color: var(--text-muted, #aaa);
    border-bottom: 1px solid var(--border-subtle, #333);
    margin-bottom: 4px;
}

/* === Thumbnail Preview Cycling === */
.thumb-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.thumb-preview.visible {
    opacity: 1;
}

.thumb-dots {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.thumbnail-wrap:hover .thumb-dots,
.thumbnail-wrap.previewing .thumb-dots {
    opacity: 1;
}

.thumb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.2s;
}

.thumb-dot.active {
    background: rgba(255, 255, 255, 0.95);
}
