/* Miss Formula Studio — workspace shell */

:root {
    --studio-bg: #ebe8e3;
    --studio-surface: #ffffff;
    --studio-sidebar: #f7f5f2;
    --studio-border: #ddd8d2;
    --studio-text: #1a1a1a;
    --studio-muted: #6b6560;
    --studio-accent: #1a1a1a;
    --studio-hover: rgba(26, 26, 26, 0.06);
    --studio-active: rgba(26, 26, 26, 0.1);
    --studio-sidebar-w: 268px;
    --studio-sidebar-w-collapsed: 72px;
    --studio-radius: 14px;
    --studio-shadow: 0 12px 40px rgba(26, 26, 26, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--studio-text);
    background: var(--studio-bg);
}

/* 工具 CSS 加载后可能改写 body overflow，保持 Studio 外壳不滚动 */
body.studio-page {
    overflow: hidden !important;
}

[v-cloak] { display: none !important; }

#studio-app {
    height: 100%;
}

.studio-app {
    display: flex;
    height: 100vh;
    width: 100%;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(255, 255, 255, 0.85), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(232, 228, 220, 0.9), transparent 50%),
        var(--studio-bg);
}

/* ——— Sidebar ——— */
.studio-sidebar {
    width: var(--studio-sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--studio-sidebar);
    border-right: 1px solid var(--studio-border);
    transition: width 0.22s ease;
    z-index: 40;
    position: relative;
    overflow: hidden;
}

/* 用户面板打开时允许溢出到主内容区（更宽的浮层） */
.studio-sidebar.has-user-panel {
    overflow: visible;
}

.studio-app.is-collapsed .studio-sidebar,
.studio-sidebar.is-collapsed {
    width: var(--studio-sidebar-w-collapsed);
}

.studio-app.is-collapsed .studio-sidebar-top,
.studio-sidebar.is-collapsed .studio-sidebar-top {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.85rem 0.45rem 0.55rem;
    gap: 0;
}

.studio-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0.9rem 0.85rem;
    gap: 0.5rem;
    min-height: 64px;
}

.studio-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    overflow: hidden;
}

.studio-brand-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 7px;
}

.studio-brand-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* Collapsed: logo that swaps to expand icon on hover */
.studio-brand-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--studio-text);
    padding: 0;
    flex-shrink: 0;
}

.studio-brand-toggle:hover {
    background: var(--studio-hover);
}

.studio-brand-toggle-logo,
.studio-brand-toggle-expand {
    position: absolute;
    inset: 0;
    margin: auto;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.studio-brand-toggle-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    opacity: 1;
    transform: scale(1);
}

.studio-brand-toggle-logo img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: block;
}

.studio-brand-toggle-expand {
    width: 20px;
    height: 20px;
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
}

.studio-brand-toggle:hover .studio-brand-toggle-logo,
.studio-brand-toggle:focus-visible .studio-brand-toggle-logo {
    opacity: 0;
    transform: scale(0.9);
}

.studio-brand-toggle:hover .studio-brand-toggle-expand,
.studio-brand-toggle:focus-visible .studio-brand-toggle-expand {
    opacity: 1;
    transform: scale(1);
}

.studio-collapse-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--studio-muted);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    pointer-events: auto;
    transition: background 0.15s, color 0.15s;
}

.studio-collapse-btn:hover {
    background: var(--studio-hover);
    color: var(--studio-text);
}

.studio-collapse-btn svg {
    width: 16px;
    height: 16px;
}

.studio-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.35rem 0.65rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.studio-nav-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--studio-muted);
    padding: 0.65rem 0.7rem 0.35rem;
}

.studio-app.is-collapsed .studio-nav-label,
.studio-sidebar.is-collapsed .studio-nav-label {
    display: none;
}

.studio-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    color: var(--studio-text);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    transition: background 0.15s;
    box-sizing: border-box;
}

.studio-nav-item:hover {
    background: var(--studio-hover);
}

.studio-nav-item.is-active {
    background: var(--studio-active);
    font-weight: 600;
}

.studio-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.85;
}

.studio-nav-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-nav-external {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.45;
}

.studio-nav-item--external:hover .studio-nav-external {
    opacity: 0.75;
}

.studio-app.is-collapsed .studio-nav-text,
.studio-sidebar.is-collapsed .studio-nav-text,
.studio-app.is-collapsed .studio-nav-external,
.studio-sidebar.is-collapsed .studio-nav-external {
    display: none;
}

