/* 
 * 荟歆文化官网 - 主样式表
 * 包含响应式设计和移动端优化
 */

/* ========================================
   1. CSS 变量定义
   ======================================== */
:root {
    --primary-color: #e91e63;
    --secondary-color: #f06292;
    --success-color: #4caf50;
    --info-color: #2196f3;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --dark-color: #333333;
    --light-color: #f8f9fa;
    --white: #ffffff;
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #e91e63 0%, #f06292 100%);
    
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-chinese: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.12);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   2. 全局样式重置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary), var(--font-chinese);
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--white);
    overflow-x: hidden;
}

/* ========================================
   3. 排版样式
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary-color);
}

/* ========================================
   4. 导航栏样式
   ======================================== */
.navbar {
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--primary-color);
}

/* 下拉菜单样式 */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 10px;
    padding: 0.5rem 0;
    animation: fadeInDown 0.3s ease;
}

.dropdown-item {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding-left: 2rem;
}

/* ========================================
   5. 页面头部样式
   ======================================== */
.page-header {
    background: var(--gradient-primary);
    padding: 120px 0 60px;
    color: white;
    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 xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,133.3C960,128,1056,96,1152,90.7C1248,85,1344,107,1392,117.3L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.page-header h1 {
    color: white;
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: fadeInUp 0.6s ease;
}

.page-header .lead {
    font-size: 1.25rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease;
}

.page-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
    animation: fadeInUp 0.4s ease;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.8);
}

/* ========================================
   6. 卡片样式
   ======================================== */
.card {
    border: none;
    border-radius: 15px;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   7. 按钮样式
   ======================================== */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all var(--transition-normal);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
    background: var(--gradient-secondary);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ========================================
   8. 表单样式
   ======================================== */
.form-control,
.form-select {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   9. 功能图标样式
   ======================================== */
.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.feature-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* ========================================
   10. 价格标签样式
   ======================================== */
.price-tag {
    display: flex;
    align-items: baseline;
    justify-content: center;
    color: var(--primary-color);
}

.price-tag .currency {
    font-size: 1.2rem;
    margin-right: 2px;
}

.price-tag .amount {
    font-size: 2.5rem;
    font-weight: bold;
}

/* ========================================
   11. 套餐和支付卡片样式
   ======================================== */
.package-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.package-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.package-card.border-primary {
    border-width: 2px !important;
    box-shadow: 0 5px 20px rgba(233, 30, 99, 0.2);
}

.payment-method {
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-method:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.payment-method.border-primary {
    border-width: 2px !important;
    background: linear-gradient(45deg, #fff 0%, #fce4ec 100%);
}

/* ========================================
   12. 动画效果
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 滚动动画触发 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   13. 响应式设计 - 平板设备
   ======================================== */
@media (max-width: 991px) {
    /* 导航栏调整 */
    .navbar-collapse {
        background: white;
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 10px;
        box-shadow: var(--shadow-md);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* 页面头部调整 */
    .page-header {
        padding: 100px 0 50px;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    /* 栅格系统调整 */
    .col-lg-3 {
        margin-bottom: 2rem;
    }
}

/* ========================================
   14. 响应式设计 - 手机设备
   ======================================== */
@media (max-width: 767px) {
    /* 全局字体大小调整 */
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.1rem; }
    h6 { font-size: 1rem; }
    
    /* 导航栏移动端优化 */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    /* 下拉菜单移动端 */
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        background: var(--light-color);
        margin-top: 0.5rem;
    }
    
    /* 页面头部移动端 */
    .page-header {
        padding: 80px 0 40px;
        margin-top: 56px;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .page-header .lead {
        font-size: 1rem;
    }
    
    /* 卡片移动端 */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* 按钮移动端 */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group-vertical .btn {
        width: 100%;
    }
    
    /* 表单移动端 */
    .form-control,
    .form-select {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 功能图标移动端 */
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* 价格标签移动端 */
    .price-tag .amount {
        font-size: 1.75rem;
    }
    
    /* 表格响应式 */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 页脚移动端 */
    footer {
        text-align: center;
    }
    
    footer .row > div {
        margin-bottom: 2rem;
    }
    
    /* 段落和列表 */
    p, li {
        font-size: 0.95rem;
    }
    
    /* 间距调整 */
    .py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .my-5 {
        margin-top: 3rem !important;
        margin-bottom: 3rem !important;
    }
    
    /* 隐藏某些装饰性元素 */
    .d-none-mobile {
        display: none !important;
    }
}

/* ========================================
   15. 小屏幕设备优化 (320px - 375px)
   ======================================== */
@media (max-width: 375px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
}

/* ========================================
   16. 横屏模式优化
   ======================================== */
@media (orientation: landscape) and (max-height: 500px) {
    .page-header {
        padding: 60px 0 30px;
        min-height: auto;
    }
    
    .navbar {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
}

/* ========================================
   17. 打印样式
   ======================================== */
@media print {
    .navbar,
    .page-header,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    a {
        color: inherit;
        text-decoration: none;
    }
}

/* ========================================
   18. 辅助功能样式
   ======================================== */
/* 焦点样式 */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 跳转链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* 屏幕阅读器专用 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   19. 加载动画
   ======================================== */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ========================================
   20. 自定义滚动条
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ========================================
   21. 工具类
   ======================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-secondary {
    background: var(--gradient-secondary);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
}

.rounded-lg {
    border-radius: 15px;
}

.rounded-xl {
    border-radius: 20px;
}

/* 固定底部CTA按钮（移动端） */
@media (max-width: 767px) {
    .mobile-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        display: flex;
        gap: 0.5rem;
    }
    
    .mobile-cta .btn {
        flex: 1;
    }
    
    /* 为固定底部留出空间 */
    body.has-mobile-cta {
        padding-bottom: 80px;
    }
}

/* ========================================
   22. 性能优化
   ======================================== */
/* 使用 will-change 优化动画性能 */
.card,
.btn,
.feature-icon {
    will-change: transform;
}

/* 图片懒加载占位 */
img.lazy {
    background: var(--light-color);
    background-image: linear-gradient(90deg, var(--light-color) 0%, #e0e0e0 50%, var(--light-color) 100%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 减少重绘和重排 */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 硬件加速 */
.hardware-accelerated {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ========================================
   23. 深色模式支持
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #343a40;
        --dark-color: #f8f9fa;
    }
    
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .form-control,
    .form-select {
        background-color: #2d2d2d;
        border-color: #555;
        color: #ffffff;
    }
    
    .navbar {
        background-color: rgba(45, 45, 45, 0.95) !important;
    }
    
    .navbar-light .navbar-nav .nav-link {
        color: #ffffff;
    }
}

/* ========================================
   24. 高对比度模式
   ======================================== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --secondary-color: #000000;
    }
    
    .btn-primary {
        background: var(--primary-color);
        color: white;
    }
    
    .card {
        border: 2px solid #000000;
    }
}

/* ========================================
   25. 减少动画模式
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .feature-icon:hover,
    .package-card:hover,
    .payment-method:hover {
        transform: none;
    }
}