/* MD2WE - Refined Design System */

/* CSS Variables */
:root {
    /* Brand Colors */
    --brand-primary: #0066FF;
    --brand-primary-soft: rgba(0, 102, 255, 0.08);
    --brand-primary-glow: rgba(0, 102, 255, 0.2);

    /* Neutral Scale */
    --gray-50: #FAFAFA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --gray-300: #D4D4D8;
    --gray-400: #A1A1AA;
    --gray-500: #71717A;
    --gray-600: #52525B;
    --gray-700: #3F3F46;
    --gray-800: #27272A;
    --gray-900: #18181B;

    /* Semantic Colors */
    --success: #10B981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Surfaces */
    --surface-primary: #FFFFFF;
    --surface-secondary: #FAFAFA;
    --surface-tertiary: #F4F4F5;
    --surface-elevated: #FFFFFF;

    /* Text */
    --text-primary: #18181B;
    --text-secondary: #52525B;
    --text-tertiary: #A1A1AA;
    --text-inverse: #FFFFFF;

    /* Borders */
    --border-subtle: #E4E4E7;
    --border-default: #D4D4D8;
    --border-focus: var(--brand-primary);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --duration-fast: 120ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --header-height: 56px;
    --panel-header-height: 44px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--surface-secondary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.drawer-open {
    overflow: hidden;
}

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(0, 102, 255, 0.08), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #fafafa 52%, #f3f5f8 100%);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 20px;
    background: var(--surface-primary);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    filter: drop-shadow(0 10px 18px rgba(20, 58, 122, 0.18));
}

.logo-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.logo-text {
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.logo-tag {
    font-family: 'Outfit', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #64748b;
    white-space: nowrap;
}

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

.header-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 0 18px;
    overflow: hidden;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(17, 24, 39, 0.08);
    color: var(--text-tertiary);
    font-size: 11px;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}

.summary-chip strong {
    color: var(--text-primary);
    font-weight: 600;
}

.summary-chip-status.is-ready {
    background: rgba(16, 185, 129, 0.1);
    color: #05603a;
}

.summary-chip-status.is-offline {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    border: none;
    outline: none;
    white-space: nowrap;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--surface-primary), 0 0 0 4px var(--brand-primary);
}

.btn-primary {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: #0052CC;
    transform: translateY(-0.5px);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 102, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    background: #0047B3;
}

.btn-outline {
    background: var(--surface-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-outline:hover {
    background: var(--surface-tertiary);
    color: var(--text-primary);
    border-color: var(--gray-300);
}

.btn-outline.active {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border-color: rgba(0, 102, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(0, 102, 255, 0.06);
}

.btn-panel-action {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 999px;
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(7, 12, 28, 0.96), rgba(21, 43, 91, 0.92));
    color: var(--text-inverse);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.btn[disabled],
.text-action[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-icon:hover {
    background: var(--surface-tertiary);
    color: var(--text-primary);
}

.btn-icon:focus-visible {
    box-shadow: 0 0 0 2px var(--brand-primary-soft);
}

/* Main Content */
.main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Resizer */
.resizer {
    width: 1px;
    background: var(--border-subtle);
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background var(--duration-fast);
}

.resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 32px;
    background: transparent;
    border-radius: var(--radius-full);
    transition: all var(--duration-fast);
}

.resizer:hover {
    background: var(--brand-primary);
}

.resizer:hover::after {
    background: var(--brand-primary-soft);
    width: 6px;
    height: 48px;
}

.resizer.dragging {
    background: var(--brand-primary);
}

.resizer.dragging::after {
    background: var(--brand-primary-soft);
    width: 6px;
    height: 64px;
}

/* Panels */
.editor-panel,
.preview-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 300px;
    overflow: hidden;
    background: var(--surface-primary);
}

.editor-panel {
    min-width: 320px;
    max-width: 50%;
}

.preview-panel {
    background: var(--surface-secondary);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--panel-header-height);
    padding: 0 16px;
    background: var(--surface-primary);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title svg {
    width: 14px;
    height: 14px;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
    border-radius: var(--radius-full);
}

.theme-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--brand-primary);
    border-radius: 50%;
}

/* Preview Mode Toggle */
.preview-mode-toggle {
    display: flex;
    background: var(--surface-tertiary);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 26px;
    background: transparent;
    border: none;
    border-radius: var(--radius-xs);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.mode-btn:hover {
    color: var(--text-secondary);
}

.mode-btn.active {
    background: var(--surface-primary);
    color: var(--brand-primary);
    box-shadow: var(--shadow-xs);
}

/* Mobile Preview Mode */
.preview-wrapper.mobile-mode {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 16px;
}

.preview-wrapper.mobile-mode #preview {
    max-width: 375px;
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 8px solid var(--gray-800);
    position: relative;
    overflow: visible;
    min-height: auto;
    max-height: calc(100vh - 140px);
}

.preview-wrapper.mobile-mode #preview::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gray-800);
    border-radius: var(--radius-full);
}

/* Mobile mode inner scroll */
.preview-wrapper.mobile-mode #preview section {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

/* Editor */
.editor-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 220px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0.08) 1px, transparent 1px, transparent 100%);
}

.editor-syntax-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.editor-selection-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.editor-selection-rect {
    position: absolute;
    border-radius: 6px;
    background: rgba(0, 102, 255, 0.16);
}

