:root {
    --ink: #2d1f3d;
    --muted: #7c6b8a;
    --violet: #6b21a8;
    --violet-soft: #ede9fe;
    --gold: #d97706;
    --card: rgba(255, 253, 255, 0.94);
    --stroke: rgba(196, 181, 253, 0.55);
    --shadow: 0 24px 56px rgba(91, 33, 182, 0.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; overflow-x: hidden; }
body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
    min-height: 100vh;
    color: var(--ink);
    padding: 24px clamp(14px, 4vw, 28px) 56px;
    background-color: #faf8ff;
    background-image:
        radial-gradient(ellipse 80% 45% at 90% 0%, rgba(167, 139, 250, 0.35), transparent 52%),
        radial-gradient(ellipse 60% 40% at 0% 40%, rgba(251, 191, 36, 0.2), transparent 48%),
        linear-gradient(168deg, #fdfbff 0%, #f5f3ff 45%, #fffbeb 100%);
    background-attachment: fixed;
}
.shell { width: 100%; max-width: min(1180px, 100%); margin: 0 auto; }
.top {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.top .auth-topbar--in-kline { margin-left: auto; }
@media (max-width: 560px) {
    .top .auth-topbar--in-kline { margin-left: 0; width: 100%; justify-content: center; }
}
.back {
    font-size: 14px; color: var(--violet); text-decoration: none; font-weight: 700;
}
.back:hover { text-decoration: underline; }
.hero {
    text-align: center; margin-bottom: 22px;
}
.hero .eyebrow {
    display: inline-block; font-size: 11px; font-weight: 700;
    letter-spacing: 0.14em; color: var(--violet);
    background: var(--violet-soft); padding: 7px 14px; border-radius: 999px;
    margin-bottom: 10px; border: 1px solid var(--stroke);
}
.hero h1 {
    font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800;
    background: linear-gradient(115deg, #5b21b6, #7c3aed, #b45309);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 8px;
}
.hero p { color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 36em; margin: 0 auto; }
.layout {
    display: grid;
    grid-template-columns: minmax(280px, 320px) 1fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.panel {
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    padding: 18px 18px 20px;
}
.panel h2 {
    font-size: 1rem; font-weight: 800; margin-bottom: 14px;
    padding-left: 10px; border-left: 4px solid var(--violet);
}
.field { margin-bottom: 12px; }
.field label {
    display: block; font-size: 13px; font-weight: 700;
    color: #5b4d6e; margin-bottom: 6px;
}
.field input, .field select {
    width: 100%; padding: 11px 12px; border-radius: 12px;
    border: 2px solid rgba(196, 181, 253, 0.65);
    font-size: 15px; background: #fff;
}
.field input:focus, .field select:focus {
    outline: none; border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.field input.input-date {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.btn-primary {
    border: none; border-radius: 999px; padding: 12px 20px;
    font-size: 15px; font-weight: 800; cursor: pointer; color: #fff;
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    box-shadow: 0 12px 28px rgba(91, 33, 182, 0.28);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-ghost {
    border: 2px solid var(--stroke); border-radius: 999px;
    padding: 10px 16px; font-size: 14px; font-weight: 700;
    background: #fff; color: var(--violet); cursor: pointer;
}
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 12px; }
.progress-wrap { margin-top: 12px; display: none; }
.progress-wrap.show { display: block; }
.progress-text { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.progress-track {
    height: 7px; border-radius: 999px; background: rgba(196, 181, 253, 0.35); overflow: hidden;
}
.progress-bar {
    height: 100%; width: 0; border-radius: 999px;
    background: linear-gradient(90deg, #8b5cf6, #d97706);
    transition: width 0.25s ease;
}
.right-col { display: grid; gap: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
    background: var(--violet-soft); border: 1px solid var(--stroke); color: #4c1d95;
}
#klineCanvas {
    width: 100%; height: auto; max-height: 380px;
    border-radius: 12px; border: 1px solid rgba(196, 181, 253, 0.5);
    background: linear-gradient(180deg, #fefeff, #f8f7ff);
}
.reading-meta {
    font-size: 12px; font-weight: 600; color: var(--muted);
}
.reading-notice {
    font-size: 12px; line-height: 1.55; color: #92400e;
    background: rgba(254, 243, 199, 0.7);
    border: 1px solid rgba(251, 191, 36, 0.45);
    border-radius: 10px; padding: 8px 10px; margin-bottom: 10px;
}
.reading {
    max-height: min(70vh, 720px);
    overflow: auto;
    padding-right: 6px;
}
.empty-state {
    text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty-state svg { opacity: 0.35; margin-bottom: 12px; }
.history-note {
    margin-top: 10px; padding: 10px 12px; border-radius: 12px;
    font-size: 12px; line-height: 1.55;
    background: rgba(254, 243, 199, 0.65);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #92400e;
}
.history-note a { color: #7c3aed; font-weight: 700; }
.error-banner {
    display: none; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
    background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
    font-size: 13px; line-height: 1.5;
}
.error-banner.show { display: block; }
.history-note .btn-inline {
    border: none; background: none; padding: 0; font: inherit;
    color: #7c3aed; font-weight: 700; cursor: pointer; text-decoration: underline;
}
