:root {
    --bg: #eef4ff;
    --panel: rgba(255, 255, 255, 0.8);
    --card: rgba(255, 255, 255, 0.9);
    --ink: #0f172a;
    --muted: #5f6f96;
    --accent: #2b6cff;
    --accent-strong: #6d4dff;
    --line: rgba(124, 146, 201, 0.18);
    --shadow: 0 30px 80px rgba(61, 87, 155, 0.14);
    --active: #edf4ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Noto Sans SC", "PingFang SC", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 26%),
        radial-gradient(circle at 76% 18%, rgba(139, 92, 246, 0.14), transparent 22%),
        linear-gradient(180deg, #f8fbff 0%, #edf3ff 48%, #f6f8ff 100%);
}

body.modal-open {
    overflow: hidden;
}

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    min-width: 180px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(31, 29, 26, 0.08);
    box-shadow: 0 18px 40px rgba(31, 29, 26, 0.14);
    backdrop-filter: blur(10px);
}

.toast.success {
    background: rgba(244, 250, 245, 0.96);
    color: #246645;
}

.toast.error {
    background: rgba(255, 246, 244, 0.96);
    color: #9b341e;
}

.shell {
    width: min(1320px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0 64px;
}

.page-workspace .page-clip-only,
.page-workspace .page-story-only,
.page-workspace .page-generate-only,
.page-workspace .page-speech-only,
.page-workspace .page-watermark-only,
.page-clip .page-workspace-only,
.page-clip .page-story-only,
.page-clip .page-generate-only,
.page-clip .page-speech-only,
.page-clip .page-watermark-only,
.page-story .page-workspace-only,
.page-story .page-clip-only,
.page-story .page-generate-only,
.page-story .page-speech-only,
.page-story .page-watermark-only,
.page-generate .page-workspace-only,
.page-generate .page-clip-only,
.page-generate .page-story-only,
.page-generate .page-speech-only,
.page-generate .page-watermark-only,
.page-speech .page-workspace-only,
.page-speech .page-clip-only,
.page-speech .page-story-only,
.page-speech .page-generate-only,
.page-speech .page-watermark-only,
.page-watermark .page-workspace-only,
.page-watermark .page-clip-only,
.page-watermark .page-story-only,
.page-watermark .page-generate-only,
.page-watermark .page-speech-only {
    display: none !important;
}

.shell-narrow {
    width: min(920px, calc(100% - 32px));
}

.workspace-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 74px;
    padding: 2px 6px 18px;
    border-bottom: 1px solid rgba(123, 146, 202, 0.16);
}

.workspace-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 0 0 auto;
    color: var(--ink);
    text-decoration: none;
}

.workspace-brand-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 244, 214, 0.88), transparent 34%),
        linear-gradient(135deg, #0f172a, #2450c5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #f8fbff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.workspace-brand-stack {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.workspace-brand-mark {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.42rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.workspace-brand-copy {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.workspace-nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}

.workspace-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: #1f2a44;
    text-decoration: none;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.workspace-nav-title {
    color: inherit;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.workspace-nav-link:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #10192b;
    transform: translateY(-1px);
}

.workspace-nav-link.active {
    border-color: rgba(245, 158, 11, 0.88);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
    color: #0f172a;
}

.workspace-nav-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #42516d;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-nav-user {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.workspace-user-menu {
    position: relative;
}

.workspace-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 3px 4px 3px 12px;
    border: 1px solid rgba(123, 146, 202, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 20px rgba(76, 98, 156, 0.08);
    color: var(--ink);
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.workspace-user-trigger:hover,
.workspace-user-menu:focus-within .workspace-user-trigger {
    border-color: rgba(43, 108, 255, 0.24);
    box-shadow: 0 12px 26px rgba(76, 98, 156, 0.14);
    transform: translateY(-1px);
}

.workspace-user-trigger:focus {
    outline: none;
}

.workspace-user-meta {
    display: grid;
    gap: 1px;
    text-align: right;
}

.workspace-user-meta strong {
    font-size: 0.88rem;
    line-height: 1.15;
}

.workspace-user-meta span {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.15;
}

.workspace-user-avatar {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(180deg, #4e8bff, #2b6cff);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
    overflow: hidden;
    flex: 0 0 auto;
}

.workspace-user-avatar::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 255, 0.94));
    transform: translateX(-50%);
}

.workspace-user-avatar::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 26px;
    height: 19px;
    border-radius: 18px 18px 10px 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 255, 0.94));
    transform: translateX(-50%);
}

.workspace-user-avatar-large {
    width: 48px;
    height: 48px;
}

.workspace-user-avatar-large::before {
    top: 8px;
    width: 16px;
    height: 16px;
}

.workspace-user-avatar-large::after {
    width: 30px;
    height: 22px;
}

.workspace-user-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    min-width: 220px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(123, 146, 202, 0.16);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(60, 84, 140, 0.16);
    display: grid;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        visibility 0.18s ease,
        transform 0.18s ease;
}

.workspace-user-menu:hover .workspace-user-dropdown,
.workspace-user-menu:focus-within .workspace-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.workspace-user-dropdown-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 0 2px 8px;
    border-bottom: 1px solid rgba(123, 146, 202, 0.14);
}

.workspace-user-dropdown-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.workspace-user-dropdown-copy strong {
    font-size: 0.94rem;
    line-height: 1.2;
}

.workspace-user-dropdown-copy span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.workspace-user-dropdown-actions {
    display: grid;
    gap: 6px;
}

