/* 量化商城独立样式 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==================== 头部样式 ==================== */
.market-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
}

/* 左侧区域：Logo + 导航 */
.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-shrink: 0;
}

.market-logo {
    display: flex;
    flex-direction: column;
    color: white;
    transition: transform 0.3s ease;
}

.market-logo:hover {
    transform: translateY(-2px);
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

.logo-subtitle {
    font-size: 12px;
    opacity: 0.9;
    letter-spacing: 1px;
}

/* 中间导航菜单 */
.market-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.nav-item i {
    font-size: 16px;
}

/* 右侧功能区域 */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    flex-shrink: 0;
}

/* 用户认证区域 */
.user-auth {
    position: relative;
}

.user-info {
    position: relative;
}

.username-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.username-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.username-btn.show {
    background: rgba(255, 255, 255, 0.3);
}

.username-btn i {
    font-size: 16px;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.username-btn:hover .dropdown-arrow,
.username-btn.show .dropdown-arrow {
    transform: rotate(180deg);
}

/* 用户下拉菜单 */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1000;
    pointer-events: none;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
}

.user-dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.user-dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding-left: 24px;
}

.user-dropdown-item:hover i {
    color: white;
}

.user-dropdown-item i {
    width: 18px;
    color: #667eea;
}

/* 登录按钮 */
.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: white;
    color: #667eea;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.login-btn i {
    font-size: 16px;
}

/* 语言切换器 */
.language-switcher {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-btn i {
    font-size: 16px;
    animation: rotate-globe 3s linear infinite;
}

@keyframes rotate-globe {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.language-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1000;
    pointer-events: none;
}

.language-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.language-btn.show {
    background: rgba(255, 255, 255, 0.3);
}

.language-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

.language-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    color: #333;
    font-size: 14px;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.language-dropdown-menu button:first-child {
    border-radius: 12px 12px 0 0;
}

.language-dropdown-menu button:last-child {
    border-radius: 0 0 12px 12px;
}

.language-dropdown-menu button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding-left: 24px;
}

.language-dropdown-menu button.active {
    background: #f0f2f5;
    color: #667eea;
    font-weight: 600;
}

.language-dropdown-menu button i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.language-dropdown-menu button.active {
    background: #f0f2f5;
    color: #667eea;
    font-weight: 600;
}

.language-dropdown-menu button.active i {
    color: #667eea;
}

/* ==================== 主内容区域 ==================== */
.market-main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    width: 100%;
}

/* ==================== 底部样式 ==================== */
.market-footer {
    background: #2c3e50;
    color: white;
    padding: 30px 0;
    margin-top: 60px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    text-align: center;
}

.footer-links {
    margin-bottom: 20px;
    font-size: 14px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-links .separator {
    margin: 0 15px;
    color: rgba(255, 255, 255, 0.5);
}

.footer-copyright {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
}

.footer-copyright .icp {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.footer-copyright .icp:hover {
    color: white;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .header-container {
        height: auto;
        padding: 10px 12px;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }

    .header-left {
        flex: 1;
        flex-wrap: wrap;
        gap: 0;
        min-width: 0;
    }

    .market-logo {
        flex-shrink: 0;
    }

    .logo-text {
        font-size: 18px;
    }

    .logo-subtitle {
        font-size: 9px;
    }

    /* 导航菜单换到第二行，横向滚动避免显示不全 */
    .market-nav {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 6px;
        padding: 8px 0 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .market-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .header-right {
        gap: 8px;
        flex-shrink: 0;
        align-self: center;
    }

    .username-btn,
    .login-btn,
    .language-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .market-main {
        padding: 15px;
    }
}

/* ==================== 登录弹窗样式 ==================== */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.login-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.login-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.login-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.login-modal-body {
    padding: 20px;
}

/* 微信扫码二维码（与主站登录弹窗保持一致） */
.qr-login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.qr-code-container {
    width: 300px;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
}

.wechat-qr-iframe {
    width: 300px;
    height: 400px;
    border: none;
}

.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #999;
}

.qr-loading i {
    font-size: 32px;
    color: #d4af37;
}

.qr-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #ff4d4f;
}

.qr-retry-btn {
    background: #d4af37;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.login-form-group {
    margin-bottom: 16px;
}

.login-label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.required-star {
    color: #ff4d4f;
    margin-left: 4px;
}

.login-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.form-help {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.login-checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.login-message {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-message-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.login-message-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.login-submit-btn {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-submit-btn:hover {
    background: #40a9ff;
    transform: translateY(-1px);
}

.login-submit-btn:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
    transform: none;
}

.login-divider {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.login-divider span {
    position: relative;
    background: white;
    padding: 0 10px;
    color: #999;
    font-size: 13px;
}

.login-alternatives {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-alt-btn {
    width: 100%;
    padding: 10px;
    background: white;
    color: #1890ff;
    border: 1px solid #1890ff;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-alt-btn:hover {
    background: #e6f7ff;
    transform: translateY(-1px);
}

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

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