:root {
    --yellow: #e8b923;
    --yellow-dark: #c99a12;
    --yellow-soft: #fff9e8;
    --white: #ffffff;
    --off-white: #f7f7f5;
    --ink: #141414;
    --muted: #6a6a6a;
    --line: #e8e8e4;
    --shadow: 0 8px 24px rgba(20, 20, 20, 0.06);
    --radius: 10px;
    --font-display: "Syne", sans-serif;
    --font-body: "Manrope", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--off-white);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1100px, calc(100% - 2.5rem));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 68px;
}

.brand {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    position: relative;
    padding-bottom: 0.35rem;
}

.brand::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 36px;
    height: 3px;
    transform: translateX(-50%);
    background: var(--yellow);
    border-radius: 2px;
}

.brand:hover {
    color: var(--ink);
}

.online-badge {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22a45a;
    box-shadow: 0 0 0 0 rgba(34, 164, 90, 0.45);
    animation: online-pulse 1.8s ease-out infinite;
}

.online-text {
    letter-spacing: 0.02em;
}

#online-count {
    color: var(--ink);
    font-weight: 700;
}

@keyframes online-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 164, 90, 0.45);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(34, 164, 90, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 164, 90, 0);
    }
}

.site-main {
    padding: 2.25rem 0 4rem;
}

.section {
    padding: 1.75rem 0 2.5rem;
}

.section-alt {
    padding-top: 2.5rem;
    border-top: 1px solid var(--line);
}

.section-head {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.section-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.35rem;
}

.video-card {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--line);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    border-color: #f0d56a;
    box-shadow: var(--shadow);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1a1a1a;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.03);
}

.play-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(232, 185, 35, 0.95);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.play-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 7px 0 7px 12px;
    border-color: transparent transparent transparent var(--ink);
}

.video-card:hover .play-icon {
    opacity: 1;
}

.video-meta {
    padding: 0.75rem 0.95rem 0.9rem;
}

.video-meta time {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.empty-state {
    margin: 0;
    padding: 1.75rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--muted);
    text-align: center;
    font-size: 0.95rem;
}

.pagination {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1rem;
}

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.pagination-btn,
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pagination-btn:hover,
.pagination-page:hover {
    border-color: #f0d56a;
    background: var(--yellow-soft);
}

.pagination-page.is-current {
    border-color: var(--yellow);
    background: var(--yellow);
    color: var(--ink);
    cursor: default;
}

.pagination-btn.is-disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.watch-section {
    padding: 0.5rem 0 1rem;
}

.watch-layout {
    max-width: 900px;
}

