/* ============================================
   心有灵犀的艺术家 — Stylesheet
   Museum/gallery dark theme with gold accents
   ============================================ */

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

:root {
    --bg-deep: #0d0d14;
    --bg-surface: #161623;
    --bg-elevated: #1e1e30;
    --bg-card: #242438;
    --gold: #d4a853;
    --gold-bright: #f0c674;
    --gold-dim: #8a6f3a;
    --text-primary: #e8e6e3;
    --text-secondary: #a09c97;
    --text-muted: #6b6863;
    --border: #2a2a40;
    --border-light: #353550;
    --accent-red: #c0392b;
    --accent-glow: rgba(212, 168, 83, 0.15);
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-strong: 0 8px 40px rgba(0, 0, 0, 0.6);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(212, 168, 83, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(192, 57, 43, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(30, 30, 48, 0.5) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- App Container --- */
.app {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.header-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ornament-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), var(--gold));
}

.ornament-diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
    box-shadow: 0 0 12px var(--accent-glow);
}

.app-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.app-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* --- Main --- */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* --- Drawing Section --- */
.drawing-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    background: #fafaf7;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow:
        var(--shadow-strong),
        0 0 0 1px var(--border-light),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.canvas-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 2px;
    background: linear-gradient(135deg, var(--gold-dim), transparent 30%, transparent 70%, var(--gold-dim));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

#drawingCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.canvas-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #c5c0b8;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.canvas-placeholder.hidden {
    opacity: 0;
}

.canvas-placeholder svg {
    opacity: 0.4;
}

.canvas-placeholder span {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

/* --- Tools --- */
.tools {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

.tool-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.brush-sizes {
    display: flex;
    gap: 6px;
}

.brush-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.brush-btn:hover {
    border-color: var(--gold-dim);
    background: var(--bg-card);
}

.brush-btn.active {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.1);
    box-shadow: 0 0 0 1px var(--gold-dim);
}

.brush-btn .dot {
    background: var(--text-primary);
    border-radius: 50%;
    display: block;
}

.brush-btn.active .dot {
    background: var(--gold-bright);
}

.color-palette {
    display: flex;
    gap: 6px;
}

.color-btn {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    border-color: var(--gold-bright);
    box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 3px var(--gold);
    transform: scale(1.1);
}

.action-buttons {
    display: flex;
    gap: 6px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.action-btn:hover {
    border-color: var(--gold-dim);
    color: var(--gold-bright);
    background: var(--bg-card);
}

.action-btn.active {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(212, 168, 83, 0.1);
}

/* --- Submit Section --- */
.submit-section {
    text-align: center;
    width: 100%;
}

.submit-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--bg-deep);
    transition: var(--transition);
}

.submit-btn-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dim) 100%);
    transition: var(--transition);
}

.submit-btn:hover .submit-btn-bg {
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-bright) 50%, var(--gold) 100%);
    box-shadow: 0 0 30px var(--accent-glow);
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn-text {
    position: relative;
    z-index: 1;
}

.submit-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Loading Status --- */
.loading-status {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 100;
}

.loading-status.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

.loading-status-bar {
    width: 120px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.loading-status-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* --- Footer --- */
.app-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 14, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* --- Modal Loading --- */
.modal-loading {
    padding: 60px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-easel {
    position: relative;
    width: 120px;
    height: 140px;
}

.easel-frame {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 80px;
    border: 3px solid var(--gold-dim);
    border-radius: 4px;
    background: var(--bg-elevated);
}

.easel-canvas {
    position: absolute;
    inset: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paint-swirl {
    width: 30px;
    height: 30px;
    border: 3px solid var(--gold);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.easel-leg {
    position: absolute;
    bottom: 0;
    width: 3px;
    height: 70px;
    background: var(--gold-dim);
    transform-origin: top center;
}

.easel-leg.left {
    left: 35px;
    transform: rotate(15deg);
}

.easel-leg.right {
    right: 35px;
    transform: rotate(-15deg);
}

.loading-message {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    color: var(--gold-bright);
    letter-spacing: 0.05em;
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--gold-dim);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* --- Modal Result --- */
.modal-result {
    padding: 40px 36px 36px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--accent-red);
    color: #fff;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-sparkle {
    display: inline-flex;
    color: var(--gold);
    margin-bottom: 8px;
    animation: sparkle 2s ease-in-out infinite;
}

.result-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.result-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Comparison --- */
.result-comparison {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 28px;
}

.comparison-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comparison-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.1em;
}

.comparison-image-wrap {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: var(--bg-elevated);
}

.comparison-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.user-wrap {
    background: #fafaf7;
}

.painting-wrap {
    background: var(--bg-deep);
}

.comparison-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 50px;
}

.connector-line {
    width: 1px;
    flex: 1;
    background: linear-gradient(180deg, transparent, var(--gold-dim));
}

.connector-line:last-child {
    background: linear-gradient(180deg, var(--gold-dim), transparent);
}

.connector-percent {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-bright);
    white-space: nowrap;
}

