/* ===== 合同到期日 contract-expiry-calc ===== 法务档案风：冷灰纸底 + 藏蓝 #33475b + 朱砂 #c14b3a */
.cec-page {
    --cec-bg: #f5f6f4;
    --cec-surface: #ffffff;
    --cec-surface2: #eceee9;
    --cec-line: #dcded6;
    --cec-ink: #2b2d28;
    --cec-dim: #7c8177;
    --cec-navy: #33475b;
    --cec-seal: #c14b3a;
    --cec-good: #4d8a5f;
    --cec-warn: #b98a2f;
    --cec-bad: #b0503f;
    background: var(--cec-bg);
    color: var(--cec-ink);
    border-radius: 16px;
    padding: 0 0 30px;
    overflow: hidden;
    border: 1px solid var(--cec-line);
}
.cec-inner { padding: 30px 34px 0; }

.cec-hero { display: grid; grid-template-columns: 1.35fr .95fr; gap: 26px; align-items: center; }
.cec-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--cec-seal); margin-bottom: 12px; }
.cec-kicker::before { content: ""; width: 22px; height: 3px; background: var(--cec-seal); border-radius: 2px; }
.cec-hero h1 { font-size: 34px; font-weight: 800; margin: 0 0 10px; color: var(--cec-ink); }
.cec-hero-sub { color: var(--cec-dim); line-height: 1.9; margin: 0 0 14px; font-size: 15px; }
.cec-hero-sub b { color: var(--cec-navy); }
.cec-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.cec-chips li { font-size: 12.5px; color: var(--cec-navy); background: var(--cec-surface); border: 1px solid var(--cec-line); border-radius: 6px; padding: 4px 10px; font-weight: 600; }

