/* style.css */

:root {
    --primary: #e83f55;
    --background: #FFF5E4;
    --card-add-btn-color: #f28693;
    --card-sub-btn-color: #B4D4A5;
    --card-add-btn-text-color: white;
    --card-sub-btn-text-color: #006400;
}

body {
    font-family: 'Comic Sans MS', cursive, fangsong, ui-rounded;
    background: var(--background);
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1400px) {
    .container {
        max-width: 1300px;
    }
}

h1 {
    color: var(--primary);
    text-align: center;
    font-size: 4em;
    text-shadow: 1px 1px #f4cfe3;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 img {
    margin-right: 20px;
}

.control-panel {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

button {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}

.sort-btn {
    background: #ffc699;
    color: white;
    font-size: 15px;
}

.batch-add {
    background: #f28693;
    color: white;
    font-size: 16px;
}

.batch-sub {
    background: #B4D4A5;
    color: white;
    font-size: 16px;
}

.student-card .add-btn {
    background: var(--card-add-btn-color);
    color: var(--card-add-btn-text-color);
    font-size: 14px;
}

.student-card .sub-btn {
    background: var(--card-sub-btn-color);
    color: var(--card-sub-btn-text-color);
    font-size: 14px;
}

/* .student-card .exchange-btn {
    width: 105px;
    height: 40px;
    padding: 10px 20px;
    font-size: 14px;
    background: #f8e8b4;
    color: #8b4513;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
} */

.exchange-btn:hover {
    transform: scale(1.05);
}
 
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 修改这里 */
    gap: 15px;
}

@media (max-width: 768px) {
    .card-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.student-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.student-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 15px;
    background: var(--secondary);
    border-radius: 50%;
    opacity: 0.3;
}

.score-box {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.operation-btns,
.coin-exchange {
    display: grid;
    gap: 10px;
}

.operation-btns {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 15px;
}

.coin-exchange {
    grid-template-columns: 1fr 1.2fr;
    margin-top: 15px;
    align-items: center;
}

.coin-exchange input {
    width: 100%;
    box-sizing: border-box;
}

.student-card .exchange-btn {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.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: #fff;
    margin: 15% auto;
    padding: 20px;
    border-radius: 15px;
    width: 340px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover {
    color: black;
    cursor: pointer;
}

.modal-btns {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-btn {
    background: #B4DAB5;
    color: #006400;
}

.cancel-btn {
    background: #DE7F7D;
    color: #8b0000;
}

.score-buttons {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.score-btn-modal {
    min-width: 50;
    margin: 5px;
    padding: 8px 8px;
    border-radius: 5px;
    border: none;
    background: #e0e0e0;
    cursor: pointer;
    font-size: 16px;
}

.score-btn-modal:hover {
    background: #d0d0d0;
}

.modal-content input {
    width: 80%;
    margin-bottom: 20px;
}

.score-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.score-btn-modal {
    margin: 5px;
    padding: 8px 12px;
    border-radius: 5px;
    border: none;
    background: #e0e0e0;
    cursor: pointer;
    width: 40px;
}

.score-btn-modal:hover {
    background: #d0d0d0;
}

.student-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
}

.batch-coin {
    background: #FADFA7;
    color: #8b4513;
    font-size: 16px;
}

.toggle-select-all {
    background: #C5D8E7;
    color: white;
    font-size: 16px;
}

.total-points {
    font-size: 0.8em;
    color: #4CAF50;
    margin-left: 10px;
}

#exchangeModal .modal-content {
    width: 340px;
}

#exchangeModal .modal-content h2 {
    margin-bottom: 15px;
}

#exchangeModal .modal-content p {
    margin-bottom: 20px;
}

.total-points {
    font-size: 0.9em; /* 调整字体大小 */
    color: #d73e3e; /* 调整颜色 */
    margin-left: 15px; /* 调整与姓名间距 */
}

#exchangeModal .modal-content .score-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

#exchangeModal .modal-content .score-btn-modal {
    margin: 5px;
    padding: 8px 12px;
    border-radius: 5px;
    border: none;
    background: #e0e0e0;
    cursor: pointer;
    width: 40px;
}

#exchangeModal .modal-content .score-btn-modal:hover {
    background: #d0d0d0;
}

#exchangeModal .modal-content .score-btn-modal.selected {
    background-color: #4CAF50;
    color: white;
}
/* ... 之前的 CSS 样式 ... */

.login-form {
    width: 400px; /* 增加宽度 */
    padding: 30px; /* 增加内边距 */
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: absolute; /* 使用绝对定位 */
    top: 50%; /* 垂直居中 */
    left: 50%; /* 水平居中 */
    transform: translate(-50%, -50%); /* 调整位置 */
}

.login-form input {
    width: calc(100% - 22px); /* 考虑边框和内边距 */
    padding: 10px;
    margin-bottom: 30px; /* 增加间距 */
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px; /* 增加字体大小 */
}

.login-form button {
    width: 100%;
    padding: 12px; /* 增加内边距 */
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px; /* 增加字体大小 */
}

.login-form button:hover {
    background: #d43449;
}