/* 时间块规划 · 日程本时间轴设计系统（前缀 tb-）
   浅色：暖米纸 + 深棕 + 琥珀；深色：深棕纸 + 暖米 + 亮琥珀 */
.tb-page, .tb-modal, .ws-toast {
    --tb-bg: #fbf6ec; --tb-paper: #fffdf7; --tb-ink: #3d3025; --tb-sub: #81725f;
    --tb-brand: #5b4636; --tb-amber: #d98324; --tb-line: #e6dac5; --tb-fill: #f4ecd9;
    --tb-c1: #3f7cb8; --tb-c2: #3e916c; --tb-c3: #8b63b8; --tb-c4: #b0763f; --tb-c5: #7c8a95;
    --tb-red: #c04535; --tb-shadow: 0 10px 26px rgba(91,70,54,.1);
    --tb-font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
:root[data-theme="dark"] .tb-page, :root[data-theme="dark"] .tb-modal, :root[data-theme="dark"] .ws-toast {
    --tb-bg: #191510; --tb-paper: #241e17; --tb-ink: #f0e4d0; --tb-sub: #b6a58e;
    --tb-brand: #e4c79f; --tb-amber: #f0a94c; --tb-line: #3b3126; --tb-fill: #2c241a;
    --tb-c1: #7db4ef; --tb-c2: #72d1a4; --tb-c3: #c29af0; --tb-c4: #e4ab72; --tb-c5: #a9b7c2;
    --tb-red: #f08a7c; --tb-shadow: 0 14px 32px rgba(0,0,0,.36);
}
.tb-page { background: var(--tb-bg); color: var(--tb-ink); font-family: var(--tb-font);
    font-size: 14.5px; line-height: 1.8; padding-bottom: 56px; }
.tb-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.tb-page .detail-breadcrumb { padding: 18px 0 0; font-size: 13px; color: var(--tb-sub); }
.tb-page .detail-breadcrumb a { color: var(--tb-brand); text-decoration: none; }
.tb-page .detail-breadcrumb .sep { margin: 0 8px; }
.tb-page b { font-weight: 700; }
.tb-kicker { font-size: 11px; letter-spacing: .16em; color: var(--tb-amber); }

/* 首屏 */
.tb-hero { display: grid; grid-template-columns: 1.55fr .58fr; gap: 22px; margin: 22px 0 22px; }
.tb-hero-copy { background: var(--tb-paper); border: 1px solid var(--tb-line); border-radius: 8px;
    padding: 28px 30px; box-shadow: var(--tb-shadow); border-left: 6px solid var(--tb-amber); }
.tb-hero h1 { font-size: clamp(24px, 2.9vw, 34px); line-height: 1.4; margin: 10px 0 8px; }
.tb-sub { font-size: 14px; line-height: 1.95; color: var(--tb-sub); margin: 0 0 18px; max-width: 690px; }
.tb-sub b { color: var(--tb-amber); }
.tb-page input, .tb-page select, .tb-page textarea { font: inherit; color: var(--tb-ink); background: var(--tb-paper);
    border: 1px solid var(--tb-line); border-radius: 5px; padding: 8px 10px; outline: none; box-sizing: border-box; }
.tb-page input:focus, .tb-page select:focus, .tb-page textarea:focus { border-color: var(--tb-amber); }
.tb-quick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tb-quick input[type="time"] { width: 116px; }
.tb-quick input[type="text"] { flex: 1 1 160px; min-width: 0; }
.tb-quick select { width: 120px; }
.tb-btn { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--tb-line);
    background: var(--tb-paper); color: var(--tb-ink); border-radius: 5px; padding: 8px 14px; white-space: nowrap; }
.tb-btn:hover { border-color: var(--tb-amber); }
.tb-btn--main { background: var(--tb-brand); border-color: var(--tb-brand); color: var(--tb-paper); }
.tb-btn--main:hover { background: var(--tb-amber); border-color: var(--tb-amber); color: #fff; }
.tb-hero-chips { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 14px; font-size: 11.5px; color: var(--tb-sub); }
.tb-chip { font: inherit; font-size: 12px; cursor: pointer; border: 1px dashed var(--tb-line);
    background: var(--tb-fill); color: var(--tb-brand); border-radius: 14px; padding: 3px 11px; }
.tb-chip:hover { border-style: solid; border-color: var(--tb-amber); }
.tb-hero-stat { background: var(--tb-brand); color: var(--tb-bg); border-radius: 8px; padding: 18px 20px; box-shadow: var(--tb-shadow); }
.tb-stat-h { font-size: 10px; letter-spacing: .14em; opacity: .8; border-bottom: 1px solid rgba(255,255,255,.24); padding-bottom: 9px; }
.tb-stat-big { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 10px; }
.tb-stat-big b { font: 700 42px Georgia, serif; }
.tb-stat-big span { font-size: 12px; opacity: .82; }
.tb-stat-row { display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.18);
    padding: 6px 0; font-size: 12px; }
.tb-stat-bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; margin-top: 14px; background: rgba(255,255,255,.18); }
.tb-stat-bar i { display: block; height: 100%; }

