/* ======================================================================
 *  生理期 / 排卵期计算器 /tool/period-calc
 * ====================================================================== */

.pd-card {
    padding: 22px;
    margin-bottom: 16px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.pd-card-title { font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 14px; }

/* ---------- 输入 ---------- */
.pd-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.pd-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 170px; }
.pd-field-sm { flex: 0 1 130px; }
.pd-label { font-size: 12px; font-weight: 700; color: var(--c-text-muted); }
.pd-input {
    height: 46px;
    padding: 0 13px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1.5px solid var(--c-border);
    border-radius: 11px;
    outline: none;
    transition: all 0.16s ease;
}
.pd-input:focus { border-color: #ec4899; box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.14); }
.pd-hint { margin-top: 12px; font-size: 12.5px; line-height: 1.7; color: var(--c-text-muted); }
.pd-hint.is-error { color: #d32f2f; }

/* ---------- 今天阶段 ---------- */
.pd-now { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pd-now-badge {
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: #ec4899;
    border-radius: 999px;
    white-space: nowrap;
}
.pd-now-badge.is-fert { background: #f59e0b; }
.pd-now-badge.is-ovu { background: #7c3aed; }
.pd-now-badge.is-safe { background: #10b981; }
.pd-now-text { font-size: 13.5px; font-weight: 600; line-height: 1.7; color: var(--c-text-sub); }

/* ---------- 关键日期 ---------- */
.pd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.pd-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 12px;
}
.pd-stat .k { font-size: 12px; font-weight: 700; color: var(--c-text-muted); }
.pd-stat .v { font-size: 16px; font-weight: 800; color: var(--c-text); }
.pd-stat small { font-size: 11.5px; font-weight: 700; color: var(--c-text-muted); }
.pd-stat-period { border-color: rgba(236, 72, 153, 0.4); background: rgba(236, 72, 153, 0.08); }
.pd-stat-period .v { color: #ec4899; }
.pd-stat-ovu { border-color: rgba(124, 58, 237, 0.4); background: rgba(124, 58, 237, 0.08); }
.pd-stat-ovu .v { color: #7c3aed; }
.pd-stat-fert { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.pd-stat-fert .v { color: #d97706; }

.pd-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 12px; font-weight: 600; color: var(--c-text-muted); }
.pd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.pd-dot-period { background: #ec4899; }
.pd-dot-fert { background: #f59e0b; }
.pd-dot-ovu { background: #7c3aed; }
.pd-dot-safe { background: #10b981; }

/* ---------- 表格 ---------- */
.pd-table-wrap { overflow-x: auto; }
.pd-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.pd-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    color: var(--c-text-muted);
    border-bottom: 1.5px solid var(--c-border);
    white-space: nowrap;
}
.pd-table td { padding: 11px 12px; border-bottom: 1px solid var(--c-border); color: var(--c-text-sub); }
.pd-table tr:last-child td { border-bottom: none; }
.pd-table tr.is-current td { background: rgba(236, 72, 153, 0.07); }
.pd-table .c-period { color: #ec4899; font-weight: 700; }
.pd-table .c-ovu { color: #7c3aed; font-weight: 700; }
.pd-table .c-fert { color: #d97706; font-weight: 700; }
.pd-table .c-idx { font-weight: 800; color: var(--c-text); }

.pd-actions { margin-top: 16px; }

/* ---------- 速查 ---------- */
.pd-rules { display: flex; flex-direction: column; gap: 8px; }
.pd-rule {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 12px;
    padding: 11px 14px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.7;
}
.pd-rule .k { font-weight: 800; color: var(--c-text); }
.pd-rule .v { color: var(--c-text-sub); }
.pd-disclaim {
    margin-top: 14px;
    padding: 12px 14px;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--c-text-muted);
    background: var(--c-surface-soft);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
}

.pd-info-block { margin: 24px 0 8px; }

/* ---------- 基础体温（BBT） ---------- */
.pd-bbt-input {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    resize: vertical;
    outline: none;
}
.pd-bbt-input:focus { border-color: #ec4899; }

.pd-bbt-result { margin-top: 14px; }
.pd-bbt-empty,
.pd-bbt-ok,
.pd-bbt-warn,
.pd-bbt-tip {
    font-size: 13px;
    line-height: 1.75;
    padding: 9px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}
.pd-bbt-empty { background: var(--c-surface-soft); color: var(--c-text-muted); }
.pd-bbt-ok { background: rgba(16, 185, 129, .1); border-left: 3px solid #10b981; color: var(--c-text-sub); }
.pd-bbt-warn { background: rgba(245, 158, 11, .12); border-left: 3px solid #f59e0b; color: var(--c-text-sub); }
.pd-bbt-tip { background: var(--c-surface-soft); color: var(--c-text-muted); }

.pd-bbt-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.pd-bbt-stat {
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-surface-soft);
}
.pd-bbt-stat .k { display: block; font-size: 11.5px; color: var(--c-text-muted); margin-bottom: 3px; }
.pd-bbt-stat .v { font-size: 15px; font-weight: 800; color: var(--c-text); font-variant-numeric: tabular-nums; }

.pd-bbt-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    overflow-x: auto;
    padding: 12px 4px 6px;
    border: 1px dashed var(--c-border);
    border-radius: 10px;
    margin-bottom: 10px;
}
.pd-bbt-bar { flex: 0 0 auto; width: 22px; text-align: center; }
.pd-bbt-bar i {
    display: block;
    width: 12px;
    margin: 0 auto 3px;
    border-radius: 3px 3px 0 0;
    background: #60a5fa;
}
.pd-bbt-bar.is-high i { background: #f43f5e; }
.pd-bbt-bar span { display: block; font-size: 9.5px; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
    .pd-rule { grid-template-columns: 1fr; gap: 4px; }
    .pd-field-sm { flex: 1 1 100px; min-width: 0; }
    .pd-bbt-head { grid-template-columns: 1fr; }
}
