:root {
    --bg: #f6f6f5;
    --panel: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e7e7ea;
    --primary: #111827;
    --primary-dark: #050816;
    --soft: #f8f8fa;
    --ok: #059669;
    --warn: #d97706;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
}
button, input, textarea, select { font: inherit; }
button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
}
button:disabled { opacity: .55; cursor: not-allowed; }
button[aria-busy="true"] { opacity: .88; }
.primary, button.primary {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-color: #111827;
    color: #fff;
    font-weight: 700;
}
.primary:hover { background: var(--primary-dark); }
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    background: #fff;
}
.site-shell { width: 100%; max-width: none; margin: 0; padding: 18px 12px 104px; }
.app-view {
    display: grid;
    gap: 16px;
}
.app-view[hidden] {
    display: none;
}
.live-app-view {
    position: relative;
    display: block;
    min-height: calc(100vh - 130px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.live-view-loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    background: #fff;
}
.live-view-loading strong { color: var(--text); }
.live-view-loading[hidden] { display: none; }
.live-view-frame {
    display: block;
    width: 100%;
    min-height: calc(100vh - 130px);
    border: 0;
    background: #fff;
    opacity: 0;
}
.live-view-frame.is-loaded { opacity: 1; }
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 900;
    width: min(560px, calc(100vw - 28px));
    min-height: 58px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(17, 24, 39, .1);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
}
.bottom-nav button {
    min-width: 0;
    min-height: 46px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    font-weight: 700;
    color: var(--muted);
}
.bottom-nav button.is-active {
    background: #111827;
    color: #fff;
}
.bottom-nav span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-pinned-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    color: #78350f;
}
.site-pinned-notice div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.site-pinned-notice-img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(120, 53, 15, .18);
    background: #fff;
    flex: 0 0 auto;
}
.site-pinned-notice strong {
    flex: 0 0 auto;
    font-size: 13px;
}
.site-pinned-notice span {
    min-width: 0;
    font-size: 14px;
    line-height: 1.5;
}
.site-pinned-notice b { color: #111827; }
.site-pinned-notice button {
    flex: 0 0 auto;
    min-height: 34px;
    border-color: #f59e0b;
    border-radius: 8px;
    background: #fff7ed;
    color: #7c2d12;
    font-weight: 700;
}
.site-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.site-logo {
    width: 28px;
    height: 28px;
    border-radius: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: #111;
    font-size: 22px;
    font-weight: 900;
    flex: 0 0 auto;
}
.site-brand strong { display: block; font-size: 20px; letter-spacing: 0; }
.site-search {
    flex: 1 1 380px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--muted);
}
.site-search input {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
}
.toolbox-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    padding: 0 2px;
    font-weight: 600;
}
.fixed-channel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}
.site-userbar {
    display: grid;
    grid-template-columns: 1.5fr .8fr auto auto auto auto;
    gap: 14px;
    align-items: stretch;
    width: 100%;
}
.user-hero { padding: 18px; overflow: hidden; }
.user-hero .site-userbar { padding: 0; }
.avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 0;
    text-align: left;
    padding: 10px 12px;
}
.avatar-btn img, .avatar-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f4f6;
}
.avatar-preview { width: 72px; height: 72px; display: block; margin-top: 8px; }
.avatar-btn span { display: grid; gap: 4px; }
.avatar-btn strong { font-size: 20px; }
.avatar-btn small, .avatar-btn em { color: var(--muted); font-style: normal; font-size: 12px; }
.avatar-btn small { overflow-wrap: anywhere; }
.meter {
    min-width: 140px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}
.meter strong { font-size: 30px; line-height: 1.05; }
.meter span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.site-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}
.home-layout {
    grid-template-columns: minmax(176px, 220px) minmax(0, 1fr) minmax(176px, 220px);
    align-items: start;
    gap: 16px;
}
.home-center {
    display: grid;
    gap: 16px;
    min-width: 0;
}
.home-template-rail {
    position: sticky;
    top: 12px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    max-height: calc(100vh - 28px);
    overflow: hidden;
    min-width: 0;
}
.home-template-rail-head {
    display: grid;
    gap: 3px;
    padding: 0 2px;
}
.home-template-rail-head strong {
    font-size: 15px;
}
.home-template-rail-head span {
    color: var(--muted);
    font-size: 12px;
}
.home-template-list {
    display: grid;
    gap: 14px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1px 6px 10px 2px;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}
.home-template-list::-webkit-scrollbar {
    width: 6px;
}
.home-template-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(17, 24, 39, .22);
}
.home-template-list::-webkit-scrollbar-track {
    background: transparent;
}
.home-template-card,
.member-template-card {
    position: relative;
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(104px, auto);
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    text-align: left;
    border: 1px solid #ded8d2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .12);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home-template-card.xhs-template-card {
    display: grid !important;
    grid-template-rows: auto minmax(104px, auto) !important;
    height: auto !important;
    min-height: 0 !important;
}
.home-template-card:hover,
.member-template-card:hover {
    transform: translateY(-1px);
    border-color: #d4c7bc;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .16);
}
.home-template-card.is-selected,
.member-template-card.is-selected {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .14), 0 8px 18px rgba(15, 23, 42, .16);
}
.home-template-media,
.member-template-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 9 / 13;
    overflow: hidden;
    background: #eee9e3;
}
.home-template-media img,
.member-template-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.home-template-media.no-image,
.member-template-media.no-image {
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0, rgba(255,255,255,.18) 1px, transparent 1px, transparent 10px),
        linear-gradient(135deg, #e6dfd7, #f2eee9);
}
.no-ref-pill {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: #6b625d;
    font-size: 12px;
    white-space: nowrap;
}
.template-tag-stack {
    position: absolute;
    left: 20px;
    bottom: 22px;
    display: grid;
    gap: 9px;
}
.template-tag-stack span {
    width: fit-content;
    max-width: 120px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.76);
    color: #111827;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.1;
}
.home-template-info,
.member-template-info {
    display: grid;
    gap: 7px;
    min-width: 0;
    align-content: start;
    min-height: 104px;
    padding: 11px 12px 12px;
    background: #fff;
}
.home-template-info.xhs-template-info {
    display: grid !important;
    visibility: visible !important;
    min-height: 104px !important;
    height: auto !important;
    padding: 11px 12px 12px !important;
    background: #fff !important;
}
.home-template-info strong,
.member-template-info strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    color: #111827;
    font-size: 14px;
    line-height: 1.45;
}
.home-template-info small,
.member-template-info p {
    display: -webkit-box;
    min-height: 40px;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #6b625d;
    font-size: 12px;
    line-height: 1.55;
}
.member-template-info small {
    color: var(--muted);
    font-size: 12px;
}
.template-ref-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .72);
    color: #fff;
    font-size: 10px;
}
.selected-template-hint {
    padding: 8px 10px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}
.selected-template-hint[hidden] {
    display: none;
}
.generate-mode-switch {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.generate-mode-switch label {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    cursor: pointer;
}
.generate-mode-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.generate-mode-switch span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.generate-mode-switch input:checked + span {
    background: #111827;
    color: #fff;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 12px;
}
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head span { color: var(--muted); font-size: 12px; }
.admin-orders-head {
    align-items: center;
}
.admin-orders-head > div {
    display: grid;
    gap: 4px;
}
.admin-orders-head form {
    margin: 0;
}
textarea, input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 9px 11px;
    outline: none;
    background: #fff;
}
textarea:focus, input:focus, select:focus { border-color: var(--primary); }
.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}
.ref-dropzone.is-invalid {
    background: #fff7f7;
}
.tool-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.tool-row input { max-width: 220px; }
.tool-row select { width: auto; min-width: 110px; }
.single-batch-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.single-batch-controls .inline-field {
    min-width: 140px;
}
.single-batch-controls .inline-field input {
    width: 72px;
    max-width: 72px;
}
.batch-i2i-layout {
    display: grid;
    gap: 10px;
}
.batch-i2i-layout > textarea { min-height: 94px; }
.batch-i2i-toolbar,
.batch-i2i-runbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fafafa;
}
.batch-i2i-add {
    display: flex;
    gap: 8px;
    flex: 1 1 320px;
    min-width: 260px;
}
.batch-i2i-add input {
    max-width: none;
    flex: 1;
}
.batch-i2i-runbar {
    justify-content: flex-end;
    background: #fff;
    border-color: var(--line);
}
.batch-i2i-runbar .fixed-channel {
    flex: 0 0 auto;
}
.batch-i2i-runbar select {
    width: auto;
    min-width: 110px;
}
.inline-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
}
.inline-field input {
    width: 76px;
    max-width: 76px;
    padding: 6px 8px;
    text-align: center;
}
.toggle-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
    min-width: max-content;
}
.toggle-field input {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}
.toggle-field span {
    min-width: 0;
    white-space: nowrap;
}
.anti-ai-toggle {
    justify-content: center;
    min-height: 42px;
    padding: 8px 12px;
    border-color: #dbe4f0;
    background: #f8fafc;
    font-weight: 650;
    color: #111827;
}
.anti-ai-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #111827;
}
.anti-ai-toggle span {
    line-height: 1.2;
}
.ref-strip, .style-prompt-box {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.ref-dropzone {
    margin-top: 10px;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.ref-dropzone.is-dragover {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.ref-hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.ref-thumb {
    width: 84px;
    height: 84px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    position: relative;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb.preset-ref-thumb {
    padding: 0;
    border-color: #ef4444;
    background: #fff;
}
.ref-thumb-label {
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 5px;
    display: block;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .72);
    color: #fff;
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
}
.ref-thumb button {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    padding: 0;
    background: rgba(0,0,0,.58);
    color: #fff;
    border: none;
}
.scene-ref-thumb .ref-thumb-replace {
    top: auto;
    right: 3px;
    bottom: 3px;
    width: auto;
    height: 22px;
    min-height: 0;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 22px;
}
.scene-ref-editor {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}
.scene-ref-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.scene-ref-editor-head span,
.scene-ref-empty {
    color: var(--muted);
    font-size: 12px;
}
.scene-ref-editor-head button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}
.scene-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.scene-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.scene-card-compact {
    display: grid;
    gap: 10px;
    min-height: auto;
}
.scene-card-summary {
    display: grid;
    grid-template-columns: 28px 64px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.scene-check {
    display: grid;
    place-items: center;
    cursor: pointer;
}
.scene-check input {
    width: 18px;
    height: 18px;
    accent-color: #111827;
}
.scene-check span {
    display: none;
}
.scene-thumb-btn {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #f3f4f6;
}
.scene-thumb-btn img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.scene-thumb-btn > span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-weight: 700;
}
.scene-card-title {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.scene-card-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}
.scene-card-title small {
    color: var(--muted);
    font-size: 12px;
}
.scene-card-form {
    display: grid;
    gap: 8px;
}
.scene-card h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 14px;
}
.scene-card h3 button {
    padding: 5px 9px;
    font-size: 12px;
}
.scene-card input,
.scene-card textarea {
    margin-top: 8px;
}
.scene-card textarea { min-height: 96px; }
.scene-card .compact-textarea { min-height: 58px; }
.scene-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.scene-card-actions span {
    color: var(--muted);
    font-size: 12px;
    margin-left: auto;
}
.scene-empty {
    grid-column: 1 / -1;
    padding: 22px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
    background: #fafafa;
}
.preset-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    min-width: 0;
}
.compact-preset-panel {
    margin-top: 10px;
    background: #fafafa;
}
.prompt-template-panel,
.generate-mode-block {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.prompt-template-panel { background: #fafafa; }
.preset-page-grid {
    display: grid;
    gap: 12px;
}
.preset-generate-controls {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 12px;
}
.mode-block-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}
.mode-block-head strong { font-size: 14px; }
.mode-block-head span { color: var(--muted); font-size: 12px; }
.prompt-template-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}
.prompt-template-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    min-height: 88px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.prompt-template-card.is-text-only {
    grid-template-columns: 1fr;
}
.template-image-btn {
    width: 76px;
    height: 76px;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f4f6;
}
.template-image-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prompt-template-body { display: grid; gap: 6px; min-width: 0; }
.prompt-template-body strong { font-size: 13px; }
.prompt-template-body p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.prompt-template-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.prompt-template-actions button { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.recharge-layout {
    display: grid;
    gap: 14px;
}
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.plan-card {
    display: grid;
    gap: 6px;
    text-align: left;
    min-height: 100px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.plan-card.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}
.member-plan-tip {
    width: fit-content;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;
}
.plan-card strong { font-size: 14px; }
.plan-card span { font-size: 18px; font-weight: 700; }
.plan-card small { color: var(--muted); }
.plan-card .member-plan-tip { color: #111827; }
.recharge-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.recharge-actions.compact { margin-top: 10px; }
.recharge-actions button { min-height: 42px; }
.mobile-recharge-page .site-main {
    max-width: 760px;
}
.recharge-pay-area {
    display: grid;
    grid-template-columns: minmax(220px, 260px) 1fr;
    gap: 14px;
    margin-top: 14px;
}
.recharge-pay-area[hidden] { display: none; }
.recharge-qr-wrap {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 260px;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: #fafafa;
}
.recharge-qr-wrap img { width: 220px; height: 220px; object-fit: contain; }
.recharge-qr-wrap img[hidden] { display: none; }
.recharge-empty { color: var(--muted); font-size: 13px; text-align: center; }
.recharge-order-info {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.recharge-order-info div {
    display: grid;
    gap: 4px;
}
.recharge-order-info span {
    color: var(--muted);
    font-size: 12px;
}
.recharge-order-info strong {
    font-size: 14px;
    word-break: break-all;
}
.recharge-order-info a {
    color: var(--text);
    word-break: break-all;
}
.admin-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.admin-thumb-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}
.payment-form textarea {
    min-height: 96px;
    resize: vertical;
}
.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.row-actions form { margin: 0; }
.preset-panel-title {
    font-size: 14px;
    font-weight: 700;
}
.global-preset-box {
    display: grid;
    gap: 12px;
    min-width: 0;
}
.preset-group-title {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}
.preset-chip-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 230px;
    max-width: 100%;
    min-height: 82px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    font-size: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.preset-chip:hover {
    border-color: #cbd5e1;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .1);
    transform: translateY(-1px);
}
.preset-chip.is-locked {
    background: #f4f5f7;
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
}
.preset-chip.is-locked:hover {
    border-color: var(--line);
    box-shadow: none;
    transform: none;
}
.preset-chip input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}
.preset-chip-body {
    display: grid;
    gap: 5px;
    min-width: 0;
    flex: 1 1 110px;
}
.preset-chip-name {
    max-width: 100%;
    line-height: 1.35;
    font-weight: 700;
    white-space: normal;
    word-break: break-word;
}
.preset-chip small {
    color: var(--muted);
    font-size: 12px;
}
.preset-ref-thumbs,
.preset-cover-thumbs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.preset-ref-btn,
.preset-cover-btn {
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: #f3f4f6;
}
.preset-ref-btn:hover,
.preset-cover-btn:hover {
    border-color: #94a3b8;
}
.preset-ref-btn img,
.preset-cover-btn img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 0;
    border: 0;
    object-fit: cover;
}
.preset-generate-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.preset-generate-btn:hover {
    background: #374151;
}
.preset-batch-generate-btn {
    background: #0f766e;
}
.preset-batch-generate-btn:hover {
    background: #115e59;
}
.preset-generate-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}
.preset-empty {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
    background: #fafafa;
}
.member-scene-panel {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.member-scene-panel.is-locked {
    background: #f7f7f8;
    color: var(--muted);
}
.member-scene-panel.is-locked .scene-list,
.member-scene-panel.is-locked .style-prompt-box {
    opacity: .68;
}
.member-scene-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.member-scene-head strong {
    display: block;
    font-size: 14px;
}
.member-scene-head span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}
.member-scene-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.member-scene-actions input {
    width: 220px;
}
.locked-btn {
    background: #f1f2f4;
    color: var(--muted);
    border-color: #d9dce1;
}
.member-scene-panel {
    border-radius: 8px;
}
.member-scene-panel .style-prompt-box {
    display: none;
}
.member-scene-panel .scene-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    align-items: start;
    gap: 16px;
}
.member-template-card {
    cursor: pointer;
}
.member-scene-more {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 4px 0 2px;
}
.member-scene-more button {
    min-height: 36px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #d9dce1;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}
.member-scene-more button:hover {
    border-color: #111827;
}
.member-template-hover-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: calc(100% - 20px);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}
.member-template-card:hover .member-template-hover-actions {
    opacity: 1;
    transform: translateY(0);
}
.member-template-hover-actions button {
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    border-color: rgba(255,255,255,.58);
    background: rgba(17, 24, 39, .68);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}