.workspace-user-dropdown-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(123, 146, 202, 0.16);
    border-radius: 8px;
    background: rgba(246, 249, 255, 0.9);
    color: #203055;
    text-decoration: none;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.workspace-user-dropdown-link:hover,
.workspace-user-dropdown-link.active {
    border-color: rgba(43, 108, 255, 0.22);
    background: rgba(237, 244, 255, 0.96);
    color: var(--accent);
}

.workspace-user-dropdown-link:focus {
    outline: none;
    border-color: rgba(43, 108, 255, 0.32);
    box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.12);
}

.auth-page {
    background:
        linear-gradient(120deg, rgba(255, 196, 122, 0.28) 0%, rgba(255, 255, 255, 0) 32%),
        linear-gradient(235deg, rgba(108, 198, 255, 0.34) 0%, rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #f7fbff 0%, #eaf4ff 100%);
}

.auth-shell {
    width: calc(100% - 24px);
    max-width: none;
    padding-top: 18px;
    padding-bottom: 48px;
}

.auth-hero {
    display: grid;
    width: 100%;
    margin: 0;
    justify-items: start;
    gap: 8px;
    padding: 0 0 16px;
    text-align: left;
}

.auth-hero h1 {
    max-width: none;
    font-size: 2.8rem;
    line-height: 1.08;
    font-family: "Noto Sans SC", "PingFang SC", sans-serif;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.auth-stage {
    display: grid;
    width: min(100%, 940px);
    grid-template-columns: minmax(280px, 0.95fr) minmax(420px, 1.45fr);
    gap: 0;
    min-height: 560px;
    margin: 0 auto;
    border: 1px solid rgba(123, 146, 202, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 30px 70px rgba(55, 84, 146, 0.14);
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.auth-showcase {
    display: grid;
    align-content: start;
    gap: 30px;
    padding: 42px 36px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 247, 255, 0.86));
    border-right: 1px solid rgba(123, 146, 202, 0.14);
}

.auth-showcase-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: linear-gradient(135deg, #12316e, #2d6bdf);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.auth-brand-copy {
    display: grid;
    gap: 4px;
}

.auth-brand-copy strong {
    font-size: 1.5rem;
    line-height: 1.1;
}

.auth-brand-copy span {
    color: #657593;
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-showcase-visual {
    display: block;
    width: 100%;
    padding: 10px 0 4px;
}

.auth-showcase-visual img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.auth-access-card {
    display: grid;
    align-content: start;
    gap: 24px;
    padding: 42px 48px;
    background: rgba(246, 250, 255, 0.78);
}

.auth-stage .muted {
    color: #6a7a98;
}

.auth-access-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.auth-access-header h2 {
    font-size: 2.5rem;
    line-height: 1.1;
}

.auth-tab-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(123, 146, 202, 0.16);
    flex-wrap: wrap;
}

.auth-tab-button {
    min-height: 40px;
    padding: 0;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #4e5e7f;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.auth-tab-button.active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.auth-stage .action-button {
    border-radius: 8px;
}

.auth-panel-stack {
    display: grid;
}

.auth-pane {
    display: none;
    gap: 16px;
}

.auth-pane.active {
    display: grid;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field span {
    color: #51617f;
    font-size: 0.92rem;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid rgba(123, 146, 202, 0.2);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font: inherit;
}

.auth-field input:focus {
    outline: none;
    border-color: rgba(43, 108, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.12);
}

.auth-input-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 52px;
    border-radius: 8px;
    border: 1px solid rgba(123, 146, 202, 0.2);
    background: rgba(255, 255, 255, 0.92);
    overflow: hidden;
}

.auth-input-shell:focus-within {
    border-color: rgba(43, 108, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.12);
}

.auth-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-width: 78px;
    padding: 0 14px;
    border-right: 1px solid rgba(123, 146, 202, 0.16);
    color: #3f4d69;
    font-weight: 700;
}

.auth-input-shell input {
    min-height: 50px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.auth-code-row .action-button {
    min-height: 52px;
    padding: 0 20px;
    background: rgba(43, 108, 255, 0.08);
    color: #284eaa;
    box-shadow: none;
    white-space: nowrap;
}

.auth-inline-hint {
    margin: -4px 0 0;
    color: #2a63d3;
    font-size: 0.88rem;
    line-height: 1.6;
}

.auth-submit-button {
    min-height: 52px;
    justify-content: center;
    font-size: 1rem;
}

.auth-pane-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #6b7b99;
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.admin-api-panel {
    max-width: 1100px;
    margin: 18px auto 0;
}

.admin-api-title {
    font-family: "Noto Sans SC", "PingFang SC", sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
}

.admin-api-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.admin-api-card {
    display: grid;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 8px;
    border: 1px solid rgba(123, 146, 202, 0.16);
    background: rgba(255, 255, 255, 0.74);
}

.admin-api-controls {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-api-field {
    display: grid;
    gap: 8px;
    min-width: min(320px, 100%);
    flex: 1 1 320px;
}

.admin-api-field span {
    color: #51617f;
    font-size: 0.92rem;
    font-weight: 700;
}

.admin-api-field input {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid rgba(123, 146, 202, 0.2);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font: inherit;
}

.admin-api-field input:focus {
    outline: none;
    border-color: rgba(43, 108, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.12);
}

.admin-api-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-api-metric {
    display: grid;
    gap: 8px;
    min-height: 104px;
    padding: 16px 18px;
    border-radius: 8px;
    border: 1px solid rgba(123, 146, 202, 0.14);
    background: rgba(245, 249, 255, 0.94);
}

.admin-api-metric span {
    color: #6a7a98;
    font-size: 0.84rem;
    font-weight: 700;
}

.admin-api-metric strong {
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}

.admin-api-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-api-result-title {
    display: grid;
    gap: 4px;
}

.admin-api-result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-api-icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(123, 146, 202, 0.16);
    border-radius: 8px;
    background: rgba(246, 249, 255, 0.92);
    color: #203055;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.admin-api-icon-button:hover {
    border-color: rgba(43, 108, 255, 0.22);
    background: rgba(237, 244, 255, 0.96);
    transform: translateY(-1px);
}

.admin-api-icon-button:focus {
    outline: none;
    border-color: rgba(43, 108, 255, 0.32);
    box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.12);
}

.admin-api-icon-button:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

.admin-api-icon-button-danger:hover {
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(254, 242, 242, 0.96);
}

.admin-api-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
}

