/**
 * 星图AI官网 - 弹窗样式
 * 包含：注册弹窗、下载引导弹窗
 */

/* ===================================
   弹窗遮罩层
   =================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   弹窗容器
   =================================== */
.modal-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

/* ===================================
   弹窗头部
   =================================== */
.modal-header {
    padding: 24px 24px 0;
    text-align: center;
}

.modal-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a42cf;
    margin: 0 0 8px;
}

.modal-header p {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}

/* ===================================
   弹窗关闭按钮
   =================================== */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: #666;
}

/* ===================================
   弹窗内容区
   =================================== */
.modal-body {
    padding: 24px;
}

/* ===================================
   表单样式
   =================================== */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #1a42cf;
    box-shadow: 0 0 0 3px rgba(26, 66, 207, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

/* 验证码发送按钮 */
.verification-row {
    display: flex;
    gap: 8px;
}

.verification-row input {
    flex: 1;
}

.verification-btn {
    padding: 12px 16px;
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a42cf;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.verification-btn:hover:not(:disabled) {
    background: #e8e8e8;
}

.verification-btn:disabled {
    color: #999;
    cursor: not-allowed;
}

/* ===================================
   提交按钮
   =================================== */
.modal-submit-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #1a42cf 0%, #2d5be3 100%);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.modal-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 66, 207, 0.3);
}

.modal-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===================================
   错误提示
   =================================== */
.form-error {
    font-size: 0.85rem;
    color: #e53935;
    margin-top: 4px;
}

/* ===================================
   成功状态
   =================================== */
.modal-success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 32px;
    height: 32px;
    stroke: #4caf50;
}

.modal-success h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    color: #333;
    margin: 0 0 8px;
}

.modal-success p {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}

.success-tips {
    margin-top: 20px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: left;
}

.success-tips .tips-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px !important;
}

.success-tips p {
    font-size: 0.85rem;
    color: #666;
    margin: 4px 0;
    line-height: 1.5;
}

.success-download-text {
    font-size: 0.95rem;
    color: #666;
    margin: 12px 0;
    line-height: 1.5;
}

.success-download-text a {
    color: #1a42cf;
    text-decoration: underline;
    cursor: pointer;
}

.success-download-text a:hover {
    color: #2d5be3;
}

/* ===================================
   下载引导弹窗
   =================================== */
.download-modal-content {
    padding: 0;
}

.download-modal-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.download-modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.download-modal-btn--mac {
    background: #f5f5f5;
    color: #333;
    border: 1.5px solid #e0e0e0;
}

.download-modal-btn--mac:hover {
    background: #e8e8e8;
}

.download-modal-btn--win {
    background: #1a42cf;
    color: #fff;
    border: none;
}

.download-modal-btn--win:hover {
    background: #2d5be3;
}

.download-modal-btn svg {
    width: 20px;
    height: 20px;
}

.download-modal-tips {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

.download-modal-tips h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px;
}

.download-modal-tips ul {
    margin: 0;
    padding-left: 20px;
}

.download-modal-tips li {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 6px;
}

.download-modal-tips li:last-child {
    margin-bottom: 0;
}

/* ===================================
   英文版
   =================================== */
[lang="en"] .modal-header h3 {
    font-size: 1.6rem;
}

[lang="en"] .verification-btn {
    font-size: 0.8rem;
}

/* ===================================
   响应式
   =================================== */
@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        margin: 16px;
    }

    .modal-header {
        padding: 20px 20px 0;
    }

    .modal-body {
        padding: 20px;
    }

    .download-modal-buttons {
        flex-direction: column;
    }
}