/* ============================================================
 * contraction-timer.css —— 宫缩计时器专属「暖意孕产」风格
 * 软圆角 + 玫瑰奶油色系；亮色 / 黑夜双主题（:root[data-theme]）
 * 独立于 arc.css；仅依赖 Arc.toggleTheme 切换 data-theme
 * ============================================================ */

:root {
    --ct-bg: #fff6f1;
    --ct-card: #ffffff;
    --ct-ink: #47262f;
    --ct-ink-2: #a07d86;
    --ct-line: #f4dde1;
    --ct-rose: #e05a7a;
    --ct-rose-deep: #c23d5f;
    --ct-rose-soft: #fce4ea;
    --ct-peach: #f4a261;
    --ct-calm-bg: #eef4f6;
    --ct-calm-ink: #4a6b76;
    --ct-warn-bg: #fdf1dc;
    --ct-warn-ink: #a06a10;
    --ct-ready-bg: #e05a7a;
    --ct-ready-ink: #ffffff;
    --ct-ok: #2e9e7b;
    --ct-shadow: 0 12px 34px rgba(224, 90, 122, .10);
    --ct-radius: 22px;
    --arc-danger: #d94343; /* bindAi 错误文案用 */
}

:root[data-theme="dark"] {
    --ct-bg: #221720;
    --ct-card: #2e2129;
    --ct-ink: #f3dee4;
    --ct-ink-2: #bb95a1;
    --ct-line: #4a3340;
    --ct-rose: #f07f9c;
    --ct-rose-deep: #e05a7a;
    --ct-rose-soft: #472836;
    --ct-peach: #f2b183;
    --ct-calm-bg: #27333a;
    --ct-calm-ink: #9fc3cd;
    --ct-warn-bg: #3a2f1e;
    --ct-warn-ink: #f0c078;
    --ct-ready-bg: #c23d5f;
    --ct-ready-ink: #ffffff;
    --ct-ok: #4cc39a;
    --ct-shadow: 0 12px 34px rgba(0, 0, 0, .38);
    --arc-danger: #ff8a8a;
}

/* ---------------- 容器 ---------------- */
.ct {
    background: var(--ct-bg);
    border-radius: 30px;
    padding: 26px 26px 34px;
    color: var(--ct-ink);
    font-size: 15px;
    line-height: 1.75;
    transition: background .25s, color .25s;
}
.ct b { color: var(--ct-ink); }

/* ---------------- 面包屑 ---------------- */
.ct-crumb { font-size: 13px; color: var(--ct-ink-2); margin-bottom: 18px; }
.ct-crumb a { color: var(--ct-ink-2); text-decoration: none; }
.ct-crumb a:hover { color: var(--ct-rose); }
.ct-crumb .sep { margin: 0 7px; opacity: .5; }

