/* ============================================================
   去AI味 — 样式表
   ============================================================ */

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

:root {
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

::selection { background: var(--green-100); color: var(--green-700); }

/* === App Layout === */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Header === */
.header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-icon { font-size: 1.5rem; }
.logo-title{font-size: 1.5rem !important;color: #22c55e !important;}
.logo-text { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); }

/* Quota Badge */
.quota-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--green-50);
    color: var(--green-600);
    border: 1px solid var(--green-200);
    transition: all 0.3s;
}
.quota-badge.quota-low {
    background: #fefce8;
    color: #ca8a04;
    border-color: #fde68a;
}
.quota-badge.quota-zero {
    background: var(--red-50);
    color: var(--red-600);
    border-color: var(--red-200);
}
.quota-icon { font-size: 0.8rem; }

/* Steps Indicator */
.steps { display: flex; align-items: center; gap: 0; }
.step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gray-400);
    transition: all 0.3s;
}
.step.active { color: var(--green-600); background: var(--green-50); }
.step.done { color: var(--green-500); }
.step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 600;
    transition: all 0.3s;
}
.step.active .step-num { background: var(--green-500); color: #fff; }
.step.done .step-num { background: var(--green-500); color: #fff; }
.step-connector {
    width: 24px; height: 1px;
    background: var(--gray-200);
    margin: 0 0.25rem;
}

/* === Main === */
.main {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* === Stage Panels === */
.stage-panel { display: none; }
.stage-panel.active { display: block; }

.panel-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--gray-100);
}
.panel-card.two-col {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}
.col-main { flex: 1; min-width: 0; }
.col-side { width: 320px; flex-shrink: 0; }

.panel-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--gray-900); }
.panel-desc { font-size: 0.9rem; color: var(--gray-500); margin-bottom: 1.5rem; }

/* === Stage 1 Two-Column Layout === */
.stage1-layout {
    display: flex;
    gap: 0;
    padding: 0;
    overflow: hidden;
    min-height: 85vh;
}
.stage1-sidebar {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--gray-100);
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.3s ease;
}
.stage1-sidebar.collapsed {
    width: 48px;
}
.stage1-sidebar.collapsed .stage1-sidebar-scroll {
    display: none;
}
.stage1-sidebar.collapsed .sidebar-toggle {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

/* Sidebar Toggle */
.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(50%);
    width: 24px;
    height: 48px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 0.65rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.2s, background 0.2s;
    padding: 0;
    line-height: 1;
}
.sidebar-toggle:hover {
    color: var(--gray-600);
    background: var(--gray-50);
}
.stage1-sidebar-scroll {
    padding: 1.75rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}
.stage1-sidebar .sidebar-title {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: var(--gray-900);
}
.sidebar-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 1rem 0;
}
.optional-tag {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--gray-400);
    margin-left: 0.25rem;
}
.stage1-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
}

.stage1-editor {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.stage1-personal {
    width: 220px;
    flex-shrink: 0;
    border-left: 1px solid var(--gray-100);
    background: var(--gray-50);
    padding: 1.5rem 1rem;
    overflow-y: auto;
}
.personal-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

/* Style List (vertical, in sidebar) */
.style-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.style-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.3;
}
.style-item:hover {
    background: #fff;
    color: var(--gray-900);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.style-item.selected {
    background: #fff;
    color: var(--green-700);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--green-200);
    padding: calc(0.55rem - 1px) calc(0.7rem - 1px);
}
.style-item-radio {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}
.style-item.selected .style-item-radio {
    border-color: var(--green-500);
    background: var(--green-500);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}
.style-item.selected .style-item-radio::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
}
.style-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.style-item-name {
    line-height: 1.3;
}
.style-item-desc {
    display: none;
    font-size: 0.7rem;
    color: var(--green-600);
    font-weight: 400;
    line-height: 1.3;
}
.style-item.selected .style-item-desc {
    display: block;
}

