/* 办公桌风水分析页面样式 */

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

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

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

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

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

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

section {
    margin-bottom: 40px;
}

section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Upload area */
.upload-area {
    position: relative;
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-prompt svg {
    color: #667eea;
    margin-bottom: 15px;
}

.upload-prompt p {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
}

.upload-prompt .hint {
    color: #999;
    font-size: 0.9em;
}

.preview {
    position: relative;
}

.preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
}

.btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
}

/* Bazi form */
.info-text {
    color: #666;
    margin-bottom: 20px;
}

.form-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.bazi-form {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

/* Action section */
.action-section {
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-analyze {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 1;
    max-width: 300px;
}

.btn-analyze:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

.stream-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stream-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Result section */
.result-section {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Score card */
.score-card {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 15px;
    margin-bottom: 30px;
}

.score-circle {
    position: relative;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 10;
}

.score-fill {
    fill: none;
    stroke: #667eea;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 408;
    stroke-dashoffset: 408;
    transition: stroke-dashoffset 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
}

.score-label {
    font-size: 1em;
    color: #999;
}

.score-info h3 {
    color: #333;
    margin-bottom: 10px;
}

.score-info p {
    color: #666;
    line-height: 1.6;
}

.bazi-info {
    margin-top: 15px;
}

.badge {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-right: 10px;
}

.badge-xishen {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8b4513;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.xishen-suggestion {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #ffd700 !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3) !important;
}

.xishen-suggestion .suggestion-reason {
    font-weight: 600;
    color: #8b4513;
    font-size: 1.05em;
}

.badge-jishen {
    background: #fff3e0;
    color: #f57c00;
}

/* Items grid */
.items-card, .suggestions-card {
    padding: 25px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    margin-bottom: 25px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.item-tag {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.item-tag:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.item-position {
    font-size: 0.85em;
    color: #666;
}

/* Suggestions list */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.suggestion-item {
    padding: 20px;
    background: white;
    border-left: 4px solid;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.suggestion-item.priority-high {
    border-left-color: #f44336;
    background: #fff5f5;
}

.suggestion-item.priority-medium {
    border-left-color: #ff9800;
    background: #fff8f0;
}

.suggestion-item.priority-low {
    border-left-color: #4caf50;
    background: #f5fff5;
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.suggestion-title {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.suggestion-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-high {
    background: #ffebee;
    color: #c62828;
}

.badge-medium {
    background: #fff3e0;
    color: #e65100;
}

.badge-low {
    background: #e8f5e9;
    color: #2e7d32;
}

.suggestion-detail {
    color: #666;
    line-height: 1.6;
    margin-bottom: 5px;
}

.suggestion-reason {
    color: #888;
    font-size: 0.9em;
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    opacity: 0.8;
}

/* 分类建议样式 */
.categorized-suggestions {
    display: grid;
    gap: 20px;
}

.category-section {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.category-header {
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.category-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* 物品位置可视化 */
.items-visualization {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.desk-layout {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 20px auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    border: 3px solid #667eea;
}

.desk-area {
    position: absolute;
    border: 2px dashed rgba(102, 126, 234, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: 600;
    color: #667eea;
}

.desk-area.left {
    left: 10%;
    top: 20%;
    width: 30%;
    height: 60%;
    background: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
}

.desk-area.right {
    right: 10%;
    top: 20%;
    width: 30%;
    height: 60%;
    background: rgba(255, 152, 0, 0.1);
    border-color: #ff9800;
}

.desk-area.front {
    left: 20%;
    top: 5%;
    width: 60%;
    height: 15%;
    background: rgba(233, 30, 99, 0.1);
    border-color: #e91e63;
}

.desk-area.back {
    left: 20%;
    bottom: 5%;
    width: 60%;
    height: 15%;
    background: rgba(0, 188, 212, 0.1);
    border-color: #00bcd4;
}

.desk-area.center {
    left: 35%;
    top: 35%;
    width: 30%;
    height: 30%;
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

/* 建议卡片增强 */
.suggestion-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.suggestion-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* 评分卡片增强 */
.score-card {
    position: relative;
    overflow: hidden;
}

.score-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .score-card {
        flex-direction: column;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
    
    .action-section {
        flex-direction: column;
    }
    
    .btn-analyze {
        max-width: 100%;
    }
}

/* LLM分析区域 */
.llm-status {
    padding: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.llm-content {
    line-height: 1.8;
    color: #333;
    min-height: 100px;
}

.llm-content.streaming {
    border-left: 3px solid #667eea;
    padding-left: 15px;
}

.llm-content p {
    margin: 10px 0;
}

.llm-content h4 {
    margin: 20px 0 10px 0;
    color: #667eea;
}

.llm-content h5 {
    margin: 15px 0 8px 0;
    color: #764ba2;
}

.llm-content .error {
    color: #e74c3c;
    padding: 15px;
    background: #fee;
    border-radius: 5px;
    border-left: 3px solid #e74c3c;
}

.stream-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stream-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

