/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    position: relative;
}

/* 语言切换 */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1001;
}

/* PC端语言切换位置调整 */
@media (min-width: 769px) {
    .language-switcher {
        top: 20px;
        right: 40px;
    }
}

.lang-btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.lang-btn:hover {
    background: #f5f5f5;
}

.lang-btn.active:hover {
    background: #5a6fd8;
}

/* 标题 */
.title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

/* 验证码输入组 */
.verification-group {
    display: flex;
    gap: 10px;
}

.verification-group .form-control {
    flex: 1;
}

.verification-group .btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 12px 16px;
    font-size: 14px;
    max-width: 100px;
}

/* 按钮样式 */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 链接样式 */
.form-links {
    text-align: center;
    margin-top: 20px;
}

.form-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.form-links a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* 错误和成功消息 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    .title {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .form-control {
        padding: 10px 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .btn {
        padding: 12px;
        font-size: 16px;
    }
    
    .language-switcher {
        top: 15px;
        right: 15px;
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* 用户信息页面样式 */
.user-info {
    text-align: center;
    padding: 20px 0;
}

.user-info h2 {
    color: #333;
    margin-bottom: 10px;
}

.user-info p {
    color: #666;
    margin-bottom: 5px;
}

.user-info .balance {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin: 10px 0;
}

/* 主导航样式 */
.main-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e1e5e9;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
}

.nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 60px;
    position: relative;
}

.nav-item:hover {
    background: #f8f9fa;
    color: #667eea;
    transform: translateY(-2px);
}

.nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #667eea;
    border-radius: 50%;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}

