/* 多计数器列表样式 */
.counter-section {
    margin: 30px 0;
}

.counter-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.primary-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.primary-btn:hover {
    background-color: #0056b3;
}

.secondary-btn {
    background-color: #6c757d;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

/* 计数器容器 */
#counters-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.empty-state {
    text-align: center;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
    color: #6c757d;
}

/* 单个计数器样式 */
.counter-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.counter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.counter-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.counter-display {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
}

.counter-controls-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.counter-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.decrement-btn {
    background-color: #dc3545;
    color: white;
}

.decrement-btn:hover {
    background-color: #c82333;
}

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

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

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

.increment-btn:hover {
    background-color: #218838;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 可排序列表样式 */
.sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sortable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: move;
}

.sortable-item:hover {
    background-color: #e9ecef;
}

.sortable-item-name {
    font-weight: bold;
}

.delete-counter {
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
}

.delete-counter:hover {
    color: #c82333;
}

.edit-instructions {
    margin-bottom: 15px;
    color: #6c757d;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .counter-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .counter-btn {
        padding: 10px;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
}

@media (min-width: 768px) {
    #counters-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}
