/**
 * 走势图页面布局：冻结表头/行头/指标列通过独立滚动容器 + Canvas 同步实现。
 */
:root {
    --bg: #f4f5f7;
    --border: #c8ccd4;
    --toolbar-bg: #fff;
    --header-h: 56px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.app-body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
    background: var(--bg);
    color: #1a1d24;
}

.trend-page {
    max-width: 100%;
    padding: 0.5rem 0.75rem 2rem;
}

.page-header {
    margin-bottom: 0.5rem;
}

.page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.65rem;
    background: var(--toolbar-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.tb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.tb-item input[type="number"] {
    width: 5.5rem;
}

.tb-status {
    font-size: 0.78rem;
    color: #3d6;
    min-height: 1.2em;
}

.tb-status.is-err {
    color: #c33;
}

.trend-shell {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    /* 总宽超过视口时整体横向滚动；避免中间列 flex 撑满产生「假第三区」空白 */
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

.trend-frozen-top {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    background: #eef0f4;
}

.corner-wrap {
    flex: 0 0 auto;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8ebf2;
}

.head-main-scroll {
    /* 宽度由 JS 设为与主数据区 Canvas 一致（含纵向滚动条占位），禁止 flex 生长 */
    flex: 0 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
    background: #eef0f4;
}

.head-feat-wrap {
    flex: 0 0 auto;
    border-left: 1px solid var(--border);
    background: #e8ebf2;
}

.trend-frozen-mid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-height: min(78vh, 900px);
    min-height: 320px;
}

.row-label-scroll {
    flex: 0 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: #fafbfc;
}

.body-scroll {
    flex: 0 0 auto;
    overflow: auto;
    min-width: 0;
    position: relative;
    scrollbar-gutter: stable;
}

.feat-scroll {
    flex: 0 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    border-left: 1px solid var(--border);
    background: #fafbfc;
}

/**
 * 与中间 body 同步纵向滚动，但不绘制可见滚动条（避免左右+中间双条）。
 * 滚动仍由 JS 同步 scrollTop，故无障碍滚动能力保留。
 */
.vscroll-slave {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.vscroll-slave::-webkit-scrollbar {
    width: 0;
    height: 0;
}

canvas {
    display: block;
    vertical-align: top;
}

.ad-placeholder {
    border: 1px dashed #ccc;
    color: #999;
    font-size: 0.75rem;
    text-align: center;
    padding: 0.35rem;
    margin: 0.35rem 0;
    border-radius: 4px;
}

.ad-slot {
    margin: 0.35rem 0;
    min-height: 0;
}

/* --- サイト共通フッター（説明・免責・プライバシー） --- */
.site-footer {
    margin-top: 2rem;
    padding: 1.5rem 0.75rem 2rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, #eef0f4 0%, var(--bg) 100%);
}

.site-footer__inner {
    max-width: 52rem;
    margin: 0 auto;
}

.site-footer__about {
    padding: 1rem 1.1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.site-footer__title {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1d24;
    letter-spacing: 0.02em;
}

.site-footer__subtitle {
    margin: 1.1rem 0 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #2c3240;
}

.site-footer__text {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    line-height: 1.65;
    color: #3d4454;
}

.site-footer__text:last-of-type {
    margin-bottom: 0;
}

.site-footer__closing {
    margin: 1rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    font-size: 0.82rem;
    line-height: 1.55;
    color: #4a5163;
    font-style: italic;
}

.site-footer__privacy {
    margin-top: 1rem;
    text-align: center;
}

.site-footer__privacy-link {
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-footer__privacy-link:hover {
    color: #1d4ed8;
}
