* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f8ff;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #4682b4;
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

/* --- 修改开始 --- */
/* 将 .summary 容器改为 Flexbox 布局 */
.summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    /* --- 新增属性 --- */
    font-size: 26px; /* 设置容器内所有文字的基础大小 */
    color: #0b6ebf;   /* 设置容器内所有文字的颜色 (深灰色) */

    /* --- 新增属性如下 --- */

    /* 1. 背景颜色 */
    background-color: #f0f7ff; /* 设置一个柔和的淡蓝色背景 */

    /* 2. 边框阴影 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* 添加一个自然的阴影效果 */

    /* 3. (推荐) 为了美观，增加内边距和圆角 */
    padding: 20px;             /* 在内容和边框之间增加 20px 的空间 */
    border-radius: 10px;       /* 将边框设置为 10px 的圆角 */
}

/* 修改 .card 的宽度以精确适应 Flexbox 布局和 gap */
.card {
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    /* 核心：宽度 = 50% - (gap的一半) */
    width: calc(50% - 10px); 
}
/* --- 修改结束 --- */

.card h2 {
    margin-top: 0;
    color: #4682b4;
}

.charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.records h2 {
    color: #4682b4;
}

#records-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: auto;
}

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

#records-table th {
    background-color: #add8e6;
    color: #333;
    font-weight: bold;
}

#records-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

#year-selector {
    cursor: pointer;
    text-decoration: underline;
}

#records-table th {
    background-color: #add8e6;
    color: #333;
}

.records button {
    background-color: #4682b4;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}

.records button:hover {
    background-color: #5a9bd5;
}

footer {
    text-align: center;
    margin-top: 20px;
}

#add-record-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background-color: #4682b4;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#add-record-btn:hover {
    background-color: #5a9bd5;
}

@media (min-width: 768px) {
    .charts {
        grid-template-columns: repeat(2, 1fr);
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#record-form .form-group {
    margin-bottom: 15px;
}

#record-form label {
    display: block;
    margin-bottom: 5px;
}

#record-form input[type="date"],
#record-form input[list],
#record-form input[type="number"],
#record-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#record-form button[type="submit"] {
    background-color: #4682b4;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#record-form button[type="submit"]:hover {
    background-color: #5a9bd5;
}
