/* ========================================
   公共样式 - Common Styles
   用于眼镜批发网站
======================================== */

/* 全局变量 */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --dark-color: #1e293b;
    --light-color: #f1f5f9;
    --white-color: #ffffff;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --text-color: #334155;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* 全局链接样式 - 取消下划线 */
a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: none;
    color: var(--primary-color);
}

/* 主内容区域 - 确保页脚始终在底部 */
.main-content {
    min-height: calc(100vh - 500px);
    padding-top: 76px; /* 固定头部高度 */
}

/* ========================================
   头部样式 - Header Styles
======================================== */
.glasses-header .navbar {
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.glasses-header .navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow);
}

.glasses-header .navbar-brand {
    font-size: 1.5rem;
    color: var(--dark-color);
    transition: all 0.3s ease;
}

.glasses-header .navbar-brand:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.glasses-header .nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.glasses-header .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.glasses-header .nav-link:hover,
.glasses-header .nav-link.active {
    color: var(--primary-color);
}

.glasses-header .nav-link:hover::after,
.glasses-header .nav-link.active::after {
    width: 60%;
}

.glasses-header .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.glasses-header .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   底部样式 - Footer Styles
======================================== */
.glasses-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.glasses-footer .footer-widget h5,
.glasses-footer .footer-widget h6 {
    color: var(--white-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.glasses-footer .footer-widget h6::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.glasses-footer .footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.glasses-footer .footer-social a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.glasses-footer .footer-links li {
    margin-bottom: 0.5rem;
}

.glasses-footer .footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.glasses-footer .footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.glasses-footer .footer-contact li {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.3rem 0;
}

.glasses-footer .footer-bottom a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.glasses-footer .footer-bottom a:hover {
    color: var(--primary-color) !important;
}

/* ========================================
   返回顶部按钮 - Back to Top Button
======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, #1d4ed8, var(--primary-color));
    color: var(--white-color);
}

/* ========================================
   通用组件样式 - Common Components
======================================== */

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: var(--white-color);
    padding: 80px 0 60px;
    margin-top: 76px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><path d="M0 0L100 100M100 0L0 100" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>');
    opacity: 0.1;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.page-header .breadcrumb {
    background: transparent;
    margin: 0;
    padding: 0;
}

.page-header .breadcrumb-item,
.page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
}

.page-header .breadcrumb-item.active {
    color: var(--white-color);
}

/* 章节标题 */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.section-title p {
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

/* 卡片样式 */
.common-card {
    background: var(--white-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.common-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* 按钮样式 */
.btn-custom-primary {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: var(--white-color);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-custom-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white-color);
}

.btn-custom-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-custom-outline:hover {
    background: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   响应式设计 - Responsive Design
======================================== */

@media (max-width: 991.98px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .glasses-header .nav-link {
        padding: 0.75rem 1rem;
        text-align: center;
    }
    
    .glasses-header .navbar-nav {
        text-align: center;
    }
    
    .glasses-header .nav-item {
        width: 100%;
    }
    
    .glasses-header .navbar-nav .btn {
        width: 80%;
        margin: 0.5rem auto;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding-top: 66px;
    }
    
    .page-header {
        padding: 60px 0 40px;
        margin-top: 66px;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
}

/* ========================================
   工具类 - Utility Classes
======================================== */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}
