/* Payins List - Independent CSS Styles */

/* 现代化变量系统 */
:root {
    --primary: #ff6b35;
    --primary-light: #ff8c61;
    --primary-dark: #e55a2b;
    --secondary: #1e3a8a;
    --accent: #06d6a0;
    --gradient: linear-gradient(135deg, #ff6b35 0%, #ff8c61 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-muted: #9ca3af;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-glass: rgba(255, 255, 255, 0.1);
}

/* 全局重置 */
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Records Container */
.records-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 20px 15px 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 800px;
    margin-top: 0;
}


.list-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 10px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 800px;
    margin-top: 0;
}

/* Report Header */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.report-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin: 0;
    background: linear-gradient(135deg, var(--primary), #e65c2e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.home-link-button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.home-link-button:hover {
    transform: scale(1.1);
    background: white;
    color: var(--primary);
}

.export-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.export-btn:hover {
    transform: scale(1.1);
    background: white;
    color: var(--primary);
}

/* Total Summary Single */
.total-summary-single {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0 12px;
    /*margin-bottom: 20px;*/
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    text-align: center;
}

.summary-item .label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
}

.summary-item .value {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.summary-item-total .value {
    color: #22c55e; /* Green for total amount */
}

.summary-separator {
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(226, 232, 240, 0.6) 15%, 
        #e2e8f0 50%, 
        rgba(226, 232, 240, 0.6) 85%, 
        transparent 100%);
    margin: 8px 0;
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(226, 232, 240, 0.3);
}

/* Unified Control Panel */
.control-panel-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    margin: 0 auto 0px;
    box-sizing: border-box;
    overflow: hidden;
}

.date-navigation-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Date Controls - Horizontal like records.php */
.date-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input {
    flex-grow: 1;
    padding: 8px 0px;
    border: 2px solid #dddddd;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    background-color: #fff;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
    min-width: 140px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

/* Navigation Buttons - Records.php Style */
#prev-day-btn,
#next-day-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #f0f2f5;
    color: #6b7280;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease-in-out;
}

#prev-day-btn:hover,
#next-day-btn:hover {
    background: #e5e7eb;
    color: #374151;
    transform: scale(1.05);
}

#prev-day-btn:active,
#next-day-btn:active {
    transform: scale(0.95);
}

#prev-day-btn:disabled,
#next-day-btn:disabled {
    background: #f9fafb;
    color: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

/* Current Day Indicator */
#current-day-display {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 20px;
    font-weight: 700;
    color: white;
    background-color: #4B5563;
    border: none;
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

#current-day-display.is-today {
    box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.4);
}

/* Horizontal Divider */
.control-panel-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e2e8f0 50%, transparent 100%);
    margin: 0;
    border: none;
}

/* Search Function - Records.php Style (Separate Line) */
.search-records-wrapper {
    position: relative;
    display: flex;
    gap: 12px;
    background: transparent;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 22px;
    pointer-events: none;
    z-index: 1;
    width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input {
    flex-grow: 1;
    padding: 0 20px 0 90px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.6);
    outline: none;
    transition: all 0.2s ease-in-out;
    height: 50px;
    position: relative;
    text-indent: 0;
    min-width: 0;
    display: flex;
    align-items: center;
}

/* 搜索框占位符文字样式 */
.search-input::placeholder {
    font-size: 14px;
    color: #9ca3af;
    font-weight: 400;
    line-height: 20px;
}

.search-input:focus {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease-in-out;
}

.search-button:hover {
    background: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.search-button:active {
    transform: scale(0.95);
}

.clear-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: #f0f2f5;
    color: #6b7280;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
}

.clear-button:hover {
    background: #e5e7eb;
    color: #374151;
}

.clear-button:active {
    transform: scale(0.95);
}

.clear-button.hidden {
    display: none;
}