.member-template-hover-actions .danger-btn {
    background: rgba(17, 24, 39, .68);
    color: #fff;
}
.scene-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 980;
    display: none;
    background: rgba(17, 24, 39, .36);
}
.scene-drawer-backdrop.is-open {
    display: block;
}
.scene-edit-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 990;
    width: min(430px, 100vw);
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    background: #fff;
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 40px rgba(15, 23, 42, .16);
    transform: translateX(104%);
    transition: transform .22s ease;
}
.scene-edit-drawer.is-open {
    transform: translateX(0);
}
.bulk-scene-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:10px 0; padding:10px; border:1px solid var(--line); border-radius:8px; background:#f8fbff; }
.bulk-scene-toolbar strong { margin-right:auto; color:#1e3a5f; font-size:13px; }
.bulk-scene-toolbar input { width:150px; padding:7px 8px; border:1px solid var(--line); border-radius:6px; }
.member-template-bulk-check { position:absolute; z-index:4; top:8px; left:8px; display:flex; align-items:center; gap:5px; padding:5px 7px; border:1px solid rgba(148,163,184,.6); border-radius:6px; background:rgba(255,255,255,.94); color:#334155; font-size:12px; cursor:pointer; box-shadow:0 1px 4px rgba(15,23,42,.08); }
.member-template-bulk-check input { margin:0; }
.member-template-card.is-bulk-selected { border-color:#2563eb; box-shadow:0 0 0 2px rgba(37,99,235,.16); }
@media (max-width:760px) { .bulk-scene-toolbar { align-items:stretch; } .bulk-scene-toolbar strong { width:100%; } .bulk-scene-toolbar input { width:100%; } }
.scene-edit-drawer.has-import-groups {
    width: min(1080px, calc(100vw - 28px));
}
.scene-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}
.scene-drawer-head h3 {
    margin: 0;
    font-size: 18px;
}
.scene-drawer-head span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}
.scene-drawer-head button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 20px;
    line-height: 1;
}
.scene-drawer-generate-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}
.scene-drawer-batch-count {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}
.scene-drawer-batch-count input {
    width: 112px;
    min-height: 38px;
    padding: 6px 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
}
.scene-drawer-import-prompts {
    grid-column: 1 / -1;
}
.scene-edit-drawer.has-import-groups .scene-drawer-generate-actions {
    grid-template-columns: minmax(170px, .8fr) minmax(150px, 1fr) minmax(190px, 1.25fr);
}
.scene-edit-drawer.has-import-groups .scene-drawer-batch-count,
.scene-edit-drawer.has-import-groups .scene-drawer-import-prompts {
    grid-column: auto;
}
.scene-drawer-import-prompts {
    min-height: 42px;
    border: 1px solid #bfdbfe !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}
.scene-drawer-import-prompts:hover {
    background: #dbeafe !important;
}
.scene-drawer-generate-actions button {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}
.scene-drawer-generate-one {
    background: #075bff;
}
.scene-drawer-generate-one:hover {
    background: #0045d8;
}
.scene-drawer-generate-batch {
    background: #0f766e;
}
.scene-drawer-generate-batch:hover {
    background: #115e59;
}
.scene-drawer-generate-actions button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}
.scene-drawer-workspace {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
}
.scene-edit-drawer.has-import-groups .scene-drawer-workspace {
    grid-template-columns: minmax(480px, 1fr) 430px;
}
.scene-edit-drawer.has-import-groups .scene-drawer-body {
    border-left: 1px solid var(--line);
}
.scene-import-panel {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    background: #f6f8fc;
    overflow: hidden;
}
.scene-import-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px 10px;
}
.scene-import-panel-head > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.scene-import-panel-head strong {
    color: #172033;
    font-size: 16px;
}
.scene-import-panel-head span {
    overflow: hidden;
    color: #71809e;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.scene-import-panel-head button {
    flex: 0 0 auto;
    min-height: 34px;
    border-color: #fecaca;
    color: #dc2626;
}
.scene-import-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 0 18px 12px;
}
.scene-import-stats span {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid #dce5f5;
    border-radius: 10px;
    background: #fff;
    color: #72809b;
    font-size: 11px;
}
.scene-import-stats b {
    color: #075bff;
    font-size: 17px;
}
.scene-import-controls {
    display: grid;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #e1e7f2;
    border-bottom: 1px solid #e1e7f2;
    background: #fff;
}
.scene-import-control-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.scene-import-control-row strong {
    min-width: 112px;
    color: #34405a;
    font-size: 12px;
}
.scene-import-control-row input {
    width: 68px;
    min-height: 32px;
    padding: 4px 7px;
    text-align: center;
}
.scene-import-control-row button {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 12px;
}
.scene-import-shortcuts {
    display: flex;
    gap: 5px;
}
.scene-import-shortcuts button {
    min-width: 34px;
    border-color: #cbdafa;
    background: #f5f8ff;
    color: #075bff;
    font-weight: 800;
}
.scene-import-range span {
    color: #71809e;
    font-size: 12px;
}
.scene-import-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 9px;
    padding: 14px 18px 24px;
    overflow: auto;
}
.scene-import-group {
    padding: 10px;
    border: 1px solid #dce4f2;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(42, 59, 91, .04);
}
.scene-import-group.is-selected {
    border-color: #75a7ff;
    box-shadow: 0 0 0 2px rgba(7, 91, 255, .08);
}
.scene-import-group-head {
    display: grid;
    grid-template-columns: 38px minmax(140px, 1fr) 86px auto auto;
    gap: 7px;
    align-items: center;
}
.scene-import-check {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #52617c;
    font-size: 12px;
    font-weight: 800;
}
.scene-import-check input {
    width: 16px;
    height: 16px;
}
.scene-import-title,
.scene-import-count input {
    min-height: 34px;
    padding: 5px 8px;
}
.scene-import-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #71809e;
    font-size: 11px;
}
.scene-import-count input {
    width: 50px;
    text-align: center;
}
.scene-import-expand,
.scene-import-delete {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
}
.scene-import-delete {
    border-color: #fecaca;
    color: #dc2626;
}
.scene-import-snippet {
    margin: 8px 0 0 38px;
    color: #748099;
    font-size: 12px;
    line-height: 1.55;
}
.scene-import-prompt {
    width: calc(100% - 38px);
    min-height: 130px;
    margin: 9px 0 0 38px;
    resize: vertical;
    font-size: 12px;
    line-height: 1.55;
}
@media (max-width: 900px) {
    .scene-edit-drawer.has-import-groups {
        width: 100vw;
    }
    .scene-edit-drawer.has-import-groups .scene-drawer-generate-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .scene-edit-drawer.has-import-groups .scene-drawer-batch-count,
    .scene-edit-drawer.has-import-groups .scene-drawer-import-prompts {
        grid-column: 1 / -1;
    }
    .scene-edit-drawer.has-import-groups .scene-drawer-workspace {
        grid-template-columns: minmax(0, 1fr);
        overflow: auto;
    }
    .scene-import-panel {
        min-height: 62vh;
        overflow: visible;
    }
    .scene-import-list {
        max-height: 52vh;
    }
    .scene-edit-drawer.has-import-groups .scene-drawer-body {
        border-top: 1px solid var(--line);
        border-left: 0;
        overflow: visible;
    }
    .scene-import-group-head {
        grid-template-columns: 38px minmax(120px, 1fr) 80px;
    }
    .scene-import-expand,
    .scene-import-delete {
        grid-column: auto;
    }
}
.scene-drawer-body {
    display: grid;
    align-content: start;
    gap: 18px;
    min-height: 0;
    padding: 22px;
    overflow: auto;
}
.drawer-field {
    display: grid;
    gap: 8px;
}
.drawer-field label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    font-weight: 800;
}
.drawer-field label span,
.drawer-field p {
    margin: 0;
    color: #9a8f86;
    font-size: 12px;
    font-weight: 400;
}
.drawer-field textarea {
    min-height: 120px;
    resize: vertical;
}
.drawer-ref-card {
    width: 100%;
    min-height: 150px;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid #e7dcd2;
    border-radius: 8px;
    background: #fff;
}
.drawer-ref-card.no-ref {
    text-align: left;
}
.drawer-cover-card {
    border-color: #dbeafe;
    background: #f8fbff;
}
.drawer-cover-card .drawer-upload-box {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}
.drawer-cover-card .drawer-ref-actions button:first-child {
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.drawer-upload-box {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    width: 96px;
    min-height: 128px;
    border: 1px dashed #d8c9bb;
    border-radius: 6px;
    background: #f6f0e8;
    color: #7c6f64;
}
.drawer-upload-box b {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: #ef4444;
    font-size: 20px;
    font-weight: 500;
}
.drawer-upload-box em {
    font-style: normal;
    font-size: 12px;
}
.drawer-ref-preview {
    width: 96px;
    height: 128px;
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
}
.drawer-ref-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.drawer-ref-copy {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    color: #6b625d;
    font-size: 13px;
    line-height: 1.55;
}
.drawer-ref-copy strong {
    color: #111827;
    font-size: 14px;
}
.drawer-ref-copy small {
    color: #8b8178;
    font-size: 12px;
}
.drawer-ref-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.drawer-ref-actions button,
.drawer-secondary-btn {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
}
.drawer-ref-actions button:first-child {
    border-color: #fecaca;
    color: #ef4444;
}
.drawer-ref-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    border-radius: 50%;
    border: 0;
    background: rgba(17,24,39,.72);
    color: #fff;
}
.drawer-ref-card.has-ref {
    position: relative;
}
.drawer-extra-refs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.drawer-secondary-btn {
    width: fit-content;
}
.scene-card.is-selected {
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, .08);
}
.progress-panel {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fafafa;
}
.progress-panel[hidden] {
    display: none;
}
.mode-progress-panel {
    margin-top: 2px;
}
.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}
.progress-head strong {
    font-size: 13px;
}
.progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e9ecef;
    overflow: hidden;
}
.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #111827, #4b5563);
    transition: width .2s ease;
}
.progress-detail {
    color: var(--muted);
    font-size: 12px;
    word-break: break-all;
}
.progress-task-list {
    display: grid;
    gap: 8px;
}
.progress-task-row {
    display: grid;
    gap: 6px;
    padding: 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}