/* --- Result Info --- */
.result-info {
    text-align: center;
    margin-bottom: 28px;
}

.painting-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.painting-meta {
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 14px;
}

.meta-separator {
    margin: 0 8px;
    opacity: 0.5;
}

.painting-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 20px;
}

.similarity-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.similarity-track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.similarity-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.similarity-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* --- Result Actions --- */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border: 1px solid var(--gold-dim);
    border-radius: 50px;
    background: transparent;
    color: var(--gold-bright);
    font-family: 'Noto Serif SC', serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(212, 168, 83, 0.1);
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 28px;
    background: var(--bg-card);
    border: 1px solid var(--gold-dim);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.85rem;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2000;
}

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

/* --- Animations --- */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-8px); opacity: 1; }
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

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

/* --- Responsive --- */
@media (max-width: 640px) {
    .app {
        padding: 24px 16px 40px;
    }

    .app-title {
        font-size: 1.8rem;
    }

    .app-subtitle {
        font-size: 0.8rem;
    }

    .tools {
        flex-direction: column;
        gap: 14px;
    }

    .tool-group {
        width: 100%;
        justify-content: center;
    }

    .submit-btn {
        padding: 14px 32px;
        font-size: 1rem;
    }

    .modal-content {
        margin: 10px;
    }

    .modal-result {
        padding: 30px 20px 24px;
    }

    .result-title {
        font-size: 1.4rem;
    }

    .result-comparison {
        flex-direction: column;
    }

    .comparison-connector {
        flex-direction: row;
        min-height: 40px;
    }

    .connector-line {
        width: auto;
        height: 1px;
        flex: 1;
        background: linear-gradient(90deg, transparent, var(--gold-dim));
    }

    .connector-line:last-child {
        background: linear-gradient(90deg, var(--gold-dim), transparent);
    }

    .loading-status {
        width: 90%;
        flex-direction: column;
        gap: 6px;
    }

    .loading-status-bar {
        width: 100%;
    }
}

/* --- Theme Bar (prompts & lazy mode) --- */
.theme-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle, rgba(212, 168, 83, 0.18));
    border-radius: 16px;
    padding: 16px 20px 14px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-soft);
}

.theme-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.theme-bar-title {
    font-size: 0.92rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.random-mood-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1a1a;
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dim) 100%);
    box-shadow: 0 3px 14px rgba(212, 168, 83, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.random-mood-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.5);
}

.random-mood-btn .dice {
    font-size: 1rem;
}

.theme-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.theme-chip {
    padding: 8px 16px;
    border: 1px solid rgba(212, 168, 83, 0.28);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-chip:hover {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.12);
}

.theme-chip.active {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: #1a1a1a;
    border-color: var(--gold-bright);
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(212, 168, 83, 0.4);
}

.theme-hint {
    margin: 11px 2px 0;
    font-size: 0.82rem;
    color: var(--gold-bright);
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.3s ease;
    min-height: 0;
}

.theme-hint.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Mode Tabs (我来画 / 我来描述)
   ============================================ */
.mode-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

.mode-tab {
    flex: 1;
    max-width: 220px;
    padding: 13px 18px;
    border: 1px solid var(--border-subtle, rgba(212, 168, 83, 0.2));
    border-radius: 14px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: 'Noto Serif SC', serif;
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition, all 0.25s ease);
}

.mode-tab:hover {
    border-color: var(--gold);
    color: var(--text-primary);
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: #1a1a1a;
    border-color: var(--gold-bright);
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(212, 168, 83, 0.4);
}

/* ============================================
   Text Creation Panel
   ============================================ */
.text-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle, rgba(212, 168, 83, 0.18));
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--shadow-soft);
    animation: fadeIn 0.4s ease;
}