.editor-syntax-content {
    min-height: 100%;
    margin: 0;
    padding: 20px 24px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: #475569;
    position: relative;
    z-index: 1;
}

.editor-line {
    display: block;
    min-height: 1.7em;
}

.editor-line-heading {
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.7;
    transform-origin: left center;
}

.editor-heading-marker {
    display: inline-block;
    min-width: 34px;
    margin-right: 8px;
    color: rgba(15, 23, 42, 0.28);
    font-weight: 700;
}

.editor-heading-space {
    color: transparent;
}

.editor-heading-text {
    color: inherit;
}

.editor-line-h1 {
    font-weight: 700;
    color: #0f172a;
    transform: scale(1.16);
}

.editor-line-h2 {
    font-weight: 700;
    color: #0f4c81;
    transform: scale(1.1);
}

.editor-line-h3 {
    font-weight: 700;
    color: #0f766e;
    transform: scale(1.05);
}

.editor-line-h4 {
    font-weight: 700;
    color: #7c2d12;
    transform: scale(1.02);
}

.editor-line-empty::before {
    content: ' ';
}

.editor-caret {
    position: absolute;
    width: 2px;
    border-radius: 999px;
    background: var(--text-primary);
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}

.editor-caret.is-visible {
    opacity: 1;
    animation: editor-caret-blink 1.05s steps(1, end) infinite;
}

@keyframes editor-caret-blink {
    0%, 45% {
        opacity: 1;
    }

    46%, 100% {
        opacity: 0;
    }
}

#editor {
    width: 100%;
    height: 100%;
    padding: 20px 24px;
    border: none;
    outline: none;
    resize: none;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: transparent;
    background: transparent;
    tab-size: 4;
    caret-color: transparent;
    position: relative;
    z-index: 1;
    overflow: auto;
}

#editor::placeholder {
    color: var(--text-tertiary);
}

#editor::selection {
    background: transparent;
}

#editor::-moz-selection {
    background: transparent;
}

#editor::-webkit-text-fill-color {
    color: transparent;
}

.assistant-studio {
    padding: 18px 18px 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 247, 255, 0.94)),
        radial-gradient(circle at top right, rgba(0, 102, 255, 0.1), transparent 36%);
}

.assistant-config-section {
    margin-bottom: 18px;
}

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

.assistant-studio-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.assistant-kicker {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand-primary);
    margin-bottom: 4px;
}

.assistant-studio-header h3 {
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
    color: #111827;
}

.assistant-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.assistant-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.assistant-status.is-ready {
    color: #05603a;
    background: rgba(16, 185, 129, 0.12);
}

.assistant-status.is-ready::before {
    background: var(--success);
}

.assistant-status.is-offline {
    color: #92400e;
    background: rgba(245, 158, 11, 0.14);
}

.assistant-status.is-offline::before {
    background: var(--warning);
}

.action-chip {
    min-width: 118px;
}

.assistant-input {
    flex: 1;
    min-width: 240px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    font: inherit;
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.assistant-input:focus {
    outline: none;
    border-color: rgba(0, 102, 255, 0.38);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.08);
}

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

.assistant-card {
    min-height: 0;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.95)),
        radial-gradient(circle at top right, rgba(0, 102, 255, 0.08), transparent 34%);
    box-shadow: var(--shadow-sm);
}

.assistant-card-wide {
    grid-column: 1 / -1;
}

.assistant-card-text {
    grid-column: 1 / -1;
}

.assistant-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.assistant-card-head-stacked {
    margin-bottom: 12px;
}

.assistant-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.assistant-card-toolbar,
.assistant-image-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.assistant-result-actions {
    margin-top: 12px;
    margin-bottom: 0;
}

.assistant-prompt-row,
.assistant-image-prompt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.assistant-prompt-row .assistant-input,
.assistant-image-prompt-row .assistant-input {
    flex: 1;
}

.assistant-image-prompt-row-stacked {
    align-items: flex-end;
}

.assistant-field {
    flex: 1;
    min-width: 220px;
}

.assistant-caption {
    font-size: 11px;
    color: var(--text-tertiary);
}

.assistant-card-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
    white-space: normal;
    word-break: break-word;
    padding: 14px 15px;
    border-radius: 16px;
    border: 1px solid rgba(17, 24, 39, 0.06);
    background: rgba(255, 255, 255, 0.76);
}

.assistant-card-text .assistant-card-body {
    min-height: 132px;
}

.assistant-card-body.muted,
.muted {
    color: var(--text-tertiary);
}

.text-action {
    border: none;
    background: transparent;
    color: var(--brand-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.title-suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.title-suggestion {
    position: relative;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 102, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 102, 255, 0.05);
    text-align: left;
    color: #163152;
    font: inherit;
    line-height: 1.55;
    white-space: normal;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.title-suggestion:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 102, 255, 0.28);
    background: rgba(0, 102, 255, 0.09);
}

.title-suggestion.is-selected {
    padding-left: 16px;
    border-color: rgba(0, 102, 255, 0.42);
    background: linear-gradient(180deg, rgba(0, 102, 255, 0.16), rgba(0, 102, 255, 0.08));
    box-shadow: inset 0 0 0 1px rgba(0, 102, 255, 0.18), 0 8px 18px rgba(0, 102, 255, 0.08);
    color: #0f2744;
}

.title-suggestion.is-selected::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 8px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(0, 102, 255, 0.92), rgba(25, 194, 200, 0.7));
}

