@import url('https://fonts.googleapis.com/css2?family=Lato');

/* 定义全局色彩变量 */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --link-color: #0072c6;
    --em-color: #aaaaaa;
    --border-color: #e5e5e5;
    --btn-bg: #f0f0f0;
    --btn-color: #333333;
    --btn-hover: #e0e0e0;
    --chart-bg: #ffffff;
}

/* 深色模式下的变量值 */
body.dark-theme {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --link-color: #66b3ff;
    --em-color: #888888;
    --border-color: #444444;
    --btn-bg: #333333;
    --btn-color: #f1f1f1;
    --btn-hover: #555555;
    --chart-bg: #1a1a1a;
}

* { margin: 0; padding: 0; }
html { height: 100%; overflow-y: scroll; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.42857143;
    margin: 0;
    position: relative;
    min-height: 100%;
    /* 核心：添加全局色彩平滑过渡 */
    transition: background-color 0.4s ease, color 0.4s ease;
}

.wrapper { min-height: 100%; height: 100%; margin: 0 auto; padding: 0 10px; }
.container { margin: 0 auto; max-width: 1080px; position: relative; }
.footer { margin-left: auto; margin-right: auto; padding: 20px 10px 10px; }
.footer .container { text-align: center; }
.pull-right { float: right; }
.text-center { text-align: center; }

a, a:hover, a:visited { 
    color: var(--link-color); 
    text-decoration: none; 
    transition: color 0.4s ease; 
}
a:hover { text-decoration: underline; }

#playersw, #playersy { height: 600px; max-width: 1080px; padding: 0 0 30px; text-align: center; }

h2 { font-weight: 400; margin: 0 0 10px; }
h2, ul.stats { font-family: 'Lato', sans-serif; }

ul.stats { list-style-type: none; margin: 0; min-height: 98px; padding: 20px 0; text-align: center; }
ul.stats > li { display: inline-block; line-height: 1.2; min-width: 155px; padding: 0 50px 10px; text-align: center; vertical-align: top; }
ul.stats > li > span { display: block; font-size: 50px; }
ul.stats > li > em { 
    color: var(--em-color); 
    display: block; 
    font-size: 16px; 
    font-style: normal;
    transition: color 0.4s ease;
}

.c-message { font-size: 20px; text-align: center; }
.c-message i { font-size: 30px; }

#weeklybreakdown { padding: 0 0 10px; text-align: center; }
.table { border-collapse: collapse; width: 100%; }
.table tr { 
    border-bottom: 1px solid var(--border-color); 
    height: 40px; 
    padding: 2px 0;
    transition: border-color 0.4s ease;
}
.table th { padding: 5px 0; }
.table td { padding: 0 2px; }

.arrow { display: inline-block; height: 0; margin: 0 8px 3px 0; width: 0; }
.arrow.up { border-bottom: 7px solid #339966; border-left: 7px solid transparent; border-right: 7px solid transparent; }
.arrow.down { border-top: 7px solid #e63900; border-left: 7px solid transparent; border-right: 7px solid transparent; }
.green { color: #339966; }
.red { color: #e63900; }

/* =========================================
   新增：右上角深浅色切换按钮样式
========================================= */
.theme-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--btn-bg);
    color: var(--btn-color);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: background-color 0.4s ease, color 0.4s ease, transform 0.2s ease, box-shadow 0.4s ease;
}

.theme-toggle-btn:hover {
    background-color: var(--btn-hover);
    transform: scale(1.1);
}

body.dark-theme .theme-toggle-btn {
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* =========================================
   新增：Highcharts 图表深色模式适配覆盖
   (通过 CSS 控制 SVG 内元素的平滑过渡)
========================================= */
body.dark-theme .highcharts-background { fill: var(--chart-bg) !important; transition: fill 0.4s ease; }
body.dark-theme .highcharts-text-outline { fill: var(--chart-bg) !important; stroke: var(--chart-bg) !important; transition: fill 0.4s ease, stroke 0.4s ease; }
body.dark-theme .highcharts-title,
body.dark-theme .highcharts-subtitle,
body.dark-theme .highcharts-axis-title,
body.dark-theme .highcharts-legend-item text,
body.dark-theme .highcharts-data-label text,
body.dark-theme .highcharts-axis-labels text { fill: var(--text-color) !important; transition: fill 0.4s ease; }
body.dark-theme .highcharts-grid-line { stroke: var(--border-color) !important; transition: stroke 0.4s ease; }
body.dark-theme .highcharts-axis-line { stroke: var(--border-color) !important; transition: stroke 0.4s ease; }
body.dark-theme .highcharts-tooltip-box { fill: #2b2b2b !important; stroke: var(--border-color) !important; transition: fill 0.4s ease, stroke 0.4s ease; }
body.dark-theme .highcharts-tooltip text { fill: var(--text-color) !important; }
body.dark-theme .highcharts-button-box { fill: #333333 !important; transition: fill 0.4s ease; }
body.dark-theme .highcharts-button text { fill: #cccccc !important; transition: fill 0.4s ease; }
body.dark-theme .highcharts-button:hover .highcharts-button-box { fill: #444444 !important; }