/* 时间轴 */
.tb-layout { display: grid; grid-template-columns: 1.1fr .68fr; gap: 18px; align-items: start; }
.tb-axis-panel, .tb-panel { background: var(--tb-paper); border: 1px solid var(--tb-line); border-radius: 8px;
    padding: 18px 20px; box-shadow: var(--tb-shadow); min-width: 0; }
.tb-panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    border-bottom: 2px solid var(--tb-brand); padding-bottom: 10px; margin-bottom: 14px; }
.tb-panel-h b { font-size: 16px; }
.tb-panel-h span { font-size: 11.5px; color: var(--tb-sub); }
.tb-axis { display: grid; grid-template-columns: 54px 1fr; position: relative; }
.tb-ticks { position: relative; height: 1080px; font: 11px Georgia, serif; color: var(--tb-sub); }
.tb-ticks span { position: absolute; right: 8px; transform: translateY(-50%); }
.tb-lane { position: relative; height: 1080px; border-left: 2px solid var(--tb-line);
    background: repeating-linear-gradient(0deg, transparent 0 29px, var(--tb-line) 29px 30px); }
.tb-block { position: absolute; left: 6px; right: 6px; border-radius: 5px; padding: 5px 9px; overflow: hidden;
    color: #fff; cursor: pointer; border: 2px solid transparent; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.tb-block:hover, .tb-block.is-on { border-color: var(--tb-ink); }
.tb-block b { display: block; font-size: 12.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-block span { font-size: 10.5px; opacity: .9; }
.tb-block.is-conf { outline: 2px dashed var(--tb-red); outline-offset: 1px; }
.tb-lane-empty { position: absolute; left: 16px; top: 300px; font-size: 13px; color: var(--tb-sub); }
.tb-side { display: flex; flex-direction: column; gap: 12px; }
.tb-side-card { background: var(--tb-paper); border: 1px solid var(--tb-line); border-radius: 8px; padding: 14px 16px; box-shadow: var(--tb-shadow); }
.tb-side-card h3 { font-size: 14px; margin: 0 0 9px; padding-bottom: 7px; border-bottom: 1px dashed var(--tb-line); }
.tb-side-card > div { font-size: 12px; color: var(--tb-sub); line-height: 1.9; }
.tb-side-card .tb-item { background: var(--tb-fill); border-radius: 4px; padding: 6px 9px; margin-bottom: 6px; }
.tb-side-card .tb-item.is-bad { color: var(--tb-red); border-left: 3px solid var(--tb-red); }
.tb-cat-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.tb-cat-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tb-cat-row span { flex: 1; }

/* 表单与批量 */
.tb-panel { margin-top: 18px; }
.tb-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.tb-field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--tb-sub); }
.tb-field input[type="time"] { width: 120px; }
.tb-field select { width: 130px; }
.tb-field.tb-grow { flex: 1 1 200px; }
.tb-field.tb-grow input { width: 100%; }
.tb-btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.tb-form-state { font-size: 11.5px; color: var(--tb-sub); }
.tb-err { color: var(--tb-red); font-size: 12.5px; min-height: 18px; margin: 8px 0 0; }
.tb-bulk-ok { color: var(--tb-c2); font-size: 12.5px; min-height: 18px; margin: 0; }
.tb-panel textarea { width: 100%; resize: vertical; font: 12.5px Consolas, monospace; }
.tb-hint { font-size: 11.5px; color: var(--tb-sub); line-height: 1.8; margin: 8px 0 0; }

/* 弹窗：导出后触发 */
.tb-modal[hidden] { display: none !important; }
.tb-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
    background: rgba(35,26,18,.62); padding: 20px; }
.tb-modal-box { position: relative; width: min(440px, 100%); background: var(--tb-paper); color: var(--tb-ink);
    padding: 28px 30px; border-radius: 8px; border-top: 5px solid var(--tb-amber); box-shadow: 0 22px 54px rgba(0,0,0,.32); }
.tb-modal-x { position: absolute; right: 12px; top: 6px; border: 0; background: none; font-size: 24px; color: var(--tb-sub); cursor: pointer; }
.tb-modal-box h2 { margin: 8px 0 10px; font-size: 22px; }
.tb-modal-box p { font-size: 14px; color: var(--tb-sub); line-height: 1.9; }
.ws-toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px); z-index: 10000;
    background: var(--tb-ink); color: var(--tb-paper); padding: 10px 20px; border-radius: 5px;
    font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; }
.ws-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ws-toast.is-err { background: var(--tb-red); color: #fff; }

@media (max-width: 960px) { .tb-hero, .tb-layout { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
    .tb-wrap { padding: 0 12px; } .tb-hero-copy, .tb-axis-panel, .tb-panel { padding: 18px 14px; }
    .tb-quick input[type="time"] { width: 100px; }
}
@media print {
    .tb-hero-stat, .tb-editor, .tb-panel .tb-btn-row, .tskb, .tb-modal { display: none !important; }
    .tb-lane { break-inside: avoid; }
}
