:root {
    color-scheme: light;
    --bg: #fff8f3;
    --panel: rgba(255, 255, 255, 0.88);
    --text: #3b3439;
    --muted: #867b83;
    --line: #f0deda;
    --accent: #ff7d9a;
    --accent-dark: #e8567b;
    --mint: #92d9c2;
    --ink: #241f23;
    --success: #0b7a52;
    --danger: #b42318;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 10% 8%, rgba(255, 213, 226, 0.74), transparent 28%),
        radial-gradient(circle at 88% 2%, rgba(198, 238, 224, 0.68), transparent 25%),
        linear-gradient(180deg, #fff8f3 0%, #fffdf8 42%, #f7fff7 100%);
    color: var(--text);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(255, 163, 186, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 163, 186, 0.12) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 76%);
}

a {
    color: inherit;
}

.site-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 260px;
    padding: 48px clamp(18px, 6vw, 86px) 44px;
    border-bottom: 1px solid rgba(240, 222, 218, 0.72);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 248, 0.74)),
        radial-gradient(circle at 78% 44%, rgba(255, 215, 130, 0.34), transparent 30%);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    color: #342a31;
    font-size: clamp(38px, 7vw, 72px);
    line-height: 0.98;
}

h2 {
    margin-bottom: 14px;
    font-size: 20px;
}

.tagline,
.muted,
.description,
.meta,
.admin-item p {
    color: var(--muted);
}

.tagline {
    margin-bottom: 0;
    font-size: clamp(16px, 2.4vw, 20px);
    line-height: 1.7;
}

.hero-note {
    display: inline-flex;
    margin: 22px 0 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 125, 154, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #7c5963;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(255, 125, 154, 0.12);
}

.hero-bubbles {
    position: absolute;
    right: clamp(18px, 8vw, 120px);
    bottom: 34px;
    width: 220px;
    height: 190px;
}

.hero-bubbles span {
    position: absolute;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    box-shadow: 0 18px 42px rgba(215, 137, 161, 0.18);
}

.hero-bubbles span:nth-child(1) {
    right: 24px;
    bottom: 18px;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #ffd6e3, #fff7bb);
}

.hero-bubbles span:nth-child(2) {
    left: 12px;
    top: 18px;
    width: 92px;
    height: 92px;
    background: linear-gradient(135deg, #c8f3e3, #fff);
}

.hero-bubbles span:nth-child(3) {
    right: 0;
    top: 0;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #ddd1ff, #fff);
}

.admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.page-shell {
    width: min(1180px, calc(100% - 36px));
    margin: 32px auto 58px;
}

.page-shell.narrow {
    width: min(1120px, calc(100% - 36px));
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 240px));
    justify-content: center;
    gap: 18px;
}

.video-card,
.panel,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 42px rgba(129, 91, 103, 0.12);
    backdrop-filter: blur(10px);
}

.video-card {
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 54px rgba(129, 91, 103, 0.16);
}

.video-frame {
    background: var(--ink);
    aspect-ratio: 4 / 5;
}

.video-cover,
.video-placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.video-cover {
    object-fit: cover;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: linear-gradient(135deg, #ffe3ec, #fff7c8 54%, #d8f6e9);
    color: #8a5d6a;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.video-body {
    padding: 18px;
}

.video-body h2 {
    color: #44323a;
    line-height: 1.25;
}

.description {
    min-height: 0;
    margin-bottom: 14px;
    line-height: 1.55;
}

.meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 16px;
    font-size: 13px;
}

.meta div {
    min-width: 0;
}

.meta dt {
    margin-bottom: 4px;
    color: #6d4654;
    font-weight: 700;
}

.meta dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.actions,
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.actions {
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(135deg, var(--accent), #ff9e74);
    color: #fff;
    box-shadow: 0 12px 24px rgba(255, 125, 154, 0.25);
}

.button.primary:hover {
    background: linear-gradient(135deg, var(--accent-dark), #ff865e);
}

.button.secondary {
    border-color: rgba(146, 217, 194, 0.48);
    background: #f8fffb;
    color: #467665;
}

.button.danger {
    border-color: rgba(180, 35, 24, 0.25);
    background: #fff5f3;
    color: var(--danger);
}

.empty-state,
.panel {
    padding: 24px;
}

.empty-state {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
}

.empty-state h2 {
    color: #6d4654;
}

.form-stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

.alert {
    margin-bottom: 16px;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}

.alert.error {
    border: 1px solid rgba(180, 35, 24, 0.24);
    background: #fff0ee;
    color: var(--danger);
}

.alert.success {
    border: 1px solid rgba(11, 122, 82, 0.22);
    background: #edf9f4;
    color: var(--success);
}


.visibility-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    border: 0;
    padding: 0;
}

.visibility-choice legend {
    width: 100%;
    margin-bottom: 2px;
    color: var(--text);
    font-weight: 800;
}

.visibility-choice label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.76);
    color: #6d4654;
    font-weight: 800;
    cursor: pointer;
}

