body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    font-size: 24px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.form button {
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #28a745;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}

.form button:hover {
    background-color: #218838;
}

.counter {
    margin-bottom: 10px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    position: relative;
}

.counter h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.counter .controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.counter span {
    font-size: 18px;
    font-weight: bold;
}

.counter button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #007bff;
    color: #fff;
    font-size: 14px;
}

.counter button:hover {
    background-color: #0056b3;
}

.counter .show-list-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background-color: #ffc107;
    color: #333;
    cursor: pointer;
    font-size: 14px;
}

.counter .show-list-button:hover {
    background-color: #e0a800;
}

/* 悬浮窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
}

.modal-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

#quantity-items {
    list-style-type: none;
    padding: 0;
}

#quantity-items li {
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
}

#total-quantity {
    font-weight: bold;
    color: #333;
}

/* 算术式部分 */
.arithmetic-section {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#arithmetic-expression {
    flex: 1;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#copy-arithmetic {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

#copy-arithmetic:hover {
    background-color: #0056b3;
}

/* 撤销和重做按钮样式 */
.controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#undo-button,
#redo-button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

#undo-button:hover,
#redo-button:hover {
    background-color: #0056b3;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 20px;
    }

    .form input,
    .form button {
        font-size: 14px;
    }

    .counter h3 {
        font-size: 16px;
    }

    .counter span {
        font-size: 16px;
    }

    .counter button {
        font-size: 12px;
    }

    .counter .show-list-button {
        font-size: 12px;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .modal-content h3 {
        font-size: 16px;
    }

    #arithmetic-expression {
        font-size: 12px;
    }

    #copy-arithmetic {
        font-size: 12px;
    }

    #undo-button,
    #redo-button {
        font-size: 12px;
        padding: 6px 10px;
    }
}
#quantity-items li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
}

#quantity-items li button {
    padding: 3px 6px;
    border: none;
    border-radius: 4px;
    background-color: #ff4d4d;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
}

#quantity-items li button:hover {
    background-color: #cc0000;
}
/* 导出悬浮窗样式 */
#export-modal .modal-content {
    max-width: 400px;
}

#export-modal label {
    display: block;
    margin: 10px 0;
}

#export-counter-list label {
    display: block;
    margin: 5px 0;
    padding: 5px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

#export-counter-list label:hover {
    background-color: #f0f0f0;
}

#export-modal button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

#export-modal button:hover {
    background-color: #0056b3;
}