/**
 * index.php 底部弹层：未登录提示 + 用户协议全文
 * 创作/智能体/我的 Tab 不加载 index-page.css 时需单独引入本文件
 */

/* ========== 登录提示（微信风居中卡片） ========== */
.h5-login-gate-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top, 0px)) 22px max(24px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    pointer-events: none;
}

.h5-login-gate-modal.is-open {
    display: flex;
    pointer-events: auto;
}

.h5-login-gate-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.h5-login-gate-dialog {
    position: relative;
    z-index: 1;
    width: min(86vw, 340px);
    max-width: 100%;
    background: #fff;
    border-radius: 22px;
    padding: 26px 20px 20px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.h5-login-gate-title {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.h5-login-gate-msg {
    font-size: 15px;
    color: #64748b;
    line-height: 1.55;
    margin: 0 0 26px;
}

.h5-login-gate-actions {
    display: flex;
    gap: 11px;
}

.h5-login-gate-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.h5-login-gate-btn--cancel {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    font-weight: 600;
}

.h5-login-gate-btn--login {
    background: linear-gradient(155deg, #5c7a72 0%, #3d524c 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(61, 82, 76, 0.3);
}

.h5-login-gate-btn:active {
    opacity: 0.92;
    transform: scale(0.98);
}

/* ========== 用户协议全文弹层 ========== */
.h5-legal-modal {
    position: fixed;
    inset: 0;
    z-index: 100020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
    pointer-events: none;
    box-sizing: border-box;
}

.h5-legal-modal.is-open {
    display: flex;
    pointer-events: auto;
}

.h5-legal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.h5-legal-sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(100%, 420px);
    max-height: min(82vh, 640px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.h5-legal-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #fafafa;
}

.h5-legal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.h5-legal-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: #eef1f8;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.h5-legal-close:active {
    background: #e2e8f0;
}

.h5-legal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 18px 12px;
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
    text-align: left;
}

.h5-legal-body-placeholder {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.h5-legal-body-error {
    margin: 0;
    color: #b91c1c;
    font-size: 14px;
}

.h5-legal-foot {
    flex-shrink: 0;
    padding: 12px 18px 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #fff;
}

.h5-legal-ok {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(155deg, #5c7a72 0%, #3d524c 100%);
    box-shadow: 0 6px 20px rgba(61, 82, 76, 0.28);
    font-family: inherit;
}

.h5-legal-ok:active {
    transform: scale(0.99);
    opacity: 0.95;
}

html[data-h5-appearance='dark'] .h5-login-gate-dialog,
html[data-theme='dark'] .h5-login-gate-dialog {
    background: #1e293b;
}

html[data-h5-appearance='dark'] .h5-login-gate-title,
html[data-theme='dark'] .h5-login-gate-title {
    color: #f1f5f9;
}

html[data-h5-appearance='dark'] .h5-login-gate-msg,
html[data-theme='dark'] .h5-login-gate-msg {
    color: #94a3b8;
}

html[data-h5-appearance='dark'] .h5-login-gate-btn--cancel,
html[data-theme='dark'] .h5-login-gate-btn--cancel {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

html[data-h5-appearance='dark'] .h5-login-gate-btn--login,
html[data-theme='dark'] .h5-login-gate-btn--login {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

html[data-h5-appearance='dark'] .h5-legal-sheet,
html[data-theme='dark'] .h5-legal-sheet {
    background: #1e293b;
}

html[data-h5-appearance='dark'] .h5-legal-head,
html[data-theme='dark'] .h5-legal-head {
    background: #0f172a;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-h5-appearance='dark'] .h5-legal-title,
html[data-theme='dark'] .h5-legal-title {
    color: #f1f5f9;
}

html[data-h5-appearance='dark'] .h5-legal-body,
html[data-theme='dark'] .h5-legal-body {
    color: #cbd5e1;
}

html[data-h5-appearance='dark'] .h5-legal-foot,
html[data-theme='dark'] .h5-legal-foot {
    background: #1e293b;
    border-top-color: rgba(255, 255, 255, 0.06);
}

/*
 * 图片预览 / 提示词详情（index.php 尾部）
 * 创作、智能体 Tab 不加载 index-page.css：若无下列规则，关闭态仍为 display:block，
 * 子元素会排在 body 末尾并露在底栏上方（× 与箭头像「浏览器控件」）。
 */
.image-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10060;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.image-modal.show {
    display: flex;
}

.image-modal .modal-close {
    position: absolute;
    top: max(16px, env(safe-area-inset-top, 0px));
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}

.image-modal .modal-image {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
}

.image-modal .modal-nav {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    justify-content: center;
    pointer-events: auto;
}

.image-modal .modal-nav button {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.prompt-detail-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: #0f0f1a;
    z-index: 10060;
    flex-direction: column;
    box-sizing: border-box;
}

.prompt-detail-modal.show {
    display: flex;
}

.prompt-detail-modal .prompt-detail-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #0f0f1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prompt-detail-modal .prompt-detail-close {
    width: 36px;
    height: 36px;
    background: #252540;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.prompt-detail-modal .prompt-detail-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    min-width: 0;
}

.prompt-detail-modal .prompt-detail-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.prompt-detail-modal .prompt-detail-image {
    width: 100%;
    aspect-ratio: 1;
    background: #252540;
    border-radius: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.prompt-detail-modal .prompt-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prompt-detail-modal .prompt-placeholder {
    font-size: 48px;
    line-height: 1;
}

.prompt-detail-modal .prompt-detail-section {
    margin-bottom: 16px;
}

.prompt-detail-modal .prompt-detail-label {
    font-size: 13px;
    color: #6b6b80;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-detail-modal .prompt-detail-text {
    background: #252540;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    color: #a0a0b0;
    line-height: 1.8;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.prompt-detail-modal .prompt-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a365d 0%, #2d4a73 100%);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.prompt-detail-modal .prompt-copy-btn:active {
    transform: scale(0.98);
    opacity: 0.95;
}
