:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --panel-soft: #f9fafb;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #d9dee7;
    --primary: #1f7a5a;
    --primary-strong: #146044;
    --accent: #c56b2c;
    --danger: #b42318;
    --warning: #a15c07;
    --ok: #087443;
    --shadow: 0 10px 25px rgba(31, 41, 55, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

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

button {
    border: 0;
    cursor: pointer;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

.login-wrap {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 24px 72px;
}

.login-panel {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1fr 420px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.login-stack {
    width: min(960px, 100%);
}

.login-footer {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    color: #64746d;
    font-size: 13px;
    line-height: 1.6;
}

.login-footer a {
    color: #64746d;
}

.login-footer a:hover {
    color: var(--primary);
}

.login-intro {
    padding: 44px;
    background: #12372a;
    color: #f8fafc;
}

.login-intro h1 {
    margin: 0 0 16px;
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: 0;
}

.login-intro p {
    margin: 0;
    max-width: 480px;
    color: #dce7e1;
    line-height: 1.8;
}

.login-card {
    padding: 36px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 232px 1fr;
}

.sidebar {
    background: #17211d;
    color: #edf7f2;
    padding: 20px 14px;
}

.brand {
    padding: 8px 10px 22px;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
}

.brand-sub {
    margin-top: 6px;
    font-size: 13px;
    color: #b6c7bf;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 10px 12px;
    color: #dbe8e2;
    background: transparent;
    border-radius: 6px;
    text-align: left;
}

.nav button.active,
.nav button:hover {
    background: #244a3b;
    color: #ffffff;
}

.main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.content {
    padding: 24px;
}

.page-title {
    margin: 0 0 18px;
    font-size: 24px;
    letter-spacing: 0;
}

.grid {
    display: grid;
    gap: 16px;
}

.verify-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    min-height: 38px;
    padding: 6px 8px 6px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
}

.verify-row span {
    color: var(--text);
    font-weight: 700;
}

.verify-row .btn {
    min-height: 28px;
    padding: 5px 10px;
    font-size: 12px;
}

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

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

.panel,
.stat,
.activity-card,
.mobile-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel {
    padding: 18px;
}

.panel h2,
.panel h3 {
    margin: 0 0 14px;
    letter-spacing: 0;
}

.panel h2 {
    font-size: 18px;
}

.panel h3 {
    font-size: 16px;
}

.settings-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.settings-nav {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.settings-nav-item {
    display: grid;
    gap: 4px;
    width: 100%;
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.settings-nav-item strong {
    font-size: 14px;
}

.settings-nav-item span {
    color: var(--muted);
    font-size: 12px;
}

.settings-nav-item.active,
.settings-nav-item:hover {
    background: var(--panel-soft);
}

.settings-nav-item.active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.settings-content {
    min-width: 0;
}

.terminal-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 220px));
    gap: 16px;
    margin-top: 16px;
    align-items: stretch;
}

.terminal-code-card {
    display: grid;
    grid-template-rows: auto auto minmax(38px, auto) auto;
    gap: 10px;
    justify-items: center;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    text-align: center;
}

.terminal-code-title {
    width: 100%;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.terminal-code-box {
    width: 168px;
    height: 168px;
    display: grid;
    place-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.terminal-code-box img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.terminal-code-empty {
    max-width: 120px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.terminal-download-btn {
    width: 100%;
    align-self: end;
}

.media-library-panel {
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
}

.media-library-top {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 20px;
    border-bottom: 1px solid #e5e7eb;
}

.media-library-tabs {
    display: flex;
    gap: 32px;
    height: 100%;
    align-items: flex-end;
}

.media-library-tabs button {
    height: 52px;
    padding: 0;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

.media-library-tabs button.active {
    border-bottom-color: #1677ff;
    color: #1677ff;
}

.media-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: transparent;
    color: #9ca3af;
    font-size: 22px;
    line-height: 1;
}

.media-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.media-library-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: min(680px, calc(100vh - 136px));
}

.media-group-sidebar {
    position: relative;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 40px 16px 72px;
    border-right: 1px solid #e5e7eb;
    background: #fff;
}

.media-group-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px;
    align-items: center;
    gap: 4px;
}

.media-group-item {
    min-height: 34px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    justify-content: start;
    gap: 8px;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: #1677ff;
    text-align: left;
    font-size: 14px;
}

.media-group-item > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-folder-icon {
    width: 20px;
    height: 15px;
    display: inline-block;
    border-radius: 2px;
    background: #ffd666;
    position: relative;
}

.media-folder-icon::before {
    content: "";
    position: absolute;
    left: 0;
    top: -4px;
    width: 9px;
    height: 5px;
    border-radius: 2px 2px 0 0;
    background: #ffd666;
}

.media-group-item.active,
.media-group-row.active .media-group-item {
    color: #1677ff;
    font-weight: 700;
}

.media-group-delete {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: transparent;
    color: #9ca3af;
    font-size: 16px;
    line-height: 1;
}

.media-group-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.media-group-form {
    position: absolute;
    left: 46px;
    bottom: 24px;
    display: grid;
    gap: 8px;
}

.media-group-form input {
    width: 88px;
    min-height: 32px;
    padding: 6px 8px;
}

.media-group-form .btn {
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
}

.media-library-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    padding: 14px 40px 0 26px;
}

.media-toolbar {
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(240px, 340px) 92px minmax(250px, 1fr);
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #eef0f3;
}

.media-filter-form {
    position: relative;
}

.media-filter-form input {
    width: 100%;
    min-height: 34px;
    padding: 8px 10px 8px 32px;
    border: 1px solid #d9dee8;
    border-radius: 4px;
    outline: none;
    font-size: 13px;
}

.media-filter-form input:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, .12);
}