/* Record Cards */
.record-card {
    background: #fefefe;
    border-radius: 16px;
    padding: 2px 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.record-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


.record-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 卡片分隔线 */
.card-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e5e7eb 20%, #e5e7eb 80%, transparent 100%);
    margin: 2px 0;
}

/* 最高值和最低值卡片特殊样式 */
.max-amount-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.min-amount-card {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.max-amount-card:hover,
.min-amount-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}


.card-header {
    display: flex;
    align-items: center;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    gap: 6px;
}


.record-id-badge {
    background-color: #3b82f6;
    color: white;
    padding: 5px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.record-id-badge:hover {
    background-color: #2563eb;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.record-amount {
    font-size: 20px;
    font-weight: 700;
    color: #22c55e;
}

.record-status {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-failed {
    background: #fee2e2;
    color: #dc2626;
}

.record-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 400;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.card-number {
    font-weight: 700;
    color: #dc2626;
}

.bank-label {
    display: inline-block;
    padding: 2px 6px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.record-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.view-btn {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 20px; /* 圆角效果 */
}

.view-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.close:hover {
    background: white;
    color: var(--primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .records-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 15px;
        padding: 10px;
    }

    .date-navigation-wrapper {
        padding: 8px 6px;
    }


    .search-wrapper {
        gap: 6px;
    }

    .date-input {
        padding: 10px 15px;
        border: 2px solid #dddddd;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        text-align: center;
        background-color: white;
        cursor: pointer;
        outline: none;
        transition: all 0.2s ease-in-out;
    }

    .date-input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    }

    #today-btn {
        background-color: var(--primary-light);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 22px;
        font-weight: 700;
        padding: 8px 16px;
        line-height: 1;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    #today-btn:hover {
        background-color: var(--primary);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    }

    .search-input {
        min-width: 80px;
        padding: 0 20px 0 80px;
        font-size: 28px;
        color: #ff8500;
        font-weight: bold;
        height: 50px;
        display: flex;
        align-items: center;
        line-height: normal;
        transform: translateY(0);
    }

    .search-input::placeholder {
        font-size: 16px;
        color: #9ca3af;
        font-weight: 400;
        line-height: 50px;
        vertical-align: middle;
    }
    

    .nav-btn,
    .today-action-btn,
    .search-btn {
        padding: 6px 8px;
        font-size: 13px;
    }


    .report-header h1 {
        font-size: 24px;
    }

    .home-link-button,
    .export-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .total-summary-single {
        padding: 0 8px;
    }

    .summary-item {
        padding: 6px 8px;
    }

    .summary-item .label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .summary-item .value {
        font-size: 18px;
    }

    .record-card {
        padding: 12px;
        margin-bottom: 8px;
    }

    .record-amount {
        font-size: 18px;
    }

    .detail-row {
        font-size: 13px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .user-nickname {
        font-weight: 600;
        color: #1e293b;
        font-size: 1rem;
    }

    .card-amount {
        font-size: 1.3rem;
        font-weight: 700;
        color: #22c55e;
        margin-left: auto;
    }

    .card-info-grid {
        padding: 4px 0;
        display: grid;
        gap: 2px;
    }

    .info-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .info-label {
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    .info-value {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text);
    }

    .font-mono {
        font-family: 'Courier New', Courier, monospace;
    }

    /* 时间信息项特殊布局 */
    .time-info-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .time-info-left,
    .time-info-right {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .time-info-right {
        margin-left: auto;
    }

    /* 时间标签和值都统一为浅灰色 */
    .time-info-left .info-label,
    .time-info-right .info-label,
    .time-info-left .time-value,
    .time-info-right .time-value {
        color: var(--text-muted) !important;
    }

    /* 时间值样式统一为灰色 */
    .time-value {
        color: var(--text-muted) !important;
        font-weight: 400;
    }

    /* 时间标签和值使用更小的字体 */
    .time-label-small,
    .time-font-small {
        font-size: 0.75rem !important;
    }

    .card-footer {
        margin-top: auto;
        padding-top: 6px;
        border-top: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
}

    .card-footer-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .status-badge {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 0.7rem;
        font-weight: 600;
    }


    .bank-badge {
        background: #e9ecef;
        color: #495057;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 0.75rem;
    }

    .image-btn {
        background-color: #f0f0f0;
        border: 1px solid #ddd;
        color: #555;
        border-radius: 12px;
        padding: 4px 10px;
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .image-btn:hover {
        background-color: #e0e0e0;
    }

    .no-data {
        text-align: center;
        padding: 40px;
        color: #6c757d;
        grid-column: 1 / -1;
    }

    .loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.7);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .loading-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    .spinner {
        border: 4px solid rgba(0, 0, 0, 0.1);
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border-left-color: var(--primary);
        animation: spin 1s ease infinite;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    .summary-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        text-align: center;
    }

    .summary-item .label {
        font-size: 13px;
        font-weight: 500;
        color: #64748b;
        margin-bottom: 6px;
    }

    .summary-item .value {
        font-size: 22px;
        font-weight: 700;
        color: #1e293b;
    }

    .summary-item-total .value {
        color: #22c55e; /* Green for total amount */
    }

    .summary-separator {
        width: 2px;
        background: linear-gradient(to bottom, 
            transparent 0%, 
            rgba(226, 232, 240, 0.6) 15%, 
            #e2e8f0 50%, 
            rgba(226, 232, 240, 0.6) 85%, 
            transparent 100%);
        margin: 6px 0;
        border-radius: 2px;
        box-shadow: 0 0 3px rgba(226, 232, 240, 0.3);
    }

    .today-action-btn {
        background-color: var(--primary);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 22px;
        font-weight: 700;
        cursor: default; /* Not a real button */
        padding: 8px 16px;
        line-height: 1;
    }

    #current-day-display {
        background-color: #f1f5f9; /* Comfortable gray */
        color: #1e293b; /* Dark text for contrast */
        margin-right: 10px;
    }

    /* Image Modal Styles */
    .image-modal {
        display: none; /* Hidden by default */
        position: fixed; /* Stay in place */
        z-index: 10000; /* Sit on top */
        left: 0;
        top: 0;
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        overflow: auto; /* Enable scroll if needed */
        background-color: rgba(0, 0, 0, 0.8); /* Black w/ opacity */
        justify-content: center;
        align-items: center;
    }

    .modal-content {
        margin: auto;
        display: block;
        max-width: 90%;
        max-height: 90%;
        transition: opacity 0.3s ease;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    /* 独立的图片加载器 */
    .image-loader {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10002;
        display: none;
    }

    .image-loader.active {
        display: block;
    }

    .loader-spinner {
        width: 50px;
        height: 50px;
        border: 4px solid rgba(255, 255, 255, 0.3);
        border-top: 4px solid #ff6b35;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    .close-modal {
        position: fixed;
        top: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        background: #ff6b35; /* Comfortable orange background */
        border-radius: 50%;
        color: #ffffff; /* White X symbol */
        font-size: 24px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
        z-index: 10001;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .close-modal:hover,
    .close-modal:focus {
        background: #ff8555; /* Lighter orange on hover */
        color: #ffffff; /* Keep white X symbol */
        text-decoration: none;
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    }

    /* Back to Top Button */
    .back-to-top {
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        background: #ff6b35; /* Comfortable orange background */
        border: 1px solid rgba(255, 107, 53, 0.3);
        border-radius: 50%;
        display: none; /* Hidden by default */
        justify-content: center;
        align-items: center;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
        opacity: 0;
        transform: translateY(20px);
    }

    .back-to-top.visible {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }

    .back-to-top:hover {
        background: #ff8555; /* Lighter orange on hover */
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    }

    .back-to-top:active {
        transform: translateY(0);
        background: #e55a2b; /* Darker orange on click */
    }

    .back-to-top i {
        color: #ffffff; /* White icon */
        font-size: 20px;
        transition: color 0.2s ease;
    }

    .back-to-top:hover i {
        color: #ffffff; /* Keep white on hover */
    }

    /* Mobile Close Button Adjustments */
    .close-modal {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        background: #ff6b35; /* Comfortable orange background */
        color: #ffffff; /* White X symbol */
        font-size: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    }

    /* Daily Extrema Component */
    .daily-extrema {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #ffffff;
        border-radius: 16px;
        padding: 10px 20px;
        /*margin-bottom: 12px;*/
        border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
        backdrop-filter: blur(10px);
    }

    .extrema-item {
        flex: 1;
        text-align: center;
    }

    .extrema-item:first-child {
        border-right: 1px solid #e9ecef;
    }

    /* 为所有extrema项添加右边框 */
    .extrema-item {
        position: relative;
        padding: 0 15px;
    }

    /* 为extrema项之间添加竖线分隔 */
    .extrema-item:not(:last-child)::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 30px;
        background-color: #e9ecef;
    }

    /* 为图表按钮前的分隔线 */
    #toggle-chart-btn {
        margin-left: 10px;
        padding-left: 15px;
        position: relative;
    }

    /* 图表按钮前的装饰竖线 */
    #toggle-chart-btn::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 24px;
        background-color: #e9ecef;
    }

    .extrema-label {
        display: inline;
        font-size: 14px;
        color: var(--text-secondary);
        margin-right: 8px;
    }

    .extrema-value {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.2;
    }

    /* 最高值和最低值颜色标识 */
    #highest-item .extrema-value {
        color: #f59e0b; /* 金色，与max-amount-card边框颜色一致 */
        text-shadow: 0 1px 2px rgba(245, 158, 11, 0.3);
    }

    #lowest-item .extrema-value {
        color: #3b82f6; /* 蓝色，与min-amount-card边框颜色一致 */
        text-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
    }

    .extrema-time {
        font-size: 14px;
        font-weight: 500;
        color: var(--text-secondary);
        margin-left: 4px;
    }

    /* 最高值和最低值时间标签颜色 */
    #highest-item .extrema-time {
        color: #d97706; /* 深金色，比主值颜色稍深 */
    }

    #lowest-item .extrema-time {
        color: #2563eb; /* 深蓝色，比主值颜色稍深 */
    }

    .extrema-clickable {
        cursor: pointer;
        transition: all 0.3s ease;
        padding: 8px 12px;
        border-radius: 12px;
        margin: -8px -12px;
    }

    .extrema-clickable:hover {
        background: rgba(0, 0, 0, 0.05);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* 悬停时增强颜色效果 */
    #highest-item:hover .extrema-value {
        color: #d97706; /* 悬停时更亮的金色 */
        text-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
    }

    #lowest-item:hover .extrema-value {
        color: #2563eb; /* 悬停时更亮的蓝色 */
        text-shadow: 0 2px 4px rgba(59, 130, 246, 0.4);
    }

    #highest-item:hover .extrema-time {
        color: #b45309; /* 悬停时更亮的深金色 */
    }

    #lowest-item:hover .extrema-time {
        color: #1d4ed8; /* 悬停时更亮的深蓝色 */
    }

    .extrema-clickable:active {
        transform: translateY(0);
    }

    /* 高亮动画 */
    @keyframes highlight-card {
        0% {
            box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
            transform: scale(1);
        }
        50% {
            box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
            transform: scale(1.02);
        }
        100% {
            box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
            transform: scale(1);
        }
    }

    .highlight-animation {
        animation: highlight-card 1s ease-in-out;
    }

    #toggle-chart-btn {
        padding: 8px 12px;
        font-size: 14px;
        border: 1px solid var(--primary);
        background-color: transparent;
        color: var(--primary);
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-left: 10px;
        padding-left: 15px;
        position: relative;
    }

    /* 图表按钮前的装饰竖线 */
    #toggle-chart-btn::before {
        content: '';
        position: absolute;
        left: -10px;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 24px;
        background-color: #e9ecef;
    }

    #toggle-chart-btn:hover {
        background-color: var(--primary);
        color: white;
    }

    #toggle-chart-btn.active {
        background-color: var(--primary);
        color: white;
    }

    /* Chart Container */
    .chart-container-wrapper {
        position: relative;
        height: 400px;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border-radius: 20px;
        padding: 24px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.6);
        margin-bottom: 24px;
        backdrop-filter: blur(10px);
    }

    .chart-container-wrapper h3 {
        margin: 0 0 20px;
        font-size: 20px;
        font-weight: 700;
        color: var(--text-primary);
        text-align: center;
    }

    #hourly-chart {
        width: 100% !important;
        height: calc(100% - 40px) !important;
    }

    /* Records Table Styles */
    .records-table-wrapper {
        position: relative;
        border-radius: 12px;
        overflow: hidden;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
        backdrop-filter: blur(10px);
        margin-bottom: 24px;
    }

    /* Spinner in records table - default hidden state */
    .records-table-wrapper .spinner {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
        z-index: 10;
        display: none; /* Initially hidden */
    }

    .records-table-wrapper.loading::after {
        opacity: 1;
        visibility: visible;
    }

    .records-table-wrapper.loading .spinner {
        opacity: 1;
        visibility: visible;
    }

    .records-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 10px;
    }

    .records-table th, .records-table td {
        padding: 12px 4px;
        text-align: left;
        border-bottom: 1px solid #e2e8f0;
    }

    .records-table th {
        background-color: rgba(117, 117, 117, 0.1);
        font-weight: 600;
    }

    .records-table th:first-child {
        border-right: 1px solid #e2e8f0;
    }

    .records-table tbody tr:not(.row-highest):not(.row-lowest) {
        background-color: #f3f4f6;
    }

    .records-table tbody tr:nth-child(odd):not(.row-highest):not(.row-lowest) {
        background-color: #f9f9f9;
    }

    .records-table tbody tr:hover {
        background-color: #f1f1f1;
    }

    .records-table tbody tr.row-highest {
        background-color: #fff3cd !important;
        position: relative;
    }

    .records-table tbody tr.row-highest td:first-child {
        border-top-left-radius: 8px;
        border-bottom-left-radius: 8px;
    }

    .records-table tbody tr.row-highest td:last-child {
        border-top-right-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    .records-table tbody tr.row-lowest {
        background-color: #ffe4e1 !important;
    }

    .records-table tr:last-child td {
        border-bottom: none;
    }

    .amount-positive {
        color: #28a745;
        font-weight: 600;
        font-size: 1.1em;
    }

    .amount-negative {
        color: #dc3545;
        font-weight: 600;
        font-size: 1.1em;
    }

    .time-cell, .subtotal-cell {
        font-size: 0.9em;
        color: #888888;
    }

    .user-cell {
        white-space: nowrap;
        border-right: 1px solid #e2e8f0;
    }

    .no-records {
        text-align: center;
        padding: 40px;
        color: var(--text-secondary);
        font-size: 16px;
    }

    /* Footer Section */
    .footer-section {
        text-align: center;
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .back-button {
        display: inline-block;
        padding: 10px 20px;
        background-color: var(--primary);
        color: white;
        text-decoration: none;
        border-radius: 8px;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .back-button:hover {
        background-color: #e55a2b;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    }

    /* Diff tag styles */
    .diff-tag {
        display: inline-block;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.8em;
        font-weight: 500;
        margin-left: 8px;
    }

    .diff-short {
        background-color: #d4edda;
        color: #155724;
    }

    .diff-medium {
        background-color: #fff3cd;
        color: #856404;
    }

    .diff-long {
        background-color: #f8d7da;
        color: #721c24;
    }

    .diff-neutral {
        background-color: #e9ecef;
        color: #6c757d;
    }

}