.progress-task-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}
.progress-task-main strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
.progress-task-main span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
}
.progress-task-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    word-break: break-word;
}
.progress-task-message > span { min-width: 0; }
.progress-task-preset {
    padding: 7px 9px;
    border-radius: 8px;
    background: #eef4ff;
    color: #2459b8;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}
.archive-custom-group-panel {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #cddbf7;
    border-radius: 12px;
    background: #f8fbff;
}
.archive-custom-group-tools,
.archive-quick-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.archive-quick-group { margin-top: 10px; align-items: stretch; }
.archive-quick-group textarea { flex: 1 1 420px; min-width: 260px; }
.archive-custom-group-summary { margin: 10px 0; color: #475569; font-size: 13px; }
.archive-custom-group-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.archive-custom-group-card { padding: 10px; border: 1px solid #dbe4f4; border-radius: 10px; background: #fff; }
.archive-custom-group-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.archive-custom-group-card span { color: #64748b; font-size: 12px; }
.archive-custom-group-card p { margin: 7px 0; color: #475569; font-size: 12px; line-height: 1.5; max-height: 72px; overflow: auto; }
.generation-elapsed {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 8px;
    background: #fff1f2;
    color: #e11d48;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: .01em;
}
.progress-task-actions {
    display: flex;
    justify-content: flex-end;
}
.progress-task-cancel {
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
}
.danger-btn {
    background: #fff;
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: 14px;
}
.danger-btn:disabled {
    opacity: .55;
}
.distribution-form {
    margin-bottom: 12px;
}
.table-wrap small {
    color: var(--muted);
    font-size: 12px;
}
.table-wrap form {
    margin: 0;
}
.table-wrap button {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 10px;
    white-space: nowrap;
}
.warn-text {
    color: #b45309;
    font-weight: 700;
}
.invite-link-box {
    margin-top: 12px;
}
.invite-link-box label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}
.qr-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.qr-preview-grid div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafafa;
}
.qr-preview-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}
.qr-preview-grid img {
    width: 160px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.batch-product-row {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.batch-product-row > span {
    color: var(--muted);
    font-size: 12px;
}
.batch-product-row .ref-strip {
    margin-top: 0;
}
.style-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}
.result-folder,
.result-loose-section {
    grid-column: 1 / -1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.result-folder-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    cursor: pointer;
    background: #f8fafc;
    list-style: none;
}
.result-folder-summary::-webkit-details-marker {
    display: none;
}
.result-folder-summary::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #6b7280;
    transform: rotate(90deg);
    transition: transform .16s ease;
    flex: 0 0 auto;
}
.result-folder:not([open]) .result-folder-summary::before {
    transform: rotate(0deg);
}
.result-folder-summary strong {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}
.result-folder-summary small {
    max-width: 50%;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-folder-body,
.result-loose-section {
    display: grid;
    gap: 12px;
    padding: 12px;
}
.result-folder-category {
    display: grid;
    gap: 8px;
    min-width: 0;
}
.result-folder-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
    font-size: 13px;
}
.result-folder-category-head span {
    color: var(--muted);
    font-size: 12px;
}
.result-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    min-width: 0;
}
.result-retention-notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #f59e0b;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}
.result-archive-panel {
    display: grid;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafafa;
}
.result-archive-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.result-archive-head strong {
    font-size: 14px;
}
.archive-head-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.archive-count-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.archive-count-field input {
    width: 58px;
    min-height: 24px;
    padding: 2px 6px;
    text-align: center;
}
.archive-count-field select {
    min-height: 28px;
    padding: 2px 26px 2px 8px;
    border-radius: 7px;
    border-color: var(--line);
    background-color: #fff;
    font-size: 12px;
}
.archive-head-controls span {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}
.result-archive-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
.result-archive-group {
    min-width: 0;
    display: grid;
    gap: 8px;
}
.result-archive-title {
    font-size: 13px;
    font-weight: 700;
}
.archive-preset-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}
.archive-preset-box .preset-empty {
    width: 100%;
    padding: 8px 10px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
}
.archive-preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}
.archive-preset-chip input {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}
.archive-preset-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.archive-preset-chip small {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}
.archive-preset-chip.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    background: #f4f5f7;
}
.result-folder-select-tools {
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
    padding:8px 10px;
    border-bottom:1px solid var(--line);
    background:#f8fafc;
}
.result-folder-select-tools button {
    min-height:30px;
    padding:4px 10px;
    border-radius:7px;
    font-size:12px;
}
.result-folder-select-tools input {
    width:min(220px, 100%);
    min-height:30px;
    padding:4px 9px;
    border:1px solid var(--line);
    border-radius:7px;
    background:#fff;
    font-size:12px;
}
.archive-preset-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    flex: 1 1 320px;
    min-width: min(100%, 320px);
    max-width: 460px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.archive-preset-item:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(7, 91, 255, .1);
}
.archive-preset-item .archive-preset-chip {
    width: auto;
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.archive-preset-item-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 6px 5px 0;
}
.archive-preset-item-actions button {
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 6px;
    border-color: #d7deed;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.archive-preset-item-actions .archive-preset-run {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.archive-preset-item-actions button:disabled {
    border-color: #e2e8f0;
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}
.result-archive-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.result-archive-actions button {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.archive-layout-switch {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 34px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.result-archive-actions .archive-layout-option {
    min-height: 26px;
    padding: 4px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.result-archive-actions .archive-layout-option.is-active {
    background: #111827;
    color: #fff;
    font-weight: 700;
}
.archive-progress {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.archive-progress[hidden] {
    display: none;
}
.result-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafafa;
}
.result-bulk-bar[hidden] { display: none; }
.result-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.result-filter-bar[hidden] {
    display: none;
}
.result-filter-bar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}
.result-filter-bar button.is-active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}
.result-filter-bar span {
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .08);
    color: inherit;
    font-size: 12px;
    text-align: center;
}
.result-filter-bar button.is-active span {
    background: rgba(255, 255, 255, .18);
}
.archive-result-region {
    display: grid;
    gap: 12px;
    margin: 0 0 12px;
}
.archive-result-region[hidden] {
    display: none;
}
.archive-result-region .result-folder {
    margin: 0;
}
.archive-result-heading {
    margin-top: 2px;
}
.result-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.result-range-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 430px;
    min-width: 300px;
    padding: 4px 0;
}
.result-range-tools label {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}
.result-range-tools input {
    flex: 1;
    min-width: 130px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
}
.result-range-tools .danger-btn {
    border: 0;
    background: #fee2e2;
    color: #991b1b;
}
.result-range-tools input:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}
.result-bulk-bar button {
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 13px;
}
.result-bulk-bar span {
    color: var(--muted);
    font-size: 13px;
}
.result-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}
.result-card.is-selected {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .12);
}
.result-select {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(17,24,39,.18);
    cursor: pointer;
}
.result-select input {
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    accent-color: #111827;
}
.result-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    -webkit-touch-callout: default;
    background: #f3f4f6;
}
.result-card a {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 8px;
    background: rgba(0,0,0,.6);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    text-decoration: none;
}
.result-meta {
    display: grid;
    gap: 2px;
    padding: 8px 9px 10px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}