/* Compact form groups in sidebar */
.form-group-compact {
    margin-bottom: 0.65rem;
}
.form-group-compact .form-label {
    font-size: 0.73rem;
}
.form-group-compact .form-input {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
}
.form-group-compact .tag-input {
    min-height: 30px;
    padding: 0.25rem 0.35rem;
}
.form-group-compact .tag-input-field {
    font-size: 0.8rem;
}
.form-group-compact .tone-selector { gap: 0.2rem; }
.form-group-compact .tone-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
}
.form-textarea-compact {
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* === Input Area === */
.draft-input {
    width: 100%;
    flex: 1;
    min-height: 70vh;
    padding: 1.5rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.8;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}
.draft-input:focus { border-color: var(--green-500); }
.draft-input::placeholder { color: var(--gray-400); }
.input-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; }
.char-count { font-size: 0.8rem; color: var(--gray-400); transition: color 0.2s; }
.char-count.char-warn { color: #d97706; font-weight: 500; }
.char-count.char-danger { color: var(--red-500); font-weight: 600; }
.char-hint { font-size: 0.75rem; color: #d97706; margin-left: 0.5rem; }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-700); }
.btn-outline { background: #fff; color: var(--gray-700); border: 1.5px solid var(--gray-300); }
.btn-outline:hover:not(:disabled) { border-color: var(--gray-400); background: var(--gray-50); }
.btn-block { width: 100%; justify-content: center; }
.btn-lg {
    padding: 0.85rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
}
.btn-ghost {
    background: transparent;
    color: var(--gray-400);
    border: none;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
}
.btn-ghost:hover { color: var(--gray-600); }

.btn-loading.hidden { display: none; }
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Output Area === */
.output-area { margin-top: 1.5rem; }
.output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.output-label { font-weight: 600; font-size: 0.9rem; color: var(--gray-700); }
.output-status { font-size: 0.8rem; color: var(--gray-400); }
.output-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.5rem;
    min-height: 120px;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.output-text.prose {
    font-size: 0.95rem;
    line-height: 1.85;
    letter-spacing: 0.02em;
}

/* Typewriter cursor */
.typewriting::after {
    content: "|";
    animation: blink 1s step-end infinite;
    color: var(--green-500);
    font-weight: 300;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* === Stage 2 Preview === */
.preview-box { max-height: 450px; }

/* === Sidebar === */
.sidebar-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.25rem;
    position: sticky;
    top: 80px;
}
.sidebar-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }

.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.35rem; }
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-input:focus { border-color: var(--green-500); }

/* Tag Input */
.tag-input {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
    padding: 0.4rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    min-height: 36px;
    cursor: text;
}
.tag-input:focus-within { border-color: var(--green-500); }
.tag-input-field {
    border: none; outline: none;
    font-size: 0.85rem;
    flex: 1; min-width: 80px;
    font-family: inherit;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.tag {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: var(--green-100); color: var(--green-700);
    border-radius: 4px;
    font-size: 0.75rem;
}
.tag-remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--green-600);
}
.tag-remove:hover { color: var(--red-500); }

