* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", Arial, sans-serif;
}

body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #121212;
    color: #e0e0e0;
}

.container {
    background: #1e1e2e;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    border: 1px solid #333344;
}

h1 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 24px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333344;
}

h2 {
    color: #bbbbff;
    margin-bottom: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 20px;
    background-color: #5d8aa8;
    margin-right: 10px;
    border-radius: 2px;
}

.base-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    align-items: end;
}

.five-col-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 500;
    color: #ccccdd;
    margin-bottom: 6px;
    font-size: 14px;
}

input, select {
    padding: 10px 12px;
    border: 1px solid #444455;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    height: 44px;
    background-color: #2a2a3a;
    color: #e0e0e0;
}

input:focus, select:focus {
    outline: none;
    border-color: #5d8aa8;
    box-shadow: 0 0 0 3px rgba(93, 138, 168, 0.2);
}

/* 单选按钮组样式 */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #5d8aa8;
}

.radio-option label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

/* 说明文本样式 */
.description {
    margin-top: 15px;
    padding: 12px 15px;
    background-color: #2a2a3a;
    border-radius: 6px;
    font-size: 13px;
    color: #aaaaaa;
    line-height: 1.5;
    border-left: 4px solid #5d8aa8;
}

.btn-container {
    text-align: center;
    margin: 30px 0;
}

button {
    padding: 12px 40px;
    background-color: #5d8aa8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button:hover {
    background-color: #4a7896;
    transform: translateY(-2px);
}

button:disabled {
    background-color: #555577;
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    padding: 20px;
    display: none;
    color: #5d8aa8;
    font-size: 0.95rem;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(93, 138, 168, 0.3);
    border-radius: 50%;
    border-top-color: #5d8aa8;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

.error {
    color: #ff6666;
    padding: 12px 15px;
    background-color: rgba(255, 102, 102, 0.08);
    border-radius: 6px;
    margin: 15px 0;
    display: none;
    border-left: 4px solid #ff6666;
}

/* 结果区域 */
.result-section {
    margin-top: 30px;
    padding: 25px;
    background: #2a2a3a;
    border-radius: 10px;
    display: none;
    border: 1px solid #333344;
}

.result-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444455;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.result-item {
    background: #1e1e2e;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #333344;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: box-shadow 0.3s;
}

.result-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.result-label {
    font-weight: 600;
    color: #ccccdd;
    margin-bottom: 8px;
    font-size: 13px;
}

.result-value {
    font-size: 1.3rem;
    color: #ffffff;
    font-weight: 700;
}

/* 表格样式 */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

.summary-table th, .summary-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #333344;
}

.summary-table th {
    background-color: #2a2a3a;
    color: #ffffff;
    font-weight: 600;
}

.summary-table tr:nth-child(even) {
    background-color: #252536;
}

.summary-table tr:hover {
    background-color: #2f2f40;
}

.result-section h3 {
    color: #bbbbff;
}

/* 建研院标识样式 */
.institute-label {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #8888aa;
    font-size: 16px;
    font-weight: normal;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* 图表容器 */
.chart-container {
    margin-top: 30px;
    padding: 20px;
    background: #1e1e2e;
    border-radius: 8px;
    border: 1px solid #333344;
    height: 500px;
    position: relative;
}

/* 确保canvas元素填充容器 */
#hourlyLoadChart {
    width: 100% !important;
    height: 100% !important;
}

/* AI分析窗口样式 - 在页面最下方 */
.ai-analysis-container {
    margin-top: 40px;
    background: #1e1e2e;
    border-radius: 8px;
    border: 1px solid #333344;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.ai-analysis-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #2a2a3a, #1a1a2a);
    color: #ffffff;
    border-bottom: 1px solid #333344;
}

.ai-analysis-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.ai-icon {
    font-size: 20px;
    margin-right: 10px;
}

.ai-analysis-body {
    padding: 20px;
    background: #1e1e2e;
}

.ai-analysis-content {
    font-size: 13px;
    line-height: 1.6;
    color: #ccccdd;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.ai-analysis-content::-webkit-scrollbar {
    width: 6px;
}

.ai-analysis-content::-webkit-scrollbar-track {
    background: #2a2a3a;
    border-radius: 3px;
}

.ai-analysis-content::-webkit-scrollbar-thumb {
    background: #5d8aa8;
    border-radius: 3px;
}

.ai-analysis-loading {
    padding: 10px 0;
}

.ai-loading-text {
    font-weight: 600;
    color: #5d8aa8;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.ai-loading-dots {
    color: #5d8aa8;
    font-weight: normal;
    margin-left: 5px;
}

.ai-analysis-description {
    padding: 15px;
    background: #2a2a3a;
    border-radius: 6px;
    border-left: 3px solid #5d8aa8;
}

.ai-analysis-description p {
    margin-bottom: 10px;
    color: #ccccdd;
}

.ai-analysis-description ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.ai-analysis-description li {
    margin-bottom: 5px;
    color: #aaaaaa;
}

.ai-disclaimer {
    font-size: 12px;
    color: #888888;
    font-style: italic;
    padding-top: 10px;
    border-top: 1px solid #444455;
}

/* 响应式适配 */
@media (max-width: 900px) {
    .base-grid {
        grid-template-columns: 1fr 1fr;
    }
    .five-col-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .result-grid {
        grid-template-columns: 1fr 1fr;
    }
    h1 {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .base-grid {
        grid-template-columns: 1fr;
    }
    .five-col-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 15px;
    }
    .chart-container {
        height: 400px;
    }
}
