/* ============================================================
   modal.css  —  自定义通用弹窗（替代 alert / prompt / confirm）
   用法：showModal('标题', '内容', [{text:'确定', primary:true}])
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: modalFadeIn 0.2s ease-out;
}

.modal-overlay.closing {
    animation: modalFadeOut 0.2s ease-in;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.modal-box {
    background-color: var(--c-panel-solid);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    max-width: 480px;
    width: 100%;
    padding: 25px;
    animation: modalSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes modalSlideIn {
    from { transform: scale(0.9) translateY(-20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.modal-box h2 {
    color: var(--c-primary-darker);
    font-size: 1.4rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-box p {
    color: var(--c-text);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-box input[type="text"],
.modal-box input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--c-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 20px;
    transition: border-color var(--t-base);
    outline: none;
    font-family: inherit;
}

.modal-box input[type="text"]:focus,
.modal-box input[type="number"]:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-actions button {
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--t-base);
    background-color: var(--c-border);
    color: var(--c-text);
    min-width: 80px;
    font-family: inherit;
}

.modal-actions button:hover {
    background-color: #bdbdbd;
    transform: translateY(-2px);
}

.modal-actions button.primary {
    background: var(--btn-primary-bg);
    color: var(--c-text-on-dark);
    box-shadow: var(--shadow-primary);
}

.modal-actions button.primary:hover {
    background: var(--btn-primary-bg-hover);
    box-shadow: var(--shadow-primary-lg);
}

.modal-actions button.danger {
    background: linear-gradient(to bottom, #f44336, #d32f2f);
    color: var(--c-text-on-dark);
}

.modal-actions button.danger:hover {
    background: linear-gradient(to bottom, #ef5350, #e53935);
}

/* 移动端 */
@media (max-width: 576px) {
    .modal-box {
        padding: 20px;
    }
    .modal-box h2 {
        font-size: 1.2rem;
    }
    .modal-actions button {
        padding: 10px 16px;
        font-size: 0.9rem;
        flex: 1;
        min-width: 0;
    }
}

/* ============================================================
   起始屏：适龄提示 + 法律同意（v1.1.0）
   ============================================================ */
.legal-consent {
    margin: 14px 0 6px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f7f6ef, #edf3e8);
    border: 1px solid #dce7d5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.age-rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.age-badge {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
    border-radius: 12px;
    background: #2f7d4f;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 14px rgba(47, 125, 79, 0.25);
}

.age-rating-row strong {
    display: block;
    color: #143f28;
    font-size: 15px;
}

.age-rating-row p {
    margin: 2px 0 0;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.5;
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 10px 0 6px;
    color: #1f2933;
    font-size: 13px;
    line-height: 1.55;
    cursor: pointer;
}

.consent-check input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: #2f7d4f;
    cursor: pointer;
}

.consent-warning {
    margin: 6px 0 0;
    color: #b42318;
    font-size: 12px;
    font-weight: 600;
}

.legal-consent .start-meta-actions {
    margin-top: 8px;
}

.legal-consent.consent-shake {
    animation: consent-shake 320ms ease;
}

@keyframes consent-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

@media (max-width: 576px) {
    .legal-consent { padding: 12px; }
    .age-rating-row { gap: 9px; }
    .age-badge { min-width: 38px; height: 38px; font-size: 13px; }
}