/* Tone Selector */
.tone-selector { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tone-btn {
    padding: 0.35rem 0.6rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-family: inherit;
}
.tone-btn:hover { border-color: var(--green-400); }
.tone-btn.active { border-color: var(--green-500); background: var(--green-50); color: var(--green-700); }

/* === Quota Exhausted Card === */
.quota-exhausted-card {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 10px;
    background: var(--red-50);
    border: 1.5px solid var(--red-200);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.quota-exhausted-icon { font-size: 1.5rem; flex-shrink: 0; }
.quota-exhausted-text strong { color: var(--red-600); font-size: 0.95rem; }
.quota-exhausted-text p { color: var(--red-500); font-size: 0.8rem; margin-top: 0.25rem; }
.quota-countdown { color: var(--gray-500); font-size: 0.75rem; margin-top: 0.35rem; display: inline-block; }

/* === Stage Actions === */
.stage-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.stage-actions-col {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.stage-actions-ghost {
    display: flex;
    gap: 0.5rem;
}
.hidden { display: none !important; }

/* === Stage 3 Comparison === */
.comparison-view {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}
.compare-col { flex: 1; min-width: 0; }
.compare-header {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}
.compare-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-original { background: var(--red-50); color: var(--red-600); }
.badge-rewritten { background: var(--green-50); color: var(--green-600); }
.compare-label { font-size: 0.8rem; color: var(--gray-500); }
.compare-text {
    padding: 1rem;
    min-height: 200px;
    max-height: 450px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}
.compare-divider { width: 1px; background: var(--gray-200); flex-shrink: 0; }

/* Diff Highlight */
.diff-removed { background: #fee2e2; color: #b91c1c; text-decoration: line-through; padding: 0 2px; border-radius: 2px; }
.diff-added { background: #dcfce7; color: #166534; padding: 0 2px; border-radius: 2px; }

/* === Score Section === */
.score-section {
    background: var(--gray-50);
    border-radius: 10px;
    padding: 1.5rem;
}
.score-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.score-display { display: flex; align-items: center; gap: 2rem; }
.score-ring {
    position: relative;
    width: 120px; height: 120px;
    flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 8;
}
.score-fill {
    fill: none;
    stroke: var(--green-500);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}
.score-value {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
}
.score-details { flex: 1; }
.score-item {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 0.6rem;
}
.score-item-label { font-size: 0.8rem; color: var(--gray-600); width: 80px; flex-shrink: 0; }
.score-bar {
    flex: 1; height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    background: var(--green-500);
    border-radius: 4px;
    transition: width 0.8s ease;
    width: 0%;
}
.score-item-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    width: 40px;
    text-align: right;
}

/* === Score Loading Overlay === */
.score-section {
    position: relative;
}
.score-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(2px);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s;
}
.score-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.score-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.score-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--green-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.score-loading-text {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* === Skeleton Loading === */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-200) 50%, var(--gray-100) 100%);
    background-size: 800px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.skeleton-line-short { width: 40%; }
.skeleton-line-medium { width: 70%; }
.skeleton-line-badge { width: 60px; height: 10px; }
.skeleton-card {
    padding: 0.75rem;
    border: 1px solid var(--gray-100);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* === Suggestions Panel === */
.suggestions-panel {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}
.suggestions-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}
.overall-comment {
    padding: 0.75rem 1rem;
    background: var(--green-50);
    border-left: 3px solid var(--green-500);
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: var(--green-700);
    margin-bottom: 1rem;
}
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.suggestion-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.2s;
}
.suggestion-card:hover {
    border-color: var(--gray-300);
}
.suggestion-dimension {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.dim-vocab { background: #fef2f2; color: #dc2626; }
.dim-sentence { background: #fefce8; color: #ca8a04; }
.dim-human { background: #f0fdf4; color: #16a34a; }
.suggestion-problem {
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
    line-height: 1.6;
}
.suggestion-problem strong {
    color: var(--gray-900);
}
.suggestion-fix {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.4rem;
    line-height: 1.5;
}
.suggestion-example {
    background: var(--gray-50);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.6;
}
.suggestion-example .before {
    color: #b91c1c;
}
.suggestion-example .after {
    color: #166534;
}
.suggestion-arrow {
    color: var(--gray-400);
    margin: 0 0.5rem;
}

/* Apply Suggestions Area */
.apply-area {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.apply-hint {
    font-size: 0.8rem;
    color: var(--gray-400);
}
.apply-status {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--green-50);
    color: var(--green-700);
}
.apply-status.error {
    background: var(--red-50);
    color: var(--red-600);
}

/* === Editable Areas === */
.output-text.editable:focus,
.compare-text.editable:focus {
    outline: 2px solid var(--green-400);
    outline-offset: -2px;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.08);
}
.output-text.editable:empty::before {
    content: "点击此处编辑文章...";
    color: var(--gray-400);
}
.compare-text.editable:empty::before {
    content: "点击此处编辑文章...";
    color: var(--gray-400);
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 0.5rem;
    color: var(--gray-400);
    font-size: 1.2rem;
    border-top: 1px solid var(--gray-100);
    /*margin-top: 2rem;*/
}

/* === Toast === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}
.toast-success { background: var(--green-600); color: #fff; }
.toast-error { background: var(--red-600); color: #fff; }
.toast-warning { background: #f59e0b; color: #fff; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; height: auto; padding: 0.75rem 1rem; gap: 0.5rem; }
    .main { padding: 1rem; }
    .panel-card { padding: 1.25rem; }
    .panel-card.two-col { flex-direction: column; }
    .col-side { width: 100%; }
    .comparison-view { flex-direction: column; }
    .compare-divider { width: 100%; height: 1px; }
    .score-display { flex-direction: column; align-items: flex-start; }
    .steps { flex-wrap: wrap; gap: 0.25rem; }
    .step-connector { display: none; }

    /* Stage 1 mobile: stack vertically */
    .stage1-layout { flex-direction: column; min-height: auto; }
    .stage1-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray-100);
    }
    .stage1-sidebar-scroll {
        padding: 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }
    .stage1-sidebar .sidebar-title {
        width: 100%;
        font-size: 0.85rem;
        margin-bottom: 0;
    }
    .sidebar-divider { display: none; }
    .style-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.35rem;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }
    .style-item {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        border: 1px solid var(--gray-200);
        border-radius: 20px;
        white-space: nowrap;
    }
    .style-item.selected {
        border-color: var(--green-500);
        background: var(--green-50);
        box-shadow: none;
        padding: 0.3rem 0.5rem;
    }
    .style-item-radio { display: none; }
    .stage1-main { flex-direction: column; }
    .stage1-editor { padding: 1.25rem; }
    .stage1-personal {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--gray-100);
        padding: 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .stage1-personal .personal-title {
        width: 100%;
        margin-bottom: 0;
    }
    .stage1-personal .form-group-compact {
        flex: 1;
        min-width: 140px;
    }
    .draft-input { min-height: 50vh; }

    /* Mobile: sidebar toggle hidden, sidebar always shows */
    .sidebar-toggle { display: none; }
    .stage1-sidebar.collapsed { width: 100%; }
    .stage1-sidebar.collapsed .stage1-sidebar-scroll { display: flex; }

    /* Mobile: style desc hidden */
    .style-item-desc { display: none !important; }

    /* Mobile: tighter button spacing */
    .stage-actions { gap: 0.4rem; }
    .stage-actions-ghost { gap: 0.25rem; }
    .btn-lg { padding: 0.65rem 1.5rem; font-size: 0.9rem; }
    .btn-ghost { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

    /* Mobile: quota badge compact */
    .quota-badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
}
