:root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --ink: #111318;
    --muted: #6e7480;
    --line: #e7e9ee;
    --accent: #dd636d;
    --accent-strong: #c24562;
    --shadow: 0 24px 70px rgba(22, 27, 36, 0.12);
    --soft-shadow: 0 14px 40px rgba(22, 27, 36, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

img,
video {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px clamp(20px, 4vw, 56px);
    background: rgba(247, 248, 250, 0.84);
    border-bottom: 1px solid rgba(231, 233, 238, 0.8);
    backdrop-filter: blur(22px);
}

.brand,
.site-nav,
.site-footer nav,
.admin-actions,
.row-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    font-weight: 800;
}

.brand-logo {
    width: clamp(112px, 13vw, 170px);
    height: auto;
}

.site-nav a,
.site-footer a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.site-nav a:hover,
.site-footer a:hover,
.row-actions a:hover {
    color: var(--accent-strong);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    min-height: 620px;
    padding: clamp(42px, 7vw, 92px) clamp(20px, 5vw, 72px) 54px;
}

.hero-copy {
    max-width: 640px;
}

.hero-logo {
    width: min(520px, 82vw);
    height: auto;
    margin-bottom: 26px;
}

.eyebrow,
.meta {
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.hero h1,
.plain-page h1,
.auth-card h1,
.admin-top h1,
.video-detail h1 {
    margin: 12px 0 18px;
    font-size: clamp(42px, 6vw, 82px);
    line-height: 0.98;
    letter-spacing: 0;
}

.hero p,
.video-detail p,
.plain-page p,
.auth-card p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    margin-top: 14px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 30px rgba(221, 99, 109, 0.28);
}

.secondary-button {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.danger-button {
    background: #d93025;
    box-shadow: none;
}

.hero-media {
    position: relative;
    overflow: hidden;
    border-radius: 34px;
    background: #fff;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 10;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-play {
    position: absolute;
    left: 34px;
    bottom: 34px;
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent);
    font-size: 28px;
    box-shadow: var(--soft-shadow);
}

.library-shell,
.watch-page,
.plain-page,
.admin-shell {
    width: min(1440px, calc(100% - 40px));
    margin: 0 auto 74px;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px);
    gap: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--soft-shadow);
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    padding: 15px 16px;
    outline: 0;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(221, 99, 109, 0.7);
    box-shadow: 0 0 0 4px rgba(221, 99, 109, 0.14);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 38px;
}

.chip {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
}

.chip.is-active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.video-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(22, 27, 36, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--soft-shadow);
}

.video-card figure {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 9;
    background: #eef1f5;
}

.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(17, 19, 24, 0.76);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.card-body {
    padding: 18px 18px 20px;
}

.card-body h3 {
    min-height: 54px;
    margin: 8px 0;
    font-size: 20px;
    line-height: 1.35;
}

.card-body p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.empty-state {
    display: none;
    padding: 36px;
    border: 1px dashed var(--line);
    border-radius: 24px;
    color: var(--muted);
    text-align: center;
}

.empty-state.is-visible {
    display: block;
}

.watch-page {
    padding-top: 46px;
}

.player-wrap {
    overflow: hidden;
    border-radius: 30px;
    background: #111318;
    box-shadow: var(--shadow);
}

.player-wrap video {
    width: 100%;
    max-height: 76vh;
    background: #111318;
}

.demo-player {
    position: relative;
    display: grid;
    place-items: center;
    min-height: min(68vh, 720px);
    background: #fff;
}

.demo-player img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.demo-player span {
    position: absolute;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent-strong);
    font-weight: 800;
    box-shadow: var(--soft-shadow);
}

.video-detail {
    max-width: 960px;
    padding: 42px 0 10px;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 30px 0 0;
}

.detail-list div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 8px 0 0;
    font-weight: 800;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 70vh;
    padding: 40px 20px;
}

.auth-card,
.form-card,
.table-card {
    width: min(100%, 960px);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--soft-shadow);
}

.auth-card {
    max-width: 460px;
}

.auth-card h1,
.admin-top h1 {
    font-size: clamp(34px, 5vw, 56px);
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff1ed;
    color: #a63a10;
    font-weight: 700;
}

.admin-note {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 44px 0 24px;
}

.admin-shell.narrow {
    width: min(1040px, calc(100% - 40px));
}

.form-card {
    display: grid;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: auto;
}

small {
    color: var(--muted);
    font-weight: 600;
}

.table-card {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.row-actions {
    justify-content: flex-end;
    white-space: nowrap;
}

.danger,
.link-button.danger {
    color: #c5221f;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}

.inline-form {
    grid-template-columns: 1fr 160px auto;
    align-items: end;
    margin-bottom: 18px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 34px clamp(20px, 4vw, 56px);
    border-top: 1px solid var(--line);
    color: var(--muted);
}

@media (max-width: 980px) {
    .hero,
    .toolbar,
    .detail-list,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-top,
    .section-heading,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .site-header,
    .site-nav,
    .admin-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero h1,
    .video-detail h1 {
        font-size: 42px;
    }

    .hero-media {
        border-radius: 22px;
    }

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

    .inline-form {
        grid-template-columns: 1fr;
    }

    .auth-card,
    .form-card,
    .table-card {
        padding: 20px;
        border-radius: 22px;
    }
}