.admin-api-icon-copy::before,
.admin-api-icon-copy::after {
    content: "";
    position: absolute;
    border: 2px solid currentColor;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.92);
}

.admin-api-icon-copy::before {
    top: 1px;
    left: 5px;
    width: 10px;
    height: 12px;
}

.admin-api-icon-copy::after {
    top: 5px;
    left: 1px;
    width: 10px;
    height: 12px;
}

.admin-api-icon-delete::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 4px;
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 3px 3px;
}

.admin-api-icon-delete::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 3px;
    width: 12px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -3px 0 -1px currentColor;
}

.admin-api-key-box {
    padding: 16px 18px;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fbff;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.96rem;
    line-height: 1.7;
    word-break: break-all;
}

.admin-api-note {
    margin: 0;
}

.hero {
    padding: 22px 4px 0;
}

h1,
h2 {
    margin: 0;
    font-family: "Noto Serif SC", "Songti SC", serif;
}

h1 {
    font-size: clamp(2.8rem, 4.4vw, 4.9rem);
    letter-spacing: 0.02em;
    line-height: 1.06;
}

.intro {
    max-width: 740px;
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: 1.02rem;
}

.hero-nav {
    margin-bottom: 18px;
}

.panel,
.video-card,
.text-card,
.history-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.panel {
    margin-top: 18px;
    padding: 24px 24px 22px;
    border-radius: 32px;
    backdrop-filter: blur(16px);
}

.hero-home {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 34px;
    align-items: center;
}

.hero-copy {
    display: grid;
    gap: 18px;
    padding: 22px 8px 12px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-pill,
.section-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(110, 134, 190, 0.16);
    color: #4762b0;
    font-size: 0.88rem;
    font-weight: 700;
}

.section-kicker {
    min-height: 28px;
    padding: 0 12px;
    margin: 0 0 10px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-surface {
    position: relative;
    min-height: 386px;
    padding: 28px;
    border-radius: 38px;
    border: 1px solid rgba(127, 146, 201, 0.18);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(229, 238, 255, 0.8)),
        linear-gradient(135deg, rgba(131, 149, 255, 0.18), rgba(78, 140, 255, 0.06));
    overflow: hidden;
}

.hero-surface-glow {
    position: absolute;
    inset: 18px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 22% 20%, rgba(90, 152, 255, 0.2), transparent 30%),
        radial-gradient(circle at 86% 18%, rgba(123, 97, 255, 0.18), transparent 26%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 60%);
    pointer-events: none;
}

.hero-surface-card {
    position: absolute;
    z-index: 1;
    width: min(280px, calc(100% - 52px));
    padding: 18px 18px 16px;
    border-radius: 26px;
    border: 1px solid rgba(126, 147, 203, 0.16);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 44px rgba(88, 110, 172, 0.12);
    backdrop-filter: blur(10px);
}

.hero-surface-card-large {
    top: 28px;
    left: 28px;
    width: min(320px, calc(100% - 72px));
}

.hero-surface-card:nth-of-type(3) {
    right: 28px;
    top: 112px;
}

.hero-surface-card:nth-of-type(4) {
    left: 72px;
    bottom: 28px;
}

.hero-surface-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    color: #5b72b9;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-surface-card strong {
    display: block;
    font-size: 1.14rem;
    line-height: 1.3;
}

.hero-surface-card p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.control-panel {
    margin-top: 22px;
}

.studio-entry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 22px 0 0;
    padding: 20px 22px;
    border-radius: 28px;
    border: 1px solid rgba(123, 146, 202, 0.16);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(233, 242, 255, 0.84));
}

.studio-entry-copy {
    display: grid;
    gap: 6px;
}

.studio-entry-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.studio-entry-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.studio-guidance-card {
    background: linear-gradient(135deg, rgba(247, 250, 255, 0.98), rgba(238, 246, 255, 0.92));
}

.studio-guidance-body {
    display: grid;
    gap: 14px;
}

.studio-guidance-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.studio-guidance-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.studio-guidance-step {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(123, 146, 202, 0.16);
    color: #4c64a7;
    font-size: 0.84rem;
    font-weight: 700;
}

