/* ============================================
   机玩派 - 公共基础样式 (简洁版)
   ============================================ */

:root {
    /* 主色调 - 白色简约风格 */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    
    /* 背景色 - 白色主题 */
    --bg-main: #ffffff;
    --bg-card: #f8fafc;
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    
    /* 文字颜色 - 深色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* 边框 */
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* 阴影 - 调整为更柔和的阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 简洁背景 - 白色主题微妙渐变 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
        var(--bg-main);
}

/* 粒子效果已禁用 - 保持简洁 */
.particles {
    display: none;
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-logo:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.login-btn {
    padding: 10px 24px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.login-btn:hover {
    background: var(--primary-dark);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.user-name {
    color: var(--text-primary);
    font-size: 0.875rem;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}

.user-name:hover {
    color: var(--primary-light);
}

.logout-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   登录弹窗
   ============================================ */
.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: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.modal-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.code-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.code-input-group input {
    flex: 1;
    min-width: 0;
}

.send-code-btn {
    padding: 0 10px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.send-code-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.send-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn {
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

.login-tips {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 20px;
}

.login-tips a {
    color: var(--primary);
    text-decoration: none;
}

.login-tips a:hover {
    text-decoration: underline;
}

/* ============================================
   页脚
   ============================================ */
.footer {
    text-align: center;
    padding: 48px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: block;
    letter-spacing: 2px;
    letter-spacing: 2px;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.footer .warning {
    color: var(--accent);
    font-size: 0.875rem;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-md);
    display: inline-block;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary);
}

.footer .footer-links {
    margin-bottom: 16px;
}

/* ============================================
   返回首页按钮
   ============================================ */
.back-home-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    z-index: 1000;
    text-decoration: none;
}

.back-home-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.back-home-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.back-home-btn .tooltip {
    position: absolute;
    right: 56px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.back-home-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   滚动条
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ============================================
   消息弹窗组件
   ============================================ */
.message-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: 3000;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.message-overlay.show {
    opacity: 1;
    visibility: visible;
}

.message-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
    position: relative;
}

.message-overlay.show .message-box {
    transform: scale(1) translateY(0);
}

.message-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.message-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.message-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.message-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--secondary);
}

.message-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.message-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

.message-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.message-icon.confirm {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.message-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.message-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.message-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.message-btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 90px;
}

.message-btn-primary {
    background: var(--primary);
    color: white;
}

.message-btn-primary:hover {
    background: var(--primary-dark);
}

.message-btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.message-btn-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* ============================================
   Toast 提示
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 360px;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.toast-icon.success { background: rgba(16, 185, 129, 0.2); color: var(--secondary); }
.toast-icon.error { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.toast-icon.warning { background: rgba(245, 158, 11, 0.2); color: var(--accent); }
.toast-icon.info { background: rgba(59, 130, 246, 0.2); color: var(--primary); }

.toast-content { flex: 1; }

.toast-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    animation: toastProgress 3s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================
   下拉导航菜单
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-dropdown-trigger:hover {
    color: var(--text-primary);
}

.nav-dropdown-trigger svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-trigger svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 140px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 0;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
    margin-top: 8px;
}

.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
}

/* NEW 标签样式 */
.nav-new-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: nav-new-pulse 2s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes nav-new-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.05);
    }
}

/* 移动端导航菜单 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1999;
    backdrop-filter: blur(4px);
}

.mobile-nav-overlay.show {
    display: block;
}

.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #ffffff;
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
}

.mobile-nav-panel.show {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.mobile-nav-close:hover {
    color: var(--text-primary);
}

.mobile-nav-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-section:last-child {
    border-bottom: none;
}

.mobile-nav-section-title {
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-nav-section a {
    display: block;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
}

.mobile-nav-section a:hover,
.mobile-nav-section a:active {
    background: var(--bg-card-hover);
    color: var(--primary);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
    .nav-links,
    .nav-dropdown {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-overlay {
        padding: 16px;
        align-items: flex-start;
        padding-top: 10vh;
    }

    .modal-content {
        padding: 28px 24px;
        max-width: 100%;
    }

    .modal-title { font-size: 1.25rem; }
    .modal-subtitle { margin-bottom: 24px; }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
    }

    .code-input-group {
        flex-direction: column;
        gap: 10px;
    }

    .send-code-btn { width: 100%; }

    .back-home-btn {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }

    .back-home-btn .tooltip { display: none; }

    .login-btn {
        padding: 8px 16px;
        font-size: 0.8125rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .user-name {
        max-width: 60px;
        font-size: 0.8125rem;
    }

    .logout-btn {
        padding: 5px 10px;
        font-size: 0.6875rem;
    }

    .toast-container {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast { max-width: 100%; }

    .message-box {
        padding: 24px 20px;
        margin: 0 16px;
    }

    .message-buttons { flex-direction: column; }
    .message-btn { width: 100%; }
}

@media (max-width: 375px) {
    .modal-content { padding: 24px 20px; }
    .form-group input { padding: 12px 14px; }
    .submit-btn { padding: 12px; }
}
