/* 全局样式重置与基础配置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn, .history-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 头部标题 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    color: #2c3e50;
    margin-bottom: 10px;
}

/* 表单区域 */
.form-area {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-item {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

    input:focus, select:focus {
        border-color: #4285f4;
        outline: none;
        box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
    }

/* 日期输入组 */
.date-input-group {
    display: flex;
    gap: 10px;
}

.date-btn {
    padding: 10px 16px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.date-tip {
    font-size: 12px;
    color: #777;
    margin-top: 4px;
}

/* 配置组样式 */
.config-group {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
}

.config-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

    .config-item label {
        min-width: 120px;
    }

.rate-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

    .rate-group select, .rate-group input {
        flex: 1;
        min-width: 120px;
    }

/* 按钮样式 */
.btn {
    width: 100%;
    padding: 12px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .btn:hover {
        background-color: #3367d6;
    }

.calculate-btn {
    margin-bottom: 30px;
}

.small-btn {
    padding: 6px 12px;
    font-size: 14px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

/* 结果操作区 */
.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

    .result-actions .btn {
        flex: 1;
    }

/* 结果区域 */
.result-area {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.result-item {
    margin-bottom: 10px;
    padding: 8px 0;
}

.total {
    font-size: 18px;
    font-weight: 600;
    color: #d32f2f;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

/* 分段明细表格样式 */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}

    .detail-table th, .detail-table td {
        padding: 10px;
        text-align: left;
        border: 1px solid #ddd;
    }

    .detail-table th {
        background-color: #f9f9f9;
        font-weight: 600;
        color: #555;
    }

    .detail-table tr:nth-child(even) {
        background-color: #f5f5f5;
    }

.detail-section {
    margin: 15px 0;
}

.toggle-btn {
    background: none;
    border: none;
    color: #4285f4;
    cursor: pointer;
    padding: 5px 0;
}

/* 规则说明区域 */
.rule-area {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.rule-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}

.rule-content {
    font-size: 14px;
    color: #666;
}

/* 错误提示 */
.error-tip {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* 警告提示 */
.warning-tip {
    color: #f57c00;
    font-size: 13px;
    margin-top: 8px;
    padding: 8px;
    background-color: #fff8e1;
    border-radius: 4px;
}

/* 历史记录面板 */
.history-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 1000;
    overflow-y: auto;
}

    .history-panel.show {
        transform: translateX(0);
    }

.history-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-controls {
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 1px solid #eee;
}

.history-list {
    padding: 10px 20px;
}

.history-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .history-item:hover {
        background-color: #f9f9f9;
    }

    .history-item .time {
        font-size: 12px;
        color: #777;
        margin-bottom: 5px;
    }

/* 术语提示 */
.term {
    color: #4285f4;
    cursor: help;
    text-decoration: underline dotted;
}

.term-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    max-width: 300px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
