/* Tech Dashboard Global Variables */
:root {
    /* Tech Dashboard Color Palette */
    --tech-dark-bg: #0a0e17;
    --tech-dark-surface: #111827;
    --tech-dark-card: #1f2937;
    --tech-dark-border: #374151;

    /* Accent Colors */
    --tech-accent-blue: #3b82f6;
    --tech-accent-cyan: #06b6d4;
    --tech-accent-purple: #8b5cf6;
    --tech-accent-green: #10b981;
    --tech-accent-red: #ef4444;
    --tech-accent-yellow: #f59e0b;

    /* Glowing Effects */
    --tech-glow-blue: rgba(59, 130, 246, 0.5);
    --tech-glow-cyan: rgba(6, 182, 212, 0.5);
    --tech-glow-purple: rgba(139, 92, 246, 0.5);
    --tech-glow-green: rgba(16, 185, 129, 0.5);
    --tech-glow-red: rgba(239, 68, 68, 0.5);
    --tech-glow-yellow: rgba(245, 158, 11, 0.5);

    /* Text Colors */
    --tech-text-primary: rgba(255, 255, 255, 0.92);
    --tech-text-secondary: rgba(255, 255, 255, 0.7);
    --tech-text-tertiary: rgba(255, 255, 255, 0.45);

    /* Legacy Variables Mapping */
    --primary-color: var(--tech-accent-blue);
    --secondary-color: var(--tech-accent-purple);
    --accent-color: var(--tech-accent-cyan);
    --background-color: var(--tech-dark-bg);
    --card-bg-color: var(--tech-dark-card);
    --text-color: var(--tech-text-primary);
    --text-light: var(--tech-text-secondary);
    --border-color: var(--tech-dark-border);
    --success-color: var(--tech-accent-green);
    --warning-color: var(--tech-accent-yellow);
    --danger-color: var(--tech-accent-red);
    --info-color: var(--tech-accent-cyan);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

/* Tech Dashboard Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--tech-dark-bg);
    color: var(--tech-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    background-image: url('tech-grid-bg.svg');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow-x: hidden;
}

/* Container Styles */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Dashboard Header Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 30px;
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid var(--tech-dark-border);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: var(--tech-shadow-md);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--tech-accent-blue), var(--tech-accent-purple));
}

.dashboard-title-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tech-logo {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 0 10px var(--tech-glow-blue));
}

.dashboard-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--tech-text-primary);
    margin: 0 0 5px 0;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.dashboard-subtitle {
    font-size: 14px;
    color: var(--tech-text-secondary);
    margin: 0;
}

/* Tech Dashboard Table Styles */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 20px 0;
    background-color: var(--tech-dark-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--tech-shadow-md);
    table-layout: fixed;
    border: 1px solid var(--tech-dark-border);
}

.tableDiv {
    height: 700px;
    overflow-y: scroll !important; /* Force vertical scrolling */
    overflow-x: auto; /* Enable horizontal scrolling for mobile */
    border-radius: var(--border-radius);
    box-shadow: var(--tech-shadow-md);
    background-color: var(--tech-dark-card);
    margin-bottom: 30px;
    border: 1px solid var(--tech-dark-border);
    position: relative;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--tech-accent-blue) var(--tech-dark-card); /* Firefox */
}

.tableDiv::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--tech-accent-blue), var(--tech-accent-purple));
    border-radius: 3px 3px 0 0;
    z-index: 2; /* Ensure the gradient line stays on top but below sticky headers */
    pointer-events: none; /* Make sure it doesn't interfere with scrolling */
}

th,
td {
    padding: 15px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid var(--tech-dark-border);
    color: var(--tech-text-secondary);
    white-space: nowrap; /* Prevent text wrapping for better mobile view */
}

th {
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    color: var(--tech-text-primary);
    background: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); /* For Safari support */
    margin-top: 3px; /* Add space for the gradient line */
}

/* Add horizontal scrolling for tables on mobile */
@media (max-width: 768px) {
    table {
        min-width: 800px; /* Ensure table has minimum width for scrolling */
    }

    th, td {
        padding: 10px 8px;
        font-size: 13px;
    }

    /* Ensure scrollbars are visible on mobile */
    .tableDiv::-webkit-scrollbar {
        -webkit-appearance: none;
        width: 7px;
        height: 7px;
    }

    .tableDiv::-webkit-scrollbar-thumb {
        border-radius: 4px;
        background-color: rgba(59, 130, 246, 0.5);
        -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
    }
}

#stat th {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.8), rgba(139, 92, 246, 0.6));
    color: white;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

#new th {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.8), rgba(59, 130, 246, 0.6));
    color: white;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
    transition: var(--transition);
}