.result-meta strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    word-break: break-all;
}
.result-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.archive-bulk-prompt { display:grid; gap:7px; padding:10px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.archive-import-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:10px; padding:10px; border:1px dashed var(--line); border-radius:10px; background:#f8fbff; }
.archive-import-tools span { color:var(--muted); font-size:12px; }
.prompt-import-draft-panel { margin-top:10px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#f8fbff; }
.prompt-import-draft-panel[hidden] { display:none; }
.prompt-import-draft-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.prompt-import-draft-head span { color:var(--muted); font-size:12px; margin-right:auto; }
.prompt-import-bulk-input { width:220px; min-height:34px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; font:inherit; resize:vertical; }
.prompt-import-draft-stats { color:var(--muted); font-size:12px; margin-bottom:8px; }
.prompt-import-draft-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:10px; max-height:560px; overflow:auto; }
.prompt-import-draft-card { display:grid; gap:7px; padding:10px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.prompt-import-draft-card.is-selected { border-color:#2563eb; box-shadow:0 0 0 2px rgba(37,99,235,.12); }
.prompt-import-draft-select { font-size:12px; color:#334155; }
.prompt-import-draft-title, .prompt-import-draft-prompt { width:100%; box-sizing:border-box; border:1px solid var(--line); border-radius:6px; padding:7px 8px; font:inherit; }
.prompt-import-draft-prompt { resize:vertical; line-height:1.45; }
.prompt-import-ref-tools { display:flex; align-items:center; justify-content:space-between; color:var(--muted); font-size:12px; }
@media (max-width:760px) { .prompt-import-draft-grid { grid-template-columns:1fr; max-height:460px; } }
.archive-bulk-prompt label { color:#334155; font-size:13px; font-weight:700; }
.archive-bulk-prompt textarea { width:100%; min-height:72px; padding:9px 10px; border:1px solid var(--line); border-radius:8px; resize:vertical; font:inherit; line-height:1.5; }
.archive-bulk-prompt-actions { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.archive-bulk-prompt-actions span { color:var(--muted); font-size:12px; }
.result-meta .result-elapsed-time {
    color: #475569;
    font-weight: 600;
}
.result-meta .result-model-label {
    justify-self: start;
    width: fit-content;
    padding: 2px 7px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-weight: 700;
}
.result-meta .result-model-label[data-model="nano_banana_2"] {
    color: #7c3aed;
    background: #f5f3ff;
    border-color: #ddd6fe;
}
.result-meta .result-model-label[data-model="seedream_5"] {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.result-card > span {
    position: absolute;
    left: 42px;
    top: 8px;
    max-width: calc(100% - 50px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 12px;
}
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}
th { color: var(--muted); font-weight: 600; }
.empty-cell {
    color: var(--muted);
    text-align: center;
}
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}
.admin-pagination .ghost-btn.disabled {
    pointer-events: none;
    opacity: .45;
}
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.45);
    padding: 18px;
    z-index: 1000;
}
.modal-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 10px;
    padding: 18px;
}
.modal-card h3 { margin: 0 0 12px; }
.modal-close-btn {
    float: right;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
}
.service-card,
.invite-card {
    position: relative;
    display: grid;
    gap: 12px;
}
.service-card p,
.invite-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}
.service-card small {
    color: var(--muted);
    text-align: center;
}
.service-qr {
    width: min(300px, 100%);
    max-height: 58vh;
    object-fit: contain;
    justify-self: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.invite-card label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}
.invite-copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.invite-copy-row input {
    height: 42px;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.invite-copy-row button {
    border-radius: 8px;
    white-space: nowrap;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    transition: .2s;
    z-index: 1200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.site-auth-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background: #f4efed;
}
.site-auth-shell {
    width: min(640px, 100%);
}
.site-auth-shell .site-auth-card {
    margin: 0 auto;
}
.auth-notice {
    margin-bottom: 14px;
}
.site-auth-card {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 30px 28px 24px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
}
.site-auth-brand {
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 10px;
}
.site-auth-brand .site-logo {
    width: auto;
    min-width: 84px;
    height: 48px;
    padding: 0 14px;
    margin: 0;
    border-radius: 16px;
    background: #f7f8fb;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}
.site-auth-brand h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: nowrap;
}
.site-auth-brand p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}
.site-auth-form {
    margin-top: 22px;
}
.site-auth-form label {
    display: block;
    margin-bottom: 14px;
}
.site-auth-form span {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #5f6775;
}
.site-auth-form input {
    height: 52px;
    border-radius: 16px;
    padding: 0 16px;
    font-size: 15px;
}
.site-auth-form .site-auth-error {
    margin-top: -4px;
}
.site-auth-form button {
    width: 100%;
    min-height: 54px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-size: 16px;
    font-weight: 700;
}
.site-auth-error {
    color: #b91c1c;
    background: #fef2f2;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}
.site-auth-hint {
    color: var(--muted);
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 12px;
    margin: -4px 0 12px;
    font-size: 13px;
}
.site-auth-ok {
    color: #047857;
    background: #ecfdf5;
    padding: 10px 12px;
    border-radius: 12px;
    margin: 12px 0 0;
    font-size: 13px;
}
.site-auth-switch {
    text-align: center;
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
}
.site-auth-switch a { color: var(--primary); }
.recharge-panel { max-width: 620px; }
.recharge-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}
.pricing-note {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
}
.storage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}
.storage-grid div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafafa;
}
.storage-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}
.storage-grid strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 13px;
}
.data-warning { margin: 12px 0 0; }
.admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: end;
}
.admin-form button,
.admin-form select,
.admin-form input {
    min-height: 42px;
}
.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
}
.admin-form textarea {
    min-height: 110px;
    resize: vertical;
}
.preset-form {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.preset-prompt-field {
    grid-column: 1 / -1;
}
.homepage-form {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.homepage-preview {
    align-self: end;
}
.homepage-preview img {
    display: block;
    width: min(180px, 100%);
    max-height: 180px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.prompt-cell {
    max-width: 260px;
    white-space: normal;
    color: var(--muted);
}
.admin-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
}
.admin-check input {
    width: auto;
    min-height: auto;
    margin: 0;
}
.user-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.user-search-form input[name="user_q"] {
    flex: 1;
    min-width: 240px;
    max-width: 560px;
}
.ai-interface-panel.panel {
    padding: 0;
    border: 0;
    background: transparent;
}
.ai-interface-panel > .panel-head {
    margin-bottom: 16px;
    padding: 0 2px;
    align-items: flex-end;
}
.ai-interface-form {
    display: grid;
    gap: 14px;
}
.ai-channel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
.ai-channel-card {
    --channel-accent: #2563eb;
    min-width: 0;
    margin: 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--channel-accent);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.ai-channel-suchuang { --channel-accent: #059669; }
.ai-channel-muse { --channel-accent: #d97706; }
.ai-channel-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    margin-bottom: 16px;
}
.ai-channel-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}
.ai-channel-title > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}
.ai-channel-title strong {
    color: #172033;
    font-size: 15px;
    line-height: 1.2;
}
.ai-channel-title small {
    color: #7a8496;
    font-size: 11px;
    font-weight: 700;
}
.ai-channel-marker {
    flex: 0 0 auto;
    width: 9px;
    height: 28px;
    border-radius: 4px;
    background: var(--channel-accent);
}
.ai-channel-toggle {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.ai-channel-toggle input {
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 0;
    accent-color: var(--channel-accent);
}
.ai-channel-fields {
    display: grid;
    gap: 12px;
}
.ai-channel-fields label,
.ai-priority-field {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}
.ai-channel-fields input,
.ai-priority-field select {
    min-width: 0;
    min-height: 42px;
    margin: 0;
    border-radius: 7px;
    font-size: 13px;
}
.ai-channel-fields input:focus,
.ai-priority-field select:focus {
    border-color: var(--channel-accent, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.ai-interface-actions {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}
.ai-priority-field {
    max-width: 520px;
}
.ai-interface-save {
    min-width: 220px;
    min-height: 42px;
}
@media (max-width: 1280px) {
    .ai-channel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .ai-channel-grid,
    .ai-interface-actions {
        grid-template-columns: 1fr;
    }
    .ai-channel-card {
        padding: 14px;
    }
    .ai-priority-field {
        max-width: none;
    }
    .ai-interface-save {
        width: 100%;
        min-width: 0;
    }
}
.preset-table .prompt-cell {
    max-width: 320px;
}

@media (max-width: 640px) {
    .progress-task-message { align-items: flex-start; flex-direction: column; }
    .generation-elapsed { font-size: 17px; }
    .site-shell {
        padding: 10px 10px 96px;
    }
    .site-pinned-notice,
    .site-pinned-notice div {
        align-items: stretch;
        flex-direction: column;
    }
    .site-pinned-notice-img {
        width: 100%;
        height: auto;
        max-height: 180px;
        object-fit: contain;
    }
    .site-pinned-notice button {
        width: 100%;
    }
    .site-topbar {
        gap: 10px;
    }
    .site-brand {
        width: 100%;
        flex-wrap: nowrap;
    }
    .site-search {
        width: 100%;
        flex: 1 1 100%;
        height: 42px;
        border-radius: 14px;
    }
    .toolbox-btn {
        margin-left: auto;
    }
    .user-hero .site-userbar {
        padding: 0;
        grid-template-columns: 1fr;
    }
    .avatar-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 8px 6px;
    }
    .avatar-btn img {
        width: 48px;
        height: 48px;
    }
    .avatar-btn strong {
        font-size: 16px;
    }
    .meter {
        min-width: 0;
        width: 100%;
        padding: 12px 14px;
        border-radius: 16px;
    }
    .meter strong {
        font-size: 24px;
    }
    .site-userbar .ghost-btn,
    .site-userbar button,
    .site-userbar a {
        width: 100%;
    }
    .panel {
        border-radius: 16px;
        padding: 14px;
    }
    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .admin-orders-head form,
    .admin-orders-head .danger-btn {
        width: 100%;
    }
    .admin-pagination {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .panel-head h2 {
        font-size: 16px;
    }
    .tool-row,
    .batch-i2i-toolbar,
    .batch-i2i-runbar,
    .admin-form {
        grid-template-columns: 1fr;
    }
    .tool-row > *,
    .batch-i2i-toolbar > *,
    .batch-i2i-runbar > *,
    .admin-form > * {
        width: 100%;
    }
    .single-batch-controls {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .single-batch-controls .inline-field,
    .single-batch-controls .danger-btn {
        width: 100%;
    }
    .member-scene-head,
    .member-scene-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .member-scene-actions input,
    .member-scene-actions button {
        width: 100%;
    }
    .batch-i2i-add,
    .batch-i2i-runbar,
    .inline-field {
        width: 100%;
    }
    .batch-i2i-add {
        min-width: 0;
        flex-wrap: wrap;
    }
    .batch-i2i-add input,
    .batch-i2i-add button,
    .batch-i2i-toolbar > button,
    .batch-i2i-runbar > button,
    .batch-i2i-runbar select {
        width: 100%;
    }
    .batch-product-row,
    .preset-panel,
    .progress-panel,
    .scene-card,
    .storage-grid div,
    .site-auth-card {
        border-radius: 14px;
    }
    .batch-product-row {
        padding: 12px;
    }
    .fixed-channel {
        width: 100%;
        justify-content: center;
    }
    .preset-chip-row {
        gap: 6px;
    }
    .preset-chip {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        width: 100%;
        min-width: 0;
        min-height: 78px;
        align-items: center;
        column-gap: 10px;
        row-gap: 10px;
        border-radius: 14px;
    }
    .preset-chip-name {
        max-width: none;
    }
    .preset-chip-body {
        min-width: 0;
    }
    .preset-ref-thumbs,
    .preset-cover-thumbs {
        min-width: 0;
        justify-content: flex-end;
    }
    .preset-ref-btn,
    .preset-cover-btn {
        width: 48px;
        height: 48px;
    }
    .preset-generate-btn {
        grid-column: 2 / -1;
        width: 100%;
        min-height: 42px;
        justify-self: stretch;
    }
    .preset-table .prompt-cell {
        max-width: 180px;
    }
    .inline-field input {
        flex: 1;
        max-width: none;
    }
    .scene-list {
        grid-template-columns: 1fr;
    }
    .result-archive-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .archive-head-controls {
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
    }
    .archive-count-field {
        width: 100%;
        justify-content: space-between;
    }
    .archive-head-controls span {
        text-align: left;
    }
    .result-archive-grid {
        grid-template-columns: 1fr;
    }
    .archive-preset-chip,
    .result-archive-actions button {
        width: 100%;
        justify-content: flex-start;
    }
    .archive-preset-item {
        flex-basis: 100%;
        width: 100%;
        max-width: none;
        min-width: 0;
    }
    .archive-preset-item .archive-preset-chip {
        width: auto;
    }
    .archive-layout-switch {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }
    .result-archive-actions .archive-layout-option {
        justify-content: center;
        white-space: normal;
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
    .result-folder-summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .result-folder-summary small {
        max-width: 100%;
        width: 100%;
        padding-left: 19px;
    }
    .result-folder-grid {
        grid-template-columns: 1fr;
    }
    .result-filter-bar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .result-filter-bar button {
        width: 100%;
        padding-left: 6px;
        padding-right: 6px;
    }
    .result-range-tools {
        flex: 1 1 100%;
        min-width: 0;
    }
    .result-range-tools input {
        min-width: 0;
    }
    .progress-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .result-card {
        border-radius: 14px;
    }
    .result-card img {
        aspect-ratio: 4 / 5;
    }
    .table-wrap {
        margin-left: -14px;
        margin-right: -14px;
        padding: 0 14px;
    }
    .admin-form label {
        font-size: 12px;
    }
    .site-auth-body {
        padding: 16px;
        align-items: start;
    }
    .site-auth-shell {
        width: 100%;
    }
    .site-auth-card {
        margin-top: 18px;
        padding: 24px 18px 20px;
        border-radius: 18px;
    }
    .site-auth-brand .site-logo {
        min-width: 76px;
        height: 44px;
        font-size: 18px;
        border-radius: 14px;
    }
    .site-auth-brand h1 {
        font-size: 24px;
    }
    .site-auth-brand p {
        font-size: 13px;
        line-height: 1.55;
    }
    .site-auth-form {
        margin-top: 18px;
    }
    .site-auth-form input {
        height: 48px;
        border-radius: 14px;
        font-size: 14px;
    }
    .site-auth-form button {
        min-height: 50px;
        border-radius: 14px;
    }
    .recharge-form {
        grid-template-columns: 1fr;
    }
    .recharge-pay-area {
        grid-template-columns: 1fr;
    }
    .invite-copy-row {
        grid-template-columns: 1fr;
    }
    .service-qr {
        width: min(260px, 100%);
    }
    .plan-grid {
        grid-template-columns: 1fr 1fr;
    }
    .bottom-nav {
        bottom: 10px;
        width: calc(100vw - 20px);
        min-height: 56px;
        border-radius: 16px;
    }
    .bottom-nav button {
        min-height: 44px;
        padding: 0 6px;
        font-size: 14px;
    }
}
.admin-form label { color: var(--muted); font-size: 13px; }
.admin-form input { margin-top: 5px; }
.adjust-form { margin-bottom: 12px; }
code { background: #f3f4f6; padding: 2px 5px; border-radius: 4px; }
@media (max-width: 1000px) {
    .site-userbar {
        grid-template-columns: 1fr 1fr;
    }
    .site-userbar .avatar-btn {
        grid-column: 1 / -1;
    }
    .site-userbar .ghost-btn,
    .site-userbar > button {
        min-height: 42px;
    }
    .batch-i2i-runbar {
        justify-content: stretch;
    }
    .batch-i2i-runbar > * {
        flex: 1 1 160px;
    }
}
@media (max-width: 760px) {
    .site-shell { padding: 12px 12px 98px; }
    .site-userbar { grid-template-columns: 1fr 1fr; }
    .site-userbar .avatar-btn { grid-column: 1 / -1; }
    .site-userbar .meter { min-width: 0; }
    .site-userbar .ghost-btn { min-height: 40px; }
    .tool-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
    .tool-row > *, .tool-row select, .tool-row button, .tool-row .fixed-channel, .tool-row .toggle-field { width: 100%; min-width: 0; max-width: none; min-height: 42px; }
    .tool-row .anti-ai-toggle, .tool-row button.primary { grid-column: 1 / -1; }
    .tool-row .anti-ai-toggle {
        justify-content: space-between;
        padding: 0 14px;
        border-radius: 14px;
        background: #f8fafc;
    }
    .tool-row .anti-ai-toggle span {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .single-batch-controls { align-items: stretch; display: grid; grid-template-columns: 1fr; gap: 8px; }
    .single-batch-controls .inline-field { min-width: 0; display: grid; grid-template-columns: auto minmax(68px, 86px) auto; align-items: center; gap: 8px; }
    .single-batch-controls .inline-field span { grid-column: 1 / -1; margin-top: 4px; line-height: 1.4; }
    .tool-row input, .tool-row select { max-width: none; width: 100%; }
    .scene-list { grid-template-columns: 1fr; }
    .result-grid { grid-template-columns: repeat(2, 1fr); }
    .recharge-form { grid-template-columns: 1fr; }
    .admin-form { grid-template-columns: 1fr; }
}
@media (max-width: 1180px) {
    .home-layout {
        grid-template-columns: 1fr;
    }
    .home-template-rail {
        position: static;
        grid-template-rows: auto minmax(0, 1fr);
        max-height: min(68vh, 640px);
        overflow: hidden;
    }
    .home-template-list {
        grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .home-template-card {
        max-width: none;
    }
}
@media (max-width: 760px) {
    .home-layout {
        display: flex;
        flex-direction: column;
    }
    .home-center {
        display: contents;
    }
    .home-generate-panel {
        order: 1;
    }
    .home-template-rail-left {
        order: 2;
    }
    .home-template-rail-right {
        order: 3;
    }
    .home-results-panel {
        order: 4;
    }
    .home-template-rail {
        max-height: min(58vh, 520px);
    }
    .home-template-list,
    .member-scene-panel .scene-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .home-template-info,
    .member-template-info {
        min-height: 94px;
        padding: 10px;
    }
    .home-template-info strong,
    .member-template-info strong {
        font-size: 13px;
    }
    .home-template-info small,
    .member-template-info p {
        min-height: 34px;
        font-size: 11px;
    }
    .template-tag-stack {
        left: 14px;
        bottom: 16px;
        gap: 7px;
    }
    .template-tag-stack span {
        padding: 5px 10px;
        font-size: 11px;
    }
    .generate-mode-switch {
        width: 100%;
    }
    .generate-mode-switch label {
        flex: 1 1 0;
    }
    .generate-mode-switch span {
        width: 100%;
        min-width: 0;
    }
    .scene-edit-drawer {
        width: 100vw;
    }
    .scene-drawer-head,
    .scene-drawer-body {
        padding-left: 18px;
        padding-right: 18px;
    }
    .drawer-ref-card {
        grid-template-columns: 88px minmax(0, 1fr);
    }
    .drawer-upload-box,
    .drawer-ref-preview {
        width: 88px;
    }
}

.home-template-rail .home-template-card.xhs-template-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
.home-template-rail .home-template-card.xhs-template-card .home-template-media {
    aspect-ratio: 9 / 13 !important;
    height: auto !important;
    min-height: 0 !important;
}
.home-template-rail .home-template-card.xhs-template-card .home-template-info {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 104px !important;
    padding: 11px 12px 12px !important;
    background: #fff !important;
}
.home-template-rail .home-template-card.xhs-template-card .home-template-info strong {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.home-template-rail .home-template-card.xhs-template-card .home-template-info small {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 760px) {
    .home-template-rail {
        max-height: none !important;
        overflow: visible !important;
    }
    .home-template-list {
        grid-template-columns: 1fr !important;
        overflow: visible !important;
        max-height: none !important;
        padding: 0 !important;
        gap: 10px !important;
    }
    .home-template-list::-webkit-scrollbar {
        display: none;
    }
    .home-template-rail .home-template-card.xhs-template-card {
        grid-template-columns: 96px minmax(0, 1fr) !important;
        grid-template-rows: 1fr !important;
        min-height: 116px !important;
        border-radius: 8px !important;
    }
    .home-template-rail .home-template-card.xhs-template-card .home-template-media {
        height: 100% !important;
        min-height: 116px !important;
        aspect-ratio: auto !important;
    }
    .home-template-rail .home-template-card.xhs-template-card .home-template-info {
        min-height: 116px !important;
        padding: 12px 12px 28px !important;
        align-content: start !important;
    }
    .home-template-rail .home-template-card.xhs-template-card .home-template-info strong {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    .home-template-rail .home-template-card.xhs-template-card .home-template-info small {
        min-height: 0 !important;
        font-size: 12px !important;
        line-height: 1.5 !important;
        -webkit-line-clamp: 3;
    }
    .home-template-rail .template-ref-badge {
        top: auto;
        right: 10px;
        bottom: 8px;
    }
    .home-template-rail .template-tag-stack {
        left: 8px;
        right: 8px;
        bottom: 8px;
        gap: 5px;
    }
    .home-template-rail .template-tag-stack span {
        max-width: 76px;
        padding: 4px 7px;
        font-size: 10px;
    }
    .home-template-rail .no-ref-pill {
        top: 8px;
        padding: 3px 8px;
        font-size: 11px;
    }
}

/* XHS-style preset cards: tall image, visible title, desktop rail scroll only. */
.home-template-rail {
    max-height: calc(100vh - 28px);
    overflow: hidden;
}
.home-template-list {
    grid-template-columns: 1fr;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.home-template-card,
.home-template-rail .home-template-card.xhs-template-card,
.member-template-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    border-radius: 8px !important;
}
.home-template-media,
.home-template-rail .home-template-card.xhs-template-card .home-template-media,
.member-template-media {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 9 / 14 !important;
}
.home-template-media img,
.member-template-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.home-template-info,
.home-template-rail .home-template-card.xhs-template-card .home-template-info,
.member-template-info {
    display: grid !important;
    gap: 5px !important;
    min-height: 82px !important;
    height: auto !important;
    padding: 10px 11px 12px !important;
    align-content: start !important;
    background: #fff !important;
}
.home-template-info strong,
.home-template-rail .home-template-card.xhs-template-card .home-template-info strong,
.member-template-info strong {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}
.home-template-info small,
.home-template-rail .home-template-card.xhs-template-card .home-template-info small,
.member-template-info p {
    display: -webkit-box !important;
    min-height: 0 !important;
    overflow: hidden !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 12px !important;
    line-height: 1.45 !important;
}
.member-template-info small {
    font-size: 11px;
    line-height: 1.3;
}
.member-scene-panel .scene-list {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    align-items: start;
}

@media (max-width: 760px) {
    .home-template-rail {
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
    }
    .home-template-list,
    .member-scene-panel .scene-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }
    .home-template-list::-webkit-scrollbar {
        display: none !important;
    }
    .home-template-card,
    .home-template-rail .home-template-card.xhs-template-card,
    .member-template-card {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        min-height: 0 !important;
    }
    .home-template-card .home-template-media,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media,
    .member-template-media {
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 9 / 14 !important;
    }
    .home-template-info,
    .home-template-rail .home-template-card.xhs-template-card .home-template-info,
    .member-template-info {
        min-height: 78px !important;
        padding: 9px 10px 11px !important;
    }
    .home-template-rail .template-ref-badge {
        top: 8px !important;
        right: 8px !important;
        bottom: auto !important;
    }
    .home-template-rail .template-tag-stack {
        left: 10px !important;
        right: 10px !important;
        bottom: 12px !important;
    }
}

/* Final homepage preset layout fix.
   Keep the center generator from squeezing desktop side template cards. */
@media (min-width: 1181px) {
    .home-layout {
        display: grid !important;
        grid-template-columns:
            clamp(240px, 14vw, 280px)
            minmax(0, 1120px)
            clamp(240px, 14vw, 280px) !important;
        justify-content: center !important;
        align-items: start !important;
        gap: 16px !important;
        width: 100% !important;
    }
    .home-center,
    .home-generate-panel,
    .home-results-panel {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 1120px !important;
    }
    .home-template-rail {
        width: 100% !important;
        min-width: 0 !important;
        max-height: calc(100vh - 28px) !important;
        overflow: hidden !important;
    }
    .home-template-list {
        grid-template-columns: 1fr !important;
        align-content: start !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    .home-template-rail .home-template-card.xhs-template-card {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }
    .home-template-rail .home-template-media {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 9 / 13 !important;
    }
    .home-template-rail .home-template-info,
    .home-template-rail .home-template-info.xhs-template-info {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 92px !important;
        height: auto !important;
        padding: 10px 12px 12px !important;
        background: #fff !important;
        align-content: start !important;
    }
    .home-template-rail .home-template-info strong {
        font-size: 14px !important;
        line-height: 1.42 !important;
    }
    .home-template-rail .home-template-info small {
        font-size: 12px !important;
        line-height: 1.48 !important;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 760px) {
    .home-template-rail {
        max-height: none !important;
        overflow: visible !important;
    }
    .home-template-list {
        grid-template-columns: 1fr !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }
    .home-template-rail .home-template-card.xhs-template-card {
        display: grid !important;
        grid-template-columns: 112px minmax(0, 1fr) !important;
        grid-template-rows: 1fr !important;
        min-height: 128px !important;
        width: 100% !important;
    }
    .home-template-rail .home-template-media {
        height: 100% !important;
        min-height: 128px !important;
        aspect-ratio: auto !important;
    }
    .home-template-rail .home-template-info,
    .home-template-rail .home-template-info.xhs-template-info {
        min-height: 128px !important;
        padding: 12px 12px 30px !important;
    }
    .home-template-rail .home-template-info small {
        -webkit-line-clamp: 3;
    }
    .home-template-rail .template-ref-badge {
        top: auto !important;
        right: 10px !important;
        bottom: 8px !important;
    }
}

/* 100% desktop zoom: force homepage side templates to be tall cards. */
@media (min-width: 1181px) {
    .home-layout {
        grid-template-columns:
            clamp(260px, 15vw, 300px)
            minmax(720px, 1080px)
            clamp(260px, 15vw, 300px) !important;
    }
    .home-template-rail .home-template-card,
    .home-template-rail .home-template-card.xhs-template-card {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }
    .home-template-rail .home-template-media,
    .home-template-rail .home-template-media.has-image,
    .home-template-rail .home-template-media.no-image,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media {
        display: block !important;
        width: 100% !important;
        height: clamp(300px, 19vw, 380px) !important;
        min-height: clamp(300px, 19vw, 380px) !important;
        max-height: clamp(300px, 19vw, 380px) !important;
        aspect-ratio: auto !important;
        overflow: hidden !important;
    }
    .home-template-rail .home-template-media img,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    .home-template-rail .home-template-info,
    .home-template-rail .home-template-info.xhs-template-info,
    .home-template-rail .home-template-card.xhs-template-card .home-template-info {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 86px !important;
        height: auto !important;
        padding: 10px 12px 12px !important;
        background: #fff !important;
        align-content: start !important;
    }
    .home-template-rail .home-template-info strong {
        display: -webkit-box !important;
        overflow: hidden !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal !important;
    }
    .home-template-rail .home-template-info small {
        display: -webkit-box !important;
        min-height: 0 !important;
        overflow: hidden !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal !important;
    }
}

/* Homepage template cards must stay vertical at normal 100% zoom. */
.home-template-rail .home-template-card,
.home-template-rail .home-template-card.xhs-template-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
}
.home-template-rail .home-template-media,
.home-template-rail .home-template-media.has-image,
.home-template-rail .home-template-media.no-image,
.home-template-rail .home-template-card.xhs-template-card .home-template-media {
    display: block !important;
    width: 100% !important;
    overflow: hidden !important;
}
.home-template-rail .home-template-media img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.home-template-rail .home-template-info,
.home-template-rail .home-template-info.xhs-template-info,
.home-template-rail .home-template-card.xhs-template-card .home-template-info {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    background: #fff !important;
    align-content: start !important;
}

@media (min-width: 1181px) {
    .home-layout {
        grid-template-columns:
            minmax(280px, 300px)
            minmax(720px, 1040px)
            minmax(280px, 300px) !important;
        justify-content: center !important;
    }
    .home-template-rail .home-template-media,
    .home-template-rail .home-template-media.has-image,
    .home-template-rail .home-template-media.no-image,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media {
        height: 380px !important;
        min-height: 380px !important;
        max-height: 380px !important;
        aspect-ratio: auto !important;
    }
    .home-template-rail .home-template-info,
    .home-template-rail .home-template-info.xhs-template-info,
    .home-template-rail .home-template-card.xhs-template-card .home-template-info {
        min-height: 92px !important;
        padding: 11px 12px 13px !important;
    }
}

@media (max-width: 760px) {
    .home-template-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }
    .home-template-rail .home-template-card,
    .home-template-rail .home-template-card.xhs-template-card {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        min-height: 0 !important;
    }
    .home-template-rail .home-template-media,
    .home-template-rail .home-template-media.has-image,
    .home-template-rail .home-template-media.no-image,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: 3 / 4 !important;
    }
    .home-template-rail .home-template-info,
    .home-template-rail .home-template-info.xhs-template-info,
    .home-template-rail .home-template-card.xhs-template-card .home-template-info {
        min-height: 86px !important;
        padding: 9px 10px 12px !important;
    }
    .home-template-rail .home-template-info strong {
        font-size: 13px !important;
        line-height: 1.35 !important;
    }
    .home-template-rail .home-template-info small {
        font-size: 11px !important;
        line-height: 1.4 !important;
        -webkit-line-clamp: 2 !important;
    }
    .home-template-rail .template-ref-badge {
        top: 8px !important;
        right: 8px !important;
        bottom: auto !important;
    }
}

@media (max-width: 390px) {
    .home-template-list {
        grid-template-columns: 1fr !important;
    }
}

/* v5: desktop/normal zoom hard lock. Do not let side preset cards become horizontal crops. */
@media (min-width: 761px) {
    .home-template-rail {
        min-width: 0 !important;
        overflow: hidden !important;
    }
    .home-template-list {
        display: grid !important;
        grid-template-columns: 1fr !important;
        align-content: start !important;
        align-items: start !important;
        gap: 14px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    .home-template-rail .home-template-card,
    .home-template-rail .home-template-card.xhs-template-card {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 360px auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 452px !important;
        max-height: none !important;
        overflow: hidden !important;
    }
    .home-template-rail .home-template-media,
    .home-template-rail .home-template-media.has-image,
    .home-template-rail .home-template-media.no-image,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media {
        grid-row: 1 !important;
        display: block !important;
        width: 100% !important;
        height: 360px !important;
        min-height: 360px !important;
        max-height: 360px !important;
        aspect-ratio: auto !important;
        overflow: hidden !important;
    }
    .home-template-rail .home-template-media img,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    .home-template-rail .home-template-info,
    .home-template-rail .home-template-info.xhs-template-info,
    .home-template-rail .home-template-card.xhs-template-card .home-template-info {
        grid-row: 2 !important;
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 92px !important;
        height: auto !important;
        max-height: none !important;
        padding: 11px 12px 13px !important;
        background: #fff !important;
        align-content: start !important;
    }
    .home-template-rail .home-template-info strong {
        display: -webkit-box !important;
        overflow: hidden !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        white-space: normal !important;
        font-size: 14px !important;
        line-height: 1.42 !important;
    }
    .home-template-rail .home-template-info small {
        display: -webkit-box !important;
        min-height: 0 !important;
        overflow: hidden !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        white-space: normal !important;
        font-size: 12px !important;
        line-height: 1.48 !important;
    }
}

@media (max-width: 760px) {
    .home-template-rail .home-template-card,
    .home-template-rail .home-template-card.xhs-template-card {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        min-height: 0 !important;
    }
    .home-template-rail .home-template-media,
    .home-template-rail .home-template-media.has-image,
    .home-template-rail .home-template-media.no-image,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: 3 / 4 !important;
    }
}

/* v6: view switching and full-width desktop home layout. */
.app-view[hidden],
.app-view[hidden].home-layout,
#homeView[hidden],
#presetView[hidden],
#profileView[hidden] {
    display: none !important;
}

@media (min-width: 761px) {
    .site-shell {
        width: 100% !important;
        max-width: none !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .site-main,
    .home-layout {
        width: 100% !important;
        max-width: none !important;
    }
    .home-layout {
        grid-template-columns:
            minmax(280px, 300px)
            minmax(0, 1fr)
            minmax(280px, 300px) !important;
        justify-content: stretch !important;
        gap: 12px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .home-center,
    .home-generate-panel,
    .home-results-panel {
        max-width: none !important;
        width: 100% !important;
    }
}

/* v7: keep the generation workspace on the left, leave a quiet middle column,
   and show homepage templates as two right-side columns: lead then commerce. */
@media (min-width: 1181px) {
    .home-layout {
        display: grid !important;
        grid-template-columns:
            minmax(0, 1fr)
            clamp(10px, 1.1vw, 24px)
            minmax(200px, 300px)
            minmax(200px, 300px) !important;
        grid-template-areas:
            "work space lead commerce" !important;
        grid-auto-rows: min-content !important;
        align-items: start !important;
        justify-content: stretch !important;
        column-gap: clamp(10px, 1.2vw, 22px) !important;
        row-gap: 0 !important;
        padding-right: clamp(10px, 1.2vw, 24px) !important;
    }
    .home-center {
        grid-area: work !important;
        align-self: start !important;
    }
    .home-template-rail-left {
        grid-area: lead !important;
    }
    .home-template-rail-right {
        grid-area: commerce !important;
    }
    .home-template-rail {
        position: sticky !important;
        top: 12px !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        max-height: calc(100vh - 88px) !important;
        overflow: hidden !important;
    }
    .home-template-rail-head {
        padding: 0 0 2px !important;
    }
    .home-template-list {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        padding: 0 6px 10px 0 !important;
        overscroll-behavior: contain !important;
    }
    .home-template-rail .home-template-card,
    .home-template-rail .home-template-card.xhs-template-card {
        display: flex !important;
        flex: 0 0 auto !important;
        flex-direction: column !important;
        grid-template-rows: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        border-color: #e6e1dc !important;
        box-shadow: 0 2px 10px rgba(15, 23, 42, .08) !important;
    }
    .home-template-rail .home-template-media,
    .home-template-rail .home-template-media.has-image,
    .home-template-rail .home-template-media.no-image,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media {
        flex: 0 0 clamp(230px, 16vw, 320px) !important;
        height: clamp(230px, 16vw, 320px) !important;
        min-height: clamp(230px, 16vw, 320px) !important;
        max-height: clamp(230px, 16vw, 320px) !important;
        aspect-ratio: auto !important;
        background: #f4f1ed !important;
    }
    .home-template-rail .home-template-media img,
    .home-template-rail .home-template-card.xhs-template-card .home-template-media img {
        object-fit: contain !important;
        background: #f4f1ed !important;
    }
    .home-template-rail .home-template-info,
    .home-template-rail .home-template-info.xhs-template-info,
    .home-template-rail .home-template-card.xhs-template-card .home-template-info {
        flex: 0 0 auto !important;
        min-height: 76px !important;
        height: auto !important;
        padding: 10px 11px 12px !important;
    }
    .home-template-rail .home-template-info strong {
        font-size: 13px !important;
        line-height: 1.35 !important;
    }
    .home-template-rail .home-template-info small {
        font-size: 11px !important;
        line-height: 1.45 !important;
        -webkit-line-clamp: 2 !important;
    }
}

/* Collapsible homepage template drawers. */
.rail-toggle-btn {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    background: #fff;
    color: #111827;
}
.home-template-rail-head {
    align-items: start;
}
.home-template-rail-head > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

@media (min-width: 1181px) {
    .home-template-rail-head {
        display: flex !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }
    .home-layout.is-lead-rail-collapsed {
        grid-template-columns:
            minmax(0, 1fr)
            clamp(10px, 1.1vw, 24px)
            44px
            minmax(200px, 300px) !important;
    }
    .home-layout.is-commerce-rail-collapsed {
        grid-template-columns:
            minmax(0, 1fr)
            clamp(10px, 1.1vw, 24px)
            minmax(200px, 300px)
            44px !important;
    }
    .home-layout.is-lead-rail-collapsed.is-commerce-rail-collapsed {
        grid-template-columns:
            minmax(0, 1fr)
            clamp(8px, .8vw, 16px)
            44px
            44px !important;
    }
    .home-template-rail.is-collapsed {
        min-width: 44px !important;
        width: 44px !important;
        max-width: 44px !important;
        overflow: visible !important;
    }
    .home-template-rail.is-collapsed .home-template-list {
        display: none !important;
    }
    .home-template-rail.is-collapsed .home-template-rail-head {
        min-height: 152px !important;
        padding: 8px 6px !important;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        align-items: center !important;
        justify-content: start !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
    }
    .home-template-rail.is-collapsed .home-template-rail-head > div {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 96px;
        width: 100%;
        order: 2;
    }
    .home-template-rail.is-collapsed .home-template-rail-head strong {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        letter-spacing: 0;
        font-size: 13px !important;
        line-height: 1.1;
    }
    .home-template-rail.is-collapsed .home-template-rail-head span {
        display: none !important;
    }
    .home-template-rail.is-collapsed .rail-toggle-btn {
        order: 1;
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 1180px) {
    .rail-toggle-btn {
        display: none;
    }
}

/* Shared drawer toggle for both homepage template rails. */
.home-template-drawer-toggle {
    display: none;
}

@media (min-width: 1181px) {
    .home-layout {
        grid-template-columns:
            minmax(0, 1fr)
            42px
            minmax(200px, 300px)
            minmax(200px, 300px) !important;
        grid-template-areas:
            "work railToggle lead commerce" !important;
        column-gap: clamp(10px, 1vw, 18px) !important;
    }
    .home-template-drawer-toggle {
        grid-area: railToggle !important;
        position: sticky;
        top: 12px;
        align-self: start;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 42px;
        height: min(220px, calc(100vh - 120px));
        min-height: 164px;
        padding: 10px 0;
        border: 1px solid rgba(17, 24, 39, .08);
        border-radius: 14px;
        background: rgba(255, 255, 255, .94);
        color: #111827;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
        backdrop-filter: blur(14px);
        z-index: 15;
    }
    .home-template-drawer-toggle:hover {
        border-color: rgba(17, 24, 39, .18);
        box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
    }
    .drawer-toggle-icon {
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        border-radius: 999px;
        background: #111827;
        color: #fff;
        font-size: 18px;
        font-weight: 900;
        line-height: 1;
    }
    .drawer-toggle-text {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        letter-spacing: 0;
        font-size: 12px;
        font-weight: 800;
        line-height: 1.15;
        white-space: nowrap;
    }
    .home-layout.is-template-rails-collapsed {
        grid-template-columns:
            minmax(0, 1fr)
            58px !important;
        grid-template-areas:
            "work railToggle" !important;
        padding-right: clamp(10px, 1.2vw, 24px) !important;
    }
    .home-layout.is-template-rails-collapsed .home-template-rail {
        display: none !important;
    }
    .home-layout.is-template-rails-collapsed .home-template-drawer-toggle {
        justify-self: end;
        width: 58px;
        height: 214px;
        min-height: 214px;
        border-radius: 18px;
        background:
            linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
        box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
    }
    .home-layout.is-template-rails-collapsed .drawer-toggle-icon {
        background: #fff;
        color: #111827;
        border: 1px solid rgba(17, 24, 39, .12);
        box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
    }
    .home-layout.is-template-rails-collapsed .drawer-toggle-text {
        font-size: 13px;
    }
}

@media (max-width: 1180px) {
    .home-template-drawer-toggle {
        display: none !important;
    }
}

.admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.admin-sidebar {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.admin-sidebar-group {
    display: grid;
    gap: 6px;
}
.admin-sidebar-group > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.admin-nav-item {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}
.admin-nav-item:hover {
    background: #f3f4f6;
}
.admin-nav-item.is-active {
    background: #111827;
    color: #fff;
}
.admin-logo {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(145deg, #8b5cf6, #6366f1);
    color: #fff;
    box-shadow: 0 8px 18px rgba(99, 102, 241, .24);
    white-space: nowrap;
}
.admin-logo span { display: block; line-height: 1; }
.admin-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 172px;
    margin-bottom: 16px;
    padding: 28px 34px;
    overflow: hidden;
    border: 1px solid #ddd6fe;
    border-radius: 26px;
    background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 58%, #ecfeff 100%);
    box-shadow: 0 18px 44px rgba(79, 70, 229, .09);
}
.dashboard-kicker { color: #7c3aed; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.admin-dashboard-hero h1 { margin: 8px 0 6px; color: #25164f; font-size: clamp(25px, 3vw, 38px); line-height: 1.12; }
.admin-dashboard-hero p { margin: 0; color: #716889; font-size: 15px; }
.dashboard-mascot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex: 0 0 110px;
    width: 110px;
    height: 110px;
    border: 5px solid rgba(255,255,255,.8);
    border-radius: 38% 46% 42% 48%;
    background: linear-gradient(145deg, #8b5cf6, #6366f1);
    transform: rotate(5deg);
    box-shadow: 0 18px 32px rgba(99, 102, 241, .25);
}
.mascot-eye { width: 12px; height: 18px; border-radius: 99px; background: #fff; }
.mascot-smile { position: absolute; bottom: 26px; left: 41px; width: 29px; height: 14px; border-bottom: 4px solid #fff; border-radius: 0 0 50% 50%; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.dashboard-metric { position: relative; min-width: 0; padding: 20px; overflow: hidden; border: 1px solid rgba(148, 163, 184, .2); border-radius: 20px; background: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.dashboard-metric::after { content: ""; position: absolute; right: -18px; bottom: -24px; width: 70px; height: 70px; border-radius: 50%; background: currentColor; opacity: .09; }
.dashboard-metric > span { display: block; color: #64748b; font-size: 13px; font-weight: 800; }
.dashboard-metric > strong { display: block; margin: 8px 0 4px; color: #172033; font-size: 30px; line-height: 1; }
.dashboard-metric small, .dashboard-metric small a { color: currentColor; font-weight: 800; text-decoration: none; }
.metric-purple { color: #7c3aed; }.metric-blue { color: #2563eb; }.metric-amber { color: #d97706; }.metric-rose { color: #e11d48; }
.dashboard-storage-panel { border-radius: 22px; box-shadow: 0 12px 34px rgba(15, 23, 42, .06); }
.dashboard-status-dot { padding: 6px 10px; border-radius: 999px; background: #ecfdf5; color: #047857 !important; font-weight: 800; }
.dashboard-storage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-storage-grid div { min-width: 0; border-radius: 16px; background: #f8fafc; }
.dashboard-storage-grid strong { overflow-wrap: anywhere; }
.runtime-log-filters { display: grid; grid-template-columns: 150px 160px minmax(190px, 1fr) minmax(190px, 1fr); gap: 10px; margin-bottom: 16px; align-items: end; }
.runtime-log-filters input, .runtime-log-filters select { width: 100%; min-width: 0; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.runtime-log-time { display: grid; gap: 5px; color: #64748b; font-size: 12px; font-weight: 800; }
.runtime-log-keyword { grid-column: 1 / -2; }
.runtime-log-actions { display: flex; gap: 8px; justify-content: flex-end; }
.runtime-log-actions button { min-height: 42px; white-space: nowrap; }
.runtime-log-refresh-state { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin: -4px 2px 10px; color: #64748b; font-size: 12px; font-weight: 700; }
.runtime-log-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .12); }
.runtime-log-list { display: grid; gap: 8px; max-height: 68vh; overflow: auto; }
.runtime-log-row { display: grid; grid-template-columns: 150px 210px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid #e5e7eb; border-left: 4px solid #94a3b8; border-radius: 12px; background: #fff; }
.runtime-log-row.level-error { border-left-color: #ef4444; background: #fff7f7; }
.runtime-log-row.level-warning { border-left-color: #f59e0b; background: #fffaf0; }
.runtime-log-row time { color: #64748b; font-size: 12px; }
.runtime-log-row strong { font-size: 13px; overflow-wrap: anywhere; }
.runtime-log-row code { color: #475569; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .site-topbar { flex-wrap: nowrap; }
    .site-brand { min-width: 0; flex: 1 1 auto; }
    .site-brand > div:last-child { min-width: 0; }
    .site-brand strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .site-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; display: flex; gap: 10px; overflow-x: auto; padding: 10px; }
    .admin-sidebar-group { min-width: 150px; flex: 0 0 auto; }
    .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-storage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .runtime-log-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .runtime-log-keyword { grid-column: 1 / -1; }
    .runtime-log-actions { grid-column: 1 / -1; justify-content: stretch; }
    .runtime-log-actions button { flex: 1 1 0; }
    .runtime-log-row { grid-template-columns: 120px minmax(0, 1fr); }
    .runtime-log-row code { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .site-topbar { gap: 8px; }
    .admin-logo { flex-basis: 36px; width: 36px; min-width: 36px; height: 36px; border-radius: 12px; }
    .site-brand span { display: none; }
    .admin-dashboard-hero { min-height: 148px; padding: 22px 20px; border-radius: 20px; }
    .dashboard-mascot { flex-basis: 76px; width: 76px; height: 76px; gap: 14px; border-radius: 30px; }
    .mascot-eye { width: 8px; height: 13px; }
    .mascot-smile { left: 27px; bottom: 17px; width: 20px; height: 10px; border-bottom-width: 3px; }
    .dashboard-metrics, .dashboard-storage-grid, .runtime-log-filters { grid-template-columns: 1fr; }
    .runtime-log-keyword, .runtime-log-actions { grid-column: auto; }
    .dashboard-metric { padding: 16px; }
    .runtime-log-row { grid-template-columns: 1fr; }
    .runtime-log-row code { grid-column: auto; }
}

.home-agent-strip {
    grid-column: 1 / -1;
}
.home-agent-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.home-agent-card {
    display: grid;
    gap: 8px;
    min-height: 126px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbfc;
    color: var(--text);
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.home-agent-card:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .1);
}
.home-agent-card strong {
    font-size: 15px;
    line-height: 1.35;
}
.home-agent-card span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.home-agent-card small,
.home-agent-empty {
    color: #64748b;
    font-size: 12px;
}

/* Homepage: align template rails with the agent strip and span the full work area. */
@media (min-width: 1181px) {
    .home-layout {
        grid-template-areas:
            "agent railToggle lead commerce"
            "work railToggle lead commerce" !important;
        row-gap: 16px !important;
    }
    .home-agent-strip {
        grid-area: agent !important;
        grid-column: auto !important;
        width: 100% !important;
    }
    .home-layout.is-template-rails-collapsed {
        grid-template-areas:
            "agent railToggle"
            "work railToggle" !important;
        row-gap: 16px !important;
    }
}

@media (max-width: 760px) {
    .home-agent-strip {
        order: 0;
    }
}
.agent-page {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
    align-items: start;
}
.agent-picker-panel {
    position: sticky;
    top: 12px;
    display: grid;
    align-content: start;
    gap: 14px;
}
.agent-picker-list {
    display: grid;
    gap: 10px;
}
.agent-picker-card {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
}
.agent-picker-card.is-active {
    border-color: #111827;
    background: #f8fafc;
    box-shadow: inset 3px 0 0 #111827;
}
.agent-picker-card strong {
    font-size: 14px;
}
.agent-picker-card span,
.agent-picker-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.agent-session-panel {
    display: grid;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.agent-session-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.agent-session-head strong {
    font-size: 14px;
}
.agent-session-head button {
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}
.agent-session-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}
.agent-session-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: stretch;
}
.agent-session-card {
    display: grid;
    justify-items: start;
    gap: 3px;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 8px;
    text-align: left;
    background: #fff;
}
.agent-session-row.is-active .agent-session-card {
    border-color: #111827;
    background: #f8fafc;
    box-shadow: inset 3px 0 0 #111827;
}
.agent-session-card span,
.agent-session-card small,
.agent-session-card em {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agent-session-card span {
    font-size: 13px;
    font-weight: 800;
}
.agent-session-card small {
    color: var(--muted);
    font-size: 11px;
}
.agent-session-card em {
    color: #64748b;
    font-size: 11px;
    font-style: normal;
}
.agent-session-delete {
    min-width: 44px;
    min-height: 58px;
    padding: 0 8px;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 12px;
}
.agent-session-empty {
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}
.agent-chat-panel {
    min-height: calc(100vh - 150px);
    display: grid;
    grid-template-rows: auto minmax(360px, 1fr) auto auto;
    gap: 12px;
}
.agent-chat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.agent-chat-head h2 {
    margin: 0 0 6px;
    font-size: 20px;
}
.agent-chat-head span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.agent-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.agent-cost-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 800;
}
.agent-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 360px;
    max-height: calc(100vh - 365px);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.agent-message {
    display: grid;
    gap: 6px;
    max-width: min(760px, 88%);
}
.agent-message.is-user {
    align-self: flex-end;
    justify-items: end;
}
.agent-message.is-assistant {
    align-self: flex-start;
}
.agent-message-meta {
    color: var(--muted);
    font-size: 12px;
}
.agent-message-body {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    line-height: 1.7;
}
.agent-message.is-user .agent-message-body {
    background: #111827;
    border-color: #111827;
    color: #fff;
}
.agent-message-images,
.agent-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.agent-message-images img {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.agent-message-actions {
    display: flex;
    gap: 8px;
}
.agent-message-actions button {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
}
.agent-progress {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
}
.agent-progress[hidden] {
    display: none;
}
.agent-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #1e3a8a;
    font-size: 13px;
}
.agent-progress-head strong,
.agent-progress-head span {
    white-space: nowrap;
}
.agent-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbeafe;
}
.agent-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #2563eb;
    transition: width .22s ease;
}
.agent-progress-detail {
    min-height: 18px;
    color: #31517a;
    font-size: 12px;
    line-height: 1.5;
}
.agent-composer {
    display: grid;
    gap: 10px;
}
.agent-tool-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}
.agent-batch-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.agent-batch-field input {
    width: 72px;
}
.agent-image-card {
    position: relative;
    width: 86px;
    height: 86px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.agent-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agent-image-card button {
    position: absolute;
    right: 4px;
    bottom: 4px;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 6px;
    background: rgba(17, 24, 39, .82);
    color: #fff;
    border-color: rgba(17, 24, 39, .2);
    font-size: 11px;
}
.agent-admin-form textarea[name="system_prompt"] {
    min-height: 360px;
}
.agent-service-form {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
}
.agent-service-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.agent-service-head > div {
    display: grid;
    gap: 4px;
}
.agent-service-head strong {
    font-size: 15px;
}
.agent-service-head span {
    color: var(--muted);
    font-size: 12px;
}
.agent-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.agent-service-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
.agent-service-card legend {
    padding: 0 6px;
    font-size: 13px;
    font-weight: 800;
}
.agent-service-card textarea {
    min-height: 74px;
}

@media (max-width: 1180px) {
    .home-agent-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .agent-page {
        grid-template-columns: 1fr;
    }
    .agent-picker-panel {
        position: static;
    }
    .agent-picker-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .home-agent-grid,
    .agent-picker-list {
        grid-template-columns: 1fr;
    }
    .agent-chat-panel {
        min-height: 0;
        grid-template-rows: auto minmax(320px, 1fr) auto auto;
    }
    .agent-messages {
        max-height: none;
        min-height: 320px;
    }
    .agent-message {
        max-width: 96%;
    }
    .agent-chat-head {
        display: grid;
    }
    .agent-head-actions,
    .agent-tool-row {
        justify-content: stretch;
    }
    .agent-tool-row button,
    .agent-batch-field {
        flex: 1 1 130px;
    }
    .agent-session-list {
        max-height: none;
    }
    .agent-session-row {
        grid-template-columns: minmax(0, 1fr) 52px;
    }
    .agent-session-delete {
        min-width: 52px;
    }
}

@media (max-width: 760px) {
    .home-agent-strip {
        padding: 12px;
        overflow: visible;
    }
    .home-agent-strip .panel-head {
        margin-bottom: 10px;
    }
    .home-agent-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
        padding: 0;
        overflow: visible;
    }
    .home-agent-card {
        min-width: 0;
        min-height: 112px;
        padding: 12px;
        align-content: start;
    }
    .home-agent-card strong {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 14px;
    }
    .home-agent-card span {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 12px;
        line-height: 1.45;
    }
    .home-agent-card small {
        margin-top: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 390px) {
    .home-agent-grid {
        grid-template-columns: 1fr;
    }
    .home-agent-card {
        min-height: 96px;
    }
}

/* Stitch Studio UI applied to /new homepage. */
body.studio-home-page {
    --bg: #f5f7ff;
    --panel: #ffffff;
    --text: #121a31;
    --muted: #6c758f;
    --line: #dbe2f3;
    --primary: #075bff;
    --primary-dark: #0045d8;
    --studio-purple: #7c3aed;
    --soft: #f2f5ff;
    background:
        radial-gradient(circle, rgba(10, 23, 55, .12) 1px, transparent 1.2px) 0 0 / 18px 18px,
        linear-gradient(180deg, #f8faff 0%, #f2f5fb 100%);
}

.studio-home-page .studio-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 0;
    width: min(1880px, calc(100vw - 28px));
    margin: 12px auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(143, 153, 180, .38);
    border-radius: 14px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 24px 70px rgba(19, 38, 85, .12);
}

.studio-sidebar {
    min-height: calc(100vh - 24px);
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    gap: 16px;
    padding: 22px 18px;
    border-right: 1px solid var(--line);
    background: rgba(247, 249, 255, .94);
}

.studio-sidebar-brand {
    display: grid;
    gap: 4px;
    padding: 0 4px 20px;
    border-bottom: 1px solid var(--line);
}

.studio-sidebar-brand strong {
    color: #0b1533;
    font-size: 22px;
    line-height: 1.05;
}

.studio-sidebar-brand span,
.studio-quota-card span,
.studio-quota-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.studio-sidebar-nav {
    display: grid;
    gap: 8px;
}

.studio-sidebar-nav button,
.studio-sidebar-nav a,
.studio-sidebar-foot button,
.studio-sidebar-foot a {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #48536d;
    text-align: left;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
}

.studio-sidebar-nav span {
    width: 20px;
    display: inline-grid;
    place-items: center;
    color: #667085;
    font-size: 15px;
}

.studio-sidebar-nav .is-active,
.studio-sidebar-nav [aria-current="page"],
.studio-sidebar-foot button:hover,
.studio-sidebar-foot a:hover {
    background: #eef3ff;
    color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}

.studio-sidebar-spacer {
    min-height: 32px;
}

.studio-quota-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid #c9d5f5;
    border-radius: 9px;
    background: #e9efff;
}

.studio-quota-card strong {
    color: #0b1533;
    font-size: 22px;
    line-height: 1;
}

.studio-quota-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-top: 4px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #075bff);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

.studio-sidebar-foot {
    display: grid;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.studio-workspace {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    background: #fbfcff;
}

.studio-home-page .studio-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 68px;
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(18px);
}

.studio-home-page .site-brand {
    min-width: 230px;
    gap: 10px;
}

.studio-home-page .studio-topbar .studio-top-tabs {
    margin-left: 8px;
    margin-right: auto;
}

.studio-home-page .site-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef3ff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 950;
}

.studio-home-page .site-brand strong {
    color: #0b1533;
    font-size: 16px;
    line-height: 1.1;
}

.studio-home-page .site-brand span {
    display: block;
    margin-top: 2px;
    color: #7a849b;
    font-size: 12px;
    font-weight: 700;
}

.studio-menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    color: var(--primary);
    background: transparent;
    font-size: 20px;
}

.studio-top-tabs {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    min-height: 40px;
}

.studio-top-tabs button,
.studio-top-tabs a {
    position: relative;
    min-height: 40px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #4c5872;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
}

.studio-top-tabs .is-active,
.studio-top-tabs [aria-current="page"] {
    color: var(--primary);
}

.studio-top-tabs .is-active::after,
.studio-top-tabs [aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.studio-home-page .site-search {
    flex: 1 1 240px;
    max-width: 360px;
    height: 42px;
    margin-left: auto;
    border-color: #cdd7f2;
    border-radius: 10px;
    background: #eef3ff;
}

.studio-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.studio-icon-btn,
.studio-avatar-mini {
    width: 36px;
    height: 36px;
    min-height: 36px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #586276;
}

.studio-new-project {
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(7, 91, 255, .24);
}

.studio-avatar-mini {
    overflow: hidden;
    border-radius: 999px;
    background: #edf2ff;
}

.studio-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.studio-home-page .site-main {
    min-width: 0;
    padding: 20px;
    background: #fbfcff;
}

.studio-home-page .home-layout {
    grid-template-columns: minmax(0, 420px) minmax(420px, 1fr) !important;
    grid-template-areas:
        "agents agents"
        "work results"
        "lead commerce" !important;
    align-items: start;
    gap: 18px !important;
}

.studio-home-page .home-agent-strip {
    grid-area: agents !important;
    padding: 0;
    border: 0;
    background: transparent;
}

.studio-home-page .home-agent-strip .panel-head {
    margin-bottom: 10px;
}

.studio-home-page .home-agent-strip .panel-head h2 {
    font-size: 16px;
}

.studio-home-page .home-agent-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.studio-home-page .home-agent-card {
    min-height: 86px;
    padding: 13px 14px;
    border-color: #dce4f6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(30, 41, 59, .04);
}

.studio-home-page .home-center {
    display: contents;
}

.studio-home-page .home-template-drawer-toggle {
    display: none !important;
}

.studio-home-page .home-generate-panel {
    grid-area: work !important;
}

.studio-home-page .home-results-panel {
    grid-area: results !important;
}

.studio-home-page .home-template-rail-left {
    grid-area: lead !important;
}

.studio-home-page .home-template-rail-right {
    grid-area: commerce !important;
}

.studio-home-page .panel {
    border-color: #dce4f6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(29, 46, 96, .06);
}

.studio-home-page .panel-head h2 {
    color: #101a34;
    font-size: 20px;
}

.studio-home-page .panel-head span {
    color: #7a849b;
    font-weight: 700;
}

.studio-home-page .generate-mode-block {
    display: grid;
    gap: 14px;
}

.studio-home-page .mode-block-head {
    padding: 0;
    border: 0;
    background: transparent;
}

.studio-home-page .mode-block-head strong {
    font-size: 14px;
}

.studio-home-page .generate-mode-switch {
    width: 100%;
    padding: 4px;
    border-color: #dce4f6;
    border-radius: 10px;
    background: #f3f6ff;
}

.studio-home-page .generate-mode-switch label {
    flex: 1;
}

.studio-home-page .generate-mode-switch span {
    width: 100%;
    min-height: 38px;
    border-radius: 8px;
}

.studio-home-page .generate-mode-switch input:checked + span,
.studio-home-page .bottom-nav button.is-active {
    background: var(--primary);
    color: #fff;
}

.studio-home-page textarea,
.studio-home-page input,
.studio-home-page select {
    border-color: #d8e1f4;
    border-radius: 9px;
    background: #fff;
}

.studio-home-page input[type="checkbox"],
.studio-home-page input[type="radio"],
.studio-home-page .toggle-field input {
    width: auto;
}

.studio-home-page textarea:focus,
.studio-home-page input:focus,
.studio-home-page select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(7, 91, 255, .12);
}

.studio-home-page #singlePrompt,
.studio-home-page #textPrompt {
    min-height: 132px;
    background: #fbfcff;
    color: #24304a;
}

.studio-home-page .tool-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.studio-home-page .tool-row > *,
.studio-home-page .tool-row select,
.studio-home-page .tool-row button,
.studio-home-page .tool-row .fixed-channel,
.studio-home-page .tool-row .toggle-field {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.studio-home-page #singleGenerateBtn {
    grid-column: 1 / -1;
    min-height: 52px;
    border-radius: 8px;
    background: var(--primary);
    box-shadow: 0 10px 22px rgba(7, 91, 255, .24);
}

.studio-home-page .primary,
.studio-home-page button.primary {
    border-color: var(--primary);
    background: var(--primary);
}

.studio-home-page .primary:hover,
.studio-home-page button.primary:hover,
.studio-new-project:hover {
    background: var(--primary-dark);
}

.studio-home-page .single-batch-controls,
.studio-home-page .ref-dropzone,
.studio-home-page .progress-panel,
.studio-home-page .result-archive-panel,
.studio-home-page .result-bulk-bar,
.studio-home-page .result-filter-bar {
    border-color: #dce4f6;
    border-radius: 10px;
    background: #f7f9ff;
}

.studio-home-page .ref-dropzone {
    min-height: 88px;
    border-style: dashed;
    border-color: #b9c7e6;
}

.studio-home-page .progress-bar,
.studio-home-page .agent-progress-bar {
    background: var(--primary);
}

.studio-home-page .result-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.studio-home-page .result-card {
    border-color: #dce4f6;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(24, 40, 82, .08);
}

.studio-home-page .result-card img {
    height: 190px;
    background: #eef3ff;
}

.studio-home-page .home-template-rail {
    position: static;
    max-height: none;
    min-height: 0;
    padding: 16px;
    border: 1px solid #dce4f6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(29, 46, 96, .06);
}

.studio-home-page .home-template-rail-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 10px;
    padding: 0;
}

.studio-home-page .home-template-rail-head strong {
    color: #101a34;
    font-size: 18px;
}

.studio-home-page .home-template-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    max-height: 560px;
    gap: 14px;
    padding: 0 4px 4px 0;
}

.studio-home-page .home-template-card,
.studio-home-page .member-template-card,
.studio-home-page .home-template-card.xhs-template-card {
    display: grid !important;
    grid-template-rows: auto minmax(84px, auto) !important;
    height: auto !important;
    border-color: #dce4f6;
    border-radius: 9px;
    box-shadow: none;
}

.studio-home-page .home-template-card:hover,
.studio-home-page .member-template-card:hover {
    border-color: #9fb5e8;
    box-shadow: 0 12px 24px rgba(30, 55, 110, .12);
}

.studio-home-page .home-template-card.is-selected,
.studio-home-page .member-template-card.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(7, 91, 255, .16);
}

.studio-home-page .home-template-media,
.studio-home-page .member-template-media {
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
    background: #edf2ff !important;
}

.studio-home-page .home-template-media img,
.studio-home-page .member-template-media img {
    object-fit: cover !important;
}

.studio-home-page .member-template-media.no-image {
    position: relative;
    display: block !important;
    background: #f5f7fc !important;
}

.member-cover-empty {
    position: absolute;
    inset: 12px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 5px;
    width: auto;
    min-height: 0;
    padding: 10px;
    border: 1px dashed #b7c5e5;
    border-radius: 7px;
    background: #fbfcff;
    color: #304263;
    box-shadow: none;
    text-align: center;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.member-cover-empty:hover:not(:disabled) {
    border-color: #6f91dc;
    background: #f3f6ff;
    color: #075bff;
}

.member-cover-empty:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.member-cover-empty-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 2px;
    border: 1px solid #cbd6ee;
    border-radius: 50%;
    background: #fff;
    color: #5271b1;
    font-size: 23px;
    font-weight: 400;
    line-height: 1;
}

.member-cover-empty strong {
    font-size: 13px;
    line-height: 1.35;
}

.member-cover-empty small {
    color: #8490a8;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.studio-home-page .home-template-info,
.studio-home-page .home-template-info.xhs-template-info,
.studio-home-page .member-template-info {
    min-height: 84px !important;
    padding: 12px !important;
}

.studio-home-page .template-ref-badge {
    background: var(--primary);
}

.studio-home-page .result-retention-notice {
    border-color: #d6def5;
    border-radius: 9px;
    background: #f1f5ff;
    color: #4b5d83;
}

.studio-home-page .bottom-nav {
    display: none;
}

@media (max-width: 1280px) {
    .studio-home-page .studio-shell {
        width: calc(100vw - 16px);
        margin: 8px auto;
        grid-template-columns: 204px minmax(0, 1fr);
    }

    .studio-home-page .home-layout {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "agents"
            "work"
            "results"
            "lead"
            "commerce" !important;
    }

    .studio-home-page .home-agent-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .studio-home-page .studio-shell {
        display: block;
        width: 100%;
        min-height: 100vh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .studio-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1001;
        width: min(280px, 86vw);
        min-height: 100vh;
        display: grid;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 18px 0 42px rgba(15, 23, 42, .18);
    }

    .studio-sidebar-open .studio-sidebar {
        transform: translateX(0);
    }

    .studio-sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(15, 23, 42, .32);
    }

    .studio-home-page .studio-topbar {
        min-height: 58px;
        padding: 10px 14px;
        gap: 10px;
    }

    .studio-menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .studio-home-page .site-brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    .studio-home-page .site-logo {
        display: none;
    }

    .studio-home-page .site-brand span,
    .studio-top-tabs,
    .studio-icon-btn,
    .studio-new-project,
    .studio-home-page .site-search {
        display: none;
    }

    .studio-top-actions {
        gap: 4px;
    }

    .studio-avatar-mini {
        width: 34px;
        height: 34px;
        min-height: 34px;
        border: 1px solid #cfd9f1;
    }

    .studio-home-page .site-main {
        padding: 14px 12px 88px;
    }

    .studio-home-page .home-layout {
        gap: 14px !important;
    }

    .studio-home-page .home-agent-strip {
        display: none;
    }

    .studio-home-page .home-template-rail {
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .studio-home-page .home-template-rail-right {
        display: none;
    }

    .studio-home-page .home-template-list {
        display: flex !important;
        overflow-x: auto;
        overflow-y: hidden;
        max-height: none;
        padding-bottom: 6px;
        scroll-snap-type: x proximity;
    }

    .studio-home-page .home-template-card,
    .studio-home-page .home-template-card.xhs-template-card {
        flex: 0 0 152px;
        scroll-snap-align: start;
    }

    .studio-home-page .panel {
        padding: 16px;
    }

    .studio-home-page .tool-row {
        grid-template-columns: 1fr;
    }

    .studio-home-page .result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .studio-home-page .result-card img {
        height: 152px;
    }

    .studio-home-page .bottom-nav {
        display: grid;
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        border-radius: 16px 16px 0 0;
        border-right: 0;
        border-left: 0;
        border-bottom: 0;
        box-shadow: 0 -10px 30px rgba(15, 23, 42, .1);
    }
}

@media (max-width: 430px) {
    .studio-home-page .home-template-list {
        gap: 10px;
    }

    .studio-home-page .home-template-card,
    .studio-home-page .home-template-card.xhs-template-card {
        flex-basis: 142px;
    }

    .studio-home-page .result-card img {
        height: 132px;
    }

    .studio-home-page .panel-head {
        display: grid;
        gap: 4px;
    }
}

/* Mobile repair pass: remove announcement/header chrome and keep creation flow linear. */
.agent-chat-page .site-pinned-notice {
    display: none !important;
}

.agent-topbar {
    align-items: center;
}

.agent-top-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.agent-top-new-chat {
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.agent-top-new-chat:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.agent-top-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #d7deed;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.agent-history-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 36px;
    padding: 0;
    border: 1px solid #d7deed;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(18, 29, 55, .08);
}

.agent-history-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: #111827;
}

.agent-history-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 23, 42, .36);
    opacity: 0;
    transition: opacity .18s ease;
}

.agent-history-backdrop.is-visible {
    opacity: 1;
}

.agent-history-drawer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    width: min(340px, 88vw);
    height: 100vh;
    height: 100dvh;
    padding: 18px 14px;
    border-right: 1px solid #d7deed;
    background: #f8fafc;
    box-shadow: 18px 0 40px rgba(15, 23, 42, .18);
    transform: translateX(-105%);
    transition: transform .22s ease;
}

.agent-history-drawer.is-open {
    transform: translateX(0);
}

.agent-history-open {
    overflow: hidden;
}

.agent-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.agent-history-head strong {
    display: block;
    color: #101827;
    font-size: 18px;
}

.agent-history-head span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.agent-history-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #d7deed;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.agent-history-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.agent-history-actions button,
.agent-history-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #d7deed;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.agent-history-actions .primary {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.agent-history-actions button:disabled {
    opacity: .55;
}

.agent-history-section {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, auto);
    align-content: start;
    gap: 8px;
}

.agent-history-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid #d7deed;
    border-radius: 8px;
    background: #fff;
}

.agent-history-category strong {
    display: block;
    font-size: 14px;
}

.agent-history-category span,
.agent-history-category small {
    color: #64748b;
    font-size: 12px;
}

.agent-history-drawer .agent-session-list {
    align-content: start;
    align-items: start;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    padding: 0 2px 18px 0;
    gap: 8px;
}

.agent-history-drawer .agent-session-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.agent-history-drawer .agent-session-card {
    min-height: 68px;
    padding: 10px 12px;
    border: 1px solid #d7deed;
    box-shadow: none;
}

.agent-history-drawer .agent-session-row.is-active .agent-session-card {
    border-color: #111827;
    background: #fff;
    box-shadow: inset 3px 0 0 #111827;
}

.agent-history-drawer .agent-session-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    width: 42px;
    min-height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #dc2626;
    font-size: 12px;
}

.agent-history-drawer .agent-session-card span {
    font-size: 13px;
}

.agent-history-drawer .agent-session-card small,
.agent-history-drawer .agent-session-card em {
    font-size: 11px;
    line-height: 1.35;
}

.agent-session-group {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.agent-side-column {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.agent-side-column .agent-session-panel {
    padding-top: 18px;
    border-top: 0;
}

.agent-chat-page.is-normal-chat .agent-picker-card.is-active {
    border-color: var(--line);
    background: #fff;
    box-shadow: none;
}

.agent-chat-page.is-normal-chat .agent-page,
.agent-chat-page.is-agent-selected .agent-page {
    grid-template-columns: minmax(0, 1fr);
}

.agent-chat-page.is-normal-chat .agent-messages.is-empty::before {
    content: "开始一段普通对话，需要专业流程时可点击顶部使用智能体。";
    display: block;
    max-width: 360px;
    margin: auto;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.7;
}

.studio-agent-entry-view {
    width: 100%;
}

.studio-agent-entry-panel {
    max-width: 860px;
}

.studio-agent-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.studio-agent-choice-card {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 150px;
    padding: 18px;
    border: 1px solid #dce4f6;
    border-radius: 8px;
    background: #f7f9ff;
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(24, 40, 82, .06);
}

.studio-agent-choice-card:hover {
    border-color: #9fb5e8;
    background: #fff;
    box-shadow: 0 14px 28px rgba(24, 40, 82, .12);
}

.studio-agent-choice-card strong {
    color: #101a34;
    font-size: 20px;
}

.studio-agent-choice-card span,
.studio-agent-choice-card small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.agent-top-new-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.agent-catalog-panel {
    width: min(980px, 100%);
}

.agent-chat-page.is-agent-catalog .agent-page {
    display: block;
}

.agent-chat-page.is-agent-catalog .agent-picker-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (max-width: 860px) {
    .studio-home-page .studio-topbar {
        display: none !important;
    }

    .studio-home-page .site-main {
        width: 100% !important;
        max-width: none !important;
        padding: 6px 8px 92px !important;
    }

    .studio-home-page .home-layout {
        width: 100% !important;
        max-width: none !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas:
            "work"
            "results"
            "lead" !important;
        gap: 12px !important;
        margin: 0 !important;
    }

    .studio-home-page .home-center,
    .studio-home-page .home-generate-panel,
    .studio-home-page .home-results-panel,
    .studio-home-page .home-template-rail-left {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .studio-home-page .home-generate-panel {
        grid-area: work !important;
        order: 0 !important;
    }

    .studio-home-page .home-results-panel {
        grid-area: results !important;
        order: 0 !important;
    }

    .studio-home-page .home-template-rail-left {
        grid-area: lead !important;
        order: 0 !important;
    }

    .studio-home-page .home-agent-strip,
    .studio-home-page .home-template-rail-right {
        display: none !important;
    }

    .studio-home-page .panel {
        width: 100% !important;
        margin: 0 !important;
        padding: 16px !important;
        border-radius: 8px !important;
    }

    .studio-home-page .home-template-rail {
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .studio-home-page .home-template-list {
        display: block !important;
        column-count: 2 !important;
        column-gap: 10px !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .studio-home-page .home-template-card,
    .studio-home-page .home-template-card.xhs-template-card {
        display: inline-grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 0 10px !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        vertical-align: top !important;
        flex: none !important;
    }

    .studio-home-page .home-template-media,
    .studio-home-page .home-template-media.has-image,
    .studio-home-page .home-template-media.no-image,
    .studio-home-page .home-template-card.xhs-template-card .home-template-media {
        width: 100% !important;
        height: auto !important;
        min-height: 112px !important;
        max-height: none !important;
        aspect-ratio: auto !important;
        overflow: visible !important;
        background: #edf2ff !important;
    }

    .studio-home-page .home-template-media img,
    .studio-home-page .home-template-card.xhs-template-card .home-template-media img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        background: #edf2ff !important;
    }

    .studio-home-page .home-template-info,
    .studio-home-page .home-template-info.xhs-template-info,
    .studio-home-page .home-template-card.xhs-template-card .home-template-info {
        min-height: 76px !important;
        padding: 10px 10px 12px !important;
    }

    .studio-home-page .result-grid,
    .studio-home-page .result-folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .agent-chat-page .site-shell {
        padding: 10px 8px 92px;
    }

    .agent-chat-page .site-topbar {
        margin-bottom: 10px;
        gap: 10px;
    }

    .agent-top-controls {
        gap: 6px;
    }

    .agent-history-toggle {
        width: 36px;
        height: 34px;
    }

    .agent-history-drawer {
        width: min(330px, 90vw);
        padding: 16px 12px;
    }

    .agent-history-drawer .agent-session-row {
        position: relative;
        display: block;
    }

    .agent-history-drawer .agent-session-card {
        min-height: 70px;
        padding-right: 54px;
    }

    .agent-history-drawer .agent-session-delete {
        position: absolute;
        top: 10px;
        right: 8px;
        width: auto;
        min-width: 38px;
        min-height: 28px;
        border-radius: 6px;
        background: transparent;
    }

    .agent-top-controls .agent-top-new-chat {
        min-height: 34px;
        padding: 0 10px;
        white-space: nowrap;
    }

    .agent-top-switch {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }

    .agent-chat-page .site-logo,
    .agent-chat-page .site-brand span {
        display: none;
    }

    .agent-chat-page .site-brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    .agent-chat-page .site-brand strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 18px;
    }

    .agent-chat-page .ghost-btn {
        display: none;
    }

    .agent-page {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px;
    }

    .agent-side-column {
        order: 2;
    }

    .agent-chat-panel {
        order: 1;
        min-height: calc(100vh - 184px);
        grid-template-rows: auto minmax(320px, 1fr) auto auto;
    }

    .agent-picker-panel,
    .agent-side-column .agent-session-panel,
    .agent-chat-panel {
        border-radius: 8px;
        padding: 16px;
    }

    .agent-picker-list {
        grid-template-columns: 1fr !important;
    }

    .agent-messages {
        min-height: 320px;
        max-height: none;
    }

    .studio-agent-entry-panel {
        max-width: none;
    }

    .studio-agent-choice-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .studio-agent-choice-card {
        min-height: 118px;
        padding: 16px;
    }
}

@media (min-width: 861px) {
    .agent-page {
        grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    }

    .agent-chat-page.is-normal-chat .agent-page,
    .agent-chat-page.is-agent-selected .agent-page {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 430px) {
    .studio-home-page .home-template-list {
        column-gap: 8px !important;
    }

    .studio-home-page .home-template-card,
    .studio-home-page .home-template-card.xhs-template-card {
        margin-bottom: 8px !important;
    }
}


/* live photo independent entry */
.studio-sidebar-nav a.studio-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-decoration: none;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.studio-sidebar-nav a.studio-sidebar-link:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary, #4f46e5);
}
.studio-top-tabs a[href="/new/live"] {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 2px;
    color: #4c5872;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
}
.studio-top-tabs a[href="/new/live"]:hover { color: var(--primary, #4f46e5); }
.bottom-nav a[href="/new/live"] {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    font-weight: 800;
    font-size: 12px;
}


/* 实况图：后台固定参数展示（用户不可改） */
.live-fixed-param{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.12);
  background:rgba(248,250,252,.95);
  color:#0f172a;
  font-weight:600;
}

.live-param-select{
  width:100%;
  min-height:42px;
  padding:0 38px 0 14px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.14);
  background:#fff;
  color:#0f172a;
  font:inherit;
  font-weight:600;
  cursor:pointer;
}
.live-param-select:focus{
  outline:2px solid rgba(79,70,229,.18);
  border-color:var(--primary,#4f46e5);
}
