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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

h2 {
    color: #555;
    margin: 20px 0 15px;
    font-size: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* 表单样式 */
.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.form-group label {
    width: 100px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* 搜索包装器 */
.search-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper input {
    flex: 1;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.pinyin {
    margin-left: 10px;
    color: #667eea;
    font-weight: bold;
    font-size: 14px;
}

/* 搜索结果下拉框 */
.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.search-item:hover {
    background: #f8f9fa;
}

.search-item:last-child {
    border-bottom: none;
}

.item-pinyin {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
}

/* 按钮样式 */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

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

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

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

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

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
}

.btn-delete:hover {
    background: #c82333;
}

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

table thead {
    background: #667eea;
    color: white;
}

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

table th {
    font-weight: bold;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* 差异颜色 */
.positive {
    color: #28a745;
    font-weight: bold;
}

.negative {
    color: #dc3545;
    font-weight: bold;
}

/* 记录区域 */
.records-section {
    margin: 30px 0;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

/* 操作按钮区域 */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.action-buttons button {
    flex: 1;
}

/* 汇总页面样式 */
.summary-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.summary-controls button {
    flex: 1;
}

/* 统计卡片 */
.statistics {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.positive {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.stat-card.negative {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
}

/* 汇总表格 */
.summary-table {
    margin-top: 30px;
    overflow-x: auto;
}

.summary-section {
    margin-bottom: 30px;
}

/* 登录页 */
.login-page {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: min(420px, 100%);
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-field {
    display: block;
}

.login-field label {
    display: block;
    width: auto;
    margin-bottom: 8px;
}

.login-field input {
    width: 100%;
}

.login-error {
    min-height: 22px;
    margin-top: 12px;
    color: #dc3545;
    text-align: center;
}

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

    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group label {
        margin-bottom: 5px;
    }

    .action-buttons,
    .summary-controls {
        flex-direction: column;
    }

    .statistics {
        flex-direction: column;
    }

    table {
        font-size: 12px;
    }

    table th,
    table td {
        padding: 8px;
    }
}
