:root {
    --accent: #3c7c67;
    --accent-strong: #245847;
    --accent-soft: #e8f1ed;
    --ink: #17221f;
    --muted: #68736f;
    --line: #dce2df;
    --paper: #f3f5f2;
    --surface: #fff;
    --surface-raised: #f7f8f6;
    --link: #1677ff;
    --link-soft: #edf5ff;
    --nav: #172521;
    --danger: #bd4d42;
    --shadow: 0 18px 50px rgba(24, 40, 35, .1);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.login-view {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 1.08fr) minmax(360px, .92fr);
}

.login-story {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(48px, 8vw, 130px);
    color: #fff;
    background: var(--nav);
}

.login-story::before {
    content: "";
    position: absolute;
    width: 58vw;
    height: 58vw;
    right: -31vw;
    top: -28vw;
    border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 9vw rgba(255, 255, 255, .025), 0 0 0 18vw rgba(255, 255, 255, .018);
}

.login-story .brand {
    position: absolute;
    top: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--nav);
    background: var(--accent);
    border-radius: 12px 12px 12px 3px;
    font-family: Georgia, serif;
    font-size: 22px;
}

.login-story .eyebrow {
    color: color-mix(in srgb, var(--accent) 70%, white);
}

.login-story h1 {
    max-width: 700px;
    margin: 0;
    font: 500 clamp(38px, 5vw, 72px)/1.08 Georgia, "Songti SC", serif;
    letter-spacing: -.03em;
}

