
:root {
    --color-bg-primary: #1e232d;
    --color-bg-panel: #0e1b2c;
    --color-bg-hover: #1f477a;
    --color-state-hover: #1f477a;
    --color-text-primary: #e0e0e0;
    --color-text-tertiary: #888888;
    --color-text-plate: #01bcdd;
    --color-function-red: #D22222;
    --color-border: #333333;
    --color-scrollbar: #555;
    --color-scrollbar-hover: #ff9900;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--color-bg-primary) !important;
    color: var(--color-text-primary) !important;
    font-family: "Microsoft YaHei", "JetBrains Mono", "Roboto Mono", Consolas, Monaco, "PingFang SC", monospace !important;
}

* {
    border-radius: 0 !important;
}

/* 滚动条样式对齐豆宝主表格（db.css）：
 * 3px 细条、thumb #555、hover #ff9900、track 透明、thumb 圆角 10px。
 * 项目全局有 border-radius:0 !important，会压掉 thumb 圆角，
 * 因此此处需显式恢复，否则与豆宝不一致。 */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
    display: block;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 10px !important;
    background: var(--color-scrollbar);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-scrollbar-hover);
}

::-webkit-scrollbar-track {
    background: transparent;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-scrollbar) transparent;
}

* {
    -ms-overflow-style: none;
}

#container {
    width: 100%;
    height: 100%;
    background: var(--color-bg-primary);
    padding: 0;
    position: relative;
    margin: 0 auto;
}

.chart {
    padding: 0;
    margin-top: 0;
}

/* 横向滚动容器：图表按「可见天数 × 单日占位宽」定宽后在此横向滚动。
 * 高度严格 100vh、无上下外边距 —— 保证图例首屏即贴屏幕顶部，
 * 且页面总高恰好一屏，首次打开不出现纵向滚动条。 */
.chart-scroll {
    width: 100%;
    height: 100vh;
    margin-top: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

#chart {
    height: 100%;
    margin-top: 0;
}

.loading-tip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    padding: 20px 30px;
    z-index: 9999;
    text-align: center;
    min-width: 280px;
}

.loading-text {
    color: var(--color-text-primary);
    font-size: 14px;
    margin-bottom: 8px;
}

.loading-progress {
    color: var(--color-text-plate);
    font-size: 12px;
}

.loading-tip.hidden {
    display: none;
}

/* 说明书开关「…」：间距与字号对齐豆宝 .toolbar-ellipsis
 * （right:10px / top:0 + margin-top:3px / font-size:11px / line-height:17px） */
.manual-open {
    position: fixed;
    top: 0;
    right: 10px;
    width: 10px;
    height: 5px;
    margin-top: 3px;
    background: none;
    border: none;
    padding: 0;
    border-radius: 0px;
    font-size: 11px;
    line-height: 17px;
    color: #555555;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    user-select: none;
}

/* 与豆宝 .toolbar-ellipsis::before 一致：
 * 视觉尺寸不变，仅向外扩 8px 提升点击热区 */
.manual-open::before {
    content: "";
    position: absolute;
    top: -8px;
    right: -8px;
    bottom: -8px;
    left: -8px;
}

.manual-open:hover {
    color: #ff9900;
}

.manual-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483005;
}

.manual-modal[hidden] {
    display: none;
}

.manual-modal-content {
    width: 100%;
    height: 100%;
    background: #1e232d;
    overflow: hidden;
    position: relative;
}

.manual-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}