.panel-headline,
.history-header-split {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.panel-headline-copy {
    color: var(--muted);
    font-size: 0.95rem;
}

.extract-stage {
    display: grid;
    gap: 14px;
}

.panel-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.extract-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.extract-input-shell {
    min-width: 0;
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid rgba(123, 146, 202, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    overflow: hidden;
}

.extract-input-shell:focus-within {
    border-color: rgba(43, 108, 255, 0.22);
    box-shadow: 0 0 0 4px rgba(66, 120, 255, 0.12);
}

.extract-form input {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding: 0;
    border: 0;
    font-size: 1rem;
    line-height: 1.4;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.extract-form input:focus {
    outline: none;
}

.input-platform-indicator {
    flex: 0 0 auto;
    margin-left: 12px;
    pointer-events: none;
}

.support-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.support-strip.hidden {
    display: none;
}

.studio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 0 4px;
}

.studio-workbench {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
}

.operation-card {
    padding: 20px;
    border-radius: 28px;
    border: 1px solid rgba(123, 146, 202, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(239, 246, 255, 0.8));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.task-board {
    padding: 20px;
    border-radius: 28px;
    border: 1px solid rgba(123, 146, 202, 0.16);
    background: linear-gradient(180deg, rgba(252, 254, 255, 0.94), rgba(238, 244, 255, 0.82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.task-manager {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.task-manager-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(123, 146, 202, 0.16);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.task-manager-toggle:hover {
    border-color: rgba(43, 108, 255, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

.task-manager-toggle.expanded {
    border-color: rgba(43, 108, 255, 0.2);
    background: rgba(255, 255, 255, 0.92);
}

.task-manager-copy,
.task-manager-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.task-manager-copy {
    min-width: 0;
}

.task-manager-copy strong {
    flex: 0 0 auto;
}

.task-manager-chevron {
    color: #5372c1;
    font-size: 0.88rem;
    font-weight: 700;
}

.operation-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.operation-heading {
    display: grid;
    gap: 4px;
}

.operation-card-body {
    display: grid;
    gap: 10px;
}

.task-board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.studio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.studio-controls input {
    min-height: 46px;
    border: 1px solid rgba(123, 146, 202, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink);
    font-size: 0.95rem;
}

#studio-prompt,
#highlight-prompt {
    min-width: min(320px, 100%);
    flex: 1 1 240px;
    padding: 0 16px;
}

#studio-duration {
    width: 92px;
    padding: 0 14px;
    text-align: center;
}

.storyboard-card {
    background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(240, 252, 247, 0.88));
}

.speech-card {
    background: linear-gradient(180deg, rgba(242, 253, 250, 0.98), rgba(239, 247, 255, 0.88));
}

.watermark-card {
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.98), rgba(244, 248, 255, 0.9));
}

.watermark-form {
    gap: 14px;
}

.watermark-upload-box {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px dashed rgba(226, 123, 44, 0.36);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.76);
}

.watermark-upload-box input[type="file"] {
    width: 100%;
    min-height: 46px;
    color: var(--ink);
    font-size: 0.95rem;
}

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

.watermark-region-grid input,
.storyboard-inline-fields select {
    min-height: 46px;
    border: 1px solid rgba(77, 150, 124, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font-size: 0.95rem;
    padding: 0 16px;
}

.storyboard-inline-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 10px;
}

.speech-options-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.storyboard-rate-control {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.storyboard-rate-control span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.storyboard-rate-control strong {
    color: var(--ink);
}

.storyboard-rate-control input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.storyboard-inline-fields input,
.speech-options-grid input,
.speech-instructions-textarea,
.storyboard-textarea {
    border: 1px solid rgba(77, 150, 124, 0.16);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font-size: 0.95rem;
}

.storyboard-inline-fields input,
.speech-options-grid input {
    min-height: 46px;
    border-radius: 18px;
    padding: 0 16px;
}

.speech-textarea {
    min-height: 180px;
}

.speech-instructions-textarea {
    min-height: 86px;
    width: 100%;
    border-radius: 18px;
    padding: 14px 16px;
    resize: vertical;
    line-height: 1.6;
}

.storyboard-textarea {
    min-height: 220px;
    width: 100%;
    border-radius: 22px;
    padding: 16px 18px;
    resize: vertical;
    line-height: 1.65;
}

.storyboard-inline-fields input:focus,
.speech-options-grid input:focus,
.speech-instructions-textarea:focus,
.storyboard-textarea:focus,
.watermark-region-grid input:focus,
.storyboard-inline-fields select:focus {
    outline: none;
    border-color: rgba(30, 142, 111, 0.32);
    box-shadow: 0 0 0 4px rgba(30, 142, 111, 0.12);
}

.storyboard-hint {
    margin: 0;
}

.storyboard-actions {
    display: flex;
    justify-content: flex-start;
}

.compose-selection-panel {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(123, 146, 202, 0.12);
    background: rgba(244, 248, 255, 0.82);
}

.compose-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.compose-selection-list {
    display: grid;
    gap: 10px;
}

.compose-selection-item {
    display: grid;
    grid-template-columns: 34px 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(123, 146, 202, 0.12);
    background: rgba(255, 255, 255, 0.9);
}

.compose-selection-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(43, 108, 255, 0.1);
    color: #2f61d6;
    font-weight: 700;
}

.compose-selection-platform {
    width: 24px;
    height: 24px;
}

.compose-selection-open {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.compose-selection-open strong,
.compose-selection-open span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compose-selection-open span {
    color: var(--muted);
    font-size: 0.88rem;
}

.compose-selection-list > .muted {
    margin: 0;
    padding: 10px 12px;
    border: 1px dashed rgba(123, 146, 202, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
}

.operation-tip {
    margin: 0;
    font-size: 0.88rem;
}

.operation-hint {
    color: var(--muted);
    font-size: 0.86rem;
}

.operation-badge,
.selection-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(123, 146, 202, 0.12);
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.selection-badge {
    color: #3159af;
    background: rgba(79, 124, 255, 0.1);
}

.task-list {
    display: grid;
    gap: 10px;
}

.task-list > .muted {
    margin: 0;
    padding: 14px;
    border-radius: 16px;
    border: 1px dashed rgba(123, 146, 202, 0.16);
    background: rgba(255, 255, 255, 0.72);
}

.task-item {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(123, 146, 202, 0.12);
    background: rgba(255, 255, 255, 0.9);
    display: grid;
    gap: 10px;
}

.task-item.task-completed {
    border-color: rgba(38, 108, 67, 0.18);
}

.task-item.task-failed {
    border-color: rgba(170, 49, 12, 0.18);
}

.task-item-top,
.task-item-bottom,
.task-actions-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.task-kind-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(43, 108, 255, 0.1);
    color: #2f61d6;
    font-size: 0.8rem;
    font-weight: 700;
}

.task-status-text,
.task-progress-copy {
    color: var(--muted);
    font-size: 0.88rem;
}

.task-title {
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.task-progress-bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: rgba(123, 146, 202, 0.12);
    overflow: hidden;
}

.task-progress-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    background: linear-gradient(90deg, #4d8cff, #7b61ff);
    border-radius: inherit;
}

.task-log-list {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(93, 110, 148, 0.07);
}

.task-log-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    color: var(--muted);
    font-size: 0.83rem;
    line-height: 1.45;
}

.task-log-time {
    font-variant-numeric: tabular-nums;
    color: rgba(75, 88, 118, 0.88);
}

.task-log-message {
    min-width: 0;
    word-break: break-word;
}

.highlight-modal-card {
    width: min(560px, 100%);
}

.highlight-modal-copy {
    display: grid;
    gap: 6px;
}

.highlight-modal-copy p {
    margin: 0;
}

.highlight-modal-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 12px;
}

.highlight-modal-form input {
    min-height: 46px;
    width: 100%;
    border: 1px solid rgba(31, 29, 26, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 0.95rem;
    padding: 0 16px;
}

.support-chip-list,
.history-source-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.platform-logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.platform-logo svg {
    display: block;
    width: 100%;
    height: 100%;
}

.platform-logo[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translate(-50%, 4px);
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(31, 29, 26, 0.88);
    color: #fff;
    font-size: 0.76rem;
    line-height: 1.1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    box-shadow: 0 10px 24px rgba(31, 29, 26, 0.18);
}

.platform-logo[data-tooltip]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    width: 8px;
    height: 8px;
    background: rgba(31, 29, 26, 0.88);
    transform: translateX(-50%) rotate(45deg);
    opacity: 0;
    transition: opacity 0.16s ease;
    pointer-events: none;
}

.platform-logo[data-tooltip]:hover::after,
.platform-logo[data-tooltip]:hover::before,
.platform-logo[data-tooltip]:focus-visible::after,
.platform-logo[data-tooltip]:focus-visible::before {
    opacity: 1;
    transform: translate(-50%, 0);
}

.support-logo {
    width: 18px;
    height: 18px;
    opacity: 0.92;
}

.input-platform-indicator {
    width: 32px;
    height: 32px;
}

.extract-form .action-button {
    flex: 0 0 auto;
    align-self: stretch;
    min-height: 56px;
    padding: 0 22px;
    white-space: nowrap;
}

.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
}

#detail-modal {
    z-index: 60;
}