.login-story > p:last-child {
    max-width: 580px;
    margin: 24px 0 0;
    color: #afc0ba;
    font-size: 16px;
    line-height: 1.8;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 42px;
    background: color-mix(in srgb, var(--paper) 92%, #dce2df);
}

.login-card {
    width: min(420px, 100%);
    padding: 38px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.login-card h2 {
    margin: 0 0 8px;
    font: 500 34px/1.2 Georgia, "Songti SC", serif;
}

.login-card > .muted {
    margin: 0 0 32px;
    font-size: 13px;
}

.field {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
    color: #3d4844;
    font-size: 13px;
    font-weight: 700;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.field select,
.field textarea,
.control {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    outline: none;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):focus,
.field select:focus,
.field textarea:focus,
.control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

/* Inline checkbox / radio — never stretch like text inputs */
.field > span:has(> input[type="checkbox"]),
.field > span:has(> input[type="radio"]),
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    font-weight: 600;
}

.field input[type="checkbox"],
.field input[type="radio"],
.check-row input[type="checkbox"],
.check-row input[type="radio"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--accent-strong, #1677ff);
    border: none;
    border-radius: 3px;
    box-shadow: none;
    background: transparent;
}

.field input[type="checkbox"]:focus,
.field input[type="radio"]:focus,
.check-row input:focus {
    box-shadow: none;
    outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
    outline-offset: 2px;
}

.assignment-list {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
    max-height: 320px;
    overflow: auto;
}

.assignment-list .check-row {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.assignment-list .check-row:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: var(--link-soft);
}

.assignment-list .check-row small {
    color: var(--muted);
    font-weight: 500;
}

.product-choice > input[type="checkbox"],
.question-picker input[type="checkbox"],
.message-type-grid input[type="checkbox"],
.inline-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--accent-strong, #1677ff);
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.login-foot {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 11px;
}

.login-foot a {
    color: var(--accent-strong);
    font-weight: 800;
    text-decoration: none;
}

.button {
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform .15s, background .15s;
}

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

.button.primary {
    color: #fff;
    background: var(--accent-strong);
}

.button.secondary {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
}

.button.soft {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.button.danger {
    color: var(--danger);
    background: var(--surface);
    border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

.button.wide {
    width: 100%;
    min-height: 48px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

.app-view {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 25px 16px;
    color: #fff;
    background: var(--nav);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(255, 255, 255, .2) transparent;
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18);
    border-radius: 10px;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 9px 28px;
}

.side-brand b {
    display: block;
    font-size: 15px;
}

.side-brand small {
    display: block;
    margin-top: 3px;
    color: #91a49d;
    font-size: 10px;
    letter-spacing: .08em;
}

.nav-label {
    margin: 14px 12px 7px;
    color: #70847c;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
}

.portal-nav {
    display: grid;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
    padding-bottom: 12px;
}

.portal-nav-group {
    display: block;
    margin: 14px 12px 4px;
    color: #70847c;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
}

.portal-nav button {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 11px 12px;
    color: #aebdb7;
    background: transparent;
    border: 0;
    border-radius: 7px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
}

.portal-nav button::before {
    content: attr(data-icon);
    width: 23px;
    color: #799189;
    font: 16px/1 Georgia, serif;
    text-align: center;
}

.portal-nav button:hover, .portal-nav button.active {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.portal-nav button.active::before {
    color: var(--accent);
}

.identity-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: #2f6fed;
    border-radius: 50%;
    font-style: normal;
    font-weight: 800;
    font-size: 13px;
}

.identity-avatar-lg {
    width: 44px;
    height: 44px;
    font-size: 16px;
}

.icon-button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 18px;
}

.icon-button:hover {
    background: rgba(255, 255, 255, .09);
}

.workspace {
    min-width: 0;
    padding: 0 clamp(18px, 3.5vw, 54px) 50px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 calc(-1 * clamp(18px, 3.5vw, 54px));
    padding: 14px clamp(18px, 3.5vw, 54px);
    background: color-mix(in srgb, var(--paper) 92%, #fff);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.topbar-title {
    min-width: 0;
}

.topbar h1 {
    margin: 0;
    font: 500 26px/1.2 Georgia, "Songti SC", serif;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.account-menu {
    position: relative;
}

.account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    min-height: 40px;
    padding: 4px 10px 4px 4px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.account-trigger:hover {
    border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
    background: var(--surface-raised);
}

.account-trigger b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: min(280px, calc(100vw - 32px));
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.account-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.account-dropdown-head b,
.account-dropdown-head small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-dropdown-head b {
    font-size: 14px;
}

.account-dropdown-head small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.account-dropdown-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-top: 4px;
}

.account-dropdown-actions button {
    min-height: 40px;
    padding: 8px 6px;
    color: var(--ink);
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 700;
}

.account-dropdown-actions button + button {
    border-left: 1px solid var(--line);
}

.account-dropdown-actions button:hover {
    color: var(--accent-strong);
}

.account-dropdown-actions .danger-text {
    color: var(--danger);
}

.account-dropdown-actions .danger-text:hover {
    color: #9d3e36;
}

.date-chip {
    padding: 9px 13px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 11px;
    white-space: nowrap;
}

.page {
    padding-top: 30px;
}

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

.page-head h2, .section-head h2 {
    margin: 0;
    font: 500 24px/1.2 Georgia, "Songti SC", serif;
}

.page-head p:not(.eyebrow) {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.page-head > div > p:first-child {
    margin-top: 0;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 24px;
}

.metric {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.metric::after {
    content: "";
    position: absolute;
    width: 70px;
    height: 70px;
    right: -35px;
    bottom: -35px;
    background: var(--accent-soft);
    border-radius: 50%;
}

.metric small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.metric b {
    display: block;
    margin: 20px 0 4px;
    font: 500 32px/1 Georgia, serif;
}

.metric span {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
}

.metric.dark {
    color: #fff;
    background: var(--nav);
    border-color: var(--nav);
}

.metric.dark small {
    color: #9eb0a9;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, .75fr);
    gap: 18px;
}

.panel {
    min-width: 0;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.panel.flush {
    padding: 0;
}

.panel h3 {
    margin: 0;
    font: 500 19px Georgia, "Songti SC", serif;
}

.schedule {
    display: grid;
}

.schedule-item {
    display: grid;
    grid-template-columns: 53px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.schedule-item:last-child {
    border-bottom: 0;
}

.date-box {
    padding: 8px 5px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    text-align: center;
}

.date-box b, .date-box small {
    display: block;
}

.date-box b {
    font: 500 21px Georgia, serif;
}

.date-box small {
    font-size: 9px;
}

.item-main b, .item-main small {
    display: block;
}

.item-main b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.item-main small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
}

.empty {
    padding: 45px 20px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.live {
    color: #a22f27;
    background: #fae4e1;
}

.badge.live::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #db5045;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #f7c9c5;
}

.badge.scheduled {
    color: #776211;
    background: #f7f0ce;
}

.badge.ended, .badge.off {
    color: #64716c;
    background: #edf0ee;
}

.badge.draft {
    color: #765385;
    background: #f0e7f4;
}

.badge.ok {
    color: #236650;
    background: #dff0e9;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 10px 4px 2px;
}

.pager-meta {
    color: var(--muted);
    font-size: 12px;
}

.pager-actions {
    display: flex;
    gap: 8px;
}

.pager-actions .button[disabled] {
    opacity: .45;
    pointer-events: none;
}

.list-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.list-toolbar .control {
    min-width: 220px;
    flex: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th, .data-table td {
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 12px;
}

.data-table th {
    color: var(--muted);
    background: var(--surface-raised);
    font-size: 10px;
    letter-spacing: .05em;
}

.data-table tbody tr {
    background: var(--surface);
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table td strong, .data-table td small {
    display: block;
}

.data-table td small {
    margin-top: 4px;
    color: var(--muted);
}

.text-button {
    padding: 4px 6px;
    color: var(--accent-strong);
    background: transparent;
    border: 0;
    font-size: 11px;
    font-weight: 800;
}

.text-button + .text-button {
    margin-left: 5px;
}

.table-avatar {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    margin-right: 9px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 8px;
    font-weight: 900;
    vertical-align: middle;
}

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

.course-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
}

.course-cover {
    min-height: 135px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 17px;
    color: #fff;
    background: linear-gradient(130deg, var(--nav), color-mix(in srgb, var(--nav) 65%, var(--accent)));
}

.course-cover .badge {
    align-self: flex-start;
}

.course-cover h3 {
    max-width: 90%;
    margin: 25px 0 0;
    font: 500 19px/1.35 Georgia, "Songti SC", serif;
}

.course-body {
    padding: 16px;
}

.course-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.course-meta small, .course-meta b {
    display: block;
}

.course-meta small {
    color: var(--muted);
    font-size: 9px;
}

.course-meta b {
    margin-top: 4px;
    font-size: 11px;
}

.course-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin-bottom: 16px;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.toolbar .control {
    width: auto;
    min-width: 180px;
    max-width: min(320px, 100%);
    min-height: 40px;
    flex: 1 1 200px;
    margin-right: auto;
}

.toolbar .button,
.toolbar .filter {
    flex: 0 0 auto;
    white-space: nowrap;
}

.module-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.module-toolbar > .control {
    width: auto;
    min-width: 140px;
    max-width: min(280px, 100%);
    min-height: 40px;
    flex: 0 1 auto;
}

.module-toolbar > input.control {
    flex: 1 1 200px;
    width: auto;
    max-width: 320px;
    margin-right: auto;
}

.module-toolbar > select.control {
    flex: 0 0 auto;
    width: auto;
}

.module-toolbar > .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

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

.delivery-card {
    min-width: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.delivery-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.delivery-symbol {
    color: var(--accent-strong);
    font: 800 11px/1 Georgia, serif;
    letter-spacing: .12em;
}

.delivery-card h3 {
    min-height: 48px;
    margin: 22px 0 17px;
    font: 500 19px/1.35 Georgia, "Songti SC", serif;
}

.delivery-card dl {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
    margin: 0 0 19px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.delivery-card dt, .delivery-card dd {
    overflow: hidden;
    margin: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-card dt {
    color: var(--muted);
    font-size: 9px;
}

.delivery-card dd {
    margin-top: 5px;
    font-size: 11px;
    font-weight: 800;
}

.question-title {
    min-width: 280px;
    max-width: 520px;
    white-space: normal;
    line-height: 1.55;
}

.selection-head {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 5px 0 10px;
    font-size: 12px;
}

.selection-head span {
    color: var(--muted);
}

.question-picker {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--line);
}

.question-picker label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.question-picker label:last-child {
    border-bottom: 0;
}

.question-picker b, .question-picker small {
    display: block;
}

.question-picker b {
    font-size: 11px;
    line-height: 1.45;
}

.question-picker small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}

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

.homework-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
    gap: 17px;
    align-items: center;
    padding: 17px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.homework-count {
    display: grid;
    place-items: center;
    min-height: 54px;
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.homework-count b {
    font: 500 22px/1 Georgia, serif;
}

.homework-count small {
    font-size: 9px;
}

.homework-row h3 {
    margin: 0;
    font: 500 16px Georgia, "Songti SC", serif;
}

.homework-row p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 10px;
}

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

.tool-summary {
    margin-bottom: 18px;
    padding: 21px;
    color: #fff;
    background: var(--nav);
}

.tool-summary .section-head {
    margin-bottom: 16px;
}

.tool-summary .eyebrow {
    color: var(--accent);
}

.tool-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
}

.marketing-hub-grid {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.marketing-hub-card {
    min-height: 150px;
    display: grid;
    grid-template-columns:42px 1fr 20px;
    gap: 14px;
    align-items: start;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.marketing-hub-card > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 8px;
    font-size: 20px;
}

.marketing-hub-card p {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 10px;
}

.marketing-hub-card h3 {
    margin: 0;
    font: 500 18px Georgia, "Songti SC", serif;
}

.marketing-hub-card small {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.6;
}

.marketing-hub-card > b {
    color: var(--accent-strong);
    font-size: 20px;
}

.marketing-course-tabs {
    display: flex;
    gap: 24px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.marketing-course-tabs button {
    padding: 16px 2px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font-weight: 800;
}

.marketing-course-tabs button.active {
    color: var(--link);
    border-color: var(--link);
}

.marketing-course-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 15px 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
}

/* .control 默认 width:100%，在 flex 行内会挤扁右侧按钮导致文字竖排 */
.marketing-course-filters > .control {
    width: auto;
    min-width: 132px;
    max-width: 100%;
    flex: 0 1 auto;
}

.marketing-course-filters > input.control:first-child {
    flex: 1 1 220px;
    width: auto;
    min-width: min(220px, 100%);
    max-width: 360px;
    margin-right: auto;
}

.marketing-course-filters > select.control {
    flex: 0 0 auto;
    width: auto;
    min-width: 132px;
}

.marketing-course-filters > input.control[type="date"] {
    flex: 0 0 auto;
    width: auto;
    min-width: 140px;
}

.marketing-course-filters > .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.course-counts {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.course-counts button {
    padding: 7px 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    font-weight: 800;
}

.course-counts button.active {
    color: var(--link);
}

.marketing-course-info {
    min-width: 280px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.course-thumb {
    width: 92px;
    height: 54px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, var(--nav), var(--accent));
    border-radius: 4px;
    font-size: 10px;
}

.course-thumb img,
.course-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #0f172a;
}

.marketing-course-info strong, .marketing-course-info small {
    display: block;
}

.marketing-course-info small {
    margin-top: 8px;
}

.marketing-course-info small span {
    display: inline-block;
    margin-right: 5px;
    padding: 3px 6px;
    color: var(--link);
    background: var(--link-soft);
}

.row-actions {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.row-actions details {
    position: relative;
}

.row-actions summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 800;
    list-style: none;
}

.row-actions details > div {
    position: absolute;
    z-index: 10;
    right: 0;
    top: 24px;
    min-width: 100px;
    padding: 6px;
    display: grid;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.row-actions details button {
    padding: 7px 10px;
    color: var(--ink);
    background: transparent;
    border: 0;
    text-align: left;
}

.tool-summary-grid > div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    align-items: center;
    padding: 14px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .08);
}

.tool-glyph {
    grid-row: span 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--nav);
    background: var(--accent);
    border-radius: 50%;
}

.tool-summary-grid b {
    font-size: 10px;
}

.tool-summary-grid strong {
    font: 500 24px/1 Georgia, serif;
}

.tool-summary-grid small {
    color: #93a09b;
    font-size: 9px;
}

.url-text {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter {
    min-height: 38px;
    padding: 8px 12px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.filter.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.business-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(145px, 190px)) auto;
    gap: 9px;
    margin-bottom: 16px;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.analytics-placeholder {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 16px;
    padding: 13px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 700;
}

.analytics-placeholder .control {
    width: auto;
    min-width: 180px;
    flex: 1 1 180px;
}

.analytics-placeholder .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.analytics-filters {
    grid-template-columns: minmax(260px, 1fr) auto;
}

.business-filters > .control {
    width: 100%;
    min-height: 42px;
}

.business-filters > .button {
    white-space: nowrap;
    align-self: center;
}

.filter-search {
    position: relative;
}

.filter-search span {
    position: absolute;
    z-index: 1;
    left: 14px;
    top: 11px;
    color: var(--muted);
    font-size: 17px;
}

.filter-search .control {
    padding-left: 39px;
}

.table-progress {
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-progress > span {
    width: 110px;
    height: 6px;
    overflow: hidden;
    background: #e8ece9;
    border-radius: 8px;
}

.table-progress i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
}

.table-progress b {
    min-width: 35px;
    font-size: 10px;
}

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

.product-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
}

.product-visual {
    position: relative;
    height: 145px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--accent-soft), #f8f8f5);
}

.product-visual > span:not(.badge) {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    color: var(--accent-strong);
    background: rgba(255, 255, 255, .65);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 50%;
    font: 500 28px Georgia, serif;
}

.product-visual img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-visual img.is-default {
    object-fit: contain;
    padding: 28px;
    box-sizing: border-box;
}

.product-visual .badge {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 1;
    width: auto;
    height: auto;
    min-width: 0;
    display: inline-flex;
    padding: 4px 10px;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 999px;
}

.product-image-field {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    margin-top: 8px;
}

.product-image-field > img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel-soft, #f5f5f2);
}

.product-image-controls {
    display: grid;
    gap: 8px;
}

.product-image-controls .button.compact {
    justify-self: start;
    cursor: pointer;
}

.product-image-controls .button.compact input {
    display: none;
}

.product-info {
    padding: 17px;
}

.product-info > small {
    color: var(--muted);
    font-size: 10px;
}

.product-info h3 {
    min-height: 40px;
    margin: 6px 0 12px;
    font-size: 14px;
    line-height: 1.4;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.product-price b {
    color: var(--accent-strong);
    font: 500 21px Georgia, serif;
}

.product-price del {
    color: #9aa39f;
    font-size: 10px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin: 14px 0;
    padding-top: 12px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 10px;
}

.order-summary {
    display: grid;
    gap: 6px;
    margin-bottom: 20px;
    padding: 17px;
    background: var(--accent-soft);
}

.order-summary span, .order-summary small {
    color: var(--muted);
    font-size: 10px;
}

.order-summary b {
    color: var(--accent-strong);
    font: 500 26px Georgia, serif;
}

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 18px;
    margin-bottom: 18px;
}

.rank-list {
    display: grid;
    gap: 14px;
}

.rank-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.rank-row > b {
    color: #a8b1ad;
    font: 500 15px Georgia, serif;
}

.rank-row > div {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.rank-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
}

.rank-row i {
    height: 5px;
    overflow: hidden;
    background: color-mix(in srgb, var(--line) 55%, var(--surface));
    border-radius: 8px;
}

.rank-row em {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
}

.rank-row strong {
    font: 500 16px Georgia, serif;
}

.funnel {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.funnel > div {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: #fff;
    background: color-mix(in srgb, var(--accent-strong) 72%, var(--nav));
}

.funnel > div:nth-child(2) {
    width: 78%;
}

.funnel > div:nth-child(3) {
    width: 56%;
}

.funnel > div:nth-child(4) {
    width: 38%;
}

.funnel b {
    font: 500 20px Georgia, serif;
}

.funnel span {
    font-size: 10px;
}

.analytics-table {
    margin-top: 18px;
}

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

.report-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.report-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-size: 9px;
    font-weight: 900;
}

.report-row strong, .report-row small {
    display: block;
}

.report-row strong {
    font-size: 12px;
}

.report-row small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
}

.progress {
    width: 100%;
    height: 6px;
    overflow: hidden;
    background: color-mix(in srgb, var(--line) 45%, var(--surface));
    border-radius: 6px;
}

.progress > i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
}

.upload-progress {
    display: grid;
    gap: 8px;
    margin: 4px 0 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-raised);
}

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

.upload-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.upload-progress-meta b {
    color: var(--ink);
    font-weight: 600;
}

.upload-progress-meta span {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.upload-progress-bar {
    height: 8px;
}

.upload-progress-bar > i {
    transition: width .15s ease;
}

.upload-progress-bar > i.indeterminate {
    animation: upload-indeterminate 1s ease-in-out infinite alternate;
}

.upload-dock,
.transfer-dock {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10050;
    width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.transfer-dock-collapsed {
    pointer-events: auto;
    display: grid;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.transfer-dock-collapsed-title {
    font-size: 13px;
    font-weight: 800;
}

.transfer-dock-collapsed-meta {
    position: absolute;
    top: 10px;
    right: 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.transfer-dock-collapsed {
    position: relative;
}

.transfer-dock-collapsed-bar {
    margin: 0;
}

.transfer-dock.is-collapsed .transfer-dock-expanded {
    display: none;
}

.transfer-dock:not(.is-collapsed) .transfer-dock-collapsed {
    display: none;
}

.transfer-dock-expanded {
    pointer-events: auto;
    display: grid;
    gap: 0;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.transfer-dock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 8px 14px;
    border-bottom: 1px solid var(--line);
}

.transfer-dock-header b {
    font-size: 13px;
}

.transfer-dock-minimize {
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 1;
}

.transfer-dock-tabs {
    display: flex;
    gap: 0;
    padding: 0 10px;
    border-bottom: 1px solid var(--line);
}

.transfer-dock-tabs button {
    flex: 1;
    padding: 8px 6px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 700;
}

.transfer-dock-tabs button.active {
    color: var(--accent-strong);
    border-bottom-color: var(--accent-strong);
}

.transfer-dock-panels {
    max-height: min(42vh, 320px);
    overflow: auto;
}

.transfer-list {
    display: grid;
    gap: 0;
}

.transfer-row {
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--line);
}

.transfer-row:last-child {
    border-bottom: 0;
}

.transfer-row-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
}

.transfer-row-head b {
    font-size: 12px;
}

.transfer-row-head span,
.transfer-row-file,
.transfer-row-hint {
    color: var(--muted);
    font-size: 11px;
}

.transfer-row-file {
    margin: 3px 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transfer-row-hint {
    margin: 6px 0 0;
}

.transfer-row.is-download .transfer-row-head b {
    color: var(--accent-strong);
}

.transfer-row.is-done .transfer-row-head b {
    color: #2f6f4e;
}

.transfer-row.is-error {
    cursor: pointer;
}

.transfer-row.is-error .transfer-row-head b {
    color: #9d3e36;
}

.upload-dock {
    display: grid;
    gap: 10px;
}

.upload-dock-card {
    pointer-events: auto;
    padding: 14px 16px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(23, 34, 31, .16);
}

.upload-dock-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.upload-dock-head b {
    font-size: 13px;
}

.upload-dock-head span,
.upload-dock-file,
.upload-dock-hint {
    color: var(--muted);
    font-size: 12px;
}

.upload-dock-file {
    margin: 4px 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-dock-hint {
    margin: 8px 0 0;
}

.upload-dock-card.is-download .upload-dock-head b {
    color: var(--accent-strong);
}

.upload-dock-card.is-done .upload-dock-head b {
    color: #2f6f4e;
}

.upload-dock-card.is-error {
    cursor: pointer;
}

.upload-dock-card.is-error .upload-dock-head b {
    color: #9d3e36;
}

@keyframes upload-indeterminate {
    from { width: 18%; margin-left: 0; }
    to { width: 42%; margin-left: 40%; }
}

.quota-list {
    display: grid;
    gap: 20px;
}

.quota-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11px;
}

.activity {
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity li {
    position: relative;
    padding: 0 0 20px 20px;
    color: var(--muted);
    border-left: 1px solid var(--line);
    font-size: 11px;
    line-height: 1.55;
}

.activity li::before {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    left: -4px;
    top: 3px;
    background: var(--accent);
    border-radius: 50%;
}

.activity li:last-child {
    padding-bottom: 0;
}

.activity b {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
}

.media-row {
    display: grid;
    grid-template-columns: 42px minmax(160px, 1fr) 110px 140px auto;
    gap: 14px;
    align-items: center;
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}

.media-row:last-child {
    border-bottom: 0;
}

.media-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 8px;
}

.media-row b, .media-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-row small {
    margin-top: 4px;
    color: var(--muted);
}

.upload-box {
    display: grid;
    grid-template-columns: 1fr 1.6fr auto;
    gap: 10px;
    padding: 18px;
    margin-bottom: 15px;
    background: var(--surface);
    border: 1px dashed color-mix(in srgb, var(--line) 80%, var(--muted));
}

.chart {
    height: 230px;
    display: flex;
    align-items: end;
    gap: 12px;
    padding-top: 30px;
}

.chart-bar {
    flex: 1;
    position: relative;
    min-width: 22px;
    background: linear-gradient(to top, var(--accent), color-mix(in srgb, var(--accent) 30%, white));
    border-radius: 4px 4px 0 0;
}

.chart-bar span {
    position: absolute;
    width: 100%;
    bottom: -23px;
    color: var(--muted);
    font-size: 9px;
    text-align: center;
}

dialog {
    width: min(720px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
}

dialog:has(.course-config) {
    width: min(1360px, calc(100vw - 16px));
}

dialog::backdrop {
    background: rgba(9, 21, 17, .72);
    backdrop-filter: blur(3px);
}

dialog a {
    color: var(--accent-strong, #1677ff);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

dialog a:hover {
    opacity: .85;
}

.dialog-card {
    overflow-y: auto;
    max-height: calc(100vh - 24px);
    padding: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dialog-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 23px;
}

.dialog-head h2 {
    margin: 0;
    font: 500 25px Georgia, "Songti SC", serif;
}

.dialog-head .icon-button {
    color: var(--muted);
    background: var(--surface-raised);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 24px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.course-config {
    min-height: 640px;
}

.course-config-page {
    margin: -4px 0 0;
    padding: 0 0 28px;
}

.course-config-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
}

.course-config-topbar-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.course-config-topbar-main b {
    font-size: 15px;
}

.course-config-topbar-main small {
    color: var(--muted);
    font-size: 12px;
}

.course-config-page .dialog-actions,
.course-config-page-form .dialog-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 92%, transparent) 30%);
}

.ondemand-page {
    padding-bottom: 88px;
}

.ondemand-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 24px;
    margin-bottom: 20px;
}

.ondemand-page-head h2 {
    margin: 0;
    font: 500 24px Georgia, "Songti SC", serif;
}

.ondemand-form {
    max-width: 920px;
}

.ondemand-section {
    margin-bottom: 22px;
    padding: 18px 18px 8px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.ondemand-section h3 {
    margin: 0 0 14px;
    font-size: 16px;
}

.ondemand-subtabs {
    margin-bottom: 14px;
}

.notice-block {
    margin-top: 12px;
    padding: 12px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
}

.notice-block p {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
}

.ondemand-page-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 0;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 92%, transparent) 28%);
    border-top: 1px solid var(--line);
}

.config-layout {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr) 220px;
    gap: 18px;
    min-height: 520px;
}

.config-block-actions {
    display: flex;
    gap: 8px;
}

.config-preview {
    padding-left: 8px;
    border-left: 1px solid var(--line);
}

.phone-preview {
    width: 196px;
    margin: 0 auto;
    padding: 12px 10px 18px;
    border-radius: 28px;
    background: #111827;
    box-shadow: inset 0 0 0 2px #374151;
}

.phone-notch {
    width: 64px;
    height: 8px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #4b5563;
}

.phone-screen {
    overflow: hidden;
    border-radius: 18px;
    background: #0b1220;
    color: #fff;
    min-height: 340px;
    display: grid;
    grid-template-rows: 120px auto 1fr;
}

.phone-cover {
    background: linear-gradient(160deg, #1e3a8a, #0f172a 70%);
    background-size: cover;
    background-position: center;
}

.phone-meta {
    padding: 10px 12px;
    background: rgba(15, 23, 42, .92);
}

.phone-meta b,
.phone-meta small {
    display: block;
}

.phone-meta small {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 11px;
}

.phone-chat {
    display: grid;
    place-items: end start;
    padding: 12px;
    color: #94a3b8;
    font-size: 11px;
    background: #020617;
}

.phone-hint {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
}

.config-side {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 8px;
    border-right: 1px solid var(--line);
    overflow-y: auto;
    max-height: min(62vh, 620px);
}

.config-side button {
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.config-side button.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.config-main {
    overflow-y: auto;
    max-height: min(62vh, 620px);
    padding-right: 4px;
}

.config-main h3 {
    margin: 18px 0 12px;
    font-size: 14px;
}

.config-main h3:first-child {
    margin-top: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.info-grid div {
    padding: 10px 12px;
    background: var(--surface-raised);
    border-radius: 10px;
}

.info-grid small,
.switch-row small,
.choice-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.switch-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.switch-copy {
    min-width: 0;
}

.switch-copy b {
    display: block;
    font-size: 13px;
}

.switch {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
    vertical-align: middle;
    cursor: pointer;
}

.switch input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.switch-track {
    position: absolute;
    inset: 0;
    display: block;
    background: #cfd7d3;
    border-radius: 999px;
    pointer-events: none;
    transition: background .15s ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    transition: transform .15s ease;
}

.switch input:checked + .switch-track {
    background: var(--accent-strong, #1677ff);
}

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

.switch input:focus-visible + .switch-track {
    outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
    outline-offset: 2px;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 12px 0 16px;
}

.choice-card {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}

.choice-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--link-soft);
}

.course-config .config-tabs {
    display: flex;
    overflow-x: auto;
    margin: -8px 0 24px;
    border-bottom: 1px solid var(--line);
}

.config-tabs button {
    padding: 12px 18px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 800;
}

.config-tabs button.active {
    color: var(--accent-strong);
    border-color: var(--accent);
}

.config-panel {
    display: none;
}

.config-panel.active {
    display: block;
}

.broadcast-summary {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.broadcast-thumb {
    width: 120px;
    height: 72px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: #1c2430;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.broadcast-thumb img,
.broadcast-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #0f172a;
}

.broadcast-actions {
    margin: 8px 0 24px;
    display: grid;
    gap: 10px;
    justify-items: start;
}

.broadcast-actions .button {
    min-width: 140px;
}

.broadcast-actions .button.danger {
    background: #d94841;
    border-color: #d94841;
    color: #fff;
}

.live-elapsed {
    margin: 0;
    color: #d94841;
    font-size: 14px;
    font-weight: 600;
}

.broadcast-assist {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-raised);
}

.broadcast-link-row {
    display: flex;
    gap: 8px;
}

.broadcast-link-row input {
    flex: 1;
    min-width: 0;
}

@media (max-width: 720px) {
    .broadcast-summary {
        grid-template-columns: 1fr;
    }
}

.switch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-bottom: 22px;
}

.switch-grid label {
    font-size: 12px;
    font-weight: 700;
}

.config-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.config-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.config-block-head b, .config-block-head small {
    display: block;
}

.config-block-head small, .media-hint {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.media-pick-field {
    min-width: 0;
}

.media-pick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 10px 12px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
}

.media-pick-card.empty {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.media-pick-thumb {
    display: grid;
    place-items: center;
    width: 52px;
    height: 36px;
    flex: 0 0 auto;
    color: #fff;
    background: #1f2a24;
    font-size: 12px;
}

.media-pick-meta {
    flex: 1;
    min-width: 0;
}

.media-pick-meta b,
.media-pick-meta small {
    display: block;
}

.media-pick-meta small,
.media-pick-hint {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.media-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(9, 21, 17, .55);
}

.media-picker-dialog {
    width: min(920px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.media-picker-notice {
    margin: 12px 0;
}

.media-picker-toolbar {
    margin-bottom: 10px;
}

.media-picker-table tr.is-selected {
    background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
}

.media-picker-table tr[data-picker-row] {
    cursor: pointer;
}

.config-rows, .product-choices {
    display: grid;
    gap: 9px;
}

.config-rows.danmaku-rows {
    gap: 4px;
    max-height: min(52vh, 480px);
    overflow: auto;
    padding-right: 2px;
}

.config-row {
    display: grid;
    align-items: end;
    gap: 9px;
    padding: 11px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
}

.danmaku-list-head {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 112px 44px 40px;
    gap: 8px;
    padding: 0 8px 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.danmaku-row {
    grid-template-columns: 64px minmax(0, 1fr) 112px 44px 40px;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    min-height: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.danmaku-row label {
    display: grid;
    gap: 0;
    margin: 0;
    color: transparent;
    font-size: 0;
    line-height: 0;
}

.danmaku-row input {
    width: 100%;
    min-height: 28px;
    height: 28px;
    padding: 2px 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
}

.danmaku-row input[type="color"] {
    width: 32px;
    min-width: 32px;
    height: 28px;
    min-height: 28px;
    padding: 2px;
    cursor: pointer;
}

.danmaku-row .danmaku-remove {
    justify-self: end;
    padding: 0;
    font-size: 12px;
    line-height: 28px;
    white-space: nowrap;
}

.danmaku-row:hover {
    border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
    background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface-raised));
}

.popup-row {
    grid-template-columns: 115px 100px 1fr 1fr auto;
}

.popup-row .span-2 {
    grid-column: 1 / -1;
}

.popup-row textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
}

.config-row label, .product-recommend {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
}

.config-row input, .product-choice input[type="number"] {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.config-row input[type="color"] {
    padding: 4px;
}

.config-row.danmaku-row label {
    display: block;
    gap: 0;
    margin: 0;
    color: transparent;
    font-size: 0;
    line-height: 0;
    font-weight: 400;
}

.config-row.danmaku-row input {
    width: 100%;
    min-height: 28px;
    height: 28px;
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 400;
}

.config-row.danmaku-row input[type="color"] {
    width: 32px;
    min-width: 32px;
    height: 28px;
    min-height: 28px;
    padding: 2px;
}

.danger-text {
    color: var(--danger);
}

.product-choice {
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) 140px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
}

.product-choice b, .product-choice small {
    display: block;
}

.product-choice small {
    margin-top: 5px;
    color: var(--muted);
}

.span-2 {
    grid-column: span 2;
}

.notice {
    padding: 12px 14px;
    color: #705e22;
    background: #fff8d9;
    border: 1px solid #eee0a7;
    font-size: 11px;
    line-height: 1.6;
}

.share-course-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.share-course-card b,
.share-course-card small {
    display: block;
}

.share-course-card b {
    font-size: 15px;
    line-height: 1.35;
}

.share-course-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.share-domain-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.share-domain-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.share-domain-select {
    width: 100%;
    min-height: 36px;
}

.share-domain-hint {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.share-block {
    margin-bottom: 16px;
    padding-bottom: 4px;
}

.share-block .section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.share-block .section-head h3 {
    margin: 0;
    font-size: 14px;
}

.share-block .section-head .muted {
    margin: 2px 0 0;
    font-size: 12px;
}

.share-block-channels {
    margin-bottom: 8px;
}

.share-tips {
    margin: 10px 0 0;
    padding: 10px 12px 10px 28px;
    color: #6b5a2a;
    background: #fff9e8;
    border: 1px solid #f0e4b0;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.55;
}

.share-tips li + li {
    margin-top: 2px;
}

.share-link-field {
    margin-bottom: 10px;
}

.share-link-field:last-of-type {
    margin-bottom: 0;
}

.share-channel-table {
    max-height: min(240px, 32vh);
    overflow: auto;
}

.share-channel-table .data-table th,
.share-channel-table .data-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.share-channel-name {
    white-space: nowrap;
    max-width: 140px;
}

.share-dialog-actions {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

dialog:has(.share-dialog) {
    width: min(860px, calc(100vw - 24px));
}

dialog:has(.share-dialog) .dialog-card {
    padding: 22px 24px 18px;
}

.invite-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.invite-layout-links-only {
    grid-template-columns: 1fr;
}

.invite-qr {
    display: grid;
    gap: 8px;
    justify-items: stretch;
}

.invite-qr img {
    width: 180px;
    height: 180px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-sizing: border-box;
}

.share-qr-copy {
    width: 100%;
    justify-content: center;
}

.invite-links {
    min-width: 0;
}

.copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.copy-field input {
    border-radius: 7px 0 0 7px;
    font-size: 12px;
}

.copy-field button {
    padding: 0 12px;
    color: #fff;
    background: var(--accent-strong);
    border: 0;
    border-radius: 0 7px 7px 0;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
}

.toast {
    position: fixed;
    inset: auto auto 28px 50%;
    z-index: 10000;
    max-width: min(520px, calc(100vw - 30px));
    margin: 0;
    padding: 11px 17px;
    color: #fff;
    background: #1f332c;
    border: 0;
    border-radius: 7px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translate(-50%, 14px);
    pointer-events: none;
    overflow: visible;
    transition: .2s;
    font-size: 12px;
}

.toast.show,
.toast:popover-open {
    display: block;
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.error {
    background: #9d3e36;
}

.wallet-debt-banner {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 10px 16px;
    background: #fff4f1;
    border-bottom: 1px solid #f0c4bc;
}

.wallet-debt-banner.hidden {
    display: none;
}

.wallet-debt-card {
    display: grid;
    gap: 4px;
    max-width: 920px;
}

.wallet-debt-card b {
    color: #9d3e36;
    font-size: 14px;
}

.wallet-debt-card p,
.wallet-debt-card small {
    margin: 0;
    color: #6d433c;
    font-size: 12px;
    line-height: 1.5;
}

.wallet-debt-panel {
    padding: 28px 24px;
    text-align: left;
}

.wallet-debt-panel h2 {
    margin: 0 0 10px;
    color: #9d3e36;
}

.portal-nav button.nav-locked,
.portal-nav button:disabled {
    opacity: .38;
    cursor: not-allowed;
}

.notice.danger {
    color: #7a2f28;
    background: #fff4f1;
    border-color: #f0c4bc;
}

.monitor-dialog {
    width: min(1480px, calc(100vw - 16px));
    padding: 0;
    border: 0;
    background: transparent;
}

.monitor-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: min(850px, calc(100vh - 20px));
    background: #111a18;
    color: #fff;
}

.monitor-shell.ref {
    grid-template-rows: auto minmax(0, 1fr) minmax(160px, 28%);
    background: #f5f7fb;
    color: #1f2a37;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(20, 35, 60, .18);
}

.monitor-shell.ref .monitor-head {
    background: #fff;
    border-bottom: 1px solid #e6ebf2;
    color: #1f2a37;
}

.monitor-shell.ref .monitor-brand b {
    color: #2f6bff;
    font-size: 14px;
}

.monitor-shell.ref .monitor-head h2 {
    font-size: 15px;
    font-weight: 600;
}

.monitor-shell.ref .monitor-head .icon-button {
    margin-left: auto;
    color: #667085;
}

.monitor-shell.ref .monitor-body {
    grid-template-columns: minmax(260px, .9fr) minmax(0, 1.4fr) minmax(280px, .95fr);
    background: #f5f7fb;
}

.monitor-shell.ref .monitor-main {
    background: #fff;
    border-left: 1px solid #e6ebf2;
    border-right: 1px solid #e6ebf2;
    grid-template-rows: minmax(0, 1fr) minmax(160px, min(34%, 280px));
}

.monitor-shell.ref .video-frame {
    background: #0b1220;
    min-height: 200px;
}

.monitor-shell.ref .monitor-tools {
    position: relative;
    z-index: 2;
    background: #fff;
    border-top: 1px solid #e6ebf2;
    min-height: 0;
    max-height: 100%;
    overflow: auto;
}

.monitor-shell.ref .monitor-tabs {
    border-bottom: 1px solid #eef2f7;
}

.monitor-shell.ref .monitor-tabs button {
    color: #667085;
}

.monitor-shell.ref .monitor-tabs button.active {
    color: #2f6bff;
    border-color: #2f6bff;
}

.monitor-shell.ref .tool-panel {
    color: #475467;
}

.monitor-shell.ref .tool-card {
    background: #f8fafc;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
}

.monitor-shell.ref .tool-card b {
    color: #1f2a37;
}

.monitor-shell.ref .interaction {
    background: #fff;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.feed-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f7;
    background: #fbfcfe;
    font-size: 12px;
}

.message {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.message-avatar {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: #dbe4ff;
}

.message-body {
    min-width: 0;
    flex: 1;
}

.list-kind {
    border-top: 0;
}

.monitor-users {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    background: #fff;
}

.user-presence {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f7;
}

.user-presence button {
    border: 0;
    background: transparent;
    color: #667085;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
    font-size: 12px;
}

.user-presence button.active {
    color: #2f6bff;
    border-color: #2f6bff;
}

.user-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f7;
    font-size: 12px;
    color: #475467;
}

.user-panel {
    min-height: 0;
    overflow: auto;
    padding: 10px 12px;
}

.monitor-user-list {
    display: grid;
    gap: 8px;
}

.guest-avatar {
    display: block;
    border-radius: 50%;
    object-fit: cover;
    background: #eef2f7;
    flex-shrink: 0;
}

.monitor-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    background: #fff;
}

.monitor-user-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.monitor-user-identity {
    min-width: 0;
}

.monitor-user-name-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.3;
}

.monitor-user-name-line b {
    display: inline;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
}

.monitor-user-channel {
    color: #22c55e;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.monitor-user-new {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 3px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.monitor-user-row small {
    display: block;
    margin-top: 4px;
    color: #98a2b3;
    font-size: 11px;
}

.monitor-user-actions {
    display: flex;
    gap: 6px;
    align-items: start;
}

.monitor-user-more {
    position: relative;
    flex-shrink: 0;
}

.monitor-user-more > summary {
    list-style: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: #98a2b3;
    font-size: 16px;
    letter-spacing: 1px;
    user-select: none;
}

.monitor-user-more > summary::-webkit-details-marker {
    display: none;
}

.monitor-user-more > summary:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.monitor-user-more-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
    min-width: 96px;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    display: grid;
    gap: 2px;
}

.monitor-user-more-menu button {
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.monitor-user-more-menu button:hover {
    background: #f3f4f6;
}

.monitor-user-more-menu button.danger-text {
    color: #dc2626;
}

.dock-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dock-user b {
    display: inline;
    margin-right: 4px;
}

.monitor-dock {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    border-top: 1px solid #e6ebf2;
    min-height: 0;
}

.dock-panel {
    min-height: 0;
    overflow: auto;
    padding: 10px 14px;
}

.announce-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.announce-modes button {
    border: 1px solid #d0d5dd;
    background: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    color: #475467;
    font-size: 12px;
}

.announce-modes button.active {
    border-color: #2f6bff;
    color: #2f6bff;
    background: #eff4ff;
}

.monitor-publisher textarea {
    width: 100%;
    min-height: 96px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 10px;
    resize: vertical;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.monitor-hint {
    margin-top: 10px;
    font-size: 12px;
}

.message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}

.data-table.compact th,
.data-table.compact td {
    padding: 8px 10px;
    font-size: 12px;
}

.monitor-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 17px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.monitor-head h2 {
    min-width: 0;
    overflow: hidden;
    margin: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.monitor-head .badge {
    margin-left: 0;
}

.monitor-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(300px, .65fr);
}

.monitor-main {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(180px, min(40%, 320px));
    overflow: hidden;
}

.video-frame {
    position: relative;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #070b0a;
}

.video-frame video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.video-empty {
    color: #7d8b86;
    font-size: 12px;
}

.live-overlay {
    position: absolute;
    left: 15px;
    top: 15px;
    padding: 6px 9px;
    background: rgba(0, 0, 0, .55);
    border-radius: 4px;
    font-size: 10px;
}

.monitor-tools {
    position: relative;
    z-index: 2;
    min-height: 210px;
    min-width: 0;
    overflow: auto;
    background: #17211f;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.monitor-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.monitor-tabs button {
    padding: 12px 15px;
    color: #8fa09a;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 11px;
}

.monitor-tabs button.active {
    color: #fff;
    border-color: var(--accent);
}

.tool-panel {
    padding: 17px;
    color: #a9b8b3;
    font-size: 11px;
    line-height: 1.7;
}

.tool-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.tool-card {
    padding: 13px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
}

.tool-card b {
    display: block;
    margin-bottom: 5px;
    color: #fff;
}

.interaction {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #fff;
    color: var(--ink);
}

.interaction-head {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}

.message-feed {
    overflow-y: auto;
    padding: 16px;
}

.message {
    margin-bottom: 15px;
    font-size: 11px;
    line-height: 1.5;
}

.message b {
    color: var(--accent-strong);
}

.message time {
    margin-left: 5px;
    color: #9ca5a1;
    font-size: 9px;
}

.message-revoke {
    float: right;
    padding: 2px 5px;
    color: var(--danger);
    background: transparent;
    border: 0;
    font-size: 9px;
}

.message.event {
    position: relative;
    padding: 10px;
    background: var(--surface-raised);
    border-left: 2px solid var(--accent);
}

.message-kind {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}

.send-box {
    padding: 12px;
    border-top: 1px solid var(--line);
}

.send-box textarea {
    width: 100%;
    height: 68px;
    resize: none;
    padding: 9px;
    border: 1px solid var(--line);
}

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

.monitor-publisher {
    display: grid;
    grid-template-columns: minmax(190px, .7fr) minmax(240px, 1.4fr) auto;
    gap: 12px;
    align-items: center;
}

.monitor-publisher b, .monitor-publisher span {
    display: block;
}

.monitor-publisher b {
    color: #fff;
}

.monitor-publisher input {
    min-height: 40px;
    padding: 9px 11px;
    color: #fff;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    outline: none;
}

.monitor-publisher input:focus {
    border-color: var(--accent);
}

.product-tool {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.product-tool span {
    color: #fff;
}

.product-tool del {
    color: #788780;
}

.tool-empty {
    display: grid;
    gap: 6px;
    padding: 20px;
    text-align: center;
}

.tool-empty b {
    color: #fff;
}

body[data-portal="admin"] {
    --accent: #dfb55c;
    --accent-strong: #74551a;
    --accent-soft: #f7edda;
    --nav: #1d2529;
}

body[data-portal="console"] {
    --accent: #73caa8;
    --accent-strong: #21684f;
    --accent-soft: #e2f3ec;
    --nav: #142923;
}

body[data-portal="teacher"] {
    --accent: #e98261;
    --accent-strong: #9c452d;
    --accent-soft: #f9e8e1;
    --nav: #28231f;
}

body[data-portal="teacher"] .teacher-overview-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body[data-portal="teacher"] .teacher-overview-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #fff8f5, #fff);
}

body[data-portal="teacher"] .teacher-overview-hero h2 {
    margin: 4px 0 8px;
    font-size: 24px;
}

body[data-portal="teacher"] .teacher-overview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

body[data-portal="teacher"] .teacher-todo-list {
    list-style: none;
    margin: 0;
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body[data-portal="teacher"] .teacher-todo-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    background: var(--surface);
}

body[data-portal="teacher"] .teacher-todo-item:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

body[data-portal="teacher"] .teacher-todo-item b {
    display: block;
    margin-bottom: 2px;
}

body[data-portal="teacher"] .teacher-todo-item small {
    color: var(--muted);
    line-height: 1.45;
}

body[data-portal="teacher"] .teacher-guide-item {
    padding: 8px 0;
}

body[data-portal="teacher"] .teacher-notice-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 12px 12px;
}

body[data-portal="teacher"] .teacher-notice {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
}

body[data-portal="teacher"] .teacher-notice p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

body[data-portal="teacher"] .teacher-compliance-list .teacher-compliance-danger b {
    color: #b42318;
}

body[data-portal="teacher"] .teacher-compliance-list .teacher-compliance-warn b {
    color: #b54708;
}

@media (max-width: 900px) {
    body[data-portal="teacher"] .teacher-overview-hero {
        flex-direction: column;
    }

    body[data-portal="teacher"] .teacher-overview-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

body[data-portal="channel"] {
    --accent: #78a8ff;
    --accent-strong: #285ea9;
    --accent-soft: #e5eefc;
    --nav: #182439;
}

@media (max-width: 1050px) {
    .metric-grid {
        grid-template-columns: 1fr 1fr;
    }

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

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

    .monitor-body {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

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

    .business-filters {
        grid-template-columns: 1fr 1fr;
    }

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

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

    .filter-search {
        grid-column: span 2;
    }
}

.material-tabs {
    display: flex;
    gap: 26px;
    padding: 0 10px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.material-tabs button {
    padding: 16px 2px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font-weight: 700;
}

.material-tabs button.active {
    color: var(--link);
    border-color: var(--link);
}

.material-layout {
    display: grid;
    grid-template-columns:210px minmax(0, 1fr);
    min-height: 520px;
    margin-top: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.category-panel {
    padding: 18px 12px;
    border-right: 1px solid var(--line);
}

.category-item {
    width: 100%;
    padding: 10px 12px;
    margin-top: 5px;
    color: var(--ink);
    background: transparent;
    border: 0;
    text-align: left;
}

.category-item.active {
    color: var(--link);
    background: var(--link-soft);
}

.material-content {
    min-width: 0;
    padding: 18px;
}

.material-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.material-toolbar > div {
    margin-right: auto;
}

.material-toolbar b, .material-toolbar small {
    display: block;
}

.material-toolbar small {
    margin-top: 4px;
    color: var(--muted);
}

.material-toolbar .control {
    width: auto;
    min-width: 180px;
    max-width: 280px;
    flex: 1 1 200px;
}

.material-toolbar .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.material-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.material-cover {
    width: 92px;
    height: 54px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, var(--nav), var(--accent));
    border-radius: 4px;
    font-size: 10px;
}

.material-cover img,
.material-cover video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #0f172a;
}

@media (max-width: 760px) {
    .login-view {
        grid-template-columns: 1fr;
    }

    .login-story {
        min-height: 38vh;
        padding: 95px 28px 42px;
    }

    .login-story .brand {
        top: 28px;
    }

    .login-story h1 {
        font-size: 37px;
    }

    .login-story > p:last-child {
        margin-top: 15px;
        font-size: 13px;
    }

    .login-panel {
        padding: 28px 18px;
    }

    .login-card {
        padding: 27px;
    }

    .app-view {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        overflow: visible;
        padding: 12px;
    }

    .side-brand {
        padding: 3px 4px 12px;
    }

    .nav-label {
        display: none;
    }

    .portal-nav {
        display: flex;
        overflow-x: auto;
        flex: 0 0 auto;
        padding-bottom: 0;
    }

    .portal-nav-group {
        display: none;
    }

    .portal-nav button {
        min-width: max-content;
        padding: 10px 12px;
    }

    .workspace {
        padding: 0 14px 35px;
    }

    .topbar {
        min-height: 64px;
        margin: 0 -14px;
        padding: 10px 14px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .date-chip {
        display: none;
    }

    .account-trigger b {
        max-width: 72px;
    }

    .date-chip {
        display: none;
    }

    .page {
        padding-top: 22px;
    }

    .metric-grid, .card-grid {
        grid-template-columns: 1fr;
    }

    .delivery-grid, .marketing-metrics, .tool-summary-grid {
        grid-template-columns: 1fr;
    }

    .module-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .module-toolbar > .control {
        width: 100%;
    }

    .module-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .module-tabs .filter {
        flex: 0 0 auto;
    }

    .homework-row {
        grid-template-columns: 50px minmax(0, 1fr);
    }

    .homework-row > .badge, .homework-row > .button {
        grid-column: 2;
        justify-self: start;
    }

    .metric {
        min-height: 120px;
    }

    .page-head {
        align-items: start;
        flex-direction: column;
    }

    .media-row {
        grid-template-columns: 42px minmax(150px, 1fr) auto;
    }

    .media-row > span {
        display: none;
    }

    .upload-box, .form-grid {
        grid-template-columns: 1fr;
    }

    .material-layout {
        grid-template-columns:1fr;
    }

    .category-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .material-toolbar {
        flex-wrap: wrap;
    }

    .material-toolbar .control {
        width: 100%;
    }

    .span-2 {
        grid-column: auto;
    }

    .monitor-shell {
        height: calc(100vh - 12px);
    }

    .monitor-body {
        display: block;
        overflow-y: auto;
    }

    .monitor-main {
        display: block;
    }

    .video-frame {
        min-height: 250px;
    }

    .interaction {
        min-height: 430px;
    }

    .tool-cards {
        grid-template-columns: 1fr;
    }

    .product-grid, .analytics-grid {
        grid-template-columns: 1fr;
    }

    .marketing-hub-grid {
        grid-template-columns:1fr;
    }

    .business-filters {
        grid-template-columns: 1fr;
    }

    .filter-search {
        grid-column: auto;
    }

    .report-row {
        grid-template-columns: 50px minmax(0, 1fr);
    }

    .report-row > .badge, .report-row > .button {
        grid-column: 2;
        justify-self: start;
    }

    .monitor-publisher {
        grid-template-columns: 1fr;
    }

    .course-config {
        min-height: 0;
    }

    .config-layout {
        grid-template-columns: 1fr;
    }

    .config-side {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding-bottom: 8px;
        max-height: none;
    }

    .config-side button {
        white-space: nowrap;
        width: auto;
    }

    .config-main {
        max-height: none;
    }

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

    .config-row, .popup-row, .product-choice {
        grid-template-columns: 1fr;
    }

    .danmaku-list-head {
        display: none;
    }

    .danmaku-row {
        grid-template-columns: 72px minmax(0, 1fr) auto;
        grid-template-areas:
            "at color remove"
            "content content content"
            "author author author";
    }

    .danmaku-row .danmaku-at { grid-area: at; }
    .danmaku-row .danmaku-content { grid-area: content; }
    .danmaku-row .danmaku-author { grid-area: author; }
    .danmaku-row .danmaku-color { grid-area: color; }
    .danmaku-row .danmaku-remove { grid-area: remove; }

    .config-row .text-button {
        justify-self: start;
    }

    .invite-layout {
        grid-template-columns: 1fr;
    }

    .invite-qr {
        justify-items: center;
    }

    .invite-qr img {
        width: 160px;
        height: 160px;
    }

    .share-domain-row {
        grid-template-columns: 1fr;
    }

    .share-channel-table {
        max-height: min(200px, 28vh);
    }

    .marketing-course-filters {
        flex-wrap: wrap;
    }

    .marketing-course-filters > .control,
    .marketing-course-filters > input.control:first-child {
        flex: 1 1 100%;
        width: 100% !important;
        max-width: none;
        margin-right: 0;
        min-width: 0;
    }

    .marketing-course-filters > .button {
        flex: 1 1 auto;
    }
}

.badge.warn {
    color: #b54708;
    background: #fffaeb;
}

dialog:has(.annotation-shell) {
    width: min(1280px, calc(100vw - 16px));
}

.annotation-shell {
    background: var(--surface);
    border-radius: 12px;
    padding: 18px 20px;
}

.annotation-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .95fr);
    gap: 16px;
    align-items: start;
}

.annotation-player {
    display: grid;
    grid-template-rows: auto auto;
    align-self: start;
    background: #0b1220;
    border-radius: 10px;
    overflow: hidden;
}

.annotation-player-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #e8eefc;
    background: rgba(255, 255, 255, .04);
}

.annotation-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.annotation-page-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.annotation-page-head h2 {
    margin: 0 0 2px;
    font-size: 18px;
    line-height: 1.25;
}

.annotation-page-head .muted {
    margin: 0;
    font-size: 12px;
}

.annotation-page-body {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

.annotation-page-body .annotation-side {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.annotation-page-body .annotation-player {
    max-height: 100%;
}

.workspace:has(.annotation-page) {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 16px;
}

.workspace:has(.annotation-page) .topbar {
    flex-shrink: 0;
    min-height: 72px;
}

.workspace:has(.annotation-page) .topbar h1 {
    font-size: 24px;
}

.workspace:has(.annotation-page) .page {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 12px;
}

.annotation-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    background: var(--surface);
    flex-shrink: 0;
}

.annotation-pager-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-menu {
    position: relative;
}

.batch-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
    min-width: 120px;
    display: grid;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.batch-menu-panel button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
}

.batch-menu-panel button:hover {
    background: var(--surface-raised);
}

.cue-hms-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cue-hms-row input[type="number"] {
    width: 64px;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

dialog:has(.cue-add-form) {
    width: min(640px, calc(100vw - 24px));
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
}

dialog:has(.cue-add-form) .dialog-card {
    padding: 0;
    max-height: calc(100vh - 32px);
}

.cue-add-form {
    padding: 18px 22px 16px;
    color: var(--ink);
}

.cue-add-head {
    margin-bottom: 8px;
    align-items: center;
}

.cue-add-head h2 {
    font: 600 16px/1.4 "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
}

.cue-add-section {
    margin: 14px 0 4px;
}

.cue-add-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.cue-add-section-head b {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.cue-add-bar {
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: #409eff;
    flex-shrink: 0;
}

.cue-add-hint {
    margin-left: 4px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.cue-add-row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.cue-add-row-top {
    align-items: start;
}

.cue-add-label {
    text-align: right;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    line-height: 32px;
}

.cue-add-label i {
    color: #f56c6c;
    font-style: normal;
    margin-right: 4px;
}

.cue-add-control {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.cue-hms {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cue-hms span {
    color: var(--muted);
    font-weight: 600;
}

.cue-add-form .cue-hms input[type="number"] {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    min-height: 32px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-raised);
    color: var(--ink);
    font-size: 13px;
    font-weight: 400;
    text-align: center;
    box-shadow: none;
}

.cue-add-form .cue-hms input[type="number"]:focus {
    border-color: #409eff;
    outline: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, #409eff 25%, transparent);
}

.cue-add-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--link);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.cue-add-link:hover {
    color: #79bbff;
}

.cue-add-radios {
    gap: 18px;
}

.cue-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ink);
    cursor: pointer;
}

.cue-radio input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #409eff;
}

.cue-input-wrap,
.cue-textarea-wrap {
    position: relative;
    width: 100%;
}

.cue-add-form .cue-input-wrap input {
    width: 100%;
    min-height: 32px;
    height: 32px;
    padding: 4px 64px 4px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-raised);
    color: var(--ink);
    font-size: 13px;
    font-weight: 400;
    box-shadow: none;
}

.cue-add-form .cue-textarea-wrap textarea {
    width: 100%;
    min-height: 120px;
    padding: 8px 12px 28px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-raised);
    color: var(--ink);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    resize: vertical;
    box-shadow: none;
}

.cue-add-form .cue-input-wrap input:focus,
.cue-add-form .cue-textarea-wrap textarea:focus {
    border-color: #409eff;
    outline: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, #409eff 25%, transparent);
}

.cue-counter {
    position: absolute;
    right: 10px;
    bottom: 6px;
    font-size: 12px;
    color: var(--muted);
    pointer-events: none;
}

.cue-input-wrap .cue-counter {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.cue-add-actions {
    margin: 8px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.cue-add-form fieldset.field {
    border: 0;
    padding: 0;
    margin: 0 0 12px;
}

.cue-add-form legend {
    margin-bottom: 8px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .cue-add-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .cue-add-label {
        text-align: left;
        line-height: 1.4;
    }
}

.switch-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.annotation-player video {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(48vh, 380px);
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
}

.annotation-player-empty {
    min-height: 200px;
    display: grid;
    place-items: center;
    color: #94a3b8;
    background: #000;
}

.annotation-meta {
    display: none;
}

.annotation-side {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
    min-height: 0;
}

.annotation-side .monitor-tabs {
    gap: 0;
    overflow-x: visible;
    border-bottom: 1px solid var(--line);
    background: var(--surface-raised);
}

.annotation-side .monitor-tabs button {
    flex: 1;
    padding: 11px 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.annotation-side .monitor-tabs button.active {
    color: var(--link);
    border-color: var(--link);
    background: transparent;
}

.annotation-side .user-presence {
    gap: 16px;
    padding: 10px 14px 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.annotation-side .user-presence button {
    color: var(--muted);
    padding: 6px 2px 8px;
    font-size: 13px;
    border-bottom: 2px solid transparent;
}

.annotation-side .user-presence button.active {
    color: var(--link);
    border-color: var(--link);
    font-weight: 500;
}

.annotation-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.annotation-toolbar .control {
    flex: 1 1 160px;
    min-width: 140px;
    margin-right: auto;
}

.cue-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 10px;
    overscroll-behavior: contain;
}

.cue-editor {
    overflow: auto;
    padding: 12px;
    border-top: 1px solid var(--line);
}

.cue-editor-form .cue-at-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cue-editor-form .cue-at-row input {
    flex: 1;
    min-width: 0;
}

.cue-editor-form textarea {
    resize: vertical;
    min-height: 72px;
}

.cue-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 36px;
    padding: 8px 10px;
    border-bottom: 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 18px;
}

.cue-row:hover {
    background: var(--surface-raised);
}

.cue-row time {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    line-height: 18px;
    white-space: nowrap;
}

.cue-main {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    font-weight: 400;
}

.cue-row b,
.cue-row span {
    display: inline;
}

.cue-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    flex-shrink: 0;
}

.cue-row:hover .cue-actions,
.cue-row:focus-within .cue-actions {
    opacity: 1;
    pointer-events: auto;
}

.cue-actions .text-button {
    padding: 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--link);
}

.cue-actions .danger-text {
    color: #f56c6c;
}

.message-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    font-size: 12px;
}

@media (max-width: 960px) {
    .annotation-body {
        grid-template-columns: 1fr;
    }

    .workspace:has(.annotation-page) {
        height: auto;
        max-height: none;
        overflow: auto;
    }

    .annotation-page-body {
        height: auto;
        min-height: 480px;
        overflow: visible;
    }

    .annotation-page-body .annotation-side {
        height: min(60vh, 560px);
    }
}
