/* ======================================================================
 *  家庭学习计划表 /tool/study-plan-print
 *  依赖 calc-common.css 变量与公共类，含打印样式，支持黑夜模式。
 * ====================================================================== */

.sp-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 14px;
}
.sp-head-field { flex: 1 1 160px; min-width: 0; }
.sp-head-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-text-sub);
    margin-bottom: 6px;
}
.sp-head-field input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 11px;
    outline: none;
}
.sp-head-field input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.sp-head-btns { display: flex; gap: 8px; flex: 1 1 100%; flex-wrap: wrap; }
.sp-head-btns .btn { height: 38px; padding: 0 14px; font-size: 13px; }

/* ---------- 计划表 ---------- */
.sp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
}
.sp-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.sp-table thead th {
    background: rgba(0, 184, 150, 0.1);
    font-size: 12.5px;
    font-weight: 800;
    color: var(--c-text);
    padding: 10px 8px;
    border-bottom: 1px solid var(--c-border);
    line-height: 1.5;
}
.sp-table thead th small { font-weight: 600; color: var(--c-text-muted); font-size: 11px; }
.sp-day-col { width: 64px; }
.sp-day-cell {
    background: rgba(0, 184, 150, 0.07);
    font-size: 13px;
    font-weight: 800;
    color: #0e9f6e;
    text-align: center;
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    padding: 8px 4px;
    white-space: nowrap;
}
.sp-table td {
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    padding: 0;
}
.sp-table tr:last-child th, .sp-table tr:last-child td { border-bottom: none; }
.sp-table th:last-child, .sp-table td:last-child { border-right: none; }
.sp-cell-input {
    width: 100%;
    min-width: 110px;
    height: 46px;
    border: none;
    background: transparent;
    padding: 6px 9px;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--c-text);
    outline: none;
    text-align: center;
}
.sp-cell-input:focus { background: rgba(0, 184, 150, 0.08); box-shadow: inset 0 0 0 2px rgba(0, 184, 150, 0.45); }

.sp-fixed {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    color: var(--c-text-sub);
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
}
.sp-fixed b { color: var(--c-text); margin-right: 4px; }
.sp-fixed label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.sp-fixed input { accent-color: #0e9f6e; }

/* ================= 打印 ================= */
#spPrintArea { display: none; }
@media print {
    @page { margin: 10mm; size: A4 landscape; }
    body * { visibility: hidden !important; }
    #spPrintArea, #spPrintArea * { visibility: visible !important; }
    #spPrintArea { display: block !important; position: absolute; left: 0; top: 0; width: 100%; color: #111 !important; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
    .sp-print-title { text-align: center; font-size: 22px; margin: 0 0 6px; }
    .sp-print-meta { font-size: 13px; margin: 0 0 10px; }
    .sp-print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
    .sp-print-table th, .sp-print-table td {
        border: 1px solid #555;
        padding: 8px 6px;
        font-size: 12px;
        text-align: center;
        vertical-align: middle;
        word-break: break-all;
    }
    .sp-print-table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sp-check-cell { font-size: 13px; letter-spacing: 2px; white-space: nowrap; }
    .sp-print-fixed { font-size: 12px; margin: 10px 0 8px; }
    .sp-print-sign { font-size: 13px; }
}

/* ---------- 黑夜模式 ---------- */
[data-theme="dark"] .sp-head-field input,
[data-theme="dark"] .sp-cell-input { background: transparent; }
[data-theme="dark"] .sp-head-field input { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .sp-table thead th { background: rgba(0, 200, 150, 0.14); }
[data-theme="dark"] .sp-day-cell { background: rgba(0, 200, 150, 0.1); color: #4ede78; }
[data-theme="dark"] .sp-cell-input:focus { background: rgba(0, 200, 150, 0.1); }
[data-theme="dark"] .sp-fixed { background: rgba(255, 255, 255, 0.03); }