#markdown-modal {
    z-index: 70;
}

#image-modal {
    z-index: 80;
}

#delete-confirm-modal {
    z-index: 90;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(19, 18, 16, 0.42);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(80vh, 900px);
    padding: 20px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: rgba(255, 252, 246, 0.98);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.image-modal-card {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: min(88vh, 1000px);
    padding: 20px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: rgba(255, 252, 246, 0.98);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-modal-card {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    max-height: min(88vh, 1100px);
    padding: 20px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: rgba(255, 252, 246, 0.98);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.modal-content {
    margin: 0;
    padding: 18px;
    overflow: auto;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(31, 29, 26, 0.08);
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.markdown-preview {
    display: grid;
    gap: 18px;
    white-space: normal;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview p,
.markdown-preview ul {
    margin: 0;
}

.markdown-preview p,
.markdown-preview li {
    line-height: 1.8;
}

.markdown-preview ul {
    padding-left: 22px;
}

.markdown-preview-gallery {
    display: grid;
    gap: 14px;
}

.markdown-preview-image {
    display: block;
    width: 100%;
    max-height: 420px;
    border-radius: 18px;
    border: 1px solid rgba(31, 29, 26, 0.08);
    background: rgba(255, 255, 255, 0.84);
    object-fit: contain;
    cursor: zoom-in;
}

.confirm-modal-card {
    width: min(480px, 100%);
}

.confirm-copy {
    color: var(--muted);
    line-height: 1.7;
}

.confirm-copy p {
    margin: 0;
}

.confirm-actions {
    justify-content: flex-end;
}

.image-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: auto;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 29, 26, 0.08);
    padding: 16px;
}

.image-modal-body img {
    display: block;
    max-width: 100%;
    max-height: min(72vh, 900px);
    object-fit: contain;
}

.detail-viewer {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
    gap: 24px;
    min-height: 0;
    overflow: hidden;
}

.detail-card {
    height: min(72vh, 740px);
}

.detail-modal-card .modal-header {
    justify-content: flex-end;
}

.detail-viewer .video-card-header {
    display: none;
}

.detail-viewer .text-card-header h2 {
    display: none;
}

.detail-viewer .video-card {
    padding-top: 12px;
}

.detail-viewer .video-frame {
    min-height: 0;
}

#detail-video-player {
    width: 100%;
    height: min(66vh, 640px);
    max-height: 100%;
    aspect-ratio: auto;
}

#detail-image-gallery {
    height: 100%;
}