/* ---------------- Hero ---------------- */
.ct-hero { position: relative; margin-bottom: 20px; }
.ct-theme {
    position: absolute; top: 0; right: 0;
    border: 1.5px solid var(--ct-line); background: var(--ct-card); color: var(--ct-ink-2);
    border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 700;
    letter-spacing: .08em; cursor: pointer; transition: .2s;
}
.ct-theme:hover { border-color: var(--ct-rose); color: var(--ct-rose); }
.ct-hero-badge {
    width: 64px; height: 64px; border-radius: 22px;
    background: linear-gradient(135deg, var(--ct-rose) 0%, var(--ct-peach) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; box-shadow: var(--ct-shadow); margin-bottom: 16px;
}
.ct-hero h1 {
    margin: 0 0 4px; font-size: 30px; font-weight: 800; letter-spacing: .01em;
}
.ct-hero h1 .reg {
    display: inline-block; margin-left: 12px; vertical-align: middle;
    font-size: 12px; font-weight: 700; color: var(--ct-rose);
    background: var(--ct-rose-soft); border-radius: 999px; padding: 4px 12px;
    letter-spacing: .06em;
}
.ct-hero p { margin: 10px 0 14px; color: var(--ct-ink-2); max-width: 760px; }
.ct-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-tag {
    font-size: 12px; font-weight: 700; color: var(--ct-ink-2);
    background: var(--ct-card); border: 1.5px solid var(--ct-line);
    border-radius: 999px; padding: 4px 12px;
}

/* ---------------- 卡片 ---------------- */
.ct-card {
    background: var(--ct-card); border: 1.5px solid var(--ct-line);
    border-radius: var(--ct-radius); padding: 22px 22px 24px;
    margin-top: 18px; box-shadow: var(--ct-shadow);
}
.ct-card-title {
    margin: 0 0 16px; font-size: 17px; font-weight: 800;
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.ct-card-title .fi {
    width: 32px; height: 32px; border-radius: 11px; background: var(--ct-rose-soft);
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.ct-card-title .sub { font-size: 12.5px; font-weight: 600; color: var(--ct-ink-2); }

/* ---------------- 大圆计时钮（核心交互） ---------------- */
.ct-stage { display: flex; flex-direction: column; align-items: center; padding: 12px 0 4px; }
.ct-big-btn {
    width: 216px; height: 216px; border-radius: 50%;
    border: none; cursor: pointer; position: relative;
    background: linear-gradient(145deg, var(--ct-rose) 0%, var(--ct-rose-deep) 100%);
    color: #fff; box-shadow: 0 18px 44px rgba(224, 90, 122, .38);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: transform .15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.ct-big-btn:hover { transform: scale(1.03); }
.ct-big-btn:active { transform: scale(.97); }
.ct-big-btn .t { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.1; }
.ct-big-btn .l { margin-top: 8px; font-size: 15px; font-weight: 700; letter-spacing: .12em; opacity: .95; }
.ct-big-btn.is-on {
    background: linear-gradient(145deg, var(--ct-rose-deep) 0%, #9e2f4d 100%);
    animation: ctPulse 1.6s ease-out infinite;
}
@keyframes ctPulse {
    0%   { box-shadow: 0 18px 44px rgba(224, 90, 122, .38), 0 0 0 0 rgba(224, 90, 122, .45); }
    70%  { box-shadow: 0 18px 44px rgba(224, 90, 122, .38), 0 0 0 30px rgba(224, 90, 122, 0); }
    100% { box-shadow: 0 18px 44px rgba(224, 90, 122, .38), 0 0 0 0 rgba(224, 90, 122, 0); }
}
.ct-big-sub { margin-top: 16px; font-size: 13px; color: var(--ct-ink-2); text-align: center; }

/* ---------------- 511 状态横幅 ---------------- */
.ct-banner {
    margin-top: 20px; border-radius: 18px; padding: 15px 18px;
    display: flex; gap: 13px; align-items: flex-start;
    transition: background .3s;
}
.ct-banner .ic { font-size: 24px; line-height: 1.4; }
.ct-banner b { font-size: 15.5px; display: block; margin-bottom: 2px; }
.ct-banner p { margin: 0; font-size: 13.5px; line-height: 1.7; opacity: .92; }
.ct-banner.calm { background: var(--ct-calm-bg); }
.ct-banner.calm b { color: var(--ct-calm-ink); }
.ct-banner.calm p { color: var(--ct-calm-ink); }
.ct-banner.near { background: var(--ct-warn-bg); }
.ct-banner.near b { color: var(--ct-warn-ink); }
.ct-banner.near p { color: var(--ct-warn-ink); }
.ct-banner.ready { background: var(--ct-ready-bg); animation: ctBlink 1.2s ease-in-out infinite; }
.ct-banner.ready b { color: var(--ct-ready-ink); }
.ct-banner.ready p { color: var(--ct-ready-ink); }
@keyframes ctBlink {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224, 90, 122, .5); }
    50% { box-shadow: 0 0 0 9px rgba(224, 90, 122, 0); }
}

/* ---------------- 统计 chips ---------------- */
.ct-chips {
    margin-top: 18px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.ct-chip {
    background: var(--ct-bg); border: 1.5px solid var(--ct-line);
    border-radius: 16px; padding: 13px 14px;
}
.ct-chip .k { font-size: 12px; font-weight: 700; color: var(--ct-ink-2); letter-spacing: .05em; }
.ct-chip .v { font-size: 19px; font-weight: 800; margin: 3px 0 2px; color: var(--ct-rose-deep); }
:root[data-theme="dark"] .ct-chip .v { color: var(--ct-rose); }
.ct-chip .n { font-size: 11.5px; color: var(--ct-ink-2); line-height: 1.5; }

/* ---------------- 记录时间线 ---------------- */
.ct-list { margin-top: 6px; }
.ct-row {
    display: grid; grid-template-columns: 52px 1.2fr 1fr 1fr 36px;
    align-items: center; gap: 10px;
    padding: 12px 6px; border-bottom: 1.5px dashed var(--ct-line);
}
.ct-row:last-child { border-bottom: none; }
.ct-row .no { font-size: 12.5px; font-weight: 800; color: var(--ct-ink-2); }
.ct-row b { font-size: 14.5px; font-weight: 700; display: block; }
.ct-row small { font-size: 11px; color: var(--ct-ink-2); }
.ct-row.is-on { background: var(--ct-rose-soft); border-radius: 14px; }
.ct-row.is-on b { color: var(--ct-rose-deep); }
:root[data-theme="dark"] .ct-row.is-on b { color: var(--ct-rose); }
.ct-row .del {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1.5px solid var(--ct-line); background: transparent;
    color: var(--ct-ink-2); font-size: 15px; line-height: 1; cursor: pointer;
    transition: .15s;
}
.ct-row .del:hover { border-color: var(--arc-danger); color: var(--arc-danger); }
.ct-empty {
    margin-top: 6px; text-align: center; color: var(--ct-ink-2);
    font-size: 13.5px; padding: 26px 12px;
    border: 1.5px dashed var(--ct-line); border-radius: 16px;
}
.ct-clear {
    margin-top: 14px; border: 1.5px solid var(--ct-line); background: transparent;
    color: var(--ct-ink-2); border-radius: 999px; padding: 8px 18px;
    font-size: 12.5px; font-weight: 700; cursor: pointer; transition: .15s;
}
.ct-clear:hover { border-color: var(--arc-danger); color: var(--arc-danger); }

/* ---------------- AI ---------------- */
.ct-textarea {
    width: 100%; box-sizing: border-box; resize: vertical;
    border: 1.5px solid var(--ct-line); border-radius: 14px;
    background: var(--ct-bg); color: var(--ct-ink);
    padding: 12px 14px; font-size: 14px; font-family: inherit; line-height: 1.6;
}
.ct-textarea:focus { outline: none; border-color: var(--ct-rose); }
.ct-label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.ct-btn {
    border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--ct-rose) 0%, var(--ct-peach) 100%);
    color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .04em;
    border-radius: 999px; padding: 12px 26px; margin-top: 14px;
    box-shadow: 0 8px 22px rgba(224, 90, 122, .30); transition: .15s;
}
.ct-btn:hover { transform: translateY(-2px); }
.ct-btn:disabled { opacity: .6; cursor: default; transform: none; }
.ct-ai {
    margin-top: 16px; border-radius: 16px; padding: 16px 18px;
    background: var(--ct-bg); border: 1.5px solid var(--ct-line);
    font-size: 14px; line-height: 1.85; white-space: pre-wrap; word-break: break-word;
}
.ct-ai.empty { color: var(--ct-ink-2); }
.arc-dots::after { content: ''; animation: ctDots 1.2s steps(4) infinite; }
@keyframes ctDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------------- toast（Arc.toast 用） ---------------- */
.arc-toast {
    position: fixed; left: 50%; bottom: 36px;
    transform: translateX(-50%) translateY(16px);
    background: var(--ct-ink, #47262f); color: var(--ct-card, #fff);
    padding: 11px 20px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; z-index: 9999;
    opacity: 0; pointer-events: none; transition: .25s;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}
.arc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Tabs / Panels ---------------- */
.ct-tabs { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.ct-tab {
    border: 1.5px solid var(--ct-line); background: var(--ct-card);
    color: var(--ct-ink-2); border-radius: 999px; padding: 9px 18px;
    font-size: 13.5px; font-weight: 700; cursor: pointer; transition: .15s;
}
.ct-tab:hover { border-color: var(--ct-rose); color: var(--ct-rose); }
.ct-tab.active {
    background: var(--ct-rose); border-color: var(--ct-rose); color: #fff;
}
.ct-panel { display: none; padding: 20px 6px 4px; }
.ct-panel.active { display: block; }
.ct-panel h2 { font-size: 17px; font-weight: 800; margin: 18px 0 8px; }
.ct-panel h2:first-child { margin-top: 4px; }
.ct-panel p { margin: 8px 0; color: var(--ct-ink); }
.ct-panel ul { margin: 8px 0; padding-left: 22px; }
.ct-panel li { margin: 6px 0; }
.ct-faq details {
    border: 1.5px solid var(--ct-line); border-radius: 15px;
    background: var(--ct-card); margin: 10px 0; overflow: hidden;
}
.ct-faq summary {
    cursor: pointer; padding: 13px 17px; font-weight: 700; font-size: 14px;
    list-style: none;
}
.ct-faq summary::-webkit-details-marker { display: none; }
.ct-faq summary::before { content: '＋'; color: var(--ct-rose); margin-right: 9px; font-weight: 800; }
.ct-faq details[open] summary::before { content: '－'; }
.ct-faq .a { padding: 0 17px 15px; font-size: 13.5px; color: var(--ct-ink-2); line-height: 1.8; }
.ct-timeline { list-style: none; padding: 0 !important; }
.ct-timeline li {
    display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
    padding: 10px 0; border-bottom: 1.5px dashed var(--ct-line);
}
.ct-timeline .ver {
    font-size: 11.5px; font-weight: 800; color: #fff; background: var(--ct-rose);
    border-radius: 999px; padding: 2px 10px;
}
.ct-timeline .date { font-size: 12.5px; color: var(--ct-ink-2); font-weight: 700; }
.ct-timeline .txt { flex: 1 1 100%; font-size: 13.5px; color: var(--ct-ink); }

/* ---------------- 相关工具 ---------------- */
.ct-rel-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.ct-rel {
    display: flex; gap: 11px; align-items: center; text-decoration: none;
    border: 1.5px solid var(--ct-line); border-radius: 16px;
    background: var(--ct-bg); padding: 13px 14px; transition: .15s;
}
.ct-rel:hover { border-color: var(--ct-rose); transform: translateY(-2px); }
.ct-rel .ri {
    width: 38px; height: 38px; border-radius: 13px; background: var(--ct-rose-soft);
    display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none;
}
.ct-rel b { display: block; font-size: 13.5px; color: var(--ct-ink); }
.ct-rel small { font-size: 11.5px; color: var(--ct-ink-2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
    .ct-chips { grid-template-columns: repeat(2, 1fr); }
    .ct-rel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .ct { padding: 18px 14px 26px; border-radius: 22px; }
    .ct-hero h1 { font-size: 23px; }
    .ct-hero h1 .reg { display: block; margin: 8px 0 0; width: fit-content; }
    .ct-big-btn { width: 188px; height: 188px; }
    .ct-big-btn .t { font-size: 38px; }
    .ct-row { grid-template-columns: 40px 1.1fr 1fr 1fr 32px; gap: 6px; }
    .ct-rel-grid { grid-template-columns: 1fr; }
    .ct-theme { position: static; margin-bottom: 12px; }
}