/* 倒计时卡 */
.cec-stamp { background: var(--cec-surface); border: 1px solid var(--cec-line); border-top: 4px solid var(--cec-seal); border-radius: 10px; padding: 24px 22px 18px; text-align: center; box-shadow: 0 2px 6px rgba(43, 45, 40, .07); }
.cec-days-num span { font-size: 56px; font-weight: 800; color: var(--cec-navy); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cec-days-num em { font-style: normal; font-size: 13px; color: var(--cec-dim); margin-left: 6px; }
.cec-termbar { margin-top: 18px; }
.cec-termbar-track { position: relative; height: 14px; border-radius: 7px; background: var(--cec-surface2); overflow: hidden; }
.cec-termbar-fill { height: 100%; background: repeating-linear-gradient(-45deg, #c8d2de 0 6px, #b4c0cf 6px 12px); }
.cec-termbar-now { position: absolute; top: -3px; width: 4px; height: 20px; background: var(--cec-seal); border-radius: 2px; box-shadow: 0 0 0 2px #fff; }
.cec-termbar-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--cec-dim); margin-top: 6px; font-variant-numeric: tabular-nums; }
.cec-stamp-tag { font-size: 12.5px; color: var(--cec-dim); margin: 12px 0 0; min-height: 18px; }

/* 面板 */
.cec-main { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-top: 24px; }
.cec-panel { background: var(--cec-surface); border: 1px solid var(--cec-line); border-radius: 14px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(43, 45, 40, .04); }
.cec-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cec-step { width: 24px; height: 24px; border-radius: 7px; background: var(--cec-navy); color: #fff; font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cec-panel-head h2 { margin: 0; font-size: 16.5px; }
.cec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cec-field span { display: block; font-size: 12.5px; color: var(--cec-dim); margin-bottom: 5px; font-weight: 600; }
.cec-field input, .cec-field select { width: 100%; box-sizing: border-box; background: var(--cec-surface2); border: 1px solid var(--cec-line); border-radius: 8px; color: var(--cec-ink); padding: 9px 11px; font-size: 15px; font-variant-numeric: tabular-nums; }
.cec-field input:focus, .cec-field select:focus { outline: 2px solid rgba(51, 71, 91, .2); border-color: var(--cec-navy); }
.cec-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cec-btn { border: 1px solid var(--cec-navy); background: var(--cec-navy); color: #fff; border-radius: 8px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.cec-btn:hover { background: #26374a; }
.cec-btn-copy { background: transparent; color: var(--cec-navy); }
.cec-btn-copy:hover { background: rgba(51, 71, 91, .07); }
.cec-btn-dl { background: transparent; border-color: var(--cec-line); color: var(--cec-dim); font-weight: 500; }
.cec-err { color: var(--cec-bad); font-size: 13px; margin: 10px 0 0; }

.cec-result { margin: 0; }
.cec-result > div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--cec-line); padding: 8px 0; }
.cec-result > div:last-child { border-bottom: 0; }
.cec-result dt { color: var(--cec-dim); font-size: 13px; }
.cec-result dd { margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cec-result dd b { font-size: 24px; color: var(--cec-navy); }
.cec-note { font-size: 12.5px; color: var(--cec-dim); line-height: 1.8; margin: 10px 0 0; }

/* 提醒节点表 */
.cec-node { margin-top: 16px; }
.cec-node-tip { font-size: 13px; color: var(--cec-dim); margin: 0 0 12px; }
.cec-table-scroll { overflow-x: auto; }
.cec-node table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cec-node th { background: var(--cec-navy); color: #fff; font-weight: 600; padding: 8px 10px; text-align: left; white-space: nowrap; }
.cec-node td { border-top: 1px solid var(--cec-line); padding: 8px 10px; color: var(--cec-ink); }
.cec-node td.cec-urged { color: var(--cec-seal); font-weight: 700; }
.cec-node tr.cec-past td { color: var(--cec-dim); text-decoration: line-through; }
.cec-node .cec-node-tag { display: inline-block; font-size: 11px; background: var(--cec-surface2); border: 1px solid var(--cec-line); border-radius: 4px; padding: 1px 7px; color: var(--cec-dim); margin-left: 6px; }

/* 批量 */
.cec-batch { margin-top: 16px; }
.cec-batch textarea { width: 100%; box-sizing: border-box; background: var(--cec-surface2); border: 1px solid var(--cec-line); border-radius: 8px; color: var(--cec-ink); padding: 10px 12px; font-size: 14px; font-family: Consolas, monospace; resize: vertical; }
.cec-batch-tip { font-size: 13px; color: var(--cec-dim); margin: 0 0 8px; }
.cec-batch-out { margin-top: 14px; overflow-x: auto; }
.cec-batch-out table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cec-batch-out th { background: var(--cec-surface2); padding: 7px 10px; color: var(--cec-dim); text-align: left; white-space: nowrap; }
.cec-batch-out td { border-top: 1px solid var(--cec-line); padding: 6px 10px; }
.cec-batch-out td.cec-expired { color: var(--cec-bad); font-weight: 700; }
.cec-batch-out td.cec-soon { color: var(--cec-seal); font-weight: 700; }

/* 风险卡 */
.cec-risk { margin-top: 24px; }
.cec-risk h2 { font-size: 18px; margin: 0 0 12px; }
.cec-risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.cec-risk-card { background: var(--cec-surface); border: 1px solid var(--cec-line); border-left: 3px solid var(--cec-seal); border-radius: 10px; padding: 14px 16px; }
.cec-risk-card h3 { margin: 0 0 6px; font-size: 14.5px; }
.cec-risk-card p { margin: 0; font-size: 13px; color: var(--cec-dim); line-height: 1.85; }
.cec-risk-card b { color: var(--cec-seal); }

.cec-toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(16px); background: var(--cec-navy); color: #fff; border-radius: 9px; padding: 10px 22px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease; z-index: 99; }
.cec-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
    .cec-inner { padding: 24px 18px 0; }
    .cec-hero { grid-template-columns: 1fr; }
    .cec-main { grid-template-columns: 1fr; }
}

/* 深色：夜读档案 */
:root[data-theme="dark"] .cec-page, :root[data-theme="dark"] .cec-toast {
    --cec-bg: #14171a;
    --cec-surface: #1c2025;
    --cec-surface2: #252b32;
    --cec-line: #343c45;
    --cec-ink: #e8ebee;
    --cec-dim: #99a1ab;
    --cec-navy: #a3bcd4;
    --cec-seal: #e06a55;
    --cec-good: #7fbf8f;
    --cec-warn: #e0b35a;
    --cec-bad: #d97a5f;
}
:root[data-theme="dark"] .cec-step { background: var(--cec-seal); color: #241009; }
:root[data-theme="dark"] .cec-btn { background: var(--cec-seal); border-color: var(--cec-seal); color: #241009; }
:root[data-theme="dark"] .cec-btn:hover { background: #e97e6a; }
:root[data-theme="dark"] .cec-btn-copy { background: transparent; color: var(--cec-seal); }
:root[data-theme="dark"] .cec-node th { background: #252b32; color: #c4ccd5; }
:root[data-theme="dark"] .cec-termbar-fill { background: repeating-linear-gradient(-45deg, #33404d 0 6px, #3c4a58 6px 12px); }
:root[data-theme="dark"] .cec-termbar-now { box-shadow: 0 0 0 2px #14171a; }