.watch-title {
    margin: 0 0 1.1rem;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.player-wrap {
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    position: relative;
    aspect-ratio: 16 / 9;
}

.player-wrap .video-player,
.player-wrap .fluid_video_wrapper,
.player-wrap .fluid_video_wrapper video {
    width: 100% !important;
    height: 100% !important;
}

.player-wrap .fluid_video_wrapper {
    position: absolute !important;
    inset: 0;
}

.watch-description {
    margin: 1.15rem 0 0;
    line-height: 1.65;
    color: var(--ink);
    font-size: 0.98rem;
}

.watch-date {
    margin: 0.65rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.watch-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.download-section {
    padding: 1rem 0 2rem;
}

.download-layout {
    max-width: 520px;
}

.download-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.35rem;
    text-align: center;
}

.download-thumb {
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
    background: #111;
    margin-bottom: 1.25rem;
}

.download-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-download {
    width: 100%;
    min-height: 50px;
    font-size: 1rem;
}

.download-links {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
}

.ad-slot {
    margin: 0.85rem 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-wrap {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.ad-strip-320 {
    position: sticky;
    top: 68px;
    z-index: 19;
    background: linear-gradient(180deg, var(--yellow-soft) 0%, #fff 100%);
    border-bottom: 2px solid var(--yellow);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ad-strip-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 0;
    min-height: 66px;
}

.ad-slot-320 {
    width: 320px;
    max-width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 4px;
    background: #fff;
    border: 1px solid #e0c45a;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ad-wrap-image {
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.ad-slot-image {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    min-height: 0;
    overflow: visible;
}

.ad-image-link {
    display: block;
    line-height: 0;
}

.ad-image-link img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.ad-slot-728 {
    width: 100%;
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
    min-height: 90px;
}

.ad-slot-300 {
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    min-height: 250px;
}

.ad-slot-native,
.ad-slot-native ins {
    display: block;
    width: 100%;
    max-width: 100%;
}

.ad-slot.ad-slot-native {
    display: block;
    overflow: visible;
    min-height: 0;
}

.download-wait {
    margin: 0 0 0.85rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.btn-download.is-disabled {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.65rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--yellow);
    color: var(--ink);
}

.btn-primary:hover {
    background: var(--yellow-dark);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    border-color: var(--line);
    color: var(--ink);
}

.btn-secondary:hover {
    border-color: var(--yellow);
}

.btn-danger {
    background: #fff;
    border-color: #e0b4b4;
    color: #b33333;
}

.btn-danger:hover {
    background: #b33333;
    border-color: #b33333;
    color: #fff;
}

.center {
    text-align: center;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--white);
    padding: 1.35rem 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    text-align: center;
}

.footer-inner p {
    margin: 0;
}

.footer-inner a {
    color: var(--ink);
    font-weight: 600;
}

.footer-inner a:hover {
    color: var(--yellow-dark);
}

.legal-section {
    padding: 0.25rem 0 1rem;
}

.legal-layout {
    max-width: 760px;
}

.legal-title {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
}

.legal-updated {
    margin: 0 0 1.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.legal-content h2 {
    margin: 1.75rem 0 0.65rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
}

.legal-content p,
.legal-content li {
    margin: 0 0 0.75rem;
    line-height: 1.7;
    color: #2a2a2a;
    font-size: 0.98rem;
}

.legal-content ul {
    margin: 0 0 0.75rem;
    padding-left: 1.25rem;
}

.legal-content a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content a:hover {
    color: var(--yellow-dark);
}

/* Admin */
.admin-body {
    background: var(--off-white);
}

.admin-shell {
    width: min(960px, calc(100% - 2rem));
    margin: 2rem auto 3rem;
}

.admin-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
}

.admin-card h1,
.admin-card h2 {
    margin-top: 0;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem;
    margin: 0 0 1.35rem;
}

.admin-stat {
    background: var(--yellow-soft);
    border: 1px solid #f0e1a8;
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.admin-stat-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}

.admin-stat-value {
    display: block;
    margin-top: 0.25rem;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid rgba(232, 185, 35, 0.45);
    border-color: var(--yellow);
}

.upload-schedule-options {
    display: grid;
    gap: 0.55rem;
}

.upload-schedule-option {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 0;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.upload-schedule-option:has(input:checked) {
    border-color: #e0c45a;
    background: var(--yellow-soft);
}

.upload-schedule-option input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.upload-schedule-option span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.upload-schedule-option strong {
    font-size: 0.94rem;
}

.upload-schedule-option small {
    color: var(--muted);
    font-size: 0.82rem;
}

.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 140px;
    padding: 1.25rem 1rem;
    border: 2px dashed var(--line);
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    text-align: center;
}

.upload-dropzone:hover,
.upload-dropzone:focus {
    outline: none;
    border-color: var(--yellow);
    background: var(--yellow-soft);
}

.upload-dropzone.is-dragover {
    border-color: var(--yellow);
    background: var(--yellow-soft);
}

.upload-dropzone.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.upload-dropzone-title {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}

.upload-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.upload-toolbar .hint {
    margin: 0;
}

.upload-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-sm {
    min-height: 34px;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
}

.upload-item-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
    max-height: 320px;
    overflow: auto;
}

.upload-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.85rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 0.88rem;
}

.upload-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.upload-item-name {
    font-weight: 600;
    word-break: break-all;
}

.upload-item-size,
.upload-item-status,
.upload-item-extra {
    color: var(--muted);
    font-size: 0.8rem;
}

.upload-item-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.upload-item-status {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
}

.upload-item-remove {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: #8a1f1f;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.upload-item-remove:hover {
    background: #fff5f5;
    border-color: #efc0c0;
}

.upload-item.is-pending .upload-item-status { color: var(--muted); }
.upload-item.is-uploading,
.upload-item.is-processing {
    border-color: #e0c45a;
    background: var(--yellow-soft);
}
.upload-item.is-uploading .upload-item-status,
.upload-item.is-processing .upload-item-status { color: #8a6a00; }
.upload-item.is-done {
    border-color: #b7dfb7;
    background: #f0faf0;
}
.upload-item.is-done .upload-item-status { color: #1f6b1f; }
.upload-item.is-failed {
    border-color: #efc0c0;
    background: #fff5f5;
}
.upload-item.is-failed .upload-item-status,
.upload-item.is-failed .upload-item-extra { color: #8a1f1f; }
.upload-item.is-cancelled {
    opacity: 0.65;
}

.upload-progress-panel {
    margin: 1.1rem 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafafa;
}

.upload-progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.upload-progress-label {
    margin: 0;
    font-weight: 700;
}

.upload-progress-track {
    height: 12px;
    background: #e8e8e8;
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #d4a017, var(--yellow));
    border-radius: 999px;
    transition: width 0.2s ease;
}

.upload-progress-percent {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #8a6a00;
}

.upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.alert {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.92rem;
}

.alert-success {
    background: #f0faf0;
    border: 1px solid #b7dfb7;
    color: #1f6b1f;
}

.alert-error {
    background: #fff5f5;
    border: 1px solid #efc0c0;
    color: #8a1f1f;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 0.55rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.admin-thumb {
    width: 96px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.hint {
    margin-top: 0.35rem;
    font-size: 0.84rem;
    color: var(--muted);
}

@media (max-width: 640px) {
    .site-main {
        padding-top: 1.5rem;
    }

    .watch-actions .btn {
        width: 100%;
    }

    .admin-card {
        padding: 1.2rem;
    }

    .header-inner {
        min-height: 60px;
        padding-right: 4.5rem;
    }

    .online-badge {
        font-size: 0.75rem;
        gap: 0.35rem;
    }

    .online-dot {
        width: 7px;
        height: 7px;
    }
}