.nav-text {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

/* 下拉菜单样式 */
.nav-item-dropdown {
    position: relative;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 60px;
    position: relative;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #667eea;
    transform: translateY(-2px);
}

.nav-item-dropdown.active .nav-link {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-arrow {
    font-size: 8px;
    margin-top: 2px;
    transition: transform 0.3s ease;
}

.nav-item-dropdown.active .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    margin-bottom: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-item-dropdown.active .nav-submenu {
    opacity: 1;
    visibility: visible;
}

.nav-subitem {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.nav-subitem:last-child {
    margin-bottom: 0;
}

.nav-subitem:hover {
    background: #f8f9fa;
    color: #667eea;
}

.nav-subitem.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-subitem .nav-icon {
    font-size: 16px;
    margin-right: 12px;
    margin-bottom: 0;
}

.nav-subitem .nav-text {
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
}

/* 页面内容区域调整 */
.page-content {
    padding-bottom: 80px; /* 为底部导航留出空间 */
    min-height: calc(100vh - 80px);
    width: 100%;
}

/* 轮播图样式 */
.carousel-section {
    margin: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    height: 200px;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.slide-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.slide-content h3 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slide-content p {
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* PC端适配 */
@media (min-width: 769px) {
    .main-navigation {
        position: fixed;
        top: 0;
        left: 0;
        bottom: auto;
        width: 200px;
        height: 100vh;
        border-top: none;
        border-right: 1px solid #e1e5e9;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
    }
    
    .nav-container {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0 15px;
        gap: 10px;
    }
    
    .nav-item:not(.nav-item-dropdown) {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px 20px;
        min-width: auto;
        border-radius: 10px;
        margin-bottom: 5px;
    }
    
    .nav-item-dropdown {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        margin-bottom: 5px;
    }
    
    .nav-item.active::before {
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        width: 4px;
        height: 20px;
        border-radius: 2px;
    }
    
    .nav-icon {
        font-size: 20px;
        margin-bottom: 0;
        margin-right: 15px;
    }
    
    .nav-text {
        font-size: 14px;
        text-align: left;
    }
    
    /* PC端下拉菜单样式 */
    .nav-link {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px 20px;
        min-width: auto;
        border-radius: 10px;
        margin-bottom: 5px;
    }
    
    .nav-arrow {
        margin-left: auto;
        margin-top: 0;
        font-size: 10px;
    }
    
    .nav-submenu {
        position: static;
        transform: none;
        box-shadow: none;
        background: transparent;
        border-radius: 0;
        margin: 0;
        padding: 0;
        opacity: 1;
        visibility: visible;
        min-width: auto;
        display: block;
        width: 100%;
    }
    
    .nav-item-dropdown .nav-submenu {
        opacity: 0;
        visibility: hidden;
        display: none;
    }
    
    .nav-item-dropdown.active .nav-submenu {
        opacity: 1;
        visibility: visible;
        display: block;
    }
    
    /* PC端产品代理菜单默认展开 */
    .nav-item-dropdown.pc-expanded .nav-submenu {
        opacity: 1;
        visibility: visible;
        display: block;
    }
    
    .nav-item-dropdown.pc-expanded .nav-arrow {
        transform: rotate(180deg);
    }
    
    .nav-subitem {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 15px 20px 15px 40px;
        margin-bottom: 5px;
        border-radius: 10px;
        text-decoration: none;
        color: #666;
        transition: all 0.3s ease;
        background: transparent;
        border-left: 3px solid transparent;
    }
    
    .nav-subitem:hover {
        background: #f8f9fa;
        color: #667eea;
        border-left-color: #667eea;
    }
    
    .nav-subitem.active {
        color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        border-left-color: #667eea;
    }
    
    .nav-subitem .nav-icon {
        font-size: 20px;
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .nav-subitem .nav-text {
        font-size: 14px;
        text-align: left;
    }
    
    .page-content {
        margin-left: 200px;
        padding-bottom: 0;
        min-height: 100vh;
        width: calc(100% - 200px);
    }
    
    .dashboard-container {
        max-width: none;
        margin: 0;
        padding: 40px;
        width: 100%;
    }
    
    .user-card {
        padding: 40px;
        margin-bottom: 40px;
    }
    
    .user-avatar {
        width: 100px;
        height: 100px;
        font-size: 40px;
        margin-bottom: 25px;
    }
    
    .user-info h2 {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .user-info p {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .balance-display {
        padding: 30px;
        margin: 30px 0;
    }
    
    .balance-amount {
        font-size: 40px;
        margin-bottom: 8px;
    }
    
    .balance-label {
        font-size: 16px;
    }
    
    .carousel-section {
        height: 300px;
        margin: 30px 0;
    }
    
    .slide-content h3 {
        font-size: 32px;
    }
    
    .slide-content p {
        font-size: 18px;
    }
    
    .carousel-indicators {
        bottom: 20px;
    }
    
    .indicator {
        width: 12px;
        height: 12px;
    }
    
    .logout-section {
        margin-top: 50px;
    }
    
    .action-btn {
        padding: 15px 30px;
        font-size: 16px;
        min-width: 150px;
    }
}

/* 平板端适配 */
@media (min-width: 481px) and (max-width: 768px) {
    .main-navigation {
        position: fixed;
        top: 0;
        left: 0;
        bottom: auto;
        width: 80px;
        height: 100vh;
        border-top: none;
        border-right: 1px solid #e1e5e9;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
    }
    
    .nav-container {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 0 10px;
        gap: 15px;
    }
    
    .nav-item {
        flex-direction: column;
        padding: 15px 10px;
        min-width: 60px;
        border-radius: 10px;
    }
    
    .nav-item.active::before {
        top: -8px;
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        height: 4px;
        border-radius: 50%;
    }
    
    .nav-icon {
        font-size: 24px;
        margin-bottom: 5px;
        margin-right: 0;
    }
    
    .nav-text {
        font-size: 10px;
        text-align: center;
    }
    
    /* 平板端下拉菜单样式 */
    .nav-link {
        flex-direction: column;
        padding: 15px 10px;
        min-width: 60px;
        border-radius: 10px;
    }
    
    .nav-arrow {
        margin-top: 2px;
        font-size: 8px;
    }
    
    .nav-submenu {
        position: absolute;
        left: 100%;
        top: 0;
        transform: none;
        margin: 0 0 0 8px;
        min-width: 180px;
    }
    
    .nav-subitem {
        padding: 10px 12px;
        margin-bottom: 2px;
    }
    
    .nav-subitem .nav-icon {
        font-size: 14px;
        margin-right: 8px;
    }
    
    .nav-subitem .nav-text {
        font-size: 12px;
    }
    
    .page-content {
        margin-left: 80px;
        padding-bottom: 0;
        min-height: 100vh;
        width: calc(100% - 80px);
    }
    
    .dashboard-container {
        max-width: none;
        margin: 0;
        padding: 20px;
        width: 100%;
    }
    
    .carousel-section {
        height: 250px;
    }
    
    .slide-content h3 {
        font-size: 28px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
}

/* 手机端适配 */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 5px;
    }
    
    .nav-item {
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-text {
        font-size: 10px;
    }
    
    .page-content {
        padding-bottom: 70px;
    }
}

@media (max-width: 360px) {
    .nav-text {
        font-size: 9px;
    }
    
    .nav-item {
        padding: 4px 6px;
        min-width: 45px;
    }
}