.media-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
}

.media-selected-count {
    color: #4b5563;
    font-size: 14px;
    white-space: nowrap;
}

.media-upload-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding-right: 6px;
}

.btn.primary.media-upload-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 88px;
    padding: 7px 16px;
    border-radius: 4px;
    background: #1677ff;
    border-color: #1677ff;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
}

.btn.primary.media-upload-btn:hover {
    background: #0f65d8;
}

.btn.primary.media-upload-btn input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.media-grid {
    align-content: start;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(106px, 106px));
    gap: 18px;
    max-height: min(58vh, 560px);
    overflow: auto;
    padding: 22px 8px 22px 0;
}

.media-card {
    position: relative;
    width: 106px;
    height: 106px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 4px;
    background: #f3f4f6;
    cursor: pointer;
}

.media-card.selected {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, .18);
}

.media-card.selected::after {
    content: "✓";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #1677ff;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.media-card-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, .58);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    opacity: 0;
    transition: opacity .16s ease, background .16s ease;
}

.media-card:hover .media-card-delete {
    opacity: 1;
}

.media-card-delete:hover {
    background: #dc2626;
}

.media-thumb {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .92);
    font-size: 30px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}

.media-file-icon {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.media-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 24px;
    padding: 5px 6px;
    background: linear-gradient(to top, rgba(15, 23, 42, .66), rgba(15, 23, 42, .08));
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-pagination {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #eef0f3;
    color: #4b5563;
    font-size: 14px;
}

.media-pagination button {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: #f6f8fb;
    color: #374151;
}

.media-pagination button.active {
    background: #1677ff;
    color: #fff;
}

.media-pagination button:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.media-page-ellipsis {
    color: #9ca3af;
}

.media-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 46px 16px 20px;
    margin: 0;
    border-top: 1px solid #eef0f3;
    background: #fff;
}

.media-picker-footer .btn {
    min-width: 104px;
}

.modal.media-picker {
    width: min(1360px, calc(100vw - 12px));
    max-height: calc(100vh - 24px);
    padding: 0;
    overflow: hidden;
}

.modal-backdrop.media-picker-modal {
    z-index: 60;
    padding: 12px;
}

.douyin-whitelist-box {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #c9d8de;
    border-radius: 8px;
    background: #f8fbfb;
}

.douyin-whitelist-box strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.douyin-whitelist-box p {
    margin: 0;
    line-height: 1.7;
}

.douyin-whitelist-users {
    display: grid;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5eef0;
}

