/* thevgpro 加密货币教育平台样式表 */

/* 全局样式 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* 性能优化 - 减少重绘和重排 */
* {
    box-sizing: border-box;
}

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

/* 导航栏响应式样式 */
@media (max-width: 1023px) {
    #nav-content.show {
        display: block !important;
    }
}

/* 链接悬停效果 - SEO友好的平滑过渡 */
a {
    transition: all 0.3s ease;
    text-decoration: none;
}

a:hover, a:focus {
    text-decoration: underline;
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 按钮悬停效果 */
.btn, button {
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn:focus, button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 卡片悬停效果 - 增强用户交互体验 */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* thevgpro品牌颜色 */
.thevgpro-primary {
    color: #3b82f6;
}

.thevgpro-secondary {
    color: #f59e0b;
}

.thevgpro-bg-primary {
    background-color: #3b82f6;
}

.thevgpro-bg-secondary {
    background-color: #f59e0b;
}

/* 页面过渡动画 - 提升感知性能 */
.page-transition {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式图片优化 */
.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* 懒加载图片样式 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* 自定义滚动条 - 提升品牌一致性 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* 通知系统样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background-color: #10b981;
    color: white;
}

.notification.error {
    background-color: #ef4444;
    color: white;
}

.notification-text {
    flex: 1;
    margin-right: 12px;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 面包屑导航样式 */
nav[aria-label="breadcrumb"] {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

/* 可访问性增强 */
.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;
}

/* 焦点管理 */
[tabindex="-1"]:focus {
    outline: none;
}

/* 跳转到主内容的链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 6px;
}

/* 加载状态样式 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3b82f6;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 价格显示样式优化 */
#crypto-prices {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 搜索结果样式 */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover,
.search-result-item:focus {
    background-color: #f8fafc;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* 性能优化 - 硬件加速 */
.card-hover,
.notification,
.page-transition {
    will-change: transform, opacity;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }

    .bg-white {
        background-color: #2d3748 !important;
        color: #e2e8f0;
    }

    .text-gray-700 {
        color: #cbd5e0 !important;
    }

    .border-gray-200 {
        border-color: #4a5568 !important;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.4;
    }

    .no-print,
    nav,
    footer,
    .notification {
        display: none !important;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    .page-transition {
        animation: none;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    /* 增加触摸目标大小 */
    button, .btn, a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* 动画减少偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .card-hover:hover {
        box-shadow: 0 0 0 3px #000;
    }

    a:focus {
        outline: 3px solid #000;
    }
}

/* 文本选择样式 */
::selection {
    background-color: #3b82f6;
    color: white;
}

/* thevgpro特定组件样式 */
.thevgpro-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.thevgpro-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.thevgpro-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* FAQ展开动画 */
details summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

details summary:hover {
    background: #f1f5f9;
}

details[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: #e2e8f0;
}

details summary::marker {
    display: none;
}

details summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s ease;
}

details[open] summary::before {
    transform: rotate(90deg);
}
