/* CSS变量定义 */
:root {
    --primary: #165DFF;
    --primary-light: #E8F3FF;
    --primary-dark: #0E42CC;
    --dark: #1D2939;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --white: #ffffff;
    --success: #00B42A;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

/* 重置样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    font-size: 16px;
}

body {
    background-color: var(--gray-50);
    color: var(--dark);
    overflow-x: hidden;
}

/* 容器样式 */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 响应式容器 */
@media (min-width: 640px) {
    .container { max-width: 640px; }
}

@media (min-width: 768px) {
    .container { max-width: 768px; }
}

@media (min-width: 1024px) {
    .container { max-width: 1024px; }
}

@media (min-width: 1280px) {
    .container { max-width: 1280px; }
}

/* 通用工具类 */
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.bg-primary-light { background-color: var(--primary-light); }
.bg-white { background-color: var(--white); }
.bg-gray-50 { background-color: var(--gray-50); }
.text-dark { color: var(--dark); }
.text-white { color: var(--white); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.bg-dark { background-color: var(--dark); }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* 布局类 */
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.inline-block { display: inline-block; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }

/* 间距类 */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-20 { padding-top: 5rem; }
.pb-16 { padding-bottom: 4rem; }

.m-0 { margin: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.mr-5 { margin-right: 1.25rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* 尺寸类 */
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }

/* 字体大小 */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

/* 圆角 */
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* 边框 */
.border { border-width: 1px; }
.border-gray-200 { border-color: var(--gray-200); }
.border-primary { border-color: var(--primary); }
.border-white { border-color: var(--white); }
.border-t { border-top-width: 1px; }

/* 阴影 */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: var(--shadow); }

/* 定位 */
.fixed { position: fixed; }
.relative { position: relative; }
.absolute { position: absolute; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* 溢出 */
.overflow-hidden { overflow: hidden; }

/* 过渡效果 */
.transition-colors { 
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}
.transition-all { transition: var(--transition); }

/* 悬停效果 */
.hover\:text-primary:hover { color: var(--primary); }
.hover\:bg-gray-100:hover { background-color: var(--gray-100); }
.hover\:bg-primary-dark:hover { background-color: var(--primary-dark); }
.hover\:bg-primary-light:hover { background-color: var(--primary-light); }
.hover\:shadow-md:hover { 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
}

/* 间距工具类 */
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }

/* 网格布局 */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* 响应式网格 */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:flex-row { flex-direction: row; }
    .sm\:w-auto { width: auto; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 自定义样式 */
.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(var(--primary) 0.5px, transparent 0.5px),
        radial-gradient(var(--primary) 0.5px, var(--white) 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.05;
    z-index: 0;
}

.hero-pattern-white {
    background-image: 
        radial-gradient(white 0.5px, transparent 0.5px),
        radial-gradient(white 0.5px, var(--primary) 0.5px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 20px;
    font-weight: bold;
}

.check-icon {
    color: var(--success);
    font-weight: bold;
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
}

/* 图标样式 - 完全本地化 */
.icon {
    display: inline-block;
    font-style: normal;
    font-weight: bold;
}

.icon-phone::before { content: "📞"; }
.icon-menu::before { content: "☰"; }
.icon-close::before { content: "✕"; }
.icon-check::before { content: "✓"; }
.icon-building::before { content: "🏢"; }
.icon-id::before { content: "🆔"; }
.icon-globe::before { content: "🌐"; }
.icon-mobile::before { content: "📱"; }
.icon-sound::before { content: "🔊"; }
.icon-history::before { content: "🕐"; }
.icon-shield::before { content: "🛡️"; }
.icon-chart::before { content: "📈"; }
.icon-qq::before { content: "💬"; }
.icon-wechat::before { content: "💼"; }
.icon-plus::before { content: "+"; }
.icon-up::before { content: "↑"; }

/* FAQ样式 */
.faq-question {
    cursor: pointer;
}

.faq-question:hover .icon-plus {
    transform: rotate(90deg);
}

.faq-question.active .icon-plus {
    transform: rotate(45deg);
}

.faq-answer {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.faq-answer:not(.hidden) {
    max-height: 200px;
    padding: 1rem 1.5rem;
}

.faq-answer.hidden {
    max-height: 0;
    padding: 0 1.5rem;
}

/* 返回顶部按钮 */
#back-to-top {
    transition: all 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-2px);
}

/* 响应式字体大小 */
.text-responsive {
    font-size: clamp(1.25rem, 5vw, 2.25rem);
}

/* 移动端优化 */
@media (max-width: 639px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
    
    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .pt-20 {
        padding-top: 4rem;
    }
    
    .pb-16 {
        padding-bottom: 3rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .mb-12 {
        margin-bottom: 2rem;
    }
    
    .mb-10 {
        margin-bottom: 2rem;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 平板优化 */
@media (min-width: 640px) and (max-width: 1023px) {
    .text-3xl {
        font-size: 1.75rem;
    }
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

.btn-white {
    background-color: var(--white);
    color: var(--primary);
}

.btn-white:hover {
    background-color: var(--gray-100);
}

.btn-transparent {
    background-color: transparent;
    color: var(--white);
    border: 1px solid var(--white);
}

.btn-transparent:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 移动端按钮优化 */
@media (max-width: 639px) {
    .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        width: 100%;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

@media (min-width: 640px) {
    .btn-group {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        justify-content: center;
    }
    
    .btn-group .btn {
        width: auto;
    }
}

/* 背景透明度 */
.bg-white\/10 {
    background-color: rgba(255, 255, 255, 0.1);
}

.bg-white\/95 {
    background-color: rgba(255, 255, 255, 0.95);
}

.text-white\/70 {
    color: rgba(255, 255, 255, 0.7);
}

.text-white\/80 {
    color: rgba(255, 255, 255, 0.8);
}

/* 背景模糊 */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 可访问性优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000FF;
        --primary-dark: #000080;
        --dark: #000000;
        --gray-600: #000000;
        --gray-700: #000000;
    }
}

/* 打印样式 */
@media print {
    .fixed,
    #navbar,
    footer {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-primary {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
}

/* 额外的响应式优化 */
@media (max-width: 480px) {
    .text-responsive {
        font-size: 1.25rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
    }
}

/* 焦点样式 */
button:focus,
a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}