.douyin-whitelist-users.empty-inline {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.douyin-test-user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.douyin-test-user {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding: 8px;
    border: 1px solid #dce8eb;
    border-radius: 8px;
    background: #fff;
}

.douyin-test-user img,
.douyin-test-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.douyin-test-user img {
    object-fit: cover;
}

.douyin-test-avatar {
    display: grid;
    place-items: center;
    background: #111827;
    color: #fff;
    font-size: 13px;
}

.douyin-test-user b,
.douyin-test-user small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.douyin-test-user b {
    font-size: 13px;
}

.douyin-test-user small {
    color: var(--muted);
    font-size: 11px;
}

.douyin-whitelist-field {
    display: grid;
    gap: 6px;
}

.douyin-whitelist-field span {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

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

.douyin-whitelist-row input {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
}

.settings-card h2 {
    margin-bottom: 8px;
}

.activity-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}

.activity-mode-tabs button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
}

.activity-mode-tabs button.active {
    border-color: var(--primary);
    background: rgba(31, 122, 90, .12);
    color: var(--primary);
    font-weight: 700;
}

.activity-form-mode-online .offline-only,
.activity-form-mode-offline .online-only {
    display: none !important;
}

.stat {
    padding: 18px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat-value {
    margin-top: 8px;
    font-size: 26px;
    font-weight: 700;
}

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

.order-tools-panel {
    padding-bottom: 14px;
}

.compact-head h2 {
    margin-bottom: 0;
}

.order-compact-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: end;
    margin-top: 12px;
}

.contents-form {
    display: contents;
}

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

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

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

.field-action > .btn {
    width: 100%;
}

.field-action .actions {
    gap: 8px;
}

.field-action .actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    padding-inline: 10px;
}

.field {
    display: grid;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
}

.field textarea {
    min-height: 84px;
    resize: vertical;
}

.cover-uploader {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: start;
}

.cover-preview {
    width: 180px;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef3f1;
    object-fit: cover;
    cursor: pointer;
}

.cover-preview.is-empty {
    opacity: .72;
}

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

.content-mode-panel {
    margin-top: 10px;
}

.content-mode-panel.is-hidden {
    display: none;
}

.content-image-uploader {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.content-image-preview {
    min-height: 120px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.content-image-preview img {
    width: 100%;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
    display: block;
}

.content-image-preview span {
    color: var(--muted);
    font-size: 13px;
}

.content-image-body {
    display: grid;
    gap: 10px;
}

.upload-btn {
    width: fit-content;
    cursor: pointer;
}

.upload-btn input {
    display: none;
}

.terminal-logo-uploader {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.terminal-logo-preview {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border: 1px dashed #b7c8ce;
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
}

.terminal-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.terminal-logo-body {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.nav-icon-uploader {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 10px;
    align-items: center;
}

.nav-icon-preview {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
    cursor: pointer;
}

.nav-icon-preview img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.nav-icon-preview span {
    font-size: 24px;
    line-height: 1;
}

.nav-icon-body {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.cover-preview:hover,
.content-image-preview:hover,
.terminal-logo-preview:hover,
.nav-icon-preview:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 122, 90, .10);
}

.image-picker-hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

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

.home-banner-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) 1fr 1.2fr 120px 64px;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.home-banner-uploader {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.home-banner-preview {
    position: relative;
    display: grid;
    place-items: center;
    width: 150px;
    aspect-ratio: 16 / 7;
    border: 1px dashed #b7c8ce;
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    overflow: hidden;
    font-size: 12px;
    cursor: pointer;
}

.home-banner-preview:hover {
    border-color: var(--primary);
}

.home-banner-media {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

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

.home-banner-tools {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: flex;
    gap: 6px;
}

.home-banner-icon-btn {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, .68);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .16);
}

.home-banner-icon-btn:hover {
    background: var(--primary);
}

.home-banner-icon-btn.danger:hover {
    background: #dc2626;
}

.home-banner-icon-btn:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.home-banner-fields {
    display: grid;
    gap: 8px;
}

.home-banner-tip {
    color: var(--muted);
    font-size: 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 122, 90, .12);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 6px;
    background: #e8edf2;
    color: #1f2937;
    white-space: nowrap;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}

.btn.primary:hover {
    background: var(--primary-strong);
}

.btn.warn {
    background: #fff3dc;
    color: var(--warning);
}

.btn.danger {
    background: #fde8e7;
    color: var(--danger);
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--line);
}

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

.switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.switch span {
    width: 100%;
    border-radius: 999px;
    background: #d7dee6;
    transition: background .18s ease;
}

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

.switch input:checked + span {
    background: var(--primary);
}

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

.switch input:disabled + span {
    opacity: .55;
}

.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    background: var(--panel-soft);
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
}