#detail-image-gallery .gallery-shell,
#detail-image-gallery .gallery-viewport,
#detail-image-gallery .gallery-track {
    height: 100%;
}

#detail-image-gallery .gallery-track {
    align-items: center;
}

#detail-image-gallery .gallery-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(66vh, 640px);
}

#detail-image-gallery .gallery-item img {
    width: auto;
    max-width: 100%;
    height: min(66vh, 640px);
    max-height: 100%;
    object-fit: contain;
}

.message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
}

.message.error {
    background: rgba(170, 49, 12, 0.12);
    color: #8d2300;
}

.message.success {
    background: rgba(38, 108, 67, 0.12);
    color: #20603b;
}

.progress-panel {
    margin-top: 22px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.progress-header p,
.muted,
.stage-percent,
.stage-message,
.history-meta,
.history-path {
    color: var(--muted);
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-badge,
.content-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid rgba(31, 29, 26, 0.08);
    background: rgba(255, 255, 255, 0.84);
}

.content-badge {
    color: var(--muted);
    background: rgba(31, 29, 26, 0.04);
}

.platform-section .content-badge {
    color: #5f6f96;
    background: rgba(107, 133, 201, 0.08);
    border-color: rgba(107, 133, 201, 0.12);
}

.platform-section .history-meta {
    color: #7f90b6;
    font-size: 0.82rem;
    line-height: 1.45;
}

.platform-badge.platform-douyin {
    background: rgba(20, 20, 28, 0.1);
    color: #17181f;
}

.platform-badge.platform-bilibili {
    background: rgba(64, 153, 255, 0.12);
    color: #1560a8;
}

.platform-badge.platform-youtube {
    background: rgba(241, 73, 73, 0.12);
    color: #b11f25;
}

.platform-badge.platform-kuaishou {
    background: rgba(255, 147, 37, 0.16);
    color: #b75a05;
}

.platform-badge.platform-ai_clip,
.platform-badge.platform-ai_story {
    background: rgba(79, 124, 255, 0.14);
    color: #3159af;
}

.platform-badge.platform-ai_storyboard {
    background: rgba(30, 142, 111, 0.14);
    color: #146149;
}

.platform-badge.platform-ai_speech {
    background: rgba(15, 118, 110, 0.14);
    color: #0d5c55;
}

.platform-badge.platform-ai_watermark {
    background: rgba(226, 123, 44, 0.14);
    color: #9a4e12;
}

.platform-badge.platform-unknown {
    background: rgba(31, 29, 26, 0.06);
    color: var(--muted);
}

.progress-card {
    padding: 16px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid rgba(31, 29, 26, 0.08);
}

.stage-top,
.video-card-header,
.text-card-header,
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.stage-top {
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(123, 146, 202, 0.12);
}

.progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    transition: width 0.3s ease;
}

.viewer {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 20px;
    align-items: stretch;
    margin-top: 24px;
}

.video-card,
.text-card,
.history-card {
    padding: 20px;
    border-radius: 28px;
}

.video-card,
.text-card {
    display: flex;
    flex-direction: column;
    height: min(68vh, 620px);
}

.history-list {
    display: grid;
    gap: 12px;
    max-height: min(68vh, 620px);
    overflow: auto;
    margin-top: 16px;
}

.history-board {
    margin-top: 28px;
    padding: 28px;
    border-radius: 36px;
}

.platform-section-logo {
    width: 30px;
    height: 30px;
}

.platform-sections {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.platform-section {
    display: grid;
    gap: 10px;
    padding: 11px;
    border-radius: 22px;
    border: 1px solid rgba(124, 146, 201, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.94)),
        linear-gradient(135deg, rgba(62, 108, 255, 0.06), rgba(123, 97, 255, 0.04));
    box-shadow: 0 16px 36px rgba(80, 101, 156, 0.1);
}

.platform-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.platform-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-section-heading strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.1;
    color: var(--ink);
}

.platform-section-heading span:last-child {
    color: #7c8eb7;
    font-size: 0.78rem;
}

.history-row-list {
    display: grid;
}

.platform-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(236px, 260px);
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.platform-grid::-webkit-scrollbar {
    display: none;
}

body.page-generate .platform-section {
    padding: 14px;
}

body.page-generate .platform-section-header {
    align-items: center;
}

body.page-generate .platform-grid {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
    overflow: visible;
    padding-bottom: 0;
    scrollbar-width: auto;
    scrollbar-color: auto;
    scroll-snap-type: none;
}

body.page-generate .platform-grid::-webkit-scrollbar {
    display: none;
}

body.page-generate .platform-grid::-webkit-scrollbar-track {
    background: transparent;
}

body.page-generate .platform-grid::-webkit-scrollbar-thumb {
    background: transparent;
}

body.page-generate .generate-record-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: auto;
    min-width: 0;
    min-height: auto;
    padding: 0;
    border-radius: 16px;
    border: 1px solid rgba(124, 146, 201, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.98));
    box-shadow: 0 10px 22px rgba(86, 107, 166, 0.08);
    overflow: hidden;
    isolation: isolate;
}

body.page-generate .generate-record-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    background: #e9eef9;
    overflow: hidden;
}

body.page-generate .generate-record-preview img,
body.page-generate .generate-record-preview video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #e9eef9;
}

body.page-generate .generate-record-body {
    display: grid;
    gap: 10px;
    min-height: 150px;
    padding: 14px 16px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.98));
}

body.page-generate .generate-record-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

body.page-generate .generate-record-footer .history-kicker {
    order: 0;
    margin-top: 0;
}

