/**
 * iPhyLab 通用组件样式
 * 包含：头部导航、底部信息、登录注册模态框、用户相关样式
 */

/* ==================== CSS Variables ==================== */
:root {
    --primary-dark: #0a1628;
    --primary-blue: #1a365d;
    --accent-cyan: #00d4ff;
    --accent-orange: #ff6b35;
    --accent-green: #00e676;
    --accent-purple: #b388ff;
    --text-light: #e8f4f8;
    --text-muted: #94a3b8;
    --card-bg: rgba(26, 54, 93, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.05);
}

/* ==================== Header Styles ==================== */
header {
    position: fixed;
    top: -80px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    transition: top 0.3s ease;
}

header.visible {
    top: 0;
}

/* Header hover area */
.header-hover-area {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    z-index: 999;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-icon {
    width: 50px;
    height: 50px;
    position: relative;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Navigation Styles */
nav {
    display: flex;
    gap: 8px;
}

nav a {
    padding: 12px 24px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

nav a:hover {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

nav a:hover::before {
    left: 100%;
}

/* ==================== Auth Buttons ==================== */
.auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-auth {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
}

.btn-login {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(0, 212, 255, 0.5);
}

.btn-login:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-register {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: var(--primary-dark);
    font-weight: 600;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

/* ==================== User Profile ==================== */
.user-profile {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-info span {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

.user-group {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-cyan);
    font-weight: 500;
}

.user-group.admin {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.user-group.user {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.user-group.visitor {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.user-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-profile:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: var(--text-light);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-content a:hover {
    background: rgba(0, 212, 255, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* ==================== Mobile Menu ==================== */
.mobile-menu-btn {
    display: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding: 20px 40px;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu nav a {
    padding: 12px 20px;
    width: 100%;
    text-align: left;
}

/* ==================== Modal Styles ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--card-bg);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    margin: 20px;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 0;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
    padding: 20px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: var(--text-muted);
}

.modal-footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* ==================== Form Styles ==================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
    width: 100%;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(148, 163, 184, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-cyan);
    cursor: pointer;
}

.forgot-password {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.forgot-password:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.btn-submit {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: 10px;
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

/* ==================== Footer Styles ==================== */
footer {
    background: rgba(5, 12, 25, 0.95);
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    padding: 50px 40px 30px;
    width: 100%;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.footer-content {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 2;
}

.footer-content a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

.footer-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
    margin: 30px 0;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-copyright a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-copyright a:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

/* Footer Stats */
.footer-stats {
    margin: 15px 0;
}

.visit-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 50px;
    font-size: 14px;
    color: var(--accent-cyan);
}

#visitCounter {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .auth-buttons,
    .user-profile {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 20px;
        height: 70px;
    }
    
    .logo-text {
        font-size: 22px;
    }
    
    .mobile-menu {
        top: 70px;
    }
    
    footer {
        padding: 40px 20px 30px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        margin: 10px;
    }

    .modal-header {
        padding: 20px 20px 0;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .modal-footer {
        padding: 15px 20px;
    }
}