.studio-app.is-collapsed .studio-nav-item,
.studio-sidebar.is-collapsed .studio-nav-item {
    justify-content: center;
    padding: 0.7rem;
}

/* More Tools flyout — fixed overlay, not inside the sidebar */
.studio-more-wrap {
    position: relative;
}

.studio-flyout {
    position: fixed;
    min-width: 220px;
    background: var(--studio-surface);
    border: 1px solid var(--studio-border);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(26, 26, 26, 0.16);
    padding: 0.5rem;
    z-index: 80;
    animation: studioFlyIn 0.16s ease;
}

.studio-flyout-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--studio-muted);
    padding: 0.4rem 0.75rem 0.3rem;
}

@keyframes studioFlyIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.studio-flyout-item {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--studio-text);
}

.studio-flyout-item:hover,
.studio-flyout-item.is-active {
    background: var(--studio-hover);
}

.studio-flyout-item.is-active {
    font-weight: 600;
}

/* User footer */
.studio-sidebar-footer {
    border-top: 1px solid var(--studio-border);
    padding: 0.75rem;
    position: relative;
}

.studio-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.55rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    text-align: left;
}

.studio-user-trigger:hover {
    background: var(--studio-hover);
}

.studio-user-avatar,
.studio-user-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.studio-user-avatar {
    object-fit: cover;
}

.studio-user-avatar-fallback {
    background: linear-gradient(135deg, #3d3d3d, #1a1a1a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.studio-user-meta {
    min-width: 0;
    flex: 1;
}

.studio-user-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-user-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--studio-muted);
}

.studio-app.is-collapsed .studio-user-meta,
.studio-app.is-collapsed .studio-user-chevron,
.studio-sidebar.is-collapsed .studio-user-meta,
.studio-sidebar.is-collapsed .studio-user-chevron {
    display: none;
}

.studio-user-chevron {
    width: 16px;
    height: 16px;
    color: var(--studio-muted);
    flex-shrink: 0;
}

.studio-guest-signin {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--studio-text);
}

.studio-guest-signin:hover {
    background: var(--studio-hover);
}

.studio-app.is-collapsed .studio-guest-signin,
.studio-sidebar.is-collapsed .studio-guest-signin {
    padding: 0.65rem;
    font-size: 0;
}

.studio-app.is-collapsed .studio-guest-signin::after,
.studio-sidebar.is-collapsed .studio-guest-signin::after {
    content: '→';
    font-size: 1rem;
}

/* User panel */
.studio-user-panel {
    position: absolute;
    left: 0.75rem;
    right: auto;
    bottom: calc(100% + 8px);
    width: min(340px, calc(100vw - 1.5rem));
    background: var(--studio-surface);
    border: 1px solid var(--studio-border);
    border-radius: 14px;
    box-shadow: var(--studio-shadow);
    padding: 0.85rem;
    z-index: 90;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    animation: studioFlyIn 0.16s ease;
}

.studio-app.is-collapsed .studio-user-panel,
.studio-sidebar.is-collapsed .studio-user-panel {
    left: calc(100% + 8px);
    right: auto;
    bottom: 0.75rem;
    width: min(340px, calc(100vw - 1.5rem));
}

.studio-panel-email {
    font-size: 0.82rem;
    color: var(--studio-muted);
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.studio-credits-block {
    background: #faf9f7;
    border: 1px solid var(--studio-border);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.55rem;
}

.studio-credits-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.studio-credits-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.studio-credits-value {
    font-size: 1.05rem;
    font-weight: 700;
}

.studio-credits-value.is-low {
    color: #c1121f;
}

.studio-credits-expire {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--studio-muted);
}

.studio-credits-expire.is-expired {
    color: #9a3412;
}

.studio-credits-note {
    margin-top: 0.3rem;
    font-size: 0.68rem;
    color: #8a847c;
    line-height: 1.35;
}

.studio-panel-btn {
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.65rem 0.85rem;
    border-radius: 9px;
    border: 1px solid var(--studio-border);
    background: var(--studio-surface);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--studio-text);
}

.studio-panel-btn:hover {
    background: var(--studio-hover);
}

.studio-panel-btn--primary {
    background: var(--studio-accent);
    color: #fff;
    border-color: var(--studio-accent);
}

.studio-panel-btn--primary:hover {
    background: #333;
}