body.page-generate .generate-record-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #16213d;
    line-height: 1.3;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body.page-generate .history-meta {
    line-height: 1.4;
    font-size: 0.82rem;
}

body.page-generate .history-inline-actions {
    margin-top: 0;
}

body.page-generate .history-inline-actions .action-button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.78rem;
}

body.page-generate .record-highlight-button,
body.page-generate .record-select-button {
    display: none !important;
}

body.page-generate .generate-record-card .record-delete-button {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    z-index: 3;
}

body.page-generate .pagination {
    margin-top: 20px;
}

.history-page-card {
    margin-top: 24px;
}

.history-list-page {
    max-height: none;
}

.history-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(31, 29, 26, 0.06);
}

.history-item-clickable {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.history-item-clickable:hover {
    transform: translateY(-1px);
    border-color: rgba(43, 108, 255, 0.2);
    box-shadow: 0 18px 38px rgba(82, 109, 176, 0.12);
}

.history-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.history-main {
    min-width: 0;
}

.history-empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 240px;
    padding: 32px 24px;
    border-radius: 28px;
    border: 1px dashed rgba(123, 146, 202, 0.18);
    background: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.history-empty-state strong {
    font-size: 1.1rem;
}

.history-empty-state p {
    margin: 0;
    color: var(--muted);
}

.history-row {
    display: grid;
    position: relative;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: start;
    min-height: 100%;
    padding: 0 0 44px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.98));
    border: 1px solid rgba(124, 146, 201, 0.16);
    box-shadow: 0 10px 22px rgba(86, 107, 166, 0.08);
    overflow: hidden;
    scroll-snap-align: start;
}

.history-row-main {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 3px;
    padding: 8px 8px 0;
}

.history-inline-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.history-inline-actions .action-button {
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.78rem;
}

.history-kicker {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    flex-wrap: wrap;
    order: 3;
}

.history-author {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(107, 133, 201, 0.08);
    color: #6d80aa;
    font-size: 0.72rem;
    line-height: 1;
}

.history-source-line {
    margin-bottom: 8px;
}

.history-row-preview {
    position: relative;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    border: 0;
    background: #e9eef9;
    aspect-ratio: 16 / 5.9;
}

.history-row-preview img,
.history-row-preview video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #e9eef9;
}

.history-row-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, rgba(240, 246, 255, 0.92), rgba(224, 235, 255, 0.96));
}

.history-platform-logo {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 2;
    width: 19px;
    height: 19px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 18px rgba(95, 114, 164, 0.14);
    backdrop-filter: blur(6px);
}

.history-title {
    display: block;
    margin: 1px 0 0;
    color: #16213d;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.16;
    word-break: break-word;
}

.history-preview {
    margin-top: 12px;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(31, 29, 26, 0.08);
    background: rgba(255, 255, 255, 0.82);
}

.history-preview img,
.history-preview video {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    background: rgba(245, 241, 234, 0.82);
}

.record-delete-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(123, 146, 202, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #66789f;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.record-highlight-button,
.record-select-button {
    position: absolute;
    bottom: 8px;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(123, 146, 202, 0.12);
    border-radius: 999px;
    background: rgba(249, 251, 255, 0.98);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.record-highlight-button {
    right: 83px;
    color: #4262bc;
}

.record-select-button {
    right: 10px;
}

.record-highlight-button.selected,
.record-select-button.selected,
.action-button.selected {
    background: rgba(43, 108, 255, 0.1);
    color: #2858ce;
    border-color: rgba(43, 108, 255, 0.2);
}

.record-delete-button:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--ink);
}

.record-highlight-button:hover,
.record-select-button:hover {
    background: #fff;
}

.record-highlight-button:disabled,
.record-delete-button:disabled {
    opacity: 0.6;
    cursor: default;
}

body.page-generate .record-delete-button {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

@media (hover: hover) {
    .record-delete-button {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.92);
    }

    .history-row:hover .record-delete-button,
    .history-row:focus-within .record-delete-button,
    .history-row:hover .record-highlight-button,
    .history-row:focus-within .record-highlight-button,
    .history-row:hover .record-select-button,
    .history-row:focus-within .record-select-button {
        opacity: 1;
        pointer-events: auto;
        transform: scale(1);
    }

    .record-highlight-button,
    .record-select-button {
        opacity: 0;
        pointer-events: none;
    }
}

