/* 自定义模态框样式 */

/* 遮罩层 */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 模态框容器 */
.custom-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
}

.custom-modal-overlay.show .custom-modal {
    transform: scale(1) translateY(0);
}

/* 模态框头部 */
.custom-modal-header {
    padding: 24px 24px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-modal-icon.success {
    background: #F0FDF4;
    color: #10B981;
}

.custom-modal-icon.error {
    background: #FEF2F2;
    color: #EF4444;
}

.custom-modal-icon.warning {
    background: #FFF7E6;
    color: #FA8C16;
}

.custom-modal-icon.info {
    background: #EFF6FF;
    color: #3B82F6;
}

.custom-modal-icon svg {
    width: 28px;
    height: 28px;
}

.custom-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* 模态框内容 */
.custom-modal-body {
    padding: 0 24px 24px;
}

.custom-modal-message {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* 模态框底部按钮 */
.custom-modal-footer {
    padding: 16px 24px;
    background: #f9fafb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.custom-modal-btn-primary {
    background: #FF6A00;
    color: white;
}

.custom-modal-btn-primary:hover {
    background: #E55D00;
    transform: translateY(-1px);
}

.custom-modal-btn-secondary {
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.custom-modal-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* 确认对话框样式 */
.custom-modal-footer.confirm {
    justify-content: space-between;
}

.custom-modal-footer.confirm .custom-modal-btn {
    flex: 1;
}

/* 动画效果 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* 响应式 */
@media (max-width: 480px) {
    .custom-modal {
        max-width: 90%;
        margin: 20px;
    }
    
    .custom-modal-header {
        padding: 20px 20px 12px;
    }
    
    .custom-modal-body {
        padding: 0 20px 20px;
    }
    
    .custom-modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }
    
    .custom-modal-btn {
        width: 100%;
    }
}

/* ========================================
   合作伙伴申请模态框
   ======================================== */

.partner-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.partner-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.partner-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.partner-modal-overlay.show .partner-modal {
    transform: scale(1) translateY(0);
}

/* 模态框头部 */
.partner-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.partner-modal-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.partner-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6A00, #FF8533);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.partner-modal-icon svg {
    width: 24px;
    height: 24px;
}

.partner-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.partner-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.partner-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* 模态框内容 */
.partner-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.partner-modal-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 24px;
}

.partner-form-group {
    margin-bottom: 20px;
}

.partner-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.partner-form-label .required {
    color: #EF4444;
    margin-left: 2px;
}

.partner-form-input,
.partner-form-textarea,
.partner-form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    transition: all 0.2s;
    font-family: inherit;
}