.studio-panel-upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.studio-panel-upgrade-btn .studio-pricing-top-btn__icon {
    width: 0.95rem;
    height: 0.95rem;
    fill: #ff7a1a;
    flex-shrink: 0;
}

.studio-panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--studio-border);
}

.studio-panel-actions .studio-panel-btn {
    margin-top: 0;
    flex: 1;
}

.studio-panel-btn--exit {
    background: #f5f3f0;
}

/* ——— Main ——— */
.studio-main {
    flex: 1 1 0%;
    width: auto !important;
    max-width: none;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: var(--studio-surface);
}

/* Catches clicks over iframe tools so user panel / More flyout can dismiss */
.studio-dismiss-overlay {
    position: absolute;
    inset: 0;
    z-index: 35;
    background: transparent;
    cursor: default;
}

.studio-main-header {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    z-index: 25;
}

/* Source Finder / Citation Checker：标题 + Upgrade 占文档流顶栏，滚动时不再浮在功能区上 */
.studio-main-header.has-title {
    position: relative;
    padding: 1.35rem 1.75rem 0.6rem;
    border-bottom: 1px solid rgba(26, 26, 26, 0.07);
    background: var(--studio-surface);
    pointer-events: auto;
}

.studio-main-header-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.studio-main-header.has-title .studio-pricing-top-btn {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* 其它工具：Upgrade 仍浮在右上角，不挤占布局 */
.studio-main-header:not(.has-title) {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    width: auto;
    padding: 0.85rem 1.25rem;
    pointer-events: none;
    background: transparent;
    border: none;
}

.studio-main-header-spacer {
    display: none;
}

.studio-pricing-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid #1a1a1a;
    background: #1a1a1a;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.18);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.studio-pricing-top-btn__icon {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    fill: #ff7a1a;
}

.studio-pricing-top-btn:hover {
    background: #111;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26, 26, 26, 0.28);
}

.studio-workspace {
    flex: 1;
    min-height: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.studio-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #fff;
}

.studio-tool-pane {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: transparent;
}

.studio-tool-pane.is-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.studio-tool-pane[hidden] {
    display: none !important;
}

.studio-tool-loading {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--studio-muted);
    pointer-events: none;
}

.studio-tool-loading-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid rgba(26, 26, 26, 0.12);
    border-top-color: #1a1a1a;
    animation: studioSpin 0.7s linear infinite;
}

@keyframes studioSpin {
    to { transform: rotate(360deg); }
}

.studio-tool-pane--iframe {
    overflow: hidden;
}

.studio-tool-pane--iframe .studio-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

.studio-workspace {
    position: relative;
}

.studio-doc-root,
.studio-doc-root .page-container,
.studio-doc-root .content-wrapper {
    height: 100%;
    min-height: 0;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.studio-doc-root .header {
    height: 100%;
    min-height: 0;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    flex: 1;
    text-align: left;
}

.studio-doc-root .title-container,
.studio-doc-root .hero-product-switch,
.studio-doc-root .header-actions,
.studio-doc-root .user-avatar-container,
.studio-doc-root nav.top-navbar {
    display: none !important;
}

.studio-doc-root .hero-stage,
.studio-doc-root .hero-stage-panel,
.studio-doc-root.homepage-en .hero-stage,
.studio-doc-root.homepage-en .hero-stage-panel {
    flex: 1;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.studio-doc-root .hero-switcher {
    flex: 0 0 auto;
    margin: 0.85rem 1.5rem 0.55rem;
}

.studio-doc-root .main-container,
.studio-doc-root .homepage-doc-main {
    flex: 1 1 0%;
    min-height: 0 !important;
    height: auto;
    max-height: none;
    width: calc(100% - 2.5rem);
    max-width: none;
    margin: 0 1.25rem 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.studio-doc-root .chat-container {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    height: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.studio-doc-root .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
}

.studio-doc-root .upload-container {
    flex-shrink: 0;
    margin-top: auto;
}

.studio-doc-root .homepage-mode-root,
.studio-doc-root .homepage-mode-root > div,
.studio-doc-root .homepage-mode-root .word-converter-workspace,
.studio-doc-root .homepage-mode-shell {
    flex: 1 1 0%;
    min-height: 0 !important;
    height: 100%;
    max-width: none;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.studio-doc-root .tool-panels {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    margin: 0;
    align-items: stretch;
    grid-template-rows: minmax(0, 1fr);
}

.studio-doc-root .tool-panel,
.studio-doc-root .preview-panel {
    min-height: 0 !important;
    max-height: none !important;
    height: 100%;
    overflow: hidden;
}

.studio-doc-root .tool-panels.is-height-locked .tool-panel,
.studio-doc-root .tool-panels.is-height-locked .preview-panel {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

.studio-doc-root .upload-dropzone,
.studio-doc-root .result-viewport,
.studio-doc-root .homepage-mode-shell-dropzone,
.studio-doc-root .homepage-mode-shell-result {
    flex: 1 1 0%;
    min-height: 0 !important;
}

.studio-doc-root .upload-placeholder,
.studio-doc-root .homepage-mode-shell-placeholder {
    min-height: 0;
}

.studio-format-workspace,
.studio-format-workspace .word-converter-workspace {
    flex: 1;
    min-height: 0;
    height: 100%;
}

.studio-pane-source .checker-card,
.studio-citation-checker .checker-card,
.studio-source-finder .checker-card {
    margin: 1rem auto 2rem;
    max-width: 1120px;
}

.studio-tool-inner {
    min-height: 100%;
}

/* Mode chips for Doc Converter */
.studio-mode-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 1.25rem 0.75rem;
}

.studio-chip {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--studio-border);
    background: transparent;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--studio-muted);
}

.studio-chip:hover {
    background: var(--studio-hover);
    color: var(--studio-text);
}

.studio-chip.is-active {
    background: var(--studio-accent);
    border-color: var(--studio-accent);
    color: #fff;
}

/* Pricing modal */
.studio-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.45);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: studioFade 0.18s ease;
}

