전략분봉 저장 에러 문제 수정

This commit is contained in:
Macbook
2026-05-23 21:08:46 +09:00
parent eaf067db1c
commit 70ac67afe7
18 changed files with 2445 additions and 498 deletions
+457
View File
@@ -0,0 +1,457 @@
/* 백테스팅 대시보드 (btd-*) — 금색 포인트 다크 테마 */
.btd-page {
display: flex;
height: calc(100vh - var(--tmb-h, 46px));
overflow: hidden;
background: #0a0e14;
color: #c8d0e0;
font-family: var(--font, 'Noto Sans KR', sans-serif);
}
/* ── 좌측 타임라인 사이드바 (~23%) ── */
.btd-sidebar {
width: 23%;
min-width: 220px;
max-width: 300px;
flex-shrink: 0;
display: flex;
flex-direction: column;
border-right: 1px solid rgba(201, 162, 39, 0.15);
background: #0d1219;
overflow: hidden;
}
.btd-sidebar-head {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 12px 10px;
border-bottom: 1px solid rgba(201, 162, 39, 0.12);
flex-shrink: 0;
}
.btd-sidebar-bar {
width: 3px;
height: 18px;
border-radius: 2px;
background: linear-gradient(180deg, #e8c547, #b8860b);
flex-shrink: 0;
}
.btd-sidebar-title {
margin: 0;
flex: 1;
font-size: 13px;
font-weight: 800;
color: #f0e6c8;
letter-spacing: -0.2px;
}
.btd-sidebar-actions {
display: flex;
gap: 4px;
}
.btd-icon-btn {
width: 28px;
height: 28px;
border-radius: 6px;
border: 1px solid rgba(201, 162, 39, 0.2);
background: rgba(201, 162, 39, 0.06);
color: #c9a227;
font-size: 13px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.btd-icon-btn:hover:not(:disabled) { background: rgba(201, 162, 39, 0.14); }
.btd-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btd-icon-btn--danger { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.btd-sidebar-empty {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 24px;
text-align: center;
color: #6272a4;
font-size: 12px;
gap: 8px;
}
.btd-sidebar-hint { font-size: 11px; opacity: 0.75; line-height: 1.6; }
.btd-timeline {
position: relative;
flex: 1;
overflow-y: auto;
padding: 12px 10px 16px 22px;
}
.btd-timeline-line {
position: absolute;
left: 28px;
top: 16px;
bottom: 16px;
width: 2px;
background: linear-gradient(180deg, rgba(201, 162, 39, 0.5), rgba(201, 162, 39, 0.08));
border-radius: 1px;
pointer-events: none;
}
.btd-timeline-item {
position: relative;
display: block;
width: 100%;
margin: 0 0 8px;
padding: 0 0 0 16px;
border: none;
background: transparent;
text-align: left;
cursor: pointer;
}
.btd-timeline-node {
position: absolute;
left: 0;
top: 18px;
width: 10px;
height: 10px;
border-radius: 50%;
background: #1a2030;
border: 2px solid rgba(201, 162, 39, 0.45);
z-index: 1;
}
.btd-timeline-item--active .btd-timeline-node {
background: #c9a227;
border-color: #e8c547;
box-shadow: 0 0 8px rgba(201, 162, 39, 0.5);
}
.btd-timeline-card {
background: #121820;
border: 1px solid rgba(201, 162, 39, 0.12);
border-radius: 8px;
padding: 8px 10px;
transition: border-color 0.15s, box-shadow 0.15s;
}
.btd-timeline-item:hover .btd-timeline-card {
border-color: rgba(201, 162, 39, 0.28);
}
.btd-timeline-item--active .btd-timeline-card {
border-color: rgba(201, 162, 39, 0.65);
box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.2), 0 4px 16px rgba(0, 0, 0, 0.35);
}
.btd-timeline-top {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 8px;
margin-bottom: 4px;
}
.btd-timeline-name {
font-size: 12px;
font-weight: 700;
color: #eef2ff;
line-height: 1.3;
}
.btd-sparkline { flex-shrink: 0; opacity: 0.9; }
.btd-timeline-date {
display: block;
font-size: 10px;
color: #6272a4;
margin-bottom: 6px;
}
.btd-timeline-roi {
display: inline-block;
padding: 3px 8px;
border-radius: 20px;
font-size: 10px;
font-weight: 800;
}
.btd-timeline-roi.up {
background: rgba(34, 197, 94, 0.12);
color: #22c55e;
border: 1px solid rgba(34, 197, 94, 0.25);
}
.btd-timeline-roi.down {
background: rgba(239, 68, 68, 0.12);
color: #ef4444;
border: 1px solid rgba(239, 68, 68, 0.25);
}
/* ── 우측 메인 ── */
.btd-main {
flex: 1;
min-width: 0;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
background: #0a0e14;
}
.btd-dashboard {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
gap: 10px;
padding: 12px 16px 10px;
overflow: hidden;
}
.btd-empty {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
color: #6272a4;
font-size: 13px;
}
.btd-empty span { font-size: 48px; opacity: 0.35; }
/* ── 섹션 헤더 (금색 바) ── */
.btd-section-head {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
flex-shrink: 0;
}
.btd-section-bar {
width: 4px;
height: 16px;
border-radius: 2px;
background: linear-gradient(180deg, #e8c547, #b8860b);
flex-shrink: 0;
}
.btd-section-title {
margin: 0;
font-size: 13px;
font-weight: 800;
color: #f0e6c8;
letter-spacing: -0.2px;
line-height: 1.2;
}
.btd-section-sub {
margin: 1px 0 0;
font-size: 9px;
color: #6272a4;
font-weight: 500;
}
/* KPI ~18% | 차트 ~44% | 테이블 ~32% (헤더 포함) */
.btd-section--kpi {
flex: 0 0 auto;
}
.btd-section--chart {
flex: 1.45;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.btd-section--table {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ── KPI 카드 4열 ── */
.btd-kpi-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
}
.btd-kpi-card {
background: #121820;
border: 1px solid rgba(201, 162, 39, 0.18);
border-radius: 10px;
padding: 10px 14px;
min-height: 0;
}
.btd-kpi-label {
font-size: 10px;
color: #9aa5ce;
margin-bottom: 4px;
font-weight: 600;
}
.btd-kpi-value {
font-size: 24px;
font-weight: 900;
color: #fff;
line-height: 1;
letter-spacing: -0.5px;
}
.btd-kpi-value.up { color: #22c55e; }
.btd-kpi-value.down { color: #ef4444; }
.btd-kpi-value.gold { color: #c9a227; }
.btd-kpi-value.neutral { color: #e2e8f0; }
.btd-kpi-desc {
margin: 6px 0 0;
font-size: 9px;
color: #6272a4;
line-height: 1.3;
}
.btd-kpi-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.btd-kpi-icon {
font-size: 20px;
opacity: 0.6;
color: #c9a227;
}
.btd-kpi-dual {
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
padding-top: 2px;
}
.btd-kpi-card--dual .btd-kpi-label {
margin-bottom: 6px;
}
.btd-kpi-card--dual .btd-kpi-value {
font-size: 22px;
}
/* ── 자산 곡선 차트 ── */
.btd-chart-card {
flex: 1;
min-height: 0;
background: #121820;
border: 1px solid rgba(201, 162, 39, 0.18);
border-radius: 10px;
padding: 4px 8px 2px;
display: flex;
flex-direction: column;
overflow: hidden;
}
.btd-chart-wrap {
flex: 1;
min-height: 0;
width: 100%;
}
.btd-chart-svg {
width: 100%;
height: 100%;
display: block;
}
/* ── 거래 내역 테이블 ── */
.btd-table-card {
flex: 1;
min-height: 0;
background: #121820;
border: 1px solid rgba(201, 162, 39, 0.18);
border-radius: 10px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.btd-table-scroll {
flex: 1;
min-height: 0;
overflow-y: auto;
overflow-x: auto;
}
.btd-table {
width: 100%;
border-collapse: collapse;
font-size: 11px;
}
.btd-table thead {
background: rgba(201, 162, 39, 0.1);
position: sticky;
top: 0;
z-index: 1;
}
.btd-table th {
padding: 8px 12px;
text-align: left;
font-size: 10px;
font-weight: 700;
color: #c9a227;
border-bottom: 1px solid rgba(201, 162, 39, 0.2);
white-space: nowrap;
}
.btd-table td {
padding: 7px 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
color: #c8d0e0;
}
.btd-table tbody tr:hover td {
background: rgba(201, 162, 39, 0.04);
}
.btd-table tbody tr:last-child td {
border-bottom: none;
}
.btd-td-time {
color: #6272a4;
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.btd-table td.buy { color: #3b82f6; font-weight: 700; }
.btd-table td.sell { color: #ef4444; font-weight: 700; }
.btd-table td.up { color: #22c55e; font-weight: 700; }
.btd-table td.down { color: #ef4444; font-weight: 700; }
.btd-table-empty {
text-align: center;
color: #6272a4;
padding: 24px !important;
}
@media (max-width: 1100px) {
.btd-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
.btd-page { flex-direction: column; height: auto; overflow: auto; }
.btd-sidebar { width: 100%; max-height: 240px; border-right: none; border-bottom: 1px solid rgba(201, 162, 39, 0.15); }
.btd-kpi-grid { grid-template-columns: 1fr 1fr; }
}
+440
View File
@@ -0,0 +1,440 @@
/* 모의투자 대시보드 (ptd-) — 전체 화면 고정 레이아웃 */
.ptd-page {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
background: #0d1117;
color: #c0caf5;
padding: 8px 12px 10px;
font-family: var(--font, 'Noto Sans KR', sans-serif);
}
.ptd-page--loading {
display: flex;
align-items: center;
justify-content: center;
min-height: 320px;
color: #9aa5ce;
}
.ptd-topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 8px;
flex-shrink: 0;
}
.ptd-title { margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.ptd-topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ptd-btn {
padding: 6px 10px;
border-radius: 8px;
border: 1px solid rgba(122,162,247,0.2);
background: #1e222d;
color: #c0caf5;
font-size: 11px;
cursor: pointer;
}
.ptd-btn:hover { background: #252a38; }
.ptd-btn--danger { border-color: rgba(239,68,68,0.4); color: #ef4444; }
.ptd-banner {
padding: 8px 10px;
border-radius: 8px;
margin-bottom: 8px;
font-size: 11px;
flex-shrink: 0;
}
.ptd-banner--warn {
background: rgba(251,191,36,0.1);
border: 1px solid rgba(251,191,36,0.3);
color: #fbbf24;
}
.ptd-metrics {
margin-bottom: 8px;
flex-shrink: 0;
}
.ptd-metrics-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
}
.ptd-metric {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 8px 10px;
border-radius: 10px;
background: #1e222d;
border: 1px solid rgba(122,162,247,0.12);
}
.ptd-metric-icon { font-size: 16px; line-height: 1; }
.ptd-metric-title { font-size: 10px; color: #6272a4; margin-bottom: 2px; }
.ptd-metric-value { font-size: 17px; font-weight: 800; line-height: 1.1; }
.ptd-metric-sub { font-size: 9px; color: #6272a4; margin-top: 2px; }
.ptd-metric--up .ptd-metric-value { color: #22c55e; }
.ptd-metric--down .ptd-metric-value { color: #ef4444; }
.ptd-main {
display: grid;
grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(250px, 280px);
gap: 10px;
flex: 1;
min-height: 0;
overflow: hidden;
}
.ptd-col {
display: flex;
flex-direction: column;
gap: 8px;
min-height: 0;
overflow: hidden;
}
.ptd-col--left {
overflow-y: auto;
overflow-x: hidden;
}
.ptd-col--center { min-width: 0; }
.ptd-col--right { min-width: 0; }
.ptd-card {
background: #1e222d;
border: 1px solid rgba(122,162,247,0.12);
border-radius: 10px;
overflow: hidden;
flex-shrink: 0;
}
.ptd-card-head, .ptd-card-label {
padding: 8px 10px 0;
font-size: 11px;
font-weight: 700;
color: #9aa5ce;
}
.ptd-asset-card { padding-bottom: 8px; }
.ptd-asset-total {
padding: 4px 10px 0;
font-size: 22px;
font-weight: 800;
color: #fff;
}
.ptd-asset-total span { font-size: 12px; color: #6272a4; font-weight: 600; }
.ptd-asset-ret {
padding: 2px 10px 0;
font-size: 18px;
font-weight: 800;
}
.ptd-asset-sub { padding: 4px 10px 0; font-size: 10px; color: #6272a4; }
.ptd-table {
width: 100%;
border-collapse: collapse;
font-size: 10px;
}
.ptd-table th, .ptd-table td {
padding: 6px 8px;
text-align: left;
border-bottom: 1px solid rgba(122,162,247,0.08);
}
.ptd-table th { color: #6272a4; font-weight: 600; }
.ptd-table tbody tr { cursor: pointer; }
.ptd-table tbody tr:hover { background: rgba(63,126,245,0.06); }
.ptd-row--sel { background: rgba(63,126,245,0.1); }
.ptd-coin {
display: inline-flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
border-radius: 50%;
font-size: 9px;
font-weight: 800;
color: #fff;
margin-right: 4px;
}
.ptd-muted { color: #6272a4; text-align: center; padding: 12px; font-size: 11px; }
.ptd-time { color: #6272a4; white-space: nowrap; }
.ptd-donut-card { padding-bottom: 8px; }
.ptd-donut-wrap {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 10px;
}
.ptd-donut {
width: 72px;
height: 72px;
border-radius: 50%;
flex-shrink: 0;
}
.ptd-donut-hole {
width: 44px;
height: 44px;
margin: 14px auto;
border-radius: 50%;
background: #1e222d;
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-weight: 700;
color: #c0caf5;
}
.ptd-donut-legend {
list-style: none;
margin: 0;
padding: 0;
font-size: 10px;
color: #9aa5ce;
}
.ptd-donut-legend li { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.ptd-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ptd-chart-card {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
}
.ptd-chart-wrap {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
padding: 8px 10px 0;
}
.ptd-chart-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 6px;
flex-shrink: 0;
}
.ptd-chart-title { font-size: 12px; font-weight: 700; }
.ptd-ws-badge {
font-size: 9px;
padding: 2px 6px;
border-radius: 20px;
background: rgba(34,197,94,0.15);
color: #22c55e;
border: 1px solid rgba(34,197,94,0.3);
}
.ptd-chart-canvas {
flex: 1;
min-height: 140px;
max-height: 220px;
position: relative;
}
.ptd-chart-loading {
position: absolute;
inset: 40% 0 auto;
text-align: center;
font-size: 11px;
color: #6272a4;
pointer-events: none;
}
.ptd-tf-row {
display: flex;
gap: 4px;
padding: 6px 0 8px;
flex-wrap: wrap;
flex-shrink: 0;
}
.ptd-tf-btn {
padding: 3px 7px;
border-radius: 6px;
border: 1px solid rgba(122,162,247,0.15);
background: #121520;
color: #9aa5ce;
font-size: 9px;
cursor: pointer;
}
.ptd-tf-btn--active {
border-color: #3f7ef5;
color: #3f7ef5;
background: rgba(63,126,245,0.12);
}
.ptd-indicators {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 6px;
padding: 0 10px 8px;
border-top: 1px solid rgba(122,162,247,0.08);
flex-shrink: 0;
}
.ptd-ind-panel {
background: #121520;
border-radius: 8px;
padding: 4px 6px;
min-height: 52px;
}
.ptd-ind-label { font-size: 9px; color: #6272a4; margin-bottom: 2px; }
.ptd-ind-svg { width: 100%; height: 36px; display: block; }
/* 우측 패널 — 매매/호가 탭 */
.ptd-right-panel {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
background: #1e222d;
border: 1px solid rgba(122,162,247,0.12);
border-radius: 10px;
overflow: hidden;
}
.ptd-tabs--main {
flex-shrink: 0;
background: #121520;
}
.ptd-tabs--main .ptd-tab {
padding: 10px;
font-size: 12px;
font-weight: 600;
}
.ptd-right-body {
flex: 1;
min-height: 0;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column;
gap: 8px;
padding: 8px;
}
.ptd-right-body > .ptd-ob--fill {
flex: 1;
min-height: 0;
margin: -8px;
border: none;
border-radius: 0;
}
.ptd-order-card { flex-shrink: 0; border: none; background: transparent; }
.ptd-order-card .ptd-order-stack { padding: 0 4px 4px; }
.ptd-order-card .top-panel { padding: 4px 2px; background: transparent; }
.ptd-order-card .top-field { margin-bottom: 4px; }
.ptd-order-card .top-submit--buy { background: #22c55e !important; border-color: #22c55e !important; }
.ptd-order-card .top-submit--sell { background: #3f7ef5 !important; border-color: #3f7ef5 !important; }
.ptd-ob {
background: #1e222d;
border: 1px solid rgba(122,162,247,0.12);
border-radius: 10px;
overflow: hidden;
}
.ptd-ob--fill {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
border-radius: 0;
}
.ptd-ob-head {
padding: 8px 10px;
font-size: 11px;
font-weight: 700;
color: #9aa5ce;
border-bottom: 1px solid rgba(122,162,247,0.08);
flex-shrink: 0;
}
.ptd-ob-body {
padding: 2px 0;
max-height: 220px;
overflow-y: auto;
}
.ptd-ob--fill .ptd-ob-body {
flex: 1;
max-height: none;
overflow-y: auto;
}
.ptd-ob-row {
position: relative;
display: flex;
justify-content: space-between;
width: 100%;
padding: 3px 10px;
border: none;
background: transparent;
color: inherit;
font-size: 11px;
cursor: pointer;
text-align: left;
}
.ptd-ob-bar {
position: absolute;
top: 2px;
bottom: 2px;
right: 0;
opacity: 0.18;
pointer-events: none;
}
.ptd-ob-row--ask .ptd-ob-bar { background: #ef4444; }
.ptd-ob-row--bid .ptd-ob-bar { background: #22c55e; left: 0; right: auto; }
.ptd-ob-row--ask .ptd-ob-price { color: #ef4444; position: relative; z-index: 1; }
.ptd-ob-row--bid .ptd-ob-price { color: #22c55e; position: relative; z-index: 1; }
.ptd-ob-size { position: relative; z-index: 1; color: #6272a4; }
.ptd-ob-mid {
text-align: center;
padding: 5px;
font-size: 12px;
font-weight: 800;
color: #fff;
border-top: 1px solid rgba(122,162,247,0.08);
border-bottom: 1px solid rgba(122,162,247,0.08);
}
.ptd-history-card {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
border: none;
background: transparent;
}
.ptd-history-card .ptd-table-wrap,
.ptd-history-card .ptd-table {
flex: 1;
min-height: 0;
}
.ptd-tabs { display: flex; border-bottom: 1px solid rgba(122,162,247,0.1); flex-shrink: 0; }
.ptd-tab {
flex: 1;
padding: 7px;
border: none;
background: transparent;
color: #6272a4;
font-size: 10px;
cursor: pointer;
}
.ptd-tab.active { color: #3f7ef5; font-weight: 700; border-bottom: 2px solid #3f7ef5; }
.ptd-table--compact { font-size: 9px; }
.ptd-table--compact th,
.ptd-table--compact td { padding: 5px 6px; }
.ptd-status {
display: inline-block;
padding: 2px 5px;
border-radius: 4px;
font-size: 9px;
font-weight: 700;
}
.ptd-status--done { background: rgba(34,197,94,0.15); color: #22c55e; }
.ptd-page .up { color: #22c55e; }
.ptd-page .down { color: #ef4444; }
@media (max-width: 1200px) {
.ptd-page { overflow-y: auto; }
.ptd-main {
grid-template-columns: 1fr;
overflow: visible;
min-height: auto;
}
.ptd-metrics-grid { grid-template-columns: repeat(2, 1fr); }
.ptd-col--left { overflow: visible; }
}