.assistant-card-image {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.illustration-progress-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(11, 75, 145, 0.14);
    background:
        radial-gradient(circle at top right, rgba(25, 194, 200, 0.14), transparent 32%),
        linear-gradient(180deg, rgba(7, 29, 66, 0.035), rgba(255, 255, 255, 0.92));
}

.illustration-progress-shell.is-failed {
    border-color: rgba(185, 28, 28, 0.16);
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(127, 29, 29, 0.03), rgba(255, 255, 255, 0.94));
}

.illustration-progress-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.illustration-progress-kicker {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4c6a92;
    font-weight: 700;
}

.illustration-progress-title {
    margin-top: 3px;
    color: #10243f;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.illustration-progress-badge {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 102, 255, 0.1);
    color: #174075;
    font-size: 11px;
    font-weight: 700;
}

.illustration-progress-badge.is-failed {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.illustration-progress-meta {
    color: #32527a;
    font-size: 12px;
    font-weight: 600;
}

.illustration-progress-track {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 39, 68, 0.08);
}

.illustration-progress-fill {
    position: relative;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f68dc 0%, #19c2c8 100%);
    box-shadow: 0 0 24px rgba(15, 104, 220, 0.2);
    transition: width 280ms ease;
}

.illustration-progress-message {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.65;
}

.illustration-result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.illustration-result-summary {
    color: #163152;
    font-weight: 600;
}

.illustration-result-item {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 102, 255, 0.1);
    background: rgba(0, 102, 255, 0.04);
}

.illustration-result-item.is-pending {
    border-style: dashed;
    border-color: rgba(12, 74, 110, 0.18);
    background: rgba(15, 104, 220, 0.03);
}

.illustration-result-meta {
    color: #0f2744;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.illustration-result-preview {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

.ai-config-summary {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(0, 102, 255, 0.06);
    border: 1px solid rgba(0, 102, 255, 0.1);
    color: #29405f;
    font-size: 12px;
    line-height: 1.7;
}

.ai-config-card.collapsed .ai-config-tabs,
.ai-config-card.collapsed .ai-config-panel,
.ai-config-card.collapsed .ai-config-actions,
.ai-config-card.collapsed .settings-hint {
    display: none;
}

.generated-image-panel {
    margin-top: 12px;
}

.generated-image-panel img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

.hidden {
    display: none !important;
}

.is-busy {
    pointer-events: none;
    opacity: 0.7;
}

/* Shared Drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-fast) ease, visibility var(--duration-fast) ease;
    z-index: 100;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer-panel {
    position: fixed;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
    box-shadow: -16px 0 36px rgba(15, 23, 42, 0.12);
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-panel-right {
    right: 0;
    transform: translateX(100%);
}

.drawer-panel.active {
    transform: translateX(0);
}

.drawer-grip {
    display: none;
    width: 42px;
    height: 5px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.12);
}

.drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.72);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
}

.assistant-panel {
    width: 620px;
    max-width: calc(100vw - 28px);
    border-left: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: -20px 0 42px rgba(15, 23, 42, 0.14);
}

.publish-settings-panel {
    width: 440px;
    max-width: calc(100vw - 28px);
    border-left: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: -20px 0 42px rgba(15, 23, 42, 0.14);
}

.assistant-panel-header {
    flex-shrink: 0;
}

.assistant-panel-header h2 {
    font-size: 20px;
    line-height: 1.2;
    color: #101828;
}

.assistant-panel-content {
    padding: 20px;
    overscroll-behavior: contain;
}

/* Share Modal */
.share-overlay,
.wechat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-fast) ease, visibility var(--duration-fast) ease;
    z-index: 120;
}

.share-overlay.active,
.wechat-overlay.active {
    opacity: 1;
    visibility: visible;
}

#templateOverlay.active {
    opacity: 1;
    visibility: visible;
}

.share-modal,
.wechat-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(760px, calc(100vw - 28px));
    max-height: min(88vh, 760px);
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(25, 194, 200, 0.14), transparent 28%),
        linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    box-shadow: 0 26px 72px rgba(8, 17, 31, 0.2);
    transform: translate(-50%, -46%) scale(0.98);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--duration-normal) var(--ease-out), opacity var(--duration-normal) ease, visibility var(--duration-normal) ease;
    z-index: 121;
    overflow: hidden;
}

.wechat-modal {
    width: min(820px, calc(100vw - 28px));
}

.template-modal {
    width: min(920px, calc(100vw - 28px));
}

.upload-image-modal {
    width: min(760px, calc(100vw - 28px));
}

.share-modal.active,
.wechat-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.template-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.upload-image-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.share-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 18px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.72);
}

.share-modal-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #2563eb;
}

.share-modal-header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
    color: #08111f;
}

