* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    margin-bottom: 30px;
}

.upload-area h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4rem;
}

.upload-box {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-box:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-box.dragover {
    border-color: #667eea;
    background: #e8f2ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #999;
}

.upload-content p {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #666;
}

.upload-content small {
    color: #999;
}

.image-preview {
    margin-top: 20px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.room-input {
    margin-bottom: 30px;
}

.room-input h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4rem;
}

.room-list {
    margin-bottom: 15px;
}

.room-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.room-name {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.room-name:focus {
    outline: none;
    border-color: #667eea;
}

.remove-room {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
}

.remove-room:hover {
    background: #ff5252;
}

.add-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.add-btn:hover {
    background: #45a049;
}

.style-selector {
    margin-bottom: 40px;
}

.style-selector h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.4rem;
    text-align: center;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

.style-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.style-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.style-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.style-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.style-card h4 {
    padding: 12px 8px;
    text-align: center;
    font-size: 0.9rem;
    margin: 0;
}

.generate-section {
    text-align: center;
    margin-bottom: 40px;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.generate-btn.loading .btn-text {
    display: none;
}

.generate-btn.loading .btn-loading {
    display: inline;
}

.btn-loading {
    display: none;
}

.result-section {
    display: none;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

.result-section.show {
    display: block;
}

.result-section h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.6rem;
    text-align: center;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 30px;
    max-width: 1200px;
    margin: 0 auto 30px auto;
}

.result-item {
    background: #f8f9fa;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.result-image-container {
    position: relative;
    overflow: hidden;
    background: #000;
}

.result-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

.result-image:hover {
    transform: scale(1.02);
}

.zoom-hint {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.result-image-container:hover .zoom-hint {
    opacity: 1;
}

.room-analysis {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(255,255,255,0.95);
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #333;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-image-container:hover .room-analysis {
    opacity: 1;
}

.result-info {
    padding: 25px;
}

.result-info h4 {
    margin-bottom: 12px;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.result-info p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.furniture-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.furniture-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #555;
    border-left: 3px solid #667eea;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.furniture-item:hover {
    background: #f0f4ff;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.furniture-number {
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.furniture-name {
    flex: 1;
    font-weight: 500;
}

.external-link {
    margin-left: 8px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 500;
}

.furniture-item:hover .external-link {
    opacity: 1;
}

/* 家具标注样式 */
.furniture-annotations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.furniture-annotation {
    position: absolute;
    pointer-events: all;
    cursor: pointer;
    z-index: 10;
}

.annotation-dot {
    width: 32px;
    height: 32px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 3px solid white;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 0 rgba(102, 126, 234, 0.7); }
    70% { box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 0 rgba(102, 126, 234, 0); }
}

.furniture-annotation:hover .annotation-dot {
    transform: scale(1.2);
    background: #5a67d8;
    animation: none;
}

.annotation-tooltip {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.annotation-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
}

.furniture-annotation:hover .annotation-tooltip {
    opacity: 1;
}

.annotation-tooltip .furniture-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.annotation-tooltip .view-product {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
    color: #a0aec0;
}

.ai-process-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f0f4ff, #e8f2ff);
    border-radius: 10px;
    border: 1px solid #d0e0ff;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 5px;
}

.step-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.step-text {
    font-size: 0.8rem;
    color: #555;
    font-weight: 500;
}

.furniture-header {
    grid-column: 1 / -1;
    margin-bottom: 10px;
}

.furniture-header h5 {
    margin: 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.castlery-info {
    text-align: center;
    padding: 20px;
    background: #f0f4ff;
    border-radius: 10px;
    margin-top: 20px;
}

.castlery-info p {
    font-size: 1.1rem;
    color: #667eea;
}

.castlery-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.castlery-info a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .style-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .style-card img {
        height: 60px;
    }
    
    .style-card h4 {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .result-image {
        height: 400px;
    }
    
    .furniture-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-annotation-dot {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .modal-annotation-tooltip {
        font-size: 0.8rem;
        padding: 10px 14px;
    }
    
    .annotation-dot {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .ai-process-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .process-step {
        padding: 8px 4px;
    }
    
    .step-icon {
        font-size: 1.2rem;
    }
    
    .step-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .style-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .style-card img {
        height: 50px;
    }
    
    .style-card h4 {
        padding: 6px 4px;
        font-size: 0.75rem;
    }
    
    .result-image {
        height: 300px;
    }
}

/* 图片模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    position: relative;
}

.modal-image-container {
    position: relative;
    display: inline-block;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

/* 模态框中的家具标注 */
.modal-furniture-annotations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.modal-furniture-annotation {
    position: absolute;
    pointer-events: all;
    cursor: pointer;
    z-index: 20;
}

.modal-annotation-dot {
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 4px solid white;
    transition: all 0.3s ease;
    animation: modalPulse 2s infinite;
}

@keyframes modalPulse {
    0% { box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 0 rgba(102, 126, 234, 0.7); }
    70% { box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 15px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 0 rgba(102, 126, 234, 0); }
}

.modal-furniture-annotation:hover .modal-annotation-dot {
    transform: scale(1.2);
    background: #5a67d8;
    animation: none;
}

.modal-annotation-tooltip {
    position: absolute;
    bottom: 55px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.2);
}

.modal-annotation-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(0,0,0,0.95);
}

.modal-furniture-annotation:hover .modal-annotation-tooltip {
    opacity: 1;
}

.modal-annotation-tooltip .furniture-name {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.modal-annotation-tooltip .view-product {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    color: #cbd5e0;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.modal-footer p {
    margin: 0;
    color: #667eea;
    font-size: 1rem;
}

.modal-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.modal-footer a:hover {
    text-decoration: underline;
}

.analysis-info {
    background: #e8f2ff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-furniture-list {
    margin: 20px 0;
}

.modal-furniture-list h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-furniture-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.modal-furniture-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #555;
    border-left: 3px solid #667eea;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #e0e0e0;
}

.modal-furniture-item:hover {
    background: #f0f4ff;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.modal-furniture-number {
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.modal-furniture-name {
    flex: 1;
    font-weight: 500;
}

.modal-external-link {
    margin-left: 8px;
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 500;
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-image {
        max-height: 60vh;
    }
    
    .modal-footer {
        padding: 12px 20px;
    }
}

/* Analysis Preview Styles */
.analysis-preview {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #e8f2ff, #f0f4ff);
    border-radius: 10px;
    border: 1px solid #d0e0ff;
}

.analysis-summary h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1rem;
}

.analysis-summary p {
    margin: 5px 0;
    font-size: 0.85rem;
    color: #555;
}

/* Style Details Styles */
.style-details {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.style-details h5 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 1rem;
}

.style-characteristics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.characteristic-item {
    display: flex;
    align-items: flex-start;
    font-size: 0.85rem;
}

.char-label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
    margin-right: 8px;
}

.char-value {
    color: #666;
    flex: 1;
}

/* Furniture Details Styles */
.furniture-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.furniture-reasoning {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}

.furniture-specs {
    font-size: 0.7rem;
    color: #999;
}

/* Room Analysis Details Styles */
.room-analysis-details {
    margin: 20px 0;
    padding: 15px;
    background: #f0f4ff;
    border-radius: 10px;
    border-left: 4px solid #4caf50;
}

.room-analysis-details h5 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 1rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.analysis-item {
    display: flex;
    align-items: flex-start;
    font-size: 0.8rem;
    padding: 5px 0;
}

.analysis-label {
    font-weight: 600;
    color: #555;
    min-width: 70px;
    margin-right: 8px;
}

.analysis-value {
    color: #666;
    flex: 1;
}

@media (max-width: 768px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .style-characteristics {
        gap: 6px;
    }
    
    .characteristic-item {
        flex-direction: column;
        gap: 2px;
    }
    
    .char-label {
        min-width: auto;
        margin-right: 0;
    }
    
    .analysis-item {
        flex-direction: column;
        gap: 2px;
    }
    
    .analysis-label {
        min-width: auto;
        margin-right: 0;
    }
}

/* User Room Image */
.user-room-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 10px;
    margin-top: 15px;
}

.user-room-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 400px;
}

/* Furniture Recommendations */
.furniture-recommendations {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
}

.recommendation-note {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.furniture-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.furniture-card {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e0e0e0;
}

.furniture-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.furniture-card-number {
    width: 32px;
    height: 32px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.furniture-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.furniture-card-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.furniture-card-link {
    font-size: 0.8rem;
    color: #667eea;
}

/* Design Tips */
.design-tips {
    background: linear-gradient(135deg, #f0f4ff, #e8f2ff);
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid #667eea;
}

.tips-content p {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #555;
}

.tips-content strong {
    color: #333;
}

@media (max-width: 768px) {
    .furniture-cards {
        grid-template-columns: 1fr;
    }
}

/* API Key Section */
.api-key-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.api-key-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.api-key-input-group input {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    width: 300px;
    font-size: 0.9rem;
}

.save-key-btn, .clear-key-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.save-key-btn {
    background: #4caf50;
    color: white;
}

.save-key-btn:hover {
    background: #45a049;
}

.clear-key-btn {
    background: #ff6b6b;
    color: white;
    margin-left: 10px;
}

.clear-key-btn:hover {
    background: #ff5252;
}

.api-key-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.api-key-status.success {
    color: #4caf50;
    font-weight: 500;
}

.api-key-help {
    font-size: 0.85rem;
    opacity: 0.8;
}

.api-key-help a {
    color: white;
    text-decoration: underline;
}

/* Loading Container */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-note {
    color: #888;
    font-size: 0.9rem;
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 40px 20px;
    color: #ff6b6b;
}

/* Comparison Images */
.comparison-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.comparison-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s;
}

.comparison-image img:hover {
    transform: scale(1.02);
}

.image-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
}

.generated-result {
    background: linear-gradient(135deg, #f0f4ff, #e8f2ff);
    border: 2px solid #667eea;
}

.furniture-note {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Result Comparison Layout */
.result-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.result-comparison .result-item {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.result-comparison .result-item.designed {
    border: 3px solid #667eea;
}

.result-arrow {
    font-size: 2rem;
    color: #667eea;
    font-weight: bold;
}

.result-image-box {
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.result-image-box img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.design-note {
    background: linear-gradient(135deg, #f0f4ff, #e8f2ff);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.design-note p {
    margin: 0;
    color: #333;
}

.furniture-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.furniture-section h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.furniture-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.furniture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.furniture-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.furniture-card:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.furniture-num {
    width: 28px;
    height: 28px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.furniture-name {
    flex: 1;
    font-size: 0.9rem;
}

.furniture-link {
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .result-comparison {
        flex-direction: column;
    }
    .result-arrow {
        transform: rotate(90deg);
    }
    .furniture-grid {
        grid-template-columns: 1fr;
    }
}

/* Demo Notice */
.demo-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    text-align: center;
}

.demo-notice p {
    margin: 5px 0;
    color: #856404;
}

.demo-notice code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Retry Button */
.retry-btn {
    margin-top: 15px;
    padding: 10px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.retry-btn:hover {
    background: #5a6fd6;
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 40px;
    background: #fff5f5;
    border-radius: 10px;
    border: 1px solid #ffcdd2;
}

.error-container h4 {
    color: #c62828;
    margin-bottom: 10px;
}

.error-container p {
    color: #666;
}