.text-panel-tip {
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.prompt-input {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle, rgba(212, 168, 83, 0.25));
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 0.98rem;
    line-height: 1.6;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.prompt-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.style-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 4px;
}

.style-chip {
    padding: 7px 14px;
    border: 1px solid rgba(212, 168, 83, 0.28);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.style-chip:hover {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.12);
}

.style-chip.active {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: #1a1a1a;
    border-color: var(--gold-bright);
    font-weight: 600;
}

.text-panel-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border: 1px dashed var(--gold-dim, rgba(212, 168, 83, 0.5));
    border-radius: 50px;
    background: transparent;
    color: var(--gold-bright);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(212, 168, 83, 0.1);
    border-style: solid;
}

/* ============================================
   Result: prompt line + educational reveal
   ============================================ */
.result-prompt {
    margin: 10px auto 0;
    max-width: 90%;
    padding: 9px 16px;
    border-radius: 50px;
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid var(--border-subtle, rgba(212, 168, 83, 0.25));
    color: var(--gold-bright);
    font-size: 0.84rem;
    line-height: 1.5;
    display: none;
}

.edu-section {
    margin-top: 24px;
    padding: 20px 22px 4px;
    border-top: 1px solid var(--border-subtle, rgba(212, 168, 83, 0.18));
    text-align: left;
}

.edu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.movement-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: #1a1a1a;
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 3px 12px rgba(212, 168, 83, 0.35);
}

.edu-period {
    color: var(--text-secondary);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

.edu-block {
    margin-bottom: 18px;
}

.edu-title {
    margin: 0 0 8px;
    font-family: 'Noto Serif SC', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.02em;
}

.edu-text {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.75;
    opacity: 0.94;
}

.edu-traits {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
}

.edu-masters {
    margin: 6px 0 0;
    color: var(--gold);
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

/* Make the tall result modal scrollable */
.modal-content {
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* ============================================
   风格探秘局 — 趣味分析小窗
   ============================================ */
.analysis-section {
    margin-top: 22px;
    padding: 22px 22px 6px;
    border-top: 1px solid var(--border-subtle, rgba(212, 168, 83, 0.18));
    text-align: left;
}

.analysis-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.analysis-icon {
    font-size: 1.3rem;
    animation: sparkle 2.4s ease-in-out infinite;
}

.analysis-title {
    margin: 0;
    font-family: 'Noto Serif SC', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.02em;
}

/* 为什么独特 */
.analysis-unique {
    background: rgba(212, 168, 83, 0.06);
    border: 1px solid rgba(212, 168, 83, 0.22);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: inset 0 0 24px rgba(212, 168, 83, 0.05);
}

.unique-text {
    margin: 0 0 12px;
    color: var(--text-primary);
    font-size: 0.94rem;
    line-height: 1.75;
}

.unique-text::first-letter {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.05rem;
    color: var(--gold-bright);
    font-weight: 700;
}

.hallmarks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hallmark-pill {
    padding: 5px 13px;
    border-radius: 50px;
    background: rgba(212, 168, 83, 0.12);
    border: 1px solid rgba(212, 168, 83, 0.32);
    color: var(--gold-bright);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.hallmark-pill:hover {
    background: rgba(212, 168, 83, 0.22);
    transform: translateY(-1px);
}

.analysis-sub {
    margin: 4px 0 14px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

/* 风格藏在哪里：探秘小窗网格 */
.analysis-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.analysis-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 14px 15px;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.analysis-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--gold-bright), transparent);
    opacity: 0.6;
    transition: opacity 0.25s ease;
}

.analysis-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.analysis-card.open {
    border-color: var(--gold);
    box-shadow: 0 8px 22px rgba(212, 168, 83, 0.18);
}

.analysis-card.open::after {
    opacity: 1;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.card-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.card-aspect {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    color: var(--gold-bright);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.card-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.62;
    color: var(--text-primary);
    opacity: 0.94;
}

.card-more {
    margin: 8px 0 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
    display: none;
}

.analysis-card.open .card-more {
    display: block;
    animation: fadeIn 0.3s ease;
}

.card-toggle {
    display: inline-block;
    margin-top: 9px;
    font-size: 0.72rem;
    color: var(--gold);
    opacity: 0.85;
    letter-spacing: 0.03em;
}

.analysis-card:hover .card-toggle {
    opacity: 1;
}