.partner-form-input:focus,
.partner-form-textarea:focus,
.partner-form-select:focus {
    outline: none;
    border-color: #FF6A00;
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

.partner-form-textarea {
    resize: vertical;
    min-height: 100px;
}

.partner-form-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

.partner-form-error {
    font-size: 12px;
    color: #EF4444;
    margin-top: 6px;
    display: none;
}

.partner-form-group.error .partner-form-input,
.partner-form-group.error .partner-form-textarea,
.partner-form-group.error .partner-form-select {
    border-color: #EF4444;
}

.partner-form-group.error .partner-form-error {
    display: block;
}

/* 模态框底部 */
.partner-modal-footer {
    padding: 16px 24px;
    background: #f9fafb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex-shrink: 0;
}

.partner-modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.partner-modal-btn-cancel {
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.partner-modal-btn-cancel:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.partner-modal-btn-submit {
    background: linear-gradient(135deg, #FF6A00, #FF8533);
    color: white;
    min-width: 120px;
}

.partner-modal-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

.partner-modal-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.partner-modal-btn-submit.loading {
    position: relative;
    color: transparent;
}

.partner-modal-btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 480px) {
    .partner-modal {
        max-width: 95%;
        margin: 20px;
    }
    
    .partner-modal-header {
        padding: 20px;
    }
    
    .partner-modal-body {
        padding: 20px;
    }
    
    .partner-modal-footer {
        padding: 12px 20px;
        flex-direction: column-reverse;
    }
    
    .partner-modal-btn {
        width: 100%;
    }
}

/* ========================================
   合作伙伴申请成功消息
   ======================================== */

.partner-success-message {
    text-align: center;
    padding: 40px 20px;
}

.partner-success-message svg {
    width: 64px;
    height: 64px;
    color: #10B981;
    margin-bottom: 20px;
}

.partner-success-message h4 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.partner-success-message p {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}


/* ========================================
   分类模态框（移动端底部导航）
   ======================================== */

.category-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.category-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.category-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.category-modal-overlay.show .category-modal {
    transform: translateY(0);
}

/* 模态框头部 */
.category-modal-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.category-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-modal-title svg {
    color: #FF6A00;
}

.category-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.category-modal-close:hover,
.category-modal-close:active {
    background: #e5e7eb;
    color: #1f2937;
}

/* 模态框内容 */
.category-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* 分类网格 */
.modal-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* 分类卡片 */
.modal-category-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: all 0.3s;
    text-decoration: none;
    cursor: pointer;
}

.modal-category-card:hover,
.modal-category-card:active {
    border-color: #FF6A00;
    background: #FFF7F0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.15);
}

.modal-category-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-category-card:hover .modal-category-icon,
.modal-category-card:active .modal-category-icon {
    transform: scale(1.1);
}

.modal-category-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-category-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-category-count {
    font-size: 12px;
    color: #9ca3af;
}

/* 响应式 - 小屏幕单列显示 */
@media (max-width: 360px) {
    .modal-category-grid {
        grid-template-columns: 1fr;
    }
}

/* 适配 iPhone 刘海屏 */
@supports (padding: max(0px)) {
    .category-modal {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}


/* ========================================
   圈子模态框（论坛子分类）
   ======================================== */

.forum-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.forum-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.forum-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.forum-modal-overlay.show .forum-modal {
    transform: translateY(0);
}

/* 模态框头部 */
.forum-modal-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.forum-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forum-modal-title svg {
    color: #FF6A00;
}

.forum-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.forum-modal-close:active {
    background: #e5e7eb;
    color: #1f2937;
}

/* 模态框内容 */
.forum-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* 论坛网格 */
.modal-forum-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* 论坛卡片 */
.modal-forum-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: all 0.3s;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.modal-forum-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.05), rgba(255, 133, 51, 0.05));
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-forum-card:active::before {
    opacity: 1;
}

.modal-forum-card:active {
    border-color: #FF6A00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.15);
}

.modal-forum-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.modal-forum-card:active .modal-forum-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.modal-forum-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.modal-forum-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-forum-count {
    font-size: 12px;
    color: #9ca3af;
}

/* 美业圈子总览入口卡（突出显示） */
.modal-forum-card-hub {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff5ec 0%, #fff0f5 100%);
    border: 2px solid #ffd1a8;
    flex-direction: row;
    padding: 14px 16px;
    min-height: auto;
    align-items: center;
    gap: 12px;
}

.modal-forum-card-hub .modal-forum-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin: 0;
    box-shadow: 0 4px 10px rgba(255, 106, 0, 0.3);
}

.modal-forum-card-hub .modal-forum-info {
    flex: 1;
    gap: 2px;
}

.modal-forum-card-hub .modal-forum-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1f2937;
}

.modal-forum-card-hub .modal-forum-count {
    color: #FF6A00;
    font-weight: 500;
}

.modal-forum-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(135deg, #FF6A00, #FF6FA5);
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(255, 106, 0, 0.25);
}

.modal-forum-card-hub:active {
    border-color: #FF6A00;
    background: linear-gradient(135deg, #ffe8d3 0%, #ffd9e8 100%);
}

/* 空状态 */
.modal-forum-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.modal-forum-empty svg {
    color: #d1d5db;
    margin-bottom: 16px;
}

.modal-forum-empty p {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.modal-forum-empty span {
    font-size: 14px;
    color: #9ca3af;
}

/* 响应式 - 小屏幕单列显示 */
@media (max-width: 360px) {
    .modal-forum-grid {
        grid-template-columns: 1fr;
    }
}

/* 适配 iPhone 刘海屏 */
@supports (padding: max(0px)) {
    .forum-modal {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}