@keyframes studioFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.studio-pricing-modal {
    background: var(--studio-surface);
    border-radius: 18px;
    width: min(960px, 100%);
    max-height: min(90vh, 820px);
    overflow: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    padding: 1.75rem 1.75rem 1.25rem;
    position: relative;
}

.studio-pricing-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f3f0;
    border-radius: 50%;
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
    color: var(--studio-muted);
}

.studio-pricing-close:hover {
    background: #ebe8e3;
    color: var(--studio-text);
}

.studio-pricing-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-right: 1.5rem;
}

.studio-pricing-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    margin: 0 0 0.4rem;
}

.studio-pricing-header p {
    margin: 0;
    color: var(--studio-muted);
    font-size: 0.95rem;
}

.studio-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 840px) {
    .studio-pricing-grid {
        grid-template-columns: 1fr;
    }
}

.studio-plan-card {
    border: 1px solid var(--studio-border);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    background: #faf9f7;
    position: relative;
}

.studio-plan-card.is-featured {
    background: #fff;
    border-color: #1a1a1a;
    box-shadow: 0 8px 28px rgba(26, 26, 26, 0.08);
}

.studio-plan-badge {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #1a1a1a;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.studio-plan-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.studio-plan-price {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.studio-plan-price span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--studio-muted);
}

.studio-plan-credits {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.studio-plan-note {
    font-size: 0.78rem;
    color: var(--studio-muted);
    margin-bottom: 0.75rem;
}

.studio-plan-features {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    flex: 1;
}

.studio-plan-features li {
    font-size: 0.82rem;
    padding: 0.3rem 0;
    color: #3d3d3d;
    padding-left: 1.1rem;
    position: relative;
    line-height: 1.4;
}

.studio-plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2d6a4f;
    font-weight: 700;
}

.studio-plan-buy {
    width: 100%;
    padding: 0.7rem;
    border-radius: 9px;
    border: none;
    background: #1a1a1a;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.studio-plan-buy:hover:not(:disabled) {
    background: #333;
}

.studio-plan-buy:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.studio-pricing-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--studio-border);
    font-size: 0.82rem;
    color: var(--studio-muted);
}

.studio-pricing-footer a {
    color: var(--studio-text);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Login modal (minimal) */
.studio-login-modal {
    background: var(--studio-surface);
    border-radius: 16px;
    width: min(400px, 100%);
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}

.studio-login-modal h2 {
    font-family: 'Playfair Display', Georgia, serif;
    margin: 0 0 1.25rem;
    font-size: 1.4rem;
    text-align: center;
}

.studio-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--studio-border);
    background: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.studio-google-btn:hover {
    background: #faf9f7;
}