.share-modal-caption {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.share-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.share-modal-body {
    padding: 22px 24px 24px;
    overflow-y: auto;
}

.share-status-card {
    padding: 16px 18px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.share-status-label {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(0, 102, 255, 0.08);
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.share-status-text {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

.share-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.upload-image-workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.template-workspace {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.share-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: var(--shadow-sm);
}

.share-card-qr {
    display: flex;
    flex-direction: column;
}

.share-card-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.upload-image-markdown {
    min-height: 152px;
    resize: vertical;
}

.upload-image-actions {
    margin-top: 14px;
}

.upload-image-workspace .generated-image-panel {
    margin-top: 14px;
}

.share-card-head span:first-child {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.share-card-caption {
    font-size: 12px;
    color: var(--text-tertiary);
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 320px;
    max-height: 460px;
    overflow-y: auto;
}

.template-empty {
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed rgba(17, 24, 39, 0.12);
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1.7;
    background: rgba(248, 250, 252, 0.8);
}

.template-list-item {
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    border-radius: 16px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.84);
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.template-list-item:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.24);
    box-shadow: var(--shadow-sm);
}

.template-list-item.is-selected {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.92));
}

.template-list-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-list-meta {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.template-textarea {
    min-height: 240px;
    resize: vertical;
}

.template-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.share-qr-frame {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 16px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 252, 0.9)),
        linear-gradient(135deg, rgba(0, 102, 255, 0.08), rgba(25, 194, 200, 0.08));
    border: 1px dashed rgba(37, 99, 235, 0.2);
}

.share-qr-placeholder {
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
    color: var(--text-tertiary);
}

.share-qr {
    width: 100%;
    max-width: 220px;
}

.share-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.share-url-input {
    margin-top: 8px;
    font-size: 13px;
}

.share-link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.share-hint {
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-tertiary);
}

.wechat-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: var(--shadow-sm);
}

.wechat-status-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 248, 255, 0.94)),
        radial-gradient(circle at top right, rgba(25, 194, 200, 0.16), transparent 34%);
}

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

.wechat-status-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wechat-status-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f2744;
}

.wechat-status-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wechat-status-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.wechat-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 18px;
    max-width: 760px;
}

.wechat-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

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

.wechat-card-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wechat-step-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(0, 102, 255, 0.14), rgba(25, 194, 200, 0.1));
    border: 1px solid rgba(0, 102, 255, 0.16);
    color: #0f4bbf;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

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

.wechat-card .field-label:not(:first-of-type) {
    margin-top: 14px;
}

.wechat-editor-block + .wechat-editor-block {
    margin-top: 18px;
}

.wechat-subcard,
.wechat-editor-block,
.wechat-submit-panel,
.wechat-profile-summary {
    padding: 14px;
    border-radius: 16px;
    background: rgba(248, 251, 255, 0.88);
    border: 1px solid rgba(17, 24, 39, 0.06);
}

.wechat-profile-summary {
    margin-top: 10px;
}

.wechat-ai-prompt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.wechat-ai-prompt-row .text-field {
    flex: 1;
}

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

.wechat-block-head .field-label {
    margin: 0;
}

.wechat-textarea {
    min-height: 136px;
    resize: vertical;
    line-height: 1.6;
}

.wechat-cover-preview {
    margin-top: 10px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px dashed rgba(37, 99, 235, 0.24);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 252, 0.9)),
        linear-gradient(135deg, rgba(0, 102, 255, 0.06), rgba(25, 194, 200, 0.08));
    overflow: hidden;
}

.wechat-cover-placeholder {
    padding: 18px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-tertiary);
    text-align: center;
}

#wechatCoverPreviewImage {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 220px;
    object-fit: cover;
}

.wechat-config-actions,
.wechat-submit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

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

.wechat-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.wechat-publish-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 255, 0.9)),
        radial-gradient(circle at top right, rgba(0, 102, 255, 0.08), transparent 30%);
}

.wechat-submit-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.92)),
        radial-gradient(circle at top right, rgba(25, 194, 200, 0.08), transparent 38%);
}

.wechat-submit-row .btn {
    min-width: 220px;
}

#wechatMediaIdInput {
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
    letter-spacing: 0.04em;
}

.wechat-title-suggestions {
    margin-top: 10px;
    min-height: 44px;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 44px;
    padding: 8px 16px;
    background: var(--surface-tertiary);
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
    color: var(--text-tertiary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-value {
    color: var(--text-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Preview */
.preview-wrapper {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

#preview {
    background: var(--surface-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-height: calc(100% - 48px);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

/* Preview Content Styles */
#preview section {
    padding: 28px 32px;
}

#preview h1 {
    margin: 0 0 8px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
    font-size: 1.75em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

#preview h1:first-child {
    margin-top: 0;
}

#preview h2 {
    margin: 32px 0 12px;
    padding-left: 14px;
    border-left: 3px solid var(--brand-primary);
    font-size: 1.35em;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

#preview h3 {
    margin: 24px 0 10px;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-primary);
}

#preview p {
    margin: 14px 0;
    line-height: 1.75;
    color: var(--text-secondary);
}

#preview blockquote {
    margin: 20px 0;
    padding: 14px 18px;
    border-left: 3px solid var(--brand-primary);
    background: var(--brand-primary-soft);
    color: var(--text-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

#preview code {
    padding: 2px 6px;
    background: var(--surface-tertiary);
    border-radius: var(--radius-xs);
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 0.9em;
    color: var(--brand-primary);
}

#preview pre {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--gray-900);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #E4E4E7;
}

#preview pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

#preview table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    border-radius: var(--radius-md);
    overflow: hidden;
}

#preview th,
#preview td {
    padding: 11px 14px;
    border: 1px solid var(--border-subtle);
    text-align: left;
}

#preview th {
    background: var(--gray-800);
    color: var(--text-inverse);
    font-weight: 600;
}

#preview tr:nth-child(even) {
    background: var(--surface-secondary);
}

#preview ul,
#preview ol {
    margin: 14px 0;
    padding-left: 24px;
}

