/* === 花间幽梦 · AI 美学赏析 === */

.dreams-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* Hero */
.dreams-hero {
    text-align: center;
    padding: 50px 0 20px;
}
.dreams-tag {
    font-size: 0.8em;
    letter-spacing: 4px;
    color: var(--florint-gold, #B8860B);
    text-transform: uppercase;
    margin-bottom: 8px;
}
.dreams-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.4em;
    font-weight: 700;
    letter-spacing: 8px;
    color: #2C2C2C;
    margin: 0 0 16px;
    border: none;
    padding: 0;
}
.dreams-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 20px 0;
}
.dreams-divider span {
    display: block;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #B8860B, transparent);
}
.dreams-divider i {
    color: var(--florint-primary, #C03312);
    font-size: 1em;
    font-style: normal;
    opacity: 0.6;
}
.dreams-desc {
    font-size: 0.95em;
    color: #666;
    line-height: 2;
    margin: 0;
}

/* Upload Area */
.dreams-upload-area {
    margin: 30px auto;
    max-width: 560px;
    border: 2px dashed rgba(192, 51, 18, 0.2);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(247, 245, 240, 0.5);
}
.dreams-upload-area:hover,
.dreams-upload-area.drag-over {
    border-color: var(--florint-primary, #C03312);
    background: rgba(192, 51, 18, 0.03);
    transform: scale(1.01);
}
.dreams-upload-icon {
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.7;
}
.dreams-upload-text {
    font-size: 1.05em;
    color: #2C2C2C;
    font-weight: 500;
    margin: 0 0 8px;
    letter-spacing: 1px;
}
.dreams-upload-hint {
    font-size: 0.85em;
    color: #999;
    margin: 0;
}

/* Preview Area */
.dreams-preview-area {
    max-width: 560px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.dreams-preview-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}
.dreams-preview-wrap img {
    display: block;
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: #faf8f3;
}
.dreams-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.dreams-remove-btn:hover {
    background: var(--florint-primary, #C03312);
}

/* Analyze Button */
.dreams-analyze-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 14px 36px;
    font-size: 1.05em;
    font-family: 'Noto Serif SC', serif;
    letter-spacing: 3px;
    color: #fff;
    background: linear-gradient(135deg, #C03312 0%, #8B2500 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(192, 51, 18, 0.25);
}
.dreams-analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(192, 51, 18, 0.35);
}
.dreams-analyze-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.dreams-analyze-btn.loading {
    background: linear-gradient(135deg, #888 0%, #666 100%);
}

/* Spinner */
.dreams-spinner {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dreams-spin 0.8s linear infinite;
    margin-right: 8px;
}
@keyframes dreams-spin {
    to { transform: rotate(360deg); }
}

/* Result Area */
.dreams-result {
    max-width: 700px;
    margin: 40px auto;
    animation: dreams-fade-in 0.6s ease;
}
@keyframes dreams-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.dreams-result-header {
    text-align: center;
    margin-bottom: 32px;
}
.dreams-result-header h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.4em;
    letter-spacing: 4px;
    color: #2C2C2C;
    margin: 0 0 16px;
    border: none;
    padding: 0;
}
.dreams-result-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--florint-primary, #C03312), transparent);
    margin: 0 auto;
}
.dreams-result-content {
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.95em;
    color: #444;
    line-height: 2;
}
.dreams-result-content p {
    margin: 0 0 12px;
    text-align: justify;
}
.dreams-result-content .result-section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.15em;
    color: var(--florint-primary, #C03312);
    font-weight: 600;
    margin: 24px 0 12px;
    padding: 0;
    border: none;
    letter-spacing: 2px;
}
.dreams-result-content .result-section-title:first-child {
    margin-top: 0;
}
.dreams-result-content .result-sub-title {
    font-size: 1em;
    color: #2C2C2C;
    font-weight: 600;
    margin: 16px 0 6px;
    padding: 0;
    border: none;
}
.dreams-result-content ul {
    padding-left: 1.5em;
    margin: 8px 0;
}
.dreams-result-content li {
    margin-bottom: 6px;
    color: #555;
    line-height: 1.8;
}
.dreams-result-content strong {
    color: #2C2C2C;
    font-weight: 600;
}
.dreams-result-footer {
    text-align: center;
    margin-top: 32px;
}
.dreams-retry-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 28px;
    font-size: 0.95em;
    font-family: 'Noto Serif SC', serif;
    letter-spacing: 2px;
    color: var(--florint-primary, #C03312);
    background: transparent;
    border: 1px solid var(--florint-primary, #C03312);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}
.dreams-retry-btn:hover {
    background: var(--florint-primary, #C03312);
    color: #fff;
}

/* Error */
.dreams-error {
    max-width: 560px;
    margin: 20px auto;
    padding: 16px 24px;
    background: rgba(192, 51, 18, 0.06);
    border: 1px solid rgba(192, 51, 18, 0.15);
    border-radius: 8px;
    color: var(--florint-primary, #C03312);
    font-size: 0.9em;
    text-align: center;
}

/* History Section */
.dreams-history {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.dreams-history-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.2em;
    text-align: center;
    letter-spacing: 3px;
    color: #2C2C2C;
    margin-bottom: 24px;
    border: none;
    padding: 0;
}
.dreams-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.history-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    cursor: default;
}
.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.history-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}
.history-excerpt {
    padding: 12px 14px 6px;
    font-size: 0.82em;
    color: #666;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.history-date {
    display: block;
    padding: 0 14px 12px;
    font-size: 0.75em;
    color: #aaa;
}
.history-item {
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.history-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.dreams-history-pagination {
    text-align: center;
    margin-top: 20px;
}
.history-page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px;
    height: 32px;
    line-height: 32px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #666;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}
.history-page-btn:hover,
.history-page-btn.active {
    background: var(--florint-primary, #C03312);
    color: #fff;
    border-color: var(--florint-primary, #C03312);
}

/* Responsive */
@media (max-width: 600px) {
    .dreams-title { font-size: 1.6em; letter-spacing: 4px; }
    .dreams-upload-area { padding: 32px 16px; }
    .dreams-result-content { padding: 24px 18px; }
    .dreams-container { padding: 0 16px 40px; }
    .dreams-history-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .history-item img { height: 100px; }
}

/* === History Detail Modal === */
.dreams-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dreams-modal-fade-in 0.3s ease;
}
@keyframes dreams-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.dreams-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}
.dreams-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: dreams-modal-slide-up 0.35s ease;
}
@keyframes dreams-modal-slide-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.dreams-modal-close {
    position: sticky;
    top: 12px;
    float: right;
    margin-right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    color: #666;
}
.dreams-modal-close:hover {
    background: var(--florint-primary, #C03312);
    color: #fff;
}
.dreams-modal-image {
    padding: 24px 24px 0;
    text-align: center;
}
.dreams-modal-image img {
    max-width: 100%;
    max-height: 50vh;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.dreams-modal-analysis {
    padding: 24px 32px 32px;
    font-size: 0.95em;
    color: #444;
    line-height: 2;
}
.dreams-modal-analysis p {
    margin: 0 0 12px;
    text-align: justify;
}
.dreams-modal-analysis .modal-section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.15em;
    color: var(--florint-primary, #C03312);
    font-weight: 600;
    margin: 24px 0 12px;
    padding: 0;
    border: none;
    letter-spacing: 2px;
}
.dreams-modal-analysis .modal-section-title:first-child {
    margin-top: 0;
}
.dreams-modal-analysis .modal-sub-title {
    font-size: 1em;
    color: #2C2C2C;
    font-weight: 600;
    margin: 16px 0 6px;
    padding: 0;
    border: none;
}
.dreams-modal-analysis ul {
    padding-left: 1.5em;
    margin: 8px 0;
}
.dreams-modal-analysis li {
    margin-bottom: 6px;
    color: #555;
    line-height: 1.8;
}
.dreams-modal-analysis strong {
    color: #2C2C2C;
    font-weight: 600;
}
@media (max-width: 600px) {
    .dreams-modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 12px;
    }
    .dreams-modal-image {
        padding: 16px 16px 0;
    }
    .dreams-modal-analysis {
        padding: 16px 20px 24px;
    }
}