/* ============================================
   Alpha Future Academy - 公共样式层
   全站统一基础样式
   ============================================ */

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 禁止移动端双击缩放和文本选择 */
html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

/* 中文辅助开关通用样式 */
.zh-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 111, 0, 0.1);
    border: 1px solid rgba(255, 111, 0, 0.3);
    border-radius: 10px;
}

.zh-toggle-label {
    font-size: 0.75rem;
    color: #666;
}

.zh-toggle-switch {
    width: 48px;
    height: 24px;
    background: #ddd;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #ccc;
}

.zh-toggle-switch.active {
    background: #FF6F00;
    border-color: #FF6F00;
}

.zh-toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.zh-toggle-switch.active::after {
    left: 27px;
}

/* 中文辅助文本显示 */
.zh-text {
    display: none;
    color: #FF6F00;
}

body.chinese-enabled .zh-text,
body.zh-enabled .zh-text {
    display: inline;
}

.zh-block {
    display: none;
}

body.chinese-enabled .zh-block,
body.zh-enabled .zh-block {
    display: block;
}

/* ============================================
   顶部导航组件样式
   ============================================ */
.common-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid rgba(72, 212, 228, 0.2);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #48d4e4;
    letter-spacing: 0.1em;
}

.header-subtitle {
    font-size: 0.75rem;
    color: rgba(184, 230, 245, 0.7);
    letter-spacing: 0.05em;
}

/* 返回按钮 */
.header-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(72, 212, 228, 0.1);
    border: 1px solid rgba(72, 212, 228, 0.3);
    border-radius: 20px;
    color: #48d4e4;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-back-btn:hover {
    background: rgba(72, 212, 228, 0.2);
    border-color: rgba(72, 212, 228, 0.5);
    transform: translateY(-2px);
}

.back-arrow {
    font-size: 0.7rem;
}

.back-text-zh {
    display: none;
}

body.chinese-enabled .back-text,
body.zh-enabled .back-text {
    display: none;
}

body.chinese-enabled .back-text-zh,
body.zh-enabled .back-text-zh {
    display: inline;
}

/* 用户按钮 */
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-user-btn:hover {
    background: rgba(72, 212, 228, 0.15);
    border-color: rgba(72, 212, 228, 0.5);
    color: #48d4e4;
}

.user-icon {
    font-size: 1rem;
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户菜单样式 */
.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(72, 212, 228, 0.3);
    border-radius: 12px;
    min-width: 180px;
    z-index: 1100;
    display: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    font-size: 0.9rem;
}

.user-menu-item:hover {
    background: rgba(72, 212, 228, 0.15);
}

.user-menu-item.logout-item:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.menu-icon {
    font-size: 1rem;
}

.menu-text {
    flex: 1;
}

.menu-text-zh {
    display: none;
    color: #FF6F00;
    font-size: 0.8rem;
}

body.chinese-enabled .menu-text-zh {
    display: inline;
}

.user-menu-divider {
    height: 1px;
    background: rgba(72, 212, 228, 0.2);
    margin: 4px 0;
}

/* 登录拦截遮罩 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-overlay-content {
    text-align: center;
    color: #ffffff;
}

.login-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
}

.login-overlay-content p {
    font-size: 1.2rem;
    color: #48d4e4;
    letter-spacing: 0.1em;
}

/* ============================================
   登录弹窗通用样式
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.95), rgba(26, 42, 74, 0.95));
    border: 2px solid rgba(72, 212, 228, 0.3);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 0 50px rgba(72, 212, 228, 0.2);
    max-width: 90%;
    width: 400px;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.modal-title {
    color: #48d4e4;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

.modal-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 30px;
    max-width: 300px;
}

.login-input-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-input-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.login-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(72, 212, 228, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.login-input:focus {
    border-color: #40E0D0;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.3);
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.login-submit-btn {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(72, 212, 228, 0.4), rgba(168, 85, 247, 0.4));
    border: 2px solid rgba(72, 212, 228, 0.6);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, rgba(72, 212, 228, 0.6), rgba(168, 85, 247, 0.6));
    box-shadow: 0 0 25px rgba(72, 212, 228, 0.5);
}

.login-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.login-close-btn:hover {
    color: #40E0D0;
}

.login-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 20px;
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-bottom: 15px;
    min-height: 20px;
}

/* 密码切换按钮 */
.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

/* 注册链接 */
.register-link {
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    cursor: pointer;
}

.register-link:hover {
    color: #48d4e4;
    text-decoration: underline;
}

