/* #42 训练分化安排生成 · 训练馆白板风（独立设计系统 tsp-） */
.tsp-page, .tsp-modal, .tsp-toast, .tsp-print {
    --tsp-bg: #f4f6f8;
    --tsp-surface: #ffffff;
    --tsp-surface-2: #eef1f5;
    --tsp-ink: #1c2734;
    --tsp-ink-2: #617083;
    --tsp-line: #d5dde6;
    --tsp-orange: #ec6423;
    --tsp-blue: #2f6fe0;
    --tsp-green: #2a9d6f;
    --tsp-shadow: 0 10px 30px rgba(28, 39, 52, .10);
}
:root[data-theme="dark"] .tsp-page,
:root[data-theme="dark"] .tsp-modal,
:root[data-theme="dark"] .tsp-toast,
:root[data-theme="dark"] .tsp-print {
    --tsp-bg: #121820;
    --tsp-surface: #1b2531;
    --tsp-surface-2: #243140;
    --tsp-ink: #e8eef5;
    --tsp-ink-2: #9fb0c3;
    --tsp-line: #33465a;
    --tsp-orange: #ff9457;
    --tsp-blue: #77a8ff;
    --tsp-green: #62d6a0;
    --tsp-shadow: 0 14px 38px rgba(0, 0, 0, .42);
}
.tsp-page [hidden] { display: none !important; }
.tsp-page {
    background: var(--tsp-bg); color: var(--tsp-ink); padding: 26px 0 60px;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
    font-size: 15px; line-height: 1.8;
    background-image: linear-gradient(90deg, rgba(47, 111, 224, .035) 1px, transparent 1px), linear-gradient(0deg, rgba(47, 111, 224, .035) 1px, transparent 1px);
    background-size: 26px 26px;
}
.tsp-wrap { max-width: 1200px; margin: 0 auto; padding: 0 22px; }
.tsp-page b { color: var(--tsp-orange); }
.tsp-page h1, .tsp-page h2, .tsp-page h3 { line-height: 1.35; letter-spacing: -.02em; }
.tsp-page h2 { font-size: 23px; margin: 0; font-weight: 850; }
.tsp-page h3 { font-size: 17px; margin: 0 0 10px; font-weight: 800; }
.tsp-page p { margin: 0; }
.tsp-page input, .tsp-page select {
    width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; color: var(--tsp-ink);
    background: var(--tsp-surface); border: 1px solid var(--tsp-line); border-radius: 8px; padding: 9px 11px; outline: none;
}
.tsp-page input:focus, .tsp-page select:focus { border-color: var(--tsp-blue); box-shadow: 0 0 0 3px rgba(47, 111, 224, .16); }

