/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* 页面容器 */
.page {
    display: none;
    height: 100vh;
    overflow: hidden;
}

.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    padding: 20px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

/* 开始页面样式 */
#start-page .main-title {
    font-size: 2rem;
    text-align: center;
    color: #4CAF50;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-image {
    text-align: center;
    margin: 15px 0;
}

.hero-image img {
    max-width: 100%;
    max-height: 35vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin: 15px 0;
    text-align: center;
}

.input-group label {
    display: block;
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 10px;
}

.input-group input {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #4CAF50;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: #388E3C;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

/* 按钮样式 */
.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #388E3C 0%, #4CAF50 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1976D2 0%, #2196F3 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#start-btn {
    display: block;
    margin: 15px auto 0;
}

/* 场景页面样式 */
#scene-page {
    padding: 0;
}

#scene-page.active {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.scene-header {
    background: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.scene-time {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4CAF50;
}

.carbon-display {
    font-size: 1rem;
    color: #FF9800;
    font-weight: bold;
}

.scene-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

.scene-image {
    width: 100%;
    max-width: 800px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.scene-image img {
    width: 100%;
    max-height: 30vh;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.scene-question {
    text-align: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.scene-question p {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
}

.choices {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 700px;
    flex-shrink: 0;
}

.choice-btn {
    flex: 1;
    min-width: 180px;
    padding: 15px;
    background: white;
    border: 3px solid #4CAF50;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.choice-btn:hover {
    background: #E8F5E9;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.choice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.choice-btn:disabled:hover {
    background: white;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.choice-text {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.choice-carbon {
    font-size: 0.95rem;
    color: #666;
}

/* 进度条 */
.progress-bar {
    background: white;
    padding: 10px 15px;
    position: relative;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.progress-fill {
    height: 8px;
    background: linear-gradient(90deg, #4CAF50 0%, #66BB6A 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 1rem;
    color: #666;
}

/* 结果页面样式 */
.result-title {
    font-size: 1.6rem;
    text-align: center;
    color: #4CAF50;
    margin-bottom: 15px;
}

.result-summary {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.total-carbon-box {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.carbon-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #FF9800;
}

.carbon-unit {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.rating-box {
    text-align: center;
    padding: 20px;
}

.rating-stars {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.rating-text {
    font-size: 1.1rem;
    color: #4CAF50;
    font-weight: bold;
}

.chart-container {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 15px;
    max-height: 250px;
}

.suggestions {
    margin: 15px 0;
    padding: 15px;
    background: #FFF3E0;
    border-radius: 15px;
    border-left: 5px solid #FF9800;
}

.suggestions h3 {
    color: #F57C00;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.suggestions ul {
    list-style: none;
    padding-left: 0;
}

.suggestions li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.95rem;
    color: #555;
}

.suggestions li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #FF9800;
    font-size: 1.3rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

/* 反馈提示 */
.feedback-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.feedback-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.feedback-success {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

.feedback-warning {
    background: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-height: 95vh;
    }

    #start-page .main-title {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }

    .hero-image {
        margin: 10px 0;
    }

    .hero-image img {
        max-height: 25vh;
    }

    .input-group {
        margin: 10px 0;
    }

    .input-group label {
        font-size: 1rem;
    }

    #start-btn {
        margin: 10px auto 0;
        padding: 12px 30px;
        font-size: 1rem;
    }

    .scene-header {
        padding: 10px;
    }

    .scene-time {
        font-size: 1rem;
    }

    .carbon-display {
        font-size: 0.9rem;
    }

    .scene-content {
        padding: 10px 15px;
    }

    .scene-image {
        margin-bottom: 10px;
    }

    .scene-image img {
        max-height: 25vh;
    }

    .scene-question {
        margin-bottom: 10px;
    }

    .scene-question p {
        font-size: 1rem;
    }

    .choices {
        gap: 10px;
    }

    .choice-btn {
        min-width: 100%;
        padding: 12px;
    }

    .choice-text {
        font-size: 1rem;
    }

    .choice-carbon {
        font-size: 0.9rem;
    }

    .progress-bar {
        padding: 8px 10px;
    }

    .result-title {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .result-summary {
        margin: 10px 0;
        gap: 10px;
    }

    .total-carbon-box,
    .rating-box {
        padding: 15px;
    }

    .carbon-number {
        font-size: 2rem;
    }

    .rating-stars {
        font-size: 1.5rem;
    }

    .chart-container {
        margin: 10px 0;
        padding: 10px;
        max-height: 180px;
    }

    .suggestions {
        margin: 10px 0;
        padding: 12px;
    }

    .suggestions h3 {
        font-size: 1rem;
    }

    .suggestions li {
        font-size: 0.85rem;
    }

    .action-buttons {
        gap: 10px;
        margin-top: 10px;
    }

    .action-buttons .btn {
        width: 100%;
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* 小屏手机优化 */
@media (max-width: 480px) {
    .scene-image img {
        max-height: 20vh;
    }

    .hero-image img {
        max-height: 20vh;
    }

    .chart-container {
        max-height: 150px;
    }
}

/* 图片加载动画 */
.image-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #E8F5E9;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    text-align: center;
    margin-top: 15px;
    color: #4CAF50;
    font-size: 0.9rem;
    font-weight: 500;
}

.image-container img {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.image-container img.loaded {
    opacity: 1;
}