.studio-google-btn svg {
    width: 20px;
    height: 20px;
}

.studio-login-error {
    margin-top: 0.75rem;
    color: #c1121f;
    font-size: 0.85rem;
    text-align: center;
}

@media (max-width: 720px) {
    .studio-sidebar {
        position: absolute;
        height: 100%;
        z-index: 50;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    }
    .studio-app.is-collapsed .studio-sidebar,
    .studio-sidebar.is-collapsed {
        width: 0;
        border: none;
        overflow: hidden;
        padding: 0;
    }
    .studio-main-header:not(.has-title) {
        padding-left: 3.5rem;
    }
    .studio-mobile-toggle {
        position: absolute;
        left: 0.75rem;
        top: 0.85rem;
        z-index: 45;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: 1px solid var(--studio-border);
        background: var(--studio-surface);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
}

@media (min-width: 721px) {
    .studio-mobile-toggle {
        display: none;
    }
}

/* ========================================================
   Studio – Doc Converter hero-switcher 大字显示
   ======================================================== */
.studio-doc-root .hero-switcher {
    margin: 1rem 1.5rem 0.75rem;
    justify-content: flex-start;
    gap: 0.45rem 0.65rem;
}

.studio-doc-root.homepage-en .hero-switcher-prefix {
    font-size: 1.55rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--studio-muted);
}

.studio-doc-root.homepage-en .hero-dropdown-trigger {
    font-size: 1.95rem;
}

.studio-doc-root.homepage-en .hero-switcher-connector {
    font-size: 1.65rem;
}

.studio-doc-root.homepage-en .hero-switcher-suffix {
    font-size: 1.52rem;
    color: var(--studio-muted);
}

/* ========================================================
   Studio – Source Finder / Citation Checker 内部标题
   ======================================================== */
.studio-inner-header {
    padding: 1.35rem 1.75rem 0.6rem;
    border-bottom: 1px solid rgba(26, 26, 26, 0.07);
    margin-bottom: 0;
    background: transparent;
}

/* 标题已由 Studio 外壳顶栏渲染，避免 Source/Citation 重复标题 */
.studio-source-finder > .studio-inner-header,
.studio-citation-checker > .studio-inner-header {
    display: none;
}

.studio-inner-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--studio-text);
    margin: 0 0 0.15rem;
    line-height: 1.2;
}

.studio-inner-subtitle {
    font-size: 0.88rem;
    color: var(--studio-muted);
    margin: 0;
    line-height: 1.5;
}

/* ========================================================
   Studio – Format Converter (Word↔LaTeX) 布局
   ======================================================== */
#studio-pane-word-to-latex,
#studio-pane-latex-to-word {
    overflow: hidden;
}

#studio-pane-word-to-latex > div,
#studio-pane-latex-to-word > div {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.studio-format-tool {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.studio-format-tool > .studio-inner-header {
    flex-shrink: 0;
}

.studio-format-tool > .studio-format-workspace {
    flex: 1 1 auto;
    min-height: 0;
}

.studio-format-workspace .word-converter-workspace,
.studio-format-workspace.word-converter-workspace,
.studio-format-workspace .tool-panels {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: row;
}

.studio-format-workspace .tool-panel,
.studio-format-workspace .preview-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: auto;
}

/* ========================================================
   Studio – Source/Citation checker 可滚动区域
   不要把内层锁成 height:100% + overflow，否则内容会被裁切、外层滑不动
   ======================================================== */
.studio-source-finder,
.studio-citation-checker {
    display: block;
    height: auto;
    min-height: 100%;
    overflow: visible;
}

.studio-source-finder .citation-auth,
.studio-citation-checker .citation-auth {
    display: none !important;
}

.studio-source-finder .checker-card,
.studio-citation-checker .checker-card {
    margin: 1rem auto 2rem;
    max-width: 1120px;
    width: calc(100% - 2rem);
    padding: 1.25rem 1.75rem;
    overflow: visible;
    height: auto;
    flex-shrink: 0;
}

.studio-welcome-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(520px, 90vw);
    padding: 14px 44px 14px 20px;
    border-radius: 10px;
    background: rgba(26, 26, 26, 0.95);
    color: #f5f3f0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    animation: studioWelcomeToastIn 0.3s ease;
}

.studio-welcome-toast-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #f5f3f0;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.studio-welcome-toast-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

@keyframes studioWelcomeToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
