/* ============================================================
   MetaLab Common Styles — 全站共享样式（Reset / 变量 / 导航 / 页脚）
   每个页面加载此文件后，按需加载页面专属 CSS
   ============================================================ */

:root {
    --color-bg: #f8f9fa;
    --color-surface: #fff;
    --color-primary: #2c3e50;
    --color-secondary: #7f8c8d;
    --color-accent: #3498db;
    --color-danger: #e74c3c;
    --color-border: #e0e0e0;
    --color-text: #333;
    --color-text-light: #666;
    --shadow: 0 4px 12px rgba(0,0,0,.08);
    --radius: 8px;
    --transition: all .3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 主内容区撑满剩余空间，实现 sticky footer */
body > .container {
    flex: 1;
}

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

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.icon {
    width: 1em;
    height: 1em;
    vertical-align: -.125em;
    display: inline-block;
    flex-shrink: 0;
}

/* ---------- Header / Nav ---------- */
header {
    background: var(--color-surface);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem 0;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
}

.logo span {
    color: var(--color-accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    padding: .5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.nav-active {
    color: var(--color-accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width .3s ease;
}

.nav-links a:hover::after,
.nav-links a.nav-active::after {
    width: 100%;
}

.nav-login {
    color: var(--color-accent) !important;
    font-weight: 600 !important;
}

.nav-user {
    color: var(--color-accent) !important;
    font-weight: 600 !important;
}

.nav-settings {
    font-size: .9rem;
    color: var(--color-secondary) !important;
}

.nav-logout {
    color: var(--color-secondary) !important;
}

/* ---------- Nav Messages Bell ---------- */
.nav-messages {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: background .15s ease;
}

.nav-messages:hover {
    background: rgba(52, 152, 219, .08);
}

.nav-bell-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.nav-bell-badge {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: .65rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-danger);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-primary);
    cursor: pointer;
}

/* ---------- Maintenance Banner ---------- */
.maintenance-banner {
    text-align: center;
    padding: .6rem 1rem;
    background: #fef3cd;
    border-bottom: 1px solid #f0d48a;
    color: #856404;
    font-size: .9rem;
    font-weight: 500;
}

.maintenance-banner-icon {
    font-size: 1rem;
    margin-right: .4rem;
}

/* ---------- Contact / Footer ---------- */
.contact-bar {
    text-align: center;
    padding: .6rem 0;
    background: #e8f0f8;
    border-top: 1px solid var(--color-border);
    font-size: .95rem;
    color: var(--color-text-light);
}

.contact-bar a {
    color: var(--color-accent);
    font-weight: 600;
    transition: var(--transition);
}

.contact-bar a:hover {
    color: #2980b9;
    text-decoration: underline;
}

footer {
    background: var(--color-primary);
    color: #bdc3c7;
    padding: .8rem 0;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.copyright {
    font-size: .9rem;
    color: #95a5a6;
    width: 100%;
}

/* ---------- Scroll-to-top ---------- */
.scroll-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(52,152,219,.35);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52,152,219,.45);
}

/* ---------- Responsive (共享：导航) ---------- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-surface);
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: 0 10px 15px rgba(0,0,0,.1);
        text-align: center;
    }
    .nav-links.active {
        display: flex;
    }
    .mobile-menu-btn {
        display: block;
    }
}
