/* ============================================================
   css/legal.css — 首次使用合规门禁（年龄确认 + AI 声明）
   韩系唯美风，与 onboarding 卡片视觉一致
   ============================================================ */

.legal-overlay {
    position: absolute; inset: 0; z-index: 6000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(60,52,46,0.42);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.legal-card {
    max-width: 360px; width: 88vw;
    border-radius: 24px; padding: 32px 24px 26px;
    background: linear-gradient(180deg, #FCFAF7 0%, #F7F2EC 100%);
    box-shadow: 0 8px 40px rgba(139,110,94,0.18);
    animation: legalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 88vh; overflow-y: auto;
}
@keyframes legalFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.legal-header { text-align: center; margin-bottom: 24px; }
.legal-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic; font-size: 26px; color: #8B6E5E;
    letter-spacing: 1px; margin-bottom: 6px;
}
.legal-subtitle { font-size: 13px; color: #9B8579; letter-spacing: 1px; }

.legal-note {
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(201,176,168,0.25);
    border-radius: 14px; padding: 14px 16px; margin-bottom: 18px;
}
.legal-note-title { font-size: 12px; color: #A88080; letter-spacing: 2px; margin-bottom: 6px; }
.legal-note-body { font-size: 13px; color: #6B5D53; line-height: 1.75; }
/* 「请记住…」= 附加备注（安全提示），单独浅色小框 + 更小更淡的字，与声明正文明显区分 */
.legal-note-tip {
    margin-top: 10px;
    padding: 9px 11px;
    background: rgba(201,176,168,0.10);
    border: 1px dashed rgba(201,176,168,0.40);
    border-radius: 10px;
    font-size: 11.5px;
    color: #8A7A72;
    line-height: 1.7;
}
.legal-note-tip b { color: #A88080; font-weight: 600; }

.legal-check {
    display: flex; align-items: flex-start; gap: 10px;
    cursor: pointer; padding: 6px 0; user-select: none; -webkit-user-select: none;
}
.legal-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.legal-check-box {
    flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px;
    border: 1.5px solid #D4BFB5; border-radius: 6px; background: #fff;
    transition: background 0.2s ease, border-color 0.2s ease; position: relative;
}
.legal-check input:checked + .legal-check-box { background: #C9B0A8; border-color: #C9B0A8; }
.legal-check input:checked + .legal-check-box::after {
    content: ''; position: absolute; left: 6px; top: 2px;
    width: 5px; height: 10px; border: solid #fff;
    border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.legal-check-text { font-size: 13px; color: #6B5D53; line-height: 1.65; }
.legal-check-text a { color: #A88080; text-decoration: underline; }

.legal-btn {
    width: 100%; margin-top: 20px; padding: 14px;
    border-radius: 24px; font-size: 15px; letter-spacing: 1px;
    border: none; cursor: pointer; color: #fff;
    background: var(--rose-dark, #A88080); box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}
.legal-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.legal-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

/* ============================================================
   应用内政策/协议阅读页（全屏浮层，带返回按钮）
   ============================================================ */
.legal-doc-overlay {
    position: absolute; inset: 0; z-index: 6100;
    display: flex; flex-direction: column;
    background: #F8F4EF;
    animation: legalDocIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.legal-doc-overlay.legal-doc-closing { opacity: 0; transform: translateX(10%); pointer-events: none; }
@keyframes legalDocIn {
    from { opacity: 0; transform: translateX(10%); }
    to   { opacity: 1; transform: translateX(0); }
}
.legal-doc-header {
    display: flex; align-items: center; gap: 2px; flex-shrink: 0;
    padding: calc(10px + var(--safe-top)) 12px;
    background: #FCFAF7; border-bottom: 1px solid rgba(201,176,168,0.18);
}
.legal-doc-back {
    width: 36px; height: 36px; border: none; background: transparent;
    color: #8B6E5E; cursor: pointer; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease;
}
.legal-doc-back:hover { background: rgba(201,176,168,0.14); }
.legal-doc-title {
    font-family: 'Playfair Display', Georgia, serif; font-style: italic;
    font-size: 17px; color: #8B6E5E; letter-spacing: 1px;
}
/* 内容直接加载进页面（不用 iframe，任何环境都能打开；样式跟随应用主题） */
.legal-doc-body {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 26px 22px 40px;
    background: #F8F4EF;
    color: #6B5D53;
    font-size: 14px; line-height: 1.9;
    font-family: var(--font-body);
}
.legal-doc-body h1 {
    font-size: 22px; color: #8B6E5E; text-align: center;
    letter-spacing: 2px; margin: 6px 0 20px; font-weight: 600;
}
.legal-doc-body h2 {
    font-size: 16px; color: #8B6E5E; margin: 22px 0 10px; font-weight: 600;
}
.legal-doc-body p { font-size: 14px; color: #6B5D53; margin: 8px 0; }
.legal-doc-body strong { color: #8B6E5E; }
.legal-doc-body .footer { text-align: center; font-size: 12px; color: #B5A59A; margin-top: 28px; }
.legal-doc-loading { padding: 60px 0; text-align: center; color: #B5A59A; font-size: 13px; letter-spacing: 1px; }
.legal-doc-error { padding: 60px 24px; text-align: center; color: #B5A59A; font-size: 13px; line-height: 1.8; }

/* ============================================================
   防沉迷温柔提醒（每连续使用两小时）
   ============================================================ */
.usage-reminder-overlay {
    position: absolute; inset: 0; z-index: 6200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(60,52,46,0.35);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    animation: legalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.usage-reminder-card {
    max-width: 320px; width: 82vw; text-align: center;
    border-radius: 22px; padding: 30px 24px 24px;
    background: linear-gradient(180deg, #FCFAF7 0%, #F7F2EC 100%);
    box-shadow: 0 8px 40px rgba(139,110,94,0.2);
}
.usage-reminder-heart {
    width: 42px; height: 42px; color: #C9B0A8; margin: 0 auto 14px; display: block;
    animation: usageHeart 1.6s ease-in-out infinite;
}
@keyframes usageHeart {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.16); }
}
.usage-reminder-msg { font-size: 14px; color: #6B5D53; line-height: 1.8; margin-bottom: 20px; }
.usage-reminder-btn {
    padding: 11px 32px; border-radius: 24px; font-size: 14px; letter-spacing: 1px;
    border: none; cursor: pointer; color: #fff;
    background: var(--rose-dark, #A88080); box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}
.usage-reminder-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