body.page-generate .record-delete-button {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.pagination-label {
    color: var(--muted);
    font-size: 0.95rem;
}

.video-actions,
.text-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-frame {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
}

video {
    display: block;
    width: min(100%, 760px);
    aspect-ratio: 16 / 9;
    max-height: min(100%, 420px);
    margin: 0 auto;
    border-radius: 22px;
    background: #000;
    object-fit: contain;
}

.detail-audio-player {
    display: block;
    width: min(100%, 720px);
}

.detail-audio-player.hidden {
    display: none;
}

.image-gallery {
    width: 100%;
}

.gallery-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.gallery-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gallery-viewport::-webkit-scrollbar {
    display: none;
}

.gallery-track {
    display: flex;
    gap: 14px;
}

.gallery-item {
    flex: 0 0 100%;
    display: block;
    overflow: hidden;
    scroll-snap-align: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(31, 29, 26, 0.08);
    padding: 0;
    cursor: zoom-in;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: contain;
    background: rgba(245, 241, 234, 0.82);
}

.gallery-nav {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(31, 29, 26, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.gallery-nav:hover {
    background: #fff;
}

.gallery-nav:disabled {
    opacity: 0.4;
    cursor: default;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}

.action-button.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    box-shadow: 0 16px 28px rgba(74, 112, 243, 0.24);
}

.action-button:hover {
    background: #fff;
}

.action-button.primary:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

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

.action-button:disabled,
.action-button.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.markdown-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.sync-lines {
    display: grid;
    gap: 10px;
}

.sync-line {
    margin: 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(31, 29, 26, 0.06);
    line-height: 1.85;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.sync-line.static {
    cursor: default;
}

.sync-line:hover {
    transform: translateY(-1px);
    border-color: rgba(43, 108, 255, 0.18);
}

.sync-line.static:hover {
    transform: none;
}

.sync-line.active {
    background: var(--active);
    border-color: rgba(43, 108, 255, 0.28);
    box-shadow: inset 0 0 0 1px rgba(43, 108, 255, 0.08);
}

@media (max-width: 920px) {
    .workspace-user-meta {
        text-align: left;
    }

    .workspace-user-dropdown {
        right: 0;
        left: auto;
    }

    .admin-api-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-api-field {
        min-width: 0;
        width: 100%;
    }

    .admin-api-controls .action-button {
        width: 100%;
    }

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

    .auth-shell {
        width: calc(100% - 24px);
    }

    .auth-hero {
        padding-bottom: 22px;
    }

    .auth-hero h1 {
        font-size: 2.8rem;
    }

    .auth-stage {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-showcase {
        border-right: 0;
        border-bottom: 1px solid rgba(123, 146, 202, 0.14);
    }

    .auth-access-card {
        padding: 28px 22px;
    }

    .shell {
        width: min(100% - 20px, 100%);
        padding-top: 20px;
    }

    .workspace-nav,
    .studio-entry-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .workspace-nav-links::-webkit-scrollbar {
        display: none;
    }

    .workspace-nav-link {
        flex: 0 0 auto;
    }

    .workspace-nav-current {
        align-self: flex-start;
    }

    .hero-home {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        padding: 18px 4px 4px;
    }

    .hero-surface {
        min-height: 320px;
        padding: 20px;
    }

    .hero-surface-card,
    .hero-surface-card-large {
        position: relative;
        inset: auto;
        width: 100%;
    }

    .hero-surface {
        display: grid;
        gap: 14px;
    }

    .extract-form {
        flex-direction: column;
        align-items: stretch;
    }

    .extract-form .action-button {
        width: 100%;
    }

    .studio-workbench {
        grid-template-columns: 1fr;
    }

    .studio-controls {
        justify-content: stretch;
    }

    .studio-controls input,
    #studio-prompt,
    #studio-duration,
    .studio-controls .action-button {
        width: 100%;
    }

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

    .speech-options-grid {
        grid-template-columns: 1fr;
    }

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

    .storyboard-actions .action-button {
        width: 100%;
    }

    .hero-actions .action-button,
    .studio-entry-card .action-button,
    .studio-entry-actions .action-button {
        width: 100%;
    }

    .studio-guidance-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .task-board-header,
    .operation-card-header,
    .studio-header,
    .task-item-bottom,
    .task-manager-toggle,
    .task-manager-copy,
    .task-manager-side {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .compose-selection-item {
        grid-template-columns: 34px 24px minmax(0, 1fr);
    }

    .compose-selection-remove {
        grid-column: 1 / -1;
        width: 100%;
    }

    .platform-grid {
        grid-auto-columns: minmax(214px, 70vw);
    }

    body.page-generate .platform-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    body.page-generate .generate-record-card {
        padding: 0;
    }

    body.page-generate .generate-record-preview {
        max-width: 100%;
    }

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

    .detail-viewer {
        grid-template-columns: 1fr;
    }

    .video-card,
    .text-card {
        height: auto;
        padding: 18px;
    }

    .detail-card {
        height: auto;
        padding: 18px;
    }

    video {
        width: 100%;
        max-height: 280px;
    }

    .markdown-body {
        max-height: 50vh;
    }

    .gallery-shell {
        grid-template-columns: 1fr;
    }

    .gallery-nav {
        display: none;
    }

    .history-row {
        grid-template-columns: 1fr;
        padding-right: 14px;
    }

    .history-row-preview {
        max-width: 100%;
    }

    .record-highlight-button,
    .record-select-button {
        position: static;
        margin-top: 10px;
        justify-self: start;
    }
}

@media (max-width: 640px) {
    .workspace-user-meta {
        display: none;
    }

    .workspace-user-trigger {
        min-height: 40px;
        padding: 2px;
    }

    .workspace-user-dropdown {
        min-width: 200px;
    }

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

    .auth-hero h1 {
        font-size: 2.2rem;
    }

    .auth-tab-nav {
        gap: 16px;
    }

    .auth-code-row {
        grid-template-columns: 1fr;
    }

    .auth-code-row .action-button {
        width: 100%;
    }

    .auth-input-shell {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .auth-pane-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    body.page-generate .platform-grid {
        grid-template-columns: 1fr;
    }

    .workspace-nav {
        gap: 14px;
        padding-bottom: 14px;
    }

    .workspace-brand-copy,
    .workspace-nav-current {
        display: none;
    }

    .workspace-brand-emblem {
        width: 44px;
        height: 44px;
        border-radius: 15px;
    }

    .workspace-nav-link {
        min-height: 42px;
        padding: 0 15px;
    }

    .workspace-nav-title {
        font-size: 0.96rem;
    }

    .watermark-region-grid {
        grid-template-columns: 1fr;
    }

    .history-board,
    .panel {
        padding: 20px 16px;
        border-radius: 26px;
    }

    .platform-grid {
        grid-auto-columns: minmax(196px, 78vw);
    }
}
