/**
 * ============================================================================
 * 阿旺电商运营陪练专业系统 - 主样式文件
 * ============================================================================
 * 暗金轻奢电商教育风格 - 高端UI设计
 */

/* ==========================================================================
   CSS变量定义
   ========================================================================== */
:root {
    /* 品牌色系 - 暗金轻奢 */
    --primary-color: #C9A96E;
    --primary-dark: #B8943F;
    --primary-light: #D4B87A;
    --secondary-color: #B8943F;

    /* 辅助色系 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    /* 中性色系 - 暗色梯度 */
    --gray-50: #21262D;
    --gray-100: #1C2128;
    --gray-200: #161B22;
    --gray-300: #0D1117;
    --gray-400: #8B949E;
    --gray-500: #6E7681;
    --gray-600: #484F58;
    --gray-700: #30363D;
    --gray-800: #161B22;
    --gray-900: #0D1117;

    /* 文字颜色 */
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --text-muted: #484F58;
    --text-white: #ffffff;

    /* 背景颜色 */
    --bg-primary: #161B22;
    --bg-secondary: #0D1117;
    --bg-dark: #0A0E14;

    /* 边框颜色 */
    --border-color: rgba(201, 169, 110, 0.12);
    --border-light: rgba(201, 169, 110, 0.06);

    /* 阴影 - 金色光晕风格 */
    --shadow-sm: 0 1px 2px 0 rgba(201, 169, 110, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(201, 169, 110, 0.08), 0 2px 4px -1px rgba(201, 169, 110, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(201, 169, 110, 0.08), 0 4px 6px -2px rgba(201, 169, 110, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(201, 169, 110, 0.08), 0 10px 10px -5px rgba(201, 169, 110, 0.04);

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* 字体 */
    --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, monospace;

    /* 字体大小 */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* 间距 */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* 过渡 */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* 头部高度 */
    --header-height: 72px;
}

/* ==========================================================================
   基础重置
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.6;
    color: #E6EDF3;
    background-color: #0D1117;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

/* ==========================================================================
   布局容器
   ========================================================================== */
.main-content {
    min-height: calc(100vh - var(--header-height));
    padding-top: var(--header-height);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: 960px;
}

.container-wide {
    max-width: 1440px;
}

/* ==========================================================================
   顶部导航栏
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(201, 169, 110, 0.12);
    z-index: 1000;
    transition: box-shadow var(--transition-base);
}

.main-header.scrolled {
    box-shadow: 0 0 20px rgba(201, 169, 110, 0.08);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: 700;
    background: linear-gradient(135deg, #C9A96E, #D4B87A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 主导航 */
.main-nav {
    flex: 1;
    margin: 0 var(--space-8);
}

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(201, 169, 110, 0.06);
}

.nav-link.active {
    color: #C9A96E;
    background: rgba(201, 169, 110, 0.1);
}

.nav-link i {
    font-size: var(--text-base);
}

/* 头部功能区 */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* 搜索框 */
.search-box {
    position: relative;
    width: 240px;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 var(--space-10) 0 var(--space-4);
    font-size: var(--text-sm);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: var(--radius-full);
    background: #21262D;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: #C9A96E;
    background: #21262D;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

.search-btn {
    position: absolute;
    right: var(--space-1);
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.search-btn:hover {
    color: var(--primary-color);
    background: rgba(201, 169, 110, 0.08);
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.notification-btn:hover {
    color: var(--primary-color);
    background: rgba(201, 169, 110, 0.08);
}

.notification-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-white);
    background: var(--danger-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.user-btn:hover {
    background: rgba(201, 169, 110, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-btn i {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    width: 240px;
    background: #161B22;
    border: 1px solid rgba(201, 169, 110, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 20px rgba(201, 169, 110, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1001;
}

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

.dropdown-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid rgba(201, 169, 110, 0.06);
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.dropdown-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.dropdown-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-role {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: rgba(201, 169, 110, 0.06);
    margin: var(--space-2) 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(201, 169, 110, 0.08);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

.dropdown-item.text-danger {
    color: var(--danger-color);
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

.dropdown-form {
    margin: 0;
}

.dropdown-form button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

/* 认证按钮 */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    color: var(--primary-color);
    background: rgba(201, 169, 110, 0.08);
}

/* 移动端导航 */
.mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: #161B22;
    box-shadow: 0 0 20px rgba(201, 169, 110, 0.08);
    z-index: 1002;
    transition: left var(--transition-base);
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid rgba(201, 169, 110, 0.12);
}

.mobile-nav-title {
    font-size: var(--text-lg);
    font-weight: 600;
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    font-size: var(--text-base);
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(201, 169, 110, 0.06);
    transition: all var(--transition-fast);
}

.mobile-nav-item:hover {
    color: var(--primary-color);
    background: rgba(201, 169, 110, 0.08);
}

.mobile-nav-item i {
    width: 24px;
    text-align: center;
}

.mobile-nav-auth .mobile-nav-item {
    color: var(--primary-color);
    font-weight: 500;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 1001;
    transition: all var(--transition-fast);
}

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

/* ==========================================================================
   页脚
   ========================================================================== */
.main-footer {
    background: #0D1117;
    color: var(--text-white);
    padding-top: var(--space-16);
}

.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-12);
    padding-bottom: var(--space-12);
    border-bottom: 1px solid rgba(201, 169, 110, 0.12);
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-logo-img {
    width: 44px;
    height: 44px;
}

.footer-logo-text {
    font-size: var(--text-xl);
    font-weight: 700;
    color: #C9A96E;
}

.footer-desc {
    font-size: var(--text-sm);
    line-height: 1.8;
    color: var(--gray-400);
    margin-bottom: var(--space-6);
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    background: #161B22;
    border: 1px solid rgba(201, 169, 110, 0.1);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.social-link:hover {
    color: #0D1117;
    background: #C9A96E;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
}

.footer-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: #C9A96E;
}

.footer-list li {
    margin-bottom: var(--space-3);
}

.footer-list a {
    font-size: var(--text-sm);
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.footer-list a:hover {
    color: var(--text-white);
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--gray-400);
}

.footer-contact i {
    margin-top: 3px;
    color: var(--primary-color);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6) 0;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.footer-bottom-left,
.footer-bottom-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.footer-bottom a {
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.footer-bottom a:hover {
    color: var(--text-white);
}

.footer-divider {
    color: rgba(201, 169, 110, 0.2);
}

/* ==========================================================================
   回到顶部按钮
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    background: linear-gradient(135deg, #C9A96E, #B8943F);
    border-radius: var(--radius-full);
    box-shadow: 0 0 20px rgba(201, 169, 110, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: 999;
}

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

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 30px rgba(201, 169, 110, 0.25);
}

/* ==========================================================================
   在线客服
   ========================================================================== */
.customer-service {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.service-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-white);
    background: linear-gradient(135deg, var(--success-color), #059669);
    border-radius: var(--radius-full);
    box-shadow: 0 0 20px rgba(201, 169, 110, 0.08);
    transition: all var(--transition-base);
}

.service-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(201, 169, 110, 0.15);
}

.service-btn i {
    font-size: var(--text-lg);
}

/* ==========================================================================
   响应式设计
   ========================================================================== */
@media (max-width: 1200px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 992px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-brand {
        max-width: 100%;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .header-container {
        padding: 0 var(--space-4);
    }

    .search-box {
        display: none;
    }

    .user-name {
        display: none;
    }

    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .back-to-top,
    .customer-service {
        right: 20px;
    }

    .back-to-top {
        bottom: 90px;
    }

    .customer-service {
        bottom: 20px;
    }

    .service-btn span {
        display: none;
    }

    .service-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
    }
}