.visibility-choice input {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

.visibility-choice label:has(input:checked) {
    border-color: rgba(255, 125, 154, 0.42);
    background: #fff3f7;
    color: var(--accent-dark);
}

.cover-preview {
    display: grid;
    gap: 10px;
}

.cover-preview img {
    display: none;
    width: min(280px, 100%);
    aspect-ratio: 9 / 16;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    background: var(--ink);
}

.cover-preview img.is-visible {
    display: block;
}

.cover-preview p {
    margin-bottom: 0;
    color: var(--muted);
}


.upload-progress[hidden] {
    display: none;
}

.upload-progress {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(255, 125, 154, 0.22);
    border-radius: 8px;
    background: rgba(255, 248, 251, 0.9);
}

.upload-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #7c5963;
    font-size: 14px;
    font-weight: 800;
}

.upload-progress-head strong {
    color: var(--accent-dark);
}

.upload-progress-track {
    overflow: hidden;
    height: 12px;
    border: 1px solid rgba(255, 125, 154, 0.18);
    border-radius: 999px;
    background: #ffe8ef;
}

.upload-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #ffb36c, var(--mint));
    transition: width 180ms ease;
}

.upload-progress.is-done .upload-progress-head,
.upload-progress.is-done .upload-progress-head strong {
    color: var(--success);
}

.upload-progress.is-error {
    border-color: rgba(180, 35, 24, 0.24);
    background: #fff0ee;
}

.upload-progress.is-error .upload-progress-head,
.upload-progress.is-error .upload-progress-head strong {
    color: var(--danger);
}

.button:disabled {
    opacity: 0.68;
    cursor: wait;
    transform: none;
}

.admin-list {
    display: grid;
    gap: 12px;
}

.admin-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.admin-item.is-hidden {
    background: rgba(255, 245, 243, 0.72);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.admin-position {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 125, 154, 0.22);
    border-radius: 999px;
    background: #fff8fb;
    color: #a74762;
    font-weight: 900;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-badge.is-public {
    background: #edf9f4;
    color: var(--success);
}

.status-badge.is-hidden {
    background: #fff0ee;
    color: var(--danger);
}

.admin-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    min-width: 460px;
}

.admin-order-form,
.admin-visibility-form,
.admin-delete-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.admin-order-form label {
    gap: 4px;
    font-size: 12px;
}

.admin-order-form input {
    width: 76px;
    padding: 10px;
}

.admin-controls .button {
    min-width: 68px;
    padding-inline: 14px;
}

.button.is-active {
    box-shadow: inset 0 0 0 2px currentColor;
}


.admin-item p {
    margin: 6px 0 0;
    font-size: 14px;
}

@media (max-width: 980px) {
    .admin-item {
        grid-template-columns: 1fr;
    }

    .admin-controls {
        justify-content: flex-start;
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .site-header,
    .admin-item,
    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .site-header {
        min-height: 230px;
        padding-top: 38px;
    }

    .admin-item {
        grid-template-columns: 1fr;
    }

    .admin-controls {
        flex-wrap: wrap;
        width: 100%;
    }

    .admin-order-form,
    .admin-visibility-form,
    .admin-delete-form {
        width: 100%;
    }

    .admin-order-form label {
        flex: 1;
    }

    .admin-controls .button {
        flex: 1;
    }

    .hero-bubbles {
        right: -38px;
        bottom: -42px;
        opacity: 0.55;
        transform: scale(0.78);
        transform-origin: right bottom;
    }

    h1 {
        font-size: 40px;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .meta {
        grid-template-columns: 1fr;
    }

    .actions .button,
    .admin-link {
        width: 100%;
    }
}