/* ============================================
   通用按钮样式
   ============================================ */
.btn-primary {
    padding: 12px 24px;
    background: rgba(72, 212, 228, 0.2);
    border: 2px solid rgba(72, 212, 228, 0.5);
    color: #48d4e4;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: rgba(72, 212, 228, 0.4);
    box-shadow: 0 0 20px rgba(72, 212, 228, 0.5);
}

.btn-secondary {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   通用卡片样式
   ============================================ */
.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.card:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ============================================
   响应式适配
   ============================================ */

@media (max-width: 480px) {
    .common-header {
        padding: 0 8px;
        height: 44px;
    }
    
    .header-title {
        font-size: 0.85rem;
    }
    
    .header-subtitle {
        font-size: 0.55rem;
    }
    
    .header-back-btn,
    .header-user-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
        gap: 4px;
    }
    
    .zh-toggle-container {
        padding: 3px 6px;
    }
    
    .zh-toggle-label {
        display: none;
    }
    
    .zh-toggle-switch {
        width: 40px;
        height: 20px;
    }
    
    .zh-toggle-switch::after {
        width: 14px;
        height: 14px;
        top: 1px;
        left: 1px;
    }
    
    .zh-toggle-switch.active::after {
        left: 23px;
    }
    
    .user-name {
        max-width: 45px;
        font-size: 0.75rem;
    }
    
    .modal-content {
        padding: 20px;
        border-radius: 16px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-text {
        font-size: 0.85rem;
    }
    
    .login-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .login-submit-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .common-header {
        padding: 0 10px;
        height: 50px;
    }
    
    .header-title {
        font-size: 0.95rem;
    }
    
    .header-subtitle {
        font-size: 0.6rem;
    }
    
    .header-back-btn,
    .header-user-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    
    .zh-toggle-container {
        padding: 4px 8px;
    }
    
    .zh-toggle-label {
        display: none;
    }
    
    .user-name {
        max-width: 55px;
    }
    
    .modal-content {
        padding: 25px;
        max-width: 90%;
    }
    
    .card {
        padding: 16px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 1024px) {
    .common-header {
        padding: 0 15px;
    }
    
    .header-title {
        font-size: 1.1rem;
    }
    
    .user-name {
        max-width: 80px;
    }
}

/* ============================================
   工具类
   ============================================ */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* 渐入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   用户面板样式
   ============================================ */
.user-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-panel-overlay.show {
    opacity: 1;
}

.user-panel {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid rgba(72, 212, 228, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    color: #ffffff;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 40px rgba(72, 212, 228, 0.2);
}

.user-panel.show {
    transform: scale(1);
    opacity: 1;
}

.user-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #48d4e4, #FF6F00);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-icon {
    font-size: 2rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.user-role {
    font-size: 0.875rem;
    color: #48d4e4;
}

.close-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ffffff;
}

.user-panel-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat-icon {
    font-size: 1.25rem;
    display: block;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    display: block;
}

.stat-label-zh {
    font-size: 0.625rem;
    color: #888;
    display: block;
}

.user-panel-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #48d4e4;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
}

.progress-label {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 6px;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48d4e4, #FF6F00);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-percent {
    font-size: 0.75rem;
    color: #48d4e4;
    text-align: right;
    margin-top: 4px;
}

.user-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 12px;
    background: rgba(72, 212, 228, 0.1);
    border: 1px solid rgba(72, 212, 228, 0.3);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    background: rgba(72, 212, 228, 0.2);
}

.action-btn.logout-btn {
    background: rgba(255, 100, 100, 0.1);
    border-color: rgba(255, 100, 100, 0.3);
}

.action-btn.logout-btn:hover {
    background: rgba(255, 100, 100, 0.2);
}

/* ============================================
   Alpha Future Academy - 全站统一图标系统
   SVG Sprite 图标公共样式
   ============================================ */

.icon {
    display: inline-block;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
    pointer-events: none;
}

.icon-16 {
    width: 16px;
    height: 16px;
}

.icon-24 {
    width: 24px;
    height: 24px;
}

.icon-32 {
    width: 32px;
    height: 32px;
}

.icon-40 {
    width: 40px;
    height: 40px;
}

.icon-48 {
    width: 48px;
    height: 48px;
}

.icon-64 {
    width: 64px;
    height: 64px;
}

.icon-72 {
    width: 72px;
    height: 72px;
}

.icon-text-gap-sm {
    margin-right: 8px;
}

.icon-text-gap-md {
    margin-right: 12px;
}