/* Tech Dashboard Header Styles */
.head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--tech-dark-border);
    background: var(--tech-glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--tech-shadow-md);
}

/* Tech Button Styles */
#reStat,
#orderInfo {
    background: rgba(16, 185, 129, 0.2);
    color: var(--tech-text-primary);
    padding: 10px 20px;
    border: 1px solid var(--tech-accent-green);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--tech-shadow-sm);
    position: relative;
    overflow: hidden;
}

#reStat::after,
#orderInfo::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(16, 185, 129, 0) 0%,
        rgba(16, 185, 129, 0.3) 50%,
        rgba(16, 185, 129, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

#reStat:hover,
#orderInfo:hover {
    background: rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--tech-glow-green);
}

#reStat:hover::after,
#orderInfo:hover::after {
    animation: tech-btn-shine 1.5s ease-out;
}

@keyframes tech-btn-shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
        opacity: 0;
    }
    20% {
        opacity: 0.5;
    }
    100% {
        transform: translateX(100%) rotate(45deg);
        opacity: 0;
    }
}

/* Tech Dashboard Title Styles */
.head #title,
#info {
    font-size: 24px;
    font-weight: 700;
    color: var(--tech-text-primary);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.head #title::before,
#info::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--tech-accent-blue), var(--tech-accent-purple));
    border-radius: 2px;
}

#tip {
    display: inline-block;
    font-size: 18px;
    font-weight: 600;
    color: var(--tech-accent-blue);
    margin: 15px 0;
    padding: 5px 15px;
    border-left: 3px solid var(--tech-accent-cyan);
    background: rgba(59, 130, 246, 0.1);
    border-radius: 0 4px 4px 0;
}

#closeButton {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: var(--tech-text-primary);
    border: 1px solid var(--tech-accent-red);
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    z-index: 10;
}

#closeButton:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--tech-glow-red);
}

/* Tech Dashboard Input Styles */
input[type="date"],
select {
    padding: 10px 15px;
    border: 1px solid var(--tech-dark-border);
    border-radius: 6px;
    font-size: 14px;
    margin-right: 10px;
    background-color: var(--tech-dark-card);
    color: var(--tech-text-primary);
    transition: var(--transition);
}

input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--tech-accent-blue);
    box-shadow: 0 0 0 3px var(--tech-glow-blue);
}

/* Tech Dashboard Action Links */
#seletRangeTime,
#seletRange,
#percentageRefresh,
#percentage,
#profit,
#group,
#orderVolume,
.orderBy,
.tech-action-btn {
    display: inline-block;
    margin-right: 10px;
    padding: 8px 15px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--tech-text-secondary);
    border-radius: 6px;
    border: 1px solid transparent;
    background: rgba(59, 130, 246, 0.05);
    position: relative;
    overflow: hidden;
}

#percentageRefresh:hover,
#percentage:hover,
#profit:hover,
#group:hover,
#orderVolume:hover,
.orderBy:hover,
.tech-action-btn:hover {
    color: var(--tech-accent-blue);
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* Touch-friendly active state for mobile */
#percentageRefresh:active,
#percentage:active,
#profit:active,
#group:active,
#orderVolume:active,
.orderBy:active,
.tech-action-btn:active {
    color: var(--tech-accent-blue);
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
    transform: translateY(1px);
}

.tech-action-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(59, 130, 246, 0) 0%,
        rgba(59, 130, 246, 0.3) 50%,
        rgba(59, 130, 246, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.tech-action-btn:hover::after {
    animation: tech-btn-shine 1.5s ease-out;
}

/* Tech Dashboard Image Styles */
table img {
    border-radius: 6px;
    transition: var(--transition);
    object-fit: cover;
    border: 1px solid var(--tech-dark-border);
}

table img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--tech-glow-blue);
    border-color: var(--tech-accent-blue);
}

/* Tech Dashboard Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
    }

    .dashboard-title-section {
        margin-bottom: 10px;
    }

    .head {
        flex-direction: column;
    }

    .filter-controls {
        width: 100%;
    }

    .action-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .stats-summary #info {
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-info {
        text-align: center;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 120px; /* 移动设备上为固定页脚留出更多空间 */
    }

    .tableDiv {
        height: 500px;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y; /* Improve touch scrolling */
    }

    th, td {
        padding: 10px 8px;
        font-size: 13px;
    }


    #myChart {
        max-height: 350px !important;
    }

    #tip {
        font-size: 16px;
    }

    .head #title,
    #info {
        font-size: 18px;
    }

    .date-selector, .range-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .date-selector input, .range-selector select {
        width: 100%;
        margin: 5px 0;
    }

    .tech-action-btn {
        margin: 5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 80px;
    }

    .stat-item {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .dashboard-title {
        font-size: 20px;
    }

    .dashboard-subtitle {
        font-size: 12px;
    }

    .tech-logo {
        width: 40px;
        height: 40px;
    }

    .filter-tabs {
        padding: 10px;
    }

    .filter-controls {
        padding: 10px;
    }

    .action-links {
        gap: 5px;
    }

    .tech-action-btn {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 70px;
        margin: 3px;
    }

    .footer {
        padding: 15px 0;
    }

    .footer p {
        font-size: 12px;
    }

    .footer-version {
        font-size: 10px;
    }
}

