@font-face {
    font-family: 'CsPeriodUser';
    src: url('./assets/QianTuXiaoTuTi-2.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'CsPeriodChar';
    src: url('./assets/QingSongShouXieTi1-2.ttf') format('truetype');
    font-display: swap;
}

/* 须高于 .couple-space-overlay（z-index:100135），否则从私密空间打开时叠在主层之下，表现为「点了没反应」 */
.couple-period-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 100235;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background:
        radial-gradient(circle at top, rgba(255, 236, 244, 0.96), rgba(255, 246, 250, 0.98) 42%, rgba(255, 250, 252, 0.995) 100%);
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
}

/* 挂在 #app 内时覆盖为与主屏同区域（脚本将 overlay 插入 #app） */
#app .couple-period-overlay {
    position: absolute;
    inset: 0;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    transform: none;
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: inherit;
}

.couple-period-shell {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #7d4b5f;
    background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,248,251,0.95));
    backdrop-filter: blur(12px);
}

.couple-period-topbar {
    display: flex;
    align-items: center;
    padding: 18px 18px 10px;
    gap: 8px;
}

.couple-period-topbar .couple-period-title {
    flex: 1;
    text-align: center;
}

.couple-period-topbar-spacer {
    flex: 0 0 auto;
    width: 72px;
    height: 1px;
    pointer-events: none;
}

.couple-period-back,
.couple-period-action {
    border: 0;
    background: rgba(255,255,255,0.82);
    color: #b55d7f;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    box-shadow: 0 8px 20px rgba(228, 150, 180, 0.18);
}

.couple-period-title {
    font-family: 'CsPeriodChar', cursive;
    font-size: 26px;
    color: #c45c86;
}

.couple-period-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.couple-period-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.couple-period-card {
    border-radius: 26px;
    padding: 18px;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.84);
    box-shadow: 0 16px 36px rgba(231, 171, 193, 0.2);
}

.couple-period-hero {
    background: linear-gradient(135deg, rgba(255, 232, 240, 0.95), rgba(255, 248, 252, 0.98));
}

.couple-period-hero h2,
.couple-period-note-paper h3 {
    margin: 0;
    font-family: 'CsPeriodChar', cursive;
    color: #c25b85;
}

.couple-period-hero p,
.couple-period-meta,
.couple-period-calendar-head,
.couple-period-list,
.couple-period-form,
.couple-period-empty {
    font-size: 14px;
    line-height: 1.7;
}

.couple-period-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.couple-period-stat {
    border-radius: 18px;
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.couple-period-stat strong {
    display: block;
    font-size: 20px;
    color: #d05b88;
    margin-bottom: 4px;
}

.couple-period-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.couple-period-weekday,
.couple-period-day {
    text-align: center;
}

.couple-period-weekday {
    font-size: 12px;
    color: #bc87a0;
}

.couple-period-day {
    border: 0;
    border-radius: 18px;
    background: rgba(255, 247, 250, 0.88);
    min-height: 52px;
    color: #9d627a;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(233, 195, 209, 0.36);
}

.couple-period-day.is-period {
    color: #8f355f;
}

.couple-period-day.is-period-depth-1 {
    background: linear-gradient(180deg, #ffd9e6, #ffc6d9);
}

.couple-period-day.is-period-depth-2 {
    background: linear-gradient(180deg, #ffc7da, #ffafcb);
}

.couple-period-day.is-period-depth-3 {
    background: linear-gradient(180deg, #ffb1cb, #ff8fb7);
    color: #812949;
}

.couple-period-day.is-period-start,
.couple-period-day.is-period-end {
    box-shadow: inset 0 0 0 2px rgba(180, 57, 103, 0.26), 0 8px 16px rgba(228, 141, 173, 0.18);
}

.couple-period-day.is-predicted {
    box-shadow: inset 0 0 0 2px rgba(220, 108, 150, 0.42);
}

.couple-period-day.is-selected {
    outline: 2px solid rgba(206, 96, 143, 0.5);
}

.couple-period-day-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    margin: 5px auto 0;
    background: currentColor;
    opacity: 0.7;
}

.couple-period-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.couple-period-field,
.couple-period-field textarea,
.couple-period-field input {
    width: 100%;
}

.couple-period-field input,
.couple-period-field textarea {
    box-sizing: border-box;
    border: 0;
    border-radius: 16px;
    padding: 12px 14px;
    margin-top: 6px;
    background: rgba(255, 244, 248, 0.92);
    color: #8c566c;
}

.couple-period-field textarea {
    min-height: 88px;
    resize: none;
}

.couple-period-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.couple-period-primary,
.couple-period-secondary {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
}

.couple-period-primary {
    background: linear-gradient(90deg, #ff9dc1, #ff7daa);
    color: #fff;
}

.couple-period-secondary {
    background: rgba(255, 240, 246, 0.95);
    color: #bb5f84;
}

.couple-period-note-paper {
    border-radius: 22px;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(255,253,246,0.98), rgba(255,248,236,0.98));
    box-shadow: inset 0 0 0 1px rgba(237, 216, 182, 0.56), 0 14px 28px rgba(217, 194, 156, 0.18);
}

.couple-period-note-body {
    margin-top: 10px;
    font-family: 'CsPeriodUser', cursive;
    font-size: 18px;
    line-height: 1.8;
    color: #8d5e4c;
    white-space: pre-wrap;
}

.couple-period-note-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #b5889c;
    line-height: 1.6;
}

.couple-period-remark-heading {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #9d627a;
}

.couple-period-symptom-card .couple-period-remark-thread-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(157, 98, 122, 0.28);
}

.couple-period-symptom-card .couple-period-remark-thread-section .couple-period-remark-heading {
    margin-top: 0;
}

.couple-period-note-paper .couple-period-char-note-reply {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(237, 216, 182, 0.65);
}

.couple-period-record-item {
    border-radius: 18px;
    padding: 12px 14px;
    background: rgba(255, 245, 248, 0.9);
    margin-top: 10px;
}

.couple-period-record-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.couple-period-record-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.couple-period-fold-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #9d627a;
    font-size: 15px;
    font-weight: 600;
}

.couple-period-fold-head span {
    font-size: 13px;
    color: #c06d8f;
}

.couple-period-fold-summary {
    margin-top: 10px;
}

.couple-period-record-user-tag {
    font-size: 13px;
    font-weight: 600;
    color: #c45f86;
    opacity: 0.92;
}

.couple-period-thread-msg-head {
    align-items: flex-start;
}

.couple-period-thread-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.couple-period-thread-tool {
    border: 0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #b55d7f;
    box-shadow: 0 4px 10px rgba(228, 150, 180, 0.14);
}
