/* 历史记录部分样式 */
#records-section {
    display: none;
}

#records-section.active {
    display: block;
}

/* 无充电记录提示样式 */
.no-charge-message {
    text-align: center;
    color: #999;
    font-size: 16px;
    font-weight: 500;
    padding: 20px 0;
}

.record-list {
    margin-top: 0;
}

/* 控件容器样式 */
.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

/* 删除模式控件样式 */
.delete-mode-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-mode-btn {
    padding: 6px 12px;
    height: 32px;
    background-color: #ff3b30;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
}

.delete-mode-btn:hover {
    background-color: #ff1a0d;
}

.confirm-delete-btn {
    padding: 6px 12px;
    height: 32px;
    background-color: #ff9500;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
}

.confirm-delete-btn:hover {
    background-color: #e68600;
}

.cancel-delete-btn {
    padding: 6px 12px;
    height: 32px;
    background-color: #8e8e93;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
}

.cancel-delete-btn:hover {
    background-color: #7f7f85;
}

/* 筛选控件样式 */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 自定义筛选控件样式 */
.custom-filter-container {
    position: relative;
    min-width: 150px;
    font-size: 1rem;
}

.custom-filter-selected {
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    background-color: white;
    color: #1d1d1f;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.custom-filter-selected:hover {
    border-color: #0071e3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.custom-filter-selected:active,
.custom-filter-selected.active {
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25);
}

.filter-arrow {
    transition: transform 0.3s ease;
}

.filter-arrow.rotated {
    transform: rotate(180deg);
}

.custom-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(210, 210, 215, 0.6);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.custom-filter-dropdown.show {
    display: block;
}

.filter-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option:hover {
    background-color: #f5f5f7;
}

.filter-option.selected {
    background-color: #e5f1ff;
    color: #0071e3;
    font-weight: 600;
}

.filter-controls button {
    padding: 8px 12px;
    background-color: #34c759;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn {
    padding: 6px 12px;
    height: 32px;
    background-color: #34c759;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.filter-btn i.fas.fa-check {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn:hover {
    background-color: #2db44d;
}

.filter-controls button i.fas.fa-check {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-controls button:hover {
    background-color: #2db44d;
}

.import-export-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-btn,
.delete-mode-btn {
    font-size: clamp(0.8rem, 0.6rem + 1vw, 1rem);
    line-height: 1.1;
}

.delete-mode-btn i {
    font-size: 0.95em;
    margin-right: 6px;
}

.export-dropdown .menu-item-btn {
    font-size: clamp(0.85rem, 0.65rem + 0.8vw, 1rem);
}

.export-menu {
    position: relative;
}

.export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 6px;
    display: none;
    min-width: 140px;
    z-index: 100;
}

.export-dropdown.show {
    display: block;
}

.menu-item-btn {
    width: 100%;
    padding: 8px 12px;
    background: #fff;
    color: #1d1d1f;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
}

.menu-item-btn:hover {
    background-color: #f5f5f7;
}

.record-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
}

.record-item.highlight {
    background-color: #e3f2fd;
    border-left: 4px solid #0071e3;
}

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

/* 删除模式下的记录项样式 */
.record-content.delete-mode {
    cursor: pointer;
    padding-left: 50px;
}

.record-content.delete-mode:hover {
    background-color: #f5f5f7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.record-content.delete-mode.selected {
    background-color: #ffebee;
    border-left: 4px solid #ff3b30;
}

.record-checkbox {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ff3b30;
    border-radius: 4px;
}

.record-checkbox:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

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

.charger-name {
    font-weight: 600;
    color: #1d1d1f;
}

.record-date {
    color: #6e6e73;
    font-size: 0.9rem;
}

.record-amount {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0071e3;
}

.record-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-duration {
    font-size: 1rem;
    color: #6e6e73;
}

.record-status {
    font-size: 0.8rem;
    color: #0071e3;
    background-color: #e3f2fd;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

#noRecordsMessage {
    text-align: center;
    color: #6e6e73;
    padding: 40px 0;
}

@media (max-width: 640px) {
    .filter-btn,
    .delete-mode-btn {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
}

@media (max-width: 400px) {
    .filter-btn,
    .delete-mode-btn {
        font-size: 0.82rem;
        padding: 6px 8px;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* 滑动编辑相关样式 */
.record-item {
    position: relative;
    padding: 0; /* 移除原来的内边距，交给 record-content */
    overflow: hidden; /* 隐藏超出的操作按钮 */
    background-color: #fff; /* 确保背景色 */
}

.record-content {
    position: relative;
    padding: 15px;
    background-color: #fff;
    z-index: 2;
    transition: transform 0.3s ease-out;
    width: 100%;
}

.record-content.swiping {
    transition: none; /* 拖动时移除过渡效果 */
}

/* 开启状态下的样式 */
.record-item.swiped-open .record-content {
    transform: translateX(-80px);
}

.record-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px; /* 编辑按钮区域宽度 */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    z-index: 1;
}

.edit-record-btn {
    color: white;
    background-color: #0071e3;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.3);
    /* 初始隐藏状态：向右偏移并缩小 */
    transform: translateX(40px) scale(0.7);
    opacity: 0;
    /* 弹性过渡效果 */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, background-color 0.2s;
}

.edit-record-btn.swiping {
    transition: none;
}

/* 开启状态下的按钮样式 */
.record-item.swiped-open .edit-record-btn {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.edit-record-btn:active,
.record-item.swiped-open .edit-record-btn:active {
    background-color: #005bbd;
}

.edit-record-btn i {
    font-size: 1.4rem;
}