/* Custom Scrollbar Styles */
/* Webkit browsers (Chrome, Safari, newer versions of Opera, etc) */
.tableDiv::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tableDiv::-webkit-scrollbar-track {
    background: var(--tech-dark-card);
    border-radius: 4px;
}

.tableDiv::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

.tableDiv::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Tech Dashboard Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 5px var(--tech-glow-blue); }
    50% { box-shadow: 0 0 15px var(--tech-glow-blue); }
    100% { box-shadow: 0 0 5px var(--tech-glow-blue); }
}

@keyframes dataFlow {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(100%); opacity: 0; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes tech-btn-shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
        opacity: 0;
    }
    20% {
        opacity: 0.5;
    }
    100% {
        transform: translateX(100%) rotate(45deg);
        opacity: 0;
    }
}

.tableDiv {
    animation: fadeIn 0.5s ease-in-out;
}

/* Data Flow Animation */
.data-flow {
    position: absolute;
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--tech-accent-blue), transparent);
    animation: dataFlow 3s linear infinite;
    opacity: 0.6;
    pointer-events: none;
    z-index: -1;
}

/* Rotating Elements */
.tech-rotate {
    animation: rotate 20s linear infinite;
}

/* Tech Dashboard Card Styles */
.card {
    background-color: var(--tech-dark-card);
    border-radius: var(--border-radius);
    box-shadow: var(--tech-shadow-md);
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--tech-dark-border);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--tech-accent-blue), var(--tech-accent-purple));
}

/* Tech Dashboard Filter Controls */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(31, 41, 55, 0.5);
    border-radius: var(--border-radius);
    border: 1px solid var(--tech-dark-border);
}

.date-selector, .range-selector {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(31, 41, 55, 0.3);
    border-radius: 6px;
}

.action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid var(--tech-dark-border);
}

/* Tech Dashboard Stats Summary */
.stats-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: var(--tech-dark-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--tech-dark-border);
    box-shadow: var(--tech-shadow-md);
    position: relative;
    overflow: hidden;
}

.stats-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--tech-accent-blue), var(--tech-accent-purple));
}

.stats-summary #title {
    margin-bottom: 15px;
    color: var(--tech-text-primary);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-summary #title::before {
    content: '';
    display: block;
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, var(--tech-accent-blue), var(--tech-accent-purple));
    border-radius: 2px;
}

.stats-summary #info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    padding: 12px 20px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    font-size: 16px;
    color: var(--tech-text-secondary);
    transition: var(--transition);
}

.stat-item:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.2);
}

.stat-item.profit {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    font-weight: 500;
}

.stat-item.profit:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

.stat-item strong {
    font-weight: 700;
    color: var(--tech-accent-blue);
    margin-right: 5px;
}

/* Tech Dashboard Filter Tabs */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(31, 41, 55, 0.5);
    border-radius: var(--border-radius);
    border: 1px solid var(--tech-dark-border);
    box-shadow: var(--tech-shadow-md);
    position: relative;
    overflow: hidden;
}

.filter-tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--tech-accent-cyan), var(--tech-accent-purple));
}

.section-header {
    margin: 25px 0 15px 0;
    position: relative;
}

/* Tech Dashboard Footer - Fixed at Bottom */
body {
    padding-bottom: 100px; /* 为固定页脚留出空间 */
}

.footer {
    padding: 25px 0;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-top: 1px solid var(--tech-dark-border);
    color: var(--tech-text-primary);
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, var(--tech-accent-blue), var(--tech-accent-purple));
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.footer-logo img {
    filter: drop-shadow(0 0 5px var(--tech-glow-blue));
}

.footer-info {
    text-align: left;
}

.footer p {
    font-size: 14px;
    opacity: 0.8;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    margin: 0;
}

.footer-version {
    font-size: 12px;
    color: var(--tech-text-secondary);
    margin-top: 5px;
}

/* Tech Dashboard Detail Badge */
.detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
    color: var(--tech-text-primary);
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    cursor: pointer;
}

.detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
}