.activity-title-cell {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    align-items: center;
    min-width: 220px;
}

.table-cover {
    width: 72px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    background: #e5ece9;
    object-fit: cover;
}

.member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e5ece9;
    object-fit: cover;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf2f7;
    color: #334155;
    font-size: 12px;
    white-space: nowrap;
}

.badge.ok {
    background: #def7ec;
    color: var(--ok);
}

.badge.warn {
    background: #fff3dc;
    color: var(--warning);
}

.badge.danger {
    background: #fde8e7;
    color: var(--danger);
}

.text-green {
    color: var(--ok);
}

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

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

.small {
    font-size: 12px;
}

.toast {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 80;
    transform: translate(-50%, -50%);
    max-width: 360px;
    min-width: 180px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #17211d;
    color: #fff;
    box-shadow: var(--shadow);
    text-align: center;
}

.empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

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

.field-row {
    display: grid;
    grid-template-columns: 1.2fr 140px 96px 1.2fr 42px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.field-row input,
.field-row select {
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.category-row {
    grid-template-columns: 1.4fr 1fr 110px 42px;
}

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

.session-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 180px 180px 96px 72px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.session-row input {
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.search-form input {
    min-width: 240px;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
}

.search-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 122, 90, .12);
}

.table-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.check-col {
    width: 44px;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.pager-info {
    color: var(--muted);
    font-size: 13px;
}

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

.split {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .48);
}

.modal {
    width: min(760px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    padding: 18px;
}

.kv {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 12px;
    font-size: 14px;
}

.kv div:nth-child(odd) {
    color: var(--muted);
}

.trial-review-image {
    display: block;
    width: min(260px, 100%);
    max-height: 360px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: contain;
    background: var(--panel-soft);
}

.mobile-shell {
    max-width: 720px;
    min-height: 100vh;
    margin: 0 auto;
    background: #f7f8fa;
}

.mobile-head {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.mobile-head strong {
    font-size: 18px;
}

.mobile-content {
    padding: 14px;
}

.mobile-card {
    padding: 14px;
    margin-bottom: 12px;
}

.mobile-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.activity-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    background: #dfe7e4;
    object-fit: cover;
    margin-bottom: 12px;
}

.price {
    color: var(--accent);
    font-weight: 700;
}

.voucher {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 160px;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    background: #fff;
}

.voucher-code {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 4px;
}

.bottom-tabs {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--line);
    background: #fff;
}

.bottom-tabs button {
    min-height: 50px;
    background: #fff;
    color: var(--muted);
}

.bottom-tabs button.active {
    color: var(--primary);
    font-weight: 700;
}

@media (max-width: 900px) {
    .login-panel,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 12;
        padding: 12px;
    }

    .brand {
        padding: 4px 8px 10px;
    }

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

    .nav button {
        justify-content: center;
        text-align: center;
        min-height: 38px;
        padding: 8px;
        font-size: 13px;
    }

    .topbar {
        height: auto;
        min-height: 58px;
        padding: 12px 16px;
        align-items: flex-start;
        flex-direction: column;
    }

    .content {
        padding: 16px;
    }

    .grid.cols-2,
    .grid.cols-3,
    .settings-layout,
    .form-grid,
    .order-compact-grid {
        grid-template-columns: 1fr;
    }

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

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

    .media-library-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .media-group-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .media-group-form {
        position: static;
        grid-column: 1 / -1;
    }

    .media-group-form input {
        width: 100%;
    }

    .media-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 10px;
        padding-bottom: 12px;
    }

    .media-filter-form {
        min-width: 0;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(92px, 92px));
        justify-content: center;
        max-height: min(52vh, 440px);
        gap: 12px;
    }

    .media-card {
        width: 92px;
        height: 92px;
    }

    .media-upload-actions {
        justify-content: flex-start;
    }

    .douyin-whitelist-row {
        grid-template-columns: 1fr;
    }

    .span-2,
    .span-3,
    .span-4 {
        grid-column: 1 / -1;
    }

    .field-row,
    .session-row,
    .home-banner-row,
    .home-banner-uploader {
        grid-template-columns: 1fr;
    }

    .cover-uploader,
    .content-image-uploader,
    .activity-title-cell {
        grid-template-columns: 1fr;
    }

    .cover-preview,
    .home-banner-preview,
    .table-cover {
        width: 100%;
    }
}
