:root {
    --ink: #17181a;
    --muted: #687078;
    --canvas: #f4f6f7;
    --surface: #ffffff;
    --surface-soft: #eef1f2;
    --line: #dfe3e6;
    --line-strong: #c9cfd3;
    --accent: #e93443;
    --accent-dark: #c92331;
    --cyan: #12aeb8;
    --success: #16845b;
    --danger-soft: #fff0f1;
    --shadow: 0 12px 34px rgba(23, 24, 26, 0.12);
    color-scheme: light;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--canvas);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--canvas);
}

button,
input {
    font: inherit;
    letter-spacing: 0;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
a {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(18, 174, 184, 0.3);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.page-width,
.topbar-inner {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar {
    height: 64px;
    color: #ffffff;
    background: var(--ink);
    border-bottom: 3px solid var(--cyan);
}

.topbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 750;
}

.brand-mark {
    position: relative;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: -3px 2px 0 var(--cyan), 3px -2px 0 var(--accent);
}

.brand-mark span {
    position: absolute;
    width: 3px;
    height: 14px;
    left: 11px;
    top: 3px;
    background: #ffffff;
}

.brand-mark span::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 3px;
    left: 0;
    top: 1px;
    background: #ffffff;
}

.service-status {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    color: #cbd0d3;
    background: #25282b;
    border: 1px solid #3a3e42;
    border-radius: 4px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #a0a6aa;
}

.service-status[data-state="online"] .status-dot {
    background: #39cf91;
}

.service-status[data-state="error"] .status-dot {
    background: #ff5966;
}

.search-band {
    padding: 32px 0 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.search-heading,
.section-heading,
.profile-title-row,
.dialog-header,
.dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.eyebrow,
.dialog-kicker {
    margin: 0 0 3px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
}

h1,
h2,
p {
    letter-spacing: 0;
}

h1 {
    margin: 0;
    font-size: 27px;
    line-height: 1.25;
}

h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
}

.switch-control {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
}

.switch-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    width: 40px;
    height: 22px;
    flex: 0 0 40px;
    border-radius: 12px;
    background: #c9ced1;
    transition: background 160ms ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 160ms ease;
}

.switch-control input:checked + .switch-track {
    background: var(--cyan);
}

.switch-control input:checked + .switch-track::after {
    transform: translateX(18px);
}

.switch-control input:focus-visible + .switch-track {
    outline: 3px solid rgba(18, 174, 184, 0.3);
    outline-offset: 2px;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.5fr) 116px;
    align-items: end;
    gap: 14px;
    margin-top: 22px;
}

.field {
    min-width: 0;
}

.field-label {
    display: block;
    margin-bottom: 7px;
    color: #454a4f;
    font-size: 13px;
    font-weight: 700;
}

.input-wrap {
    position: relative;
    display: block;
}

.input-wrap input {
    width: 100%;
    height: 46px;
    padding: 0 45px 0 13px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input-wrap input:hover {
    border-color: #9ba3a8;
}

.input-wrap input:focus {
    border-color: var(--cyan);
    outline: none;
    box-shadow: 0 0 0 3px rgba(18, 174, 184, 0.12);
}

.input-wrap input::placeholder {
    color: #9ca3a8;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 40px;
    padding: 0;
    color: #555c61;
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-size: 21px;
}

.icon-button:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.field-action {
    position: absolute;
    top: 3px;
    right: 3px;
}

.primary-button,
.secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.primary-button {
    color: #ffffff;
    background: var(--accent);
    border: 1px solid var(--accent);
}

.primary-button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.primary-button:disabled,
.secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.secondary-button {
    color: #31363a;
    background: #ffffff;
    border: 1px solid var(--line-strong);
    font-size: 14px;
}

.secondary-button:hover {
    color: var(--ink);
    border-color: #8f979c;
    background: #f9fafb;
}

.search-button {
    height: 46px;
}

.alert {
    min-height: 54px;
    display: grid;
    grid-template-columns: 28px 1fr 40px;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 8px 8px 8px 13px;
    color: #85202a;
    background: var(--danger-soft);
    border: 1px solid #f2bac0;
    border-radius: 5px;
}

.alert-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--accent);
    border-radius: 50%;
    font-weight: 800;
}

.alert strong,
.alert p {
    margin: 0;
}

.alert p {
    margin-top: 2px;
    font-size: 13px;
}