#preview li {
    margin: 6px 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

#preview hr {
    margin: 28px 0;
    border: none;
    height: 1px;
    background: var(--border-default);
}

#preview img {
    max-width: 100%;
    border-radius: var(--radius-md);
}

#preview .md2-mermaid svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

#preview .md2-mermaid .md2-mermaid-error {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
    font-size: 12px;
    white-space: pre-wrap;
}

/* Settings Panel */
.settings-panel {
    width: 520px;
    max-width: calc(100vw - 28px);
    background: var(--surface-primary);
}

.media-publish-card {
    padding: 18px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 253, 0.92)),
        radial-gradient(circle at top right, rgba(25, 194, 200, 0.08), transparent 34%);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: var(--shadow-sm);
}

.media-profile-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.media-profile-toolbar .text-field {
    flex: 1;
    min-width: 0;
}

.settings-header {
    align-items: center;
    flex-shrink: 0;
}

.settings-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.btn-close:hover {
    background: var(--surface-tertiary);
    color: var(--text-primary);
}

.settings-content {
    padding: 20px;
}

.settings-section {
    margin-bottom: 28px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

/* Theme Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.theme-preview {
    width: 100%;
    min-height: 76px;
    border-radius: calc(var(--radius-md) - 4px);
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.45);
    overflow: hidden;
}

.theme-preview-checklist_window {
    background:
        radial-gradient(circle at 1px 1px, rgba(162, 145, 126, 0.18) 1px, transparent 0) 0 0 / 7px 7px,
        linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0.18));
    border-color: rgba(184, 166, 145, 0.7);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.checklist-window {
    width: 100%;
    min-height: 76px;
    color: #4e463f;
    font-family: 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
}

.checklist-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 9px 6px;
    font-size: 9px;
    color: #8a7d70;
    background: rgba(78, 70, 63, 0.04);
    border-bottom: 1px solid rgba(184, 166, 145, 0.5);
}

.window-dots {
    display: inline-flex;
    width: 22px;
    height: 7px;
    border-radius: 999px;
    background:
        radial-gradient(circle, #f16b64 0 46%, transparent 52%) 0 50% / 7px 7px no-repeat,
        radial-gradient(circle, #efc04e 0 46%, transparent 52%) 7px 50% / 7px 7px no-repeat,
        radial-gradient(circle, #5fcf75 0 46%, transparent 52%) 14px 50% / 7px 7px no-repeat;
}

.window-date {
    letter-spacing: 0.08em;
}

.checklist-window-body {
    padding: 7px 9px 8px;
}

.checklist-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
    font-size: 9px;
    border-bottom: 1px solid rgba(184, 166, 145, 0.22);
}

.checklist-row:last-of-type {
    border-bottom: none;
}

.checklist-box {
    color: #d87243;
    font-size: 8px;
    line-height: 1;
}

.checklist-row:not(.is-done) .checklist-box {
    width: 7px;
    height: 7px;
    border: 1px solid rgba(138, 125, 112, 0.75);
    border-radius: 2px;
}

.checklist-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checklist-state {
    color: #d87243;
    opacity: 0.9;
}

.checklist-row:not(.is-done) .checklist-state {
    color: #a3988d;
}

.checklist-progress {
    margin-top: 7px;
    height: 5px;
    border-radius: 999px;
    background: rgba(78, 70, 63, 0.08);
    overflow: hidden;
}

.checklist-progress-bar {
    display: block;
    width: 32%;
    height: 100%;
    background: linear-gradient(90deg, #d87243, #efb089);
}

.preview-scene {
    position: relative;
    width: 100%;
    min-height: 76px;
    padding: 9px;
    color: var(--theme-card-text);
}

.preview-scene span,
.preview-scene div {
    display: block;
}

.scene-title,
.scene-kicker,
.scene-divider,
.scene-line,
.scene-frame-title,
.scene-frame-rule,
.scene-neon-title,
.scene-neon-subtitle,
.scene-leaf-title,
.scene-glow-ribbon,
.scene-ribbon-tag,
.scene-min-title,
.scene-min-rule,
.scene-blueprint-chip,
.scene-blueprint-grid,
.scene-type-title,
.scene-type-rule,
.scene-formal-header,
.scene-formal-rule,
.scene-formal-badge,
.scene-market-pill,
.scene-chip,
.scene-bar,
.scene-wave,
.scene-bubble,
.scene-seal,
.scene-stamp,
.scene-market-bar,
.scene-terminal-line,
.scene-leaf-row {
    border-radius: 999px;
}

.scene-title {
    width: 66%;
    height: 8px;
    background: var(--theme-primary);
}

.scene-kicker {
    width: 24%;
    height: 5px;
    margin-bottom: 6px;
    background: var(--theme-secondary);
}

.scene-divider,
.scene-min-rule,
.scene-frame-rule,
.scene-type-rule,
.scene-formal-rule {
    width: 100%;
    height: 2px;
    margin: 7px 0;
    background: rgba(0, 0, 0, 0.1);
}

.scene-line {
    width: 100%;
    height: 5px;
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.12);
}

.scene-line.line-strong {
    width: 84%;
}

.scene-line.line-mid {
    width: 74%;
}

.scene-line.line-short {
    width: 52%;
}

.preview-scene-editorial {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.36)),
        linear-gradient(90deg, rgba(0,0,0,0.03) 0 1px, transparent 1px 100%);
    background-size: auto, 14px 14px;
    border-left: 3px solid rgba(0, 0, 0, 0.08);
}

.preview-scene-editorial .scene-divider {
    background: linear-gradient(90deg, var(--theme-primary), transparent);
}

.preview-scene-editorial .scene-title {
    width: 72%;
}

.preview-scene-editorial .scene-line {
    border-radius: 2px;
}

.preview-scene-scoreboard {
    background: linear-gradient(135deg, rgba(255,255,255,0.26), rgba(255,255,255,0.08));
}

.scene-banner {
    display: flex;
    gap: 6px;
    margin-bottom: 9px;
}

.scene-chip {
    width: 28%;
    height: 13px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
    border-radius: 999px;
}

.scene-chip.is-ghost {
    width: 20%;
    background: rgba(255, 255, 255, 0.45);
}

.scene-bars {
    display: grid;
    gap: 7px;
}

.scene-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
}

.scene-bar.bar-lg {
    width: 92%;
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary), var(--theme-accent));
}

.scene-bar.bar-md {
    width: 68%;
    background: rgba(33, 150, 243, 0.22);
}

.scene-bar.bar-sm {
    width: 46%;
    background: rgba(255, 152, 0, 0.28);
}

.preview-scene-seal {
    border: 1px solid rgba(198, 40, 40, 0.18);
    box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.08);
}

.scene-frame-title {
    width: 44%;
    height: 7px;
    margin: 2px auto 6px;
    background: var(--theme-primary);
}

.preview-scene-seal .scene-frame-rule {
    background: linear-gradient(90deg, transparent, var(--theme-primary), transparent);
}

.scene-seal {
    position: absolute;
    right: 9px;
    bottom: 9px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--theme-primary);
    background: rgba(198, 40, 40, 0.08);
}

.preview-scene-neon {
    background:
        linear-gradient(180deg, rgba(13, 10, 30, 0.82), rgba(13, 10, 30, 0.92)),
        radial-gradient(circle at top right, rgba(233,30,99,0.18), transparent 35%);
    color: #fff;
}

.preview-scene-neon .scene-neon-title {
    width: 58%;
    height: 8px;
    background: var(--theme-primary);
    box-shadow: 0 0 8px var(--theme-primary);
}

.preview-scene-neon .scene-neon-subtitle {
    width: 34%;
    height: 5px;
    margin-top: 7px;
    background: var(--theme-accent);
    box-shadow: 0 0 8px var(--theme-accent);
}

.scene-terminal-lines {
    margin-top: 10px;
    display: grid;
    gap: 7px;
}

.scene-terminal-line {
    width: 100%;
    height: 4px;
    background: rgba(224, 224, 224, 0.22);
    box-shadow: 0 0 6px rgba(0, 188, 212, 0.18);
}

.preview-scene-wave .scene-wave {
    width: 100%;
    height: 6px;
    margin-top: 8px;
    background:
        linear-gradient(90deg, var(--theme-primary) 0 18%, transparent 18% 24%, var(--theme-secondary) 24% 42%, transparent 42% 48%, var(--theme-accent) 48% 66%, transparent 66% 72%, var(--theme-secondary) 72% 90%, transparent 90%);
}

.preview-scene-wave {
    background:
        radial-gradient(circle at 85% 18%, rgba(144, 224, 239, 0.42), transparent 20%),
        linear-gradient(180deg, rgba(255,255,255,0.72), rgba(224,247,250,0.58));
}

.scene-bubbles {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.scene-bubble {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 180, 216, 0.18);
    border: 1px solid rgba(0, 119, 182, 0.18);
}

.scene-bubble.is-small {
    width: 12px;
    height: 12px;
}

.scene-bubble.is-tiny {
    width: 8px;
    height: 8px;
}

.preview-scene-organic .scene-leaf-title {
    width: 54%;
    height: 8px;
    margin-left: 10px;
    background: var(--theme-primary);
}

.preview-scene-organic {
    background:
        radial-gradient(circle at 90% 20%, rgba(139, 195, 74, 0.18), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.56), rgba(220,237,200,0.48));
    border-radius: 16px 10px 14px 10px;
}

.scene-organic-list {
    margin-top: 10px;
    display: grid;
    gap: 7px;
}

.scene-leaf-row {
    position: relative;
    width: 100%;
    height: 5px;
    margin-left: 10px;
    background: rgba(46, 125, 50, 0.16);
}

.scene-leaf-row::before {
    content: '';
    position: absolute;
    left: -10px;
    top: -1px;
    width: 7px;
    height: 7px;
    border-radius: 7px 0;
    background: var(--theme-secondary);
    transform: rotate(-30deg);
}

.scene-leaf-row.is-short {
    width: 70%;
}

.preview-scene-sun {
    background:
        radial-gradient(circle at 85% 16%, rgba(255, 193, 7, 0.38), transparent 18%),
        linear-gradient(180deg, rgba(255,248,240,0.88), rgba(255,243,224,0.72));
}

.scene-glow-ribbon {
    width: 34%;
    height: 12px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary), var(--theme-accent));
    border-radius: 999px;
}

.preview-scene-sun .scene-title {
    width: 60%;
    background: rgba(255, 87, 34, 0.88);
}

.preview-scene-sun .scene-line {
    background: linear-gradient(90deg, rgba(255, 87, 34, 0.18), rgba(255, 152, 0, 0.08));
}

.preview-scene-ribbon .scene-ribbon-tag {
    width: 32%;
    height: 13px;
    margin-left: -2px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
    border-radius: 0 999px 999px 0;
    box-shadow: 3px 3px 0 rgba(206, 147, 216, 0.6);
}

.scene-ribbon-lines {
    margin-top: 9px;
}

.preview-scene-minimal {
    background: rgba(255,255,255,0.76);
    border: 1px solid rgba(33, 33, 33, 0.06);
}

.scene-min-title {
    width: 42%;
    height: 6px;
    background: #212121;
}

.preview-scene-minimal .scene-min-rule {
    background: rgba(33, 33, 33, 0.18);
}

.preview-scene-minimal .scene-line {
    background: rgba(33, 33, 33, 0.1);
    height: 3px;
    border-radius: 0;
}

.preview-scene-blueprint {
    background:
        linear-gradient(90deg, rgba(13,71,161,0.06) 1px, transparent 1px) 0 0 / 12px 12px,
        linear-gradient(180deg, rgba(13,71,161,0.06) 1px, transparent 1px) 0 0 / 12px 12px,
        linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.3));
    border: 1px solid rgba(13, 71, 161, 0.12);
}

.scene-blueprint-chip {
    width: 28%;
    height: 12px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
}

.scene-blueprint-grid {
    width: 100%;
    height: 2px;
    background: rgba(13, 71, 161, 0.18);
}

.scene-blueprint-lines {
    margin-top: 10px;
}

.preview-scene-blueprint .scene-line {
    position: relative;
    height: 4px;
    background: rgba(13, 71, 161, 0.16);
}

.preview-scene-blueprint .scene-line::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -1px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--theme-secondary);
}

.preview-scene-typewriter {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.08)),
        repeating-linear-gradient(180deg, transparent 0 7px, rgba(141,110,99,0.08) 7px 8px);
    border: 1px solid rgba(141,110,99,0.18);
}

.scene-type-title {
    width: 48%;
    height: 7px;
    background: var(--theme-primary);
}

.preview-scene-typewriter .scene-type-rule {
    background: rgba(141, 110, 99, 0.22);
}

.preview-scene-typewriter .scene-line {
    height: 3px;
    border-radius: 0;
    background: rgba(93, 64, 55, 0.16);
}

.scene-stamp {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 18px;
    height: 12px;
    border: 1px solid rgba(141,110,99,0.45);
    border-radius: 3px;
    transform: rotate(-8deg);
}

.preview-scene-formal {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,248,225,0.42)),
        linear-gradient(90deg, rgba(183,28,28,0.04), transparent 18%, transparent 82%, rgba(183,28,28,0.04));
    border: 1px solid rgba(183, 28, 28, 0.12);
}

.scene-formal-header {
    width: 52%;
    height: 7px;
    margin: 1px auto 7px;
    background: var(--theme-primary);
}

.preview-scene-formal .scene-formal-rule {
    background: linear-gradient(90deg, transparent, var(--theme-accent), transparent);
}

.preview-scene-formal .scene-line {
    width: 88%;
    margin-left: auto;
    margin-right: auto;
    background: rgba(183, 28, 28, 0.12);
}

.scene-formal-badge {
    width: 16px;
    height: 16px;
    margin: 9px auto 0;
    border-radius: 50%;
    background: rgba(183, 28, 28, 0.1);
    border: 2px solid var(--theme-primary);
}

.preview-scene-market {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.88), rgba(227,242,253,0.62)),
        linear-gradient(90deg, rgba(13,71,161,0.04) 0 1px, transparent 1px 100%);
    background-size: auto, 16px 16px;
    border: 1px solid rgba(13, 71, 161, 0.08);
}

.scene-market-top {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.scene-market-pill {
    width: 24%;
    height: 11px;
    background: var(--theme-primary);
}

.scene-market-pill.is-gold {
    width: 18%;
    background: var(--theme-accent);
}

.scene-market-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 32px;
}

.preview-scene-market::after {
    content: '';
    position: absolute;
    left: 9px;
    right: 9px;
    bottom: 9px;
    height: 1px;
    background: rgba(13, 71, 161, 0.12);
}

.scene-market-bar {
    width: 10px;
    background: linear-gradient(180deg, var(--theme-secondary), var(--theme-primary));
    border-radius: 999px 999px 0 0;
}

.scene-market-bar.h1 {
    height: 26px;
}

.scene-market-bar.h2 {
    height: 18px;
}

.scene-market-bar.h3 {
    height: 30px;
}

.scene-market-bar.h4 {
    height: 22px;
    background: linear-gradient(180deg, var(--theme-accent), var(--theme-secondary));
}

.theme-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--brand-primary), var(--brand-primary-glow));
    opacity: 0;
    transition: opacity var(--duration-fast);
}

.theme-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-card:hover::before {
    opacity: 1;
}

.theme-card.active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.theme-card.active::before {
    opacity: 1;
}

.theme-colors {
    display: flex;
    gap: 4px;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.theme-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

.theme-card.active .theme-name {
    color: var(--brand-primary);
}

/* Code Theme Grid */
.code-theme-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.code-theme-item {
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-fast);
    color: var(--text-secondary);
}

