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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 页头 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 区块样式 */
section {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

section:last-child {
    border-bottom: none;
}

section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 24px;
}

/* 参数组 */
.param-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.group-title {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
}

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

.param-input {
    display: flex;
    flex-direction: column;
}

.param-input label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #495057;
    font-size: 14px;
}

.param-input input,
.param-input select {
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.param-input input:focus,
.param-input select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.param-note {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
    padding: 10px;
    background: white;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    margin-top: 10px;
}

/* 按钮 */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 错误提示 */
.error-box {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.error-item {
    margin: 5px 0;
}

/* 日志容器 */
.log-container {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-entry {
    margin: 5px 0;
    padding: 3px 0;
}

.log-entry.info {
    color: #d4d4d4;
}

.log-entry.success {
    color: #4ec9b0;
}

.log-entry.warning {
    color: #dcdcaa;
}

.log-entry.error {
    color: #f48771;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* 债券久期择时表格 - 较小尺寸 */
#timing-table-container table {
    font-size: 13px;
    max-width: 800px;
}

#timing-table-container th,
#timing-table-container td {
    padding: 8px 10px;
}

/* 图表容器 */
.chart-container {
    margin-bottom: 40px;
}

.chart-container h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
}

.chart-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    header h1 {
        font-size: 24px;
    }

    .param-row {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