/* 首屏 */
.tsp-hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 32px; margin-top: 22px; align-items: start; }
.tsp-board { min-width: 0; background: var(--tsp-surface); border: 1px solid var(--tsp-line); border-radius: 14px; padding: 26px; box-shadow: var(--tsp-shadow); position: relative; }
.tsp-board::before { content: ''; position: absolute; left: 26px; right: 26px; bottom: 0; height: 8px; background: repeating-linear-gradient(90deg, var(--tsp-orange) 0 18px, var(--tsp-blue) 18px 34px); border-radius: 0 0 6px 6px; }
.tsp-board-head { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 850; letter-spacing: .1em; color: var(--tsp-blue); }
.tsp-marker { width: 20px; height: 8px; border-radius: 2px; background: var(--tsp-orange); transform: rotate(-8deg); }
.tsp-board-head em { font-style: normal; color: var(--tsp-ink-2); border-left: 1px solid var(--tsp-line); padding-left: 9px; }
.tsp-board h1 { font-size: clamp(33px, 4.5vw, 51px); margin: 18px 0 14px; font-weight: 900; }
.tsp-sub { font-size: 16px; line-height: 2; color: var(--tsp-ink-2); }
.tsp-mini-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 22px 0 16px; }
.tsp-mini-week > div { border: 1px solid var(--tsp-line); border-radius: 7px; padding: 9px 3px; text-align: center; font-size: 10px; font-weight: 750; background: var(--tsp-surface-2); color: var(--tsp-ink-2); }
.tsp-mini-week > div.is-train { background: var(--tsp-orange); color: #fff; border-color: var(--tsp-orange); }
.tsp-hero-points { display: flex; flex-wrap: wrap; gap: 8px; }
.tsp-hero-points span { font-size: 11px; font-weight: 700; color: var(--tsp-blue); background: var(--tsp-surface-2); border-radius: 5px; padding: 5px 10px; }
.tsp-form { background: var(--tsp-surface); border: 1px solid var(--tsp-line); border-radius: 14px; padding: 20px; box-shadow: var(--tsp-shadow); min-width: 0; }
.tsp-form-head { font-size: 10px; letter-spacing: .14em; font-weight: 850; color: var(--tsp-blue); border-bottom: 3px solid var(--tsp-orange); padding-bottom: 9px; margin-bottom: 14px; }
.tsp-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.tsp-days-label { font-size: 12px; font-weight: 750; width: 100%; }
.tsp-days button { font-family: inherit; font-size: 12px; font-weight: 750; padding: 8px 12px; border-radius: 7px; border: 1px solid var(--tsp-line); background: var(--tsp-surface-2); color: var(--tsp-ink-2); cursor: pointer; }
.tsp-days button.is-on { background: var(--tsp-orange); color: #fff; border-color: var(--tsp-orange); }
.tsp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.tsp-field { display: block; font-size: 12px; font-weight: 750; }
.tsp-field select, .tsp-field input { margin-top: 5px; }
.tsp-field small { font-size: 10px; font-weight: 500; color: var(--tsp-ink-2); }
.tsp-weak { margin-bottom: 8px; }
.tsp-weak-label { font-size: 12px; font-weight: 750; margin-bottom: 7px; }
.tsp-weak-label small { font-weight: 500; color: var(--tsp-ink-2); }
.tsp-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tsp-chips label { display: flex; align-items: center; gap: 6px; font-size: 11px; background: var(--tsp-surface-2); border-radius: 6px; padding: 7px 8px; cursor: pointer; min-width: 0; }
.tsp-chips input { width: 14px; height: 14px; flex: none; }
.tsp-btn-main { display: block; width: 100%; border: 0; border-radius: 9px; padding: 14px; margin-top: 10px; font-family: inherit; font-size: 15px; font-weight: 850; color: #fff; cursor: pointer; background: linear-gradient(100deg, var(--tsp-blue), #4b8cf5); }
.tsp-btn-main span { float: right; }
.tsp-form-foot, .tsp-note { font-size: 11px; line-height: 1.85; color: var(--tsp-ink-2); margin-top: 12px; }
.tsp-err { margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--tsp-orange); background: rgba(236, 100, 35, .11); padding: 9px 11px; border-radius: 8px; }

/* 区块 */
.tsp-sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tsp-sec-head > span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; flex: none; background: var(--tsp-blue); color: #fff; font-size: 11px; font-weight: 850; }
.tsp-sec-head p { font-size: 12px; color: var(--tsp-ink-2); }
.tsp-page section.tsp-week, .tsp-page section.tsp-volume, .tsp-page section.tsp-compare, .tsp-page section.tsp-tools { margin-top: 44px; }
.tsp-card { background: var(--tsp-surface); border: 1px solid var(--tsp-line); border-radius: 14px; padding: 20px; box-shadow: var(--tsp-shadow); min-width: 0; }
.tsp-card h3 small { font-size: 11px; font-weight: 500; color: var(--tsp-ink-2); margin-left: 8px; }
.tsp-scroll { width: 100%; overflow-x: auto; }
.tsp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.tsp-table th, .tsp-table td { padding: 10px 12px; border-bottom: 1px solid var(--tsp-line); text-align: left; }
.tsp-table th { font-size: 11px; color: var(--tsp-ink-2); background: var(--tsp-surface-2); font-weight: 750; }
.tsp-table tr.is-on td { background: rgba(47, 111, 224, .10); font-weight: 800; }
.tsp-table tbody tr { cursor: pointer; }

/* 周计划 */
.tsp-week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.tsp-day { background: var(--tsp-surface); border: 1px solid var(--tsp-line); border-top: 4px solid var(--tsp-orange); border-radius: 10px; padding: 11px 9px; min-width: 0; box-shadow: var(--tsp-shadow); }
.tsp-day.is-rest { border-top-color: var(--tsp-line); background: var(--tsp-surface-2); }
.tsp-day-head { font-size: 11px; font-weight: 850; color: var(--tsp-blue); }
.tsp-day.is-rest .tsp-day-head { color: var(--tsp-ink-2); }
.tsp-day-title { font-size: 13px; font-weight: 850; margin: 4px 0 9px; min-height: 18px; }
.tsp-ex { border-left: 2px solid var(--tsp-orange); padding: 5px 0 5px 7px; margin-bottom: 7px; min-width: 0; }
.tsp-ex.assist { border-left-color: var(--tsp-blue); }
.tsp-ex b { display: block; font-size: 11px; line-height: 1.5; }
.tsp-ex small { display: block; font-size: 10px; color: var(--tsp-ink-2); line-height: 1.55; }
.tsp-day-foot { font-size: 10px; color: var(--tsp-ink-2); border-top: 1px dashed var(--tsp-line); padding-top: 7px; margin-top: 8px; }
.tsp-rest-note { font-size: 11px; color: var(--tsp-ink-2); line-height: 1.8; }
.tsp-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 11px; color: var(--tsp-ink-2); }
.tsp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tsp-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* 组数 / 周期 */
.tsp-volume-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tsp-bars { margin-top: 8px; }
.tsp-bar-row { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.tsp-bar-row > span { width: 40px; flex: none; font-size: 11px; font-weight: 750; }
.tsp-bar-track { flex: 1; height: 11px; background: var(--tsp-surface-2); border-radius: 6px; position: relative; min-width: 0; }
.tsp-bar-track::after { content: ''; position: absolute; left: 41.6%; top: -2px; bottom: -2px; width: 1px; background: var(--tsp-green); }
.tsp-bar-track i { display: block; height: 100%; border-radius: 6px; }
.tsp-bar-row > b { width: 46px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.tsp-volume-out { font-size: 12px; line-height: 1.9; color: var(--tsp-ink-2); border-top: 1px dashed var(--tsp-line); padding-top: 12px; margin-top: 12px; }

/* 文章 / 工具 */
.tsp-article { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.tsp-article article { background: var(--tsp-surface); border-left: 4px solid var(--tsp-blue); border-radius: 4px 12px 12px 4px; padding: 20px; box-shadow: var(--tsp-shadow); min-width: 0; }
.tsp-article h3 { font-size: 16px; }
.tsp-article p { font-size: 13px; line-height: 2.05; color: var(--tsp-ink-2); }
.tsp-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tsp-export p, .tsp-ai-card p { font-size: 12px; line-height: 1.9; color: var(--tsp-ink-2); }
.tsp-btns { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.tsp-btn-sub, .tsp-btn-ghost { font-family: inherit; font-size: 13px; font-weight: 800; padding: 10px 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--tsp-blue); background: var(--tsp-blue); color: #fff; }
.tsp-btn-ghost { background: transparent; color: var(--tsp-blue); border-color: var(--tsp-line); }
.tsp-btn-ghost:hover { border-color: var(--tsp-blue); }
.tsp-btn-ai { margin-top: 14px; font-family: inherit; font-size: 13px; font-weight: 800; padding: 11px 17px; border-radius: 8px; cursor: pointer; border: 1px solid var(--tsp-orange); color: #fff; background: var(--tsp-orange); }
.tsp-btn-ai:disabled { opacity: .5; cursor: not-allowed; }
.tsp-ai-out { margin-top: 12px; font-size: 12px; line-height: 1.95; color: var(--tsp-ink-2); background: var(--tsp-surface-2); border-radius: 8px; padding: 12px; min-height: 52px; }
.tsp-ai-out p { margin-bottom: 6px; }
.tsp-ai-out p:last-child { margin-bottom: 0; }

/* 弹窗 / 打印 / toast */
.tsp-modal { position: fixed; inset: 0; z-index: 9000; background: rgba(16, 24, 34, .66); display: flex; align-items: center; justify-content: center; padding: 18px; }
.tsp-modal[hidden] { display: none !important; }
.tsp-modal-box { position: relative; width: min(460px, 100%); max-height: 88vh; overflow-y: auto; background: var(--tsp-surface); color: var(--tsp-ink); border-radius: 14px; padding: 26px; box-shadow: var(--tsp-shadow); }
.tsp-modal-x { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; font-size: 24px; color: var(--tsp-ink-2); cursor: pointer; line-height: 1; }
.tsp-modal-kicker { font-size: 10px; letter-spacing: .14em; font-weight: 850; color: var(--tsp-blue); }
.tsp-modal-box h3 { font-size: 21px; margin: 8px 0 14px; }
.tsp-modal-result { background: var(--tsp-surface-2); border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.9; margin-bottom: 16px; }
.tsp-modal-box .tsp-field input { font-size: 12px; }
.tsp-toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 9500; background: var(--tsp-ink); color: var(--tsp-surface); padding: 11px 20px; border-radius: 9px; font-size: 13px; box-shadow: var(--tsp-shadow); }
.tsp-toast[hidden] { display: none !important; }
.tsp-print { display: none; }

@media print {
    .tsp-page > .tsp-wrap > nav, .tsp-hero, .tsp-volume, .tsp-compare, .tsp-tools, .tskb, .tsp-sharebar, .tsp-modal, .tsp-toast { display: none !important; }
    .tsp-page { background: #fff; padding: 0; }
    .tsp-week-grid { grid-template-columns: repeat(4, 1fr); }
    .tsp-day { box-shadow: none; break-inside: avoid; }
    .tsp-print { display: block !important; padding: 12px 0; font-size: 12px; }
}
@media (max-width: 1000px) {
    .tsp-week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .tsp-hero, .tsp-volume-grid, .tsp-tools-grid { grid-template-columns: 1fr; }
    .tsp-article { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .tsp-wrap { padding: 0 14px; }
    .tsp-page { padding-top: 16px; font-size: 14px; }
    .tsp-board { padding: 18px; }
    .tsp-board h1 { font-size: 30px; }
    .tsp-sub { font-size: 15px; }
    .tsp-mini-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
    .tsp-mini-week > div { font-size: 9px; padding: 7px 1px; }
    .tsp-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tsp-two, .tsp-chips { grid-template-columns: 1fr; }
    .tsp-page section.tsp-week, .tsp-page section.tsp-volume, .tsp-page section.tsp-compare, .tsp-page section.tsp-tools { margin-top: 30px; }
    .tsp-card { padding: 16px; }
    .tsp-table { min-width: 520px; }
}