.code-theme-item:hover {
    background: var(--surface-tertiary);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.code-theme-item.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--text-inverse);
}

/* Radio Options */
.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--surface-secondary);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 8px;
    transition: all var(--duration-fast);
}

.radio-option:hover {
    background: var(--surface-tertiary);
    border-color: var(--border-default);
}

.radio-option.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

.radio-indicator {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-default);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all var(--duration-fast);
}

.radio-option.active .radio-indicator {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
}

.radio-option.active .radio-indicator::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--text-inverse);
    border-radius: 50%;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.option-desc {
    font-size: 11px;
    color: var(--text-tertiary);
}

.ai-config-card {
    padding: 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.ai-config-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-subtle);
}

.ai-config-tab {
    min-width: 86px;
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--duration-fast), color var(--duration-fast), box-shadow var(--duration-fast);
}

.ai-config-tab.active {
    background: var(--surface-primary);
    color: var(--brand-primary);
    box-shadow: var(--shadow-xs);
}

.ai-config-panel {
    display: none;
}

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

.ai-config-group + .ai-config-group {
    margin-top: 14px;
}

.ai-config-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.field-label {
    display: block;
    margin: 10px 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.field-label:first-child {
    margin-top: 0;
}

.text-field {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface-primary);
    color: var(--text-primary);
    font: inherit;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.text-field:focus {
    outline: none;
    border-color: rgba(0, 102, 255, 0.36);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.08);
}