.main-content {
    padding-top: 28px;
    padding-bottom: 56px;
}

.empty-state {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.empty-symbol {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    color: var(--cyan);
    background: #e4f7f8;
    border: 1px solid #b6e4e7;
    border-radius: 50%;
    font-size: 36px;
}

.empty-state h2 {
    color: #3d4347;
}

.empty-state p,
.works-empty p {
    margin: 7px 0 0;
    font-size: 14px;
}

.loading-state {
    min-height: 420px;
}

.profile-skeleton {
    display: flex;
    gap: 20px;
    padding: 24px 0;
}

.skeleton {
    display: block;
    background: #e2e6e8;
    animation: pulse 1.2s ease-in-out infinite alternate;
}

.skeleton-avatar {
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    border-radius: 50%;
}

.skeleton-lines {
    flex: 1;
    padding-top: 8px;
}

.skeleton-title {
    width: 220px;
    max-width: 70%;
    height: 24px;
    margin-bottom: 14px;
}

.skeleton-line {
    width: 420px;
    max-width: 90%;
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-line.short {
    width: 290px;
}

.stats-skeleton {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 94px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stats-skeleton .skeleton {
    margin: 20px;
}

.grid-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 34px;
}

.grid-skeleton .skeleton {
    aspect-ratio: 3 / 4;
    border-radius: 6px;
}

@keyframes pulse {
    from { opacity: 0.55; }
    to { opacity: 1; }
}

.profile-section {
    padding: 8px 0 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.profile-main {
    min-height: 174px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 26px;
}

.avatar-wrap {
    width: 108px;
    height: 108px;
    position: relative;
    flex: 0 0 108px;
}

.avatar,
.avatar-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px var(--cyan), 4px 0 0 2px rgba(233, 52, 67, 0.78);
}

.avatar {
    object-fit: cover;
    background: var(--surface-soft);
}

.avatar-fallback {
    color: #ffffff;
    background: #34393d;
    font-size: 34px;
    font-weight: 800;
}

.profile-copy {
    min-width: 0;
    flex: 1;
}

.profile-title-row {
    justify-content: flex-start;
}

.profile-title-row h2 {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 24px;
}

.source-badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    color: #08747b;
    background: #e1f6f7;
    border: 1px solid #b4e3e6;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}

.profile-identifiers {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 20px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.profile-identifiers strong {
    color: #3d4347;
    font-weight: 650;
}

.profile-signature {
    max-width: 760px;
    margin: 13px 0 0;
    color: #474d51;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 17px;
}

.profile-actions .secondary-button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 13px;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    background: #fafbfb;
    border-top: 1px solid var(--line);
}

.stats-strip div {
    min-width: 0;
    padding: 16px 12px 17px;
    text-align: center;
    border-right: 1px solid var(--line);
}

.stats-strip div:last-child {
    border-right: 0;
}

.stats-strip dt {
    color: var(--muted);
    font-size: 12px;
}

.stats-strip dd {
    margin: 3px 0 0;
    color: var(--ink);
    font-size: 23px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.works-section {
    padding-top: 32px;
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h2 {
    font-size: 22px;
}

.section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.refresh-button {
    background: #ffffff;
    border: 1px solid var(--line);
}

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

.video-card {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.video-card:hover {
    transform: translateY(-2px);
    border-color: #b9c0c4;
    box-shadow: 0 9px 24px rgba(23, 24, 26, 0.1);
}

.video-cover-button {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    display: block;
    padding: 0;
    overflow: hidden;
    color: #ffffff;
    background: #292d30;
    border: 0;
}

.video-cover-button:disabled {
    cursor: default;
}

.video-cover,
.cover-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    object-fit: cover;
}

.cover-placeholder {
    color: #aab0b4;
    font-size: 13px;
}

.play-symbol {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding-left: 3px;
    color: #ffffff;
    background: rgba(23, 24, 26, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    font-size: 20px;
    transform: translate(-50%, -50%);
}

.video-duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    min-width: 42px;
    padding: 2px 6px;
    color: #ffffff;
    background: rgba(23, 24, 26, 0.82);
    border-radius: 3px;
    font-size: 11px;
    text-align: center;
}

.video-copy {
    padding: 11px 12px 12px;
}

.video-description {
    height: 42px;
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    color: #303539;
    font-size: 14px;
    line-height: 21px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
}

.video-stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #edf0f1;
}

.video-stat-row span {
    min-width: 0;
    color: #62696e;
    font-size: 11px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.works-empty {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: #ffffff;
    border: 1px dashed var(--line-strong);
    border-radius: 6px;
}

.works-empty > span {
    font-size: 34px;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 22px;
}

.load-more-button {
    min-width: 150px;
}

.video-dialog {
    width: min(860px, calc(100% - 36px));
    max-height: calc(100vh - 40px);
    padding: 0;
    color: var(--ink);
    background: #ffffff;
    border: 0;
    border-radius: 7px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.video-dialog::backdrop {
    background: rgba(15, 17, 18, 0.74);
}

.dialog-header,
.dialog-footer {
    padding: 15px 18px;
}

.dialog-header {
    border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
    max-width: 680px;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dialog-kicker {
    display: block;
}

.dialog-close {
    background: var(--surface-soft);
}

.video-stage {
    display: grid;
    place-items: center;
    min-height: 320px;
    max-height: calc(100vh - 190px);
    background: #101112;
}

.video-stage video {
    display: block;
    width: 100%;
    height: min(64vh, 620px);
    object-fit: contain;
    background: #101112;
}

.dialog-footer {
    border-top: 1px solid var(--line);
}

.dialog-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 15px;
    color: var(--muted);
    font-size: 13px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 20;
    min-width: 180px;
    max-width: min(420px, calc(100% - 32px));
    padding: 10px 14px;
    color: #ffffff;
    background: #24272a;
    border: 1px solid #3d4246;
    border-radius: 5px;
    box-shadow: var(--shadow);
    text-align: center;
    font-size: 13px;
    transform: translateX(-50%);
}

@media (max-width: 920px) {
    .search-form {
        grid-template-columns: minmax(190px, 0.8fr) minmax(260px, 1.2fr) 104px;
    }

    .works-grid,
    .grid-skeleton {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .page-width,
    .topbar-inner {
        width: min(100% - 28px, 1180px);
    }

    .topbar {
        height: 58px;
    }

    .brand {
        font-size: 16px;
    }

    .brand-mark {
        transform: scale(0.88);
    }

    .service-status {
        padding: 0 8px;
    }

    .search-band {
        padding: 23px 0 20px;
    }

    h1 {
        font-size: 23px;
    }

    .search-heading {
        align-items: flex-end;
    }

    .switch-control {
        font-size: 12px;
    }

    .search-form {
        grid-template-columns: 1fr;
        gap: 11px;
        margin-top: 18px;
    }

    .search-button {
        width: 100%;
        margin-top: 2px;
    }

    .main-content {
        padding-top: 18px;
        padding-bottom: 36px;
    }

    .empty-state {
        min-height: 300px;
    }

    .profile-main {
        align-items: flex-start;
        gap: 16px;
        padding: 20px 16px;
    }

    .avatar-wrap {
        width: 74px;
        height: 74px;
        flex-basis: 74px;
    }

    .profile-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .profile-title-row h2 {
        font-size: 20px;
    }

    .profile-signature {
        margin-top: 10px;
    }

    .profile-actions {
        margin-top: 13px;
    }

    .profile-actions .secondary-button {
        width: 100%;
    }

    .stats-strip {
        grid-template-columns: repeat(5, minmax(66px, 1fr));
        overflow-x: auto;
    }

    .stats-strip div {
        padding: 13px 2px 14px;
    }

    .stats-strip dd {
        font-size: 16px;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .works-section {
        padding-top: 25px;
    }

    .works-grid,
    .grid-skeleton {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .video-copy {
        padding: 9px 9px 10px;
    }

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

    .video-stat-row span {
        text-align: left;
    }

    .video-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }

    .dialog-header,
    .dialog-footer {
        padding: 12px;
    }

    .dialog-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .dialog-footer .secondary-button {
        width: 100%;
    }

    .video-stage {
        min-height: 240px;
    }

    .video-stage video {
        height: min(60vh, 540px);
    }

    .stats-skeleton {
        grid-template-columns: repeat(5, minmax(66px, 1fr));
        overflow: hidden;
    }
}

@media (max-width: 420px) {
    .profile-main {
        flex-direction: column;
    }

    .profile-copy,
    .profile-actions {
        width: 100%;
    }

    .profile-title-row {
        position: relative;
        padding-right: 0;
    }

    .video-description {
        height: 38px;
        font-size: 13px;
        line-height: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