.ai-config-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.settings-hint {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* API Info */
.api-info {
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--border-subtle);
}

.api-endpoint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border-subtle);
}

.api-endpoint code {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 12px;
    color: var(--brand-primary);
    font-weight: 500;
}

.btn-copy-api {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    background: var(--brand-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.btn-copy-api:hover {
    background: #0052CC;
}

.api-example {
    padding: 12px;
    background: var(--gray-900);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 11px;
    color: #A1A1AA;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.5;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 20px;
    background: var(--gray-800);
    color: var(--text-inverse);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: all var(--duration-slow) var(--ease-out);
    z-index: 200;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.success::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--text-inverse);
    border-radius: 50%;
}

.toast.error {
    background: var(--danger);
}

.toast.error::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--text-inverse);
    border-radius: 50%;
}

/* Keyboard Shortcut Hints */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--surface-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xs);
    box-shadow: 0 1px 0 var(--border-default);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --header-height: 52px;
    }

    .header {
        padding: 0 16px;
        gap: 12px;
    }

    .logo-text {
        font-size: 16px;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
    }

    .logo-tag {
        display: none;
    }

    .header-summary {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0;
        gap: 6px;
        flex: 1;
        scrollbar-width: none;
    }

    .header-summary::-webkit-scrollbar {
        display: none;
    }

    .summary-chip {
        min-height: 28px;
        padding: 0 9px;
        font-size: 10px;
    }

    .btn {
        height: 34px;
        padding: 0 12px;
        font-size: 12px;
    }

    .btn svg {
        width: 16px;
        height: 16px;
    }

    .main {
        flex-direction: column;
    }

    .editor-panel,
    .preview-panel {
        flex: none;
        height: 50%;
        min-width: 0;
        max-width: none;
    }

    .resizer {
        width: 100%;
        height: 1px;
        cursor: row-resize;
    }

    .resizer::after {
        width: 32px;
        height: 4px;
    }

    .resizer:hover::after {
        width: 48px;
        height: 6px;
    }

    .drawer-panel {
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-radius: 18px 18px 0 0;
        top: auto;
        bottom: 0;
        height: min(88vh, 820px);
        transform: translateY(100%);
        box-shadow: 0 -14px 32px rgba(15, 23, 42, 0.14);
    }

    .drawer-panel-right {
        right: 0;
    }

    .drawer-panel.active {
        transform: translateY(0);
    }

    .drawer-header {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .drawer-content {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .drawer-grip {
        display: block;
    }

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

    .assistant-studio {
        padding: 16px 14px 14px;
    }

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

    .assistant-input {
        min-width: 0;
        width: 100%;
    }

    .assistant-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .assistant-card-toolbar,
    .assistant-image-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .assistant-image-prompt-row {
        align-items: stretch;
    }

    .stats-bar {
        gap: 10px 14px;
    }

    .assistant-panel-content {
        padding: 14px;
    }

    .share-modal,
    .wechat-modal,
    .template-modal,
    .upload-image-modal {
        width: min(100vw - 18px, 760px);
        max-height: min(88vh, 760px);
        border-radius: 24px;
    }

    .share-modal-header,
    .share-modal-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .share-modal-header {
        flex-direction: column;
    }

    .share-modal-actions {
        width: 100%;
        justify-content: space-between;
    }

    .share-grid,
    .wechat-workspace,
    .template-workspace,
    .upload-image-workspace {
        grid-template-columns: 1fr;
    }

    .wechat-field-grid {
        grid-template-columns: 1fr;
    }

    .wechat-status-head,
    .wechat-block-head {
        flex-direction: column;
        align-items: stretch;
    }

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

    .share-qr-frame {
        min-height: 220px;
    }

    #preview section {
        padding: 20px;
    }
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* Selection */
::selection {
    background: var(--brand-primary-soft);
}

/* Print */
@media print {
    .header,
    .drawer-overlay,
    .drawer-panel,
    .share-overlay,
    .share-modal,
    .template-modal,
    .toast {
        display: none !important;
    }

    .main {
        display: block;
    }

    .editor-panel {
        display: none;
    }

    .preview-panel {
        width: 100%;
    }
}
