/* BdChatRoom 首页样式 */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.25), transparent 55%),
        radial-gradient(circle at bottom right, rgba(147,51,234,0.35), #020617);
    color: #e5e7eb;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    height: 64px;
    padding: 0 6vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg,#0f172a 0%,#1d4ed8 40%,#7c3aed 100%);
    box-shadow: 0 12px 30px rgba(15,23,42,0.7);
    position: relative;
    overflow: visible;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 18px;
}

.nav-logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: contain;
}

.nav-logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(191, 219, 254, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 100;
}

.lang-switcher:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(191, 219, 254, 0.5);
}

.lang-switcher #langSelect {
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 2px 20px 2px 4px;
    min-width: 100px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e5e7eb' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-color: transparent;
}

.lang-switcher #langSelect:focus {
    outline: none;
}

.lang-switcher #langSelect option {
    background: #0f172a;
    color: #e5e7eb;
    padding: 8px;
}

.lang-switcher #currentLangDisplay {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    flex-shrink: 0;
}

.btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
}

.btn-outline {
    border-color: rgba(191,219,254,0.9);
    color: #e5e7eb;
    background: transparent;
}

.btn-outline:hover {
    background: rgba(15,23,42,0.45);
}

.btn-primary {
    background: linear-gradient(135deg,#22c55e 0%,#16a34a 100%);
    color: #f9fafb;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn:active {
    transform: scale(0.97);
}

.hero {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
    padding: 7vh 8vw 6vh;
}

.hero-main-title {
    font-size: clamp(32px, 4vw, 40px);
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 15px;
    color: #cbd5f5;
    margin-bottom: 22px;
    max-width: 520px;
}

.hero-tagline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(129,140,248,0.7);
    margin-bottom: 12px;
}

.hero-tagline-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34,197,94,0.9);
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.hero-hint {
    font-size: 12px;
    color: #9ca3af;
}

.hero-list {
    margin-top: 16px;
    font-size: 14px;
    color: #d1d5db;
    padding-left: 18px;
}

.hero-list li {
    margin-bottom: 6px;
}

.hero-right {
    align-self: center;
}

.panel {
    background: rgba(15,23,42,0.9);
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.6);
    box-shadow: 0 24px 60px rgba(15,23,42,0.9);
    padding: 18px 18px 14px;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.panel-subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.timeline {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.timeline-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.timeline-badge {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(135deg,#38bdf8 0%,#6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.timeline-body-title {
    font-weight: 600;
}

.timeline-body-text {
    font-size: 12px;
    color: #9ca3af;
}

.footer {
    padding: 10px 8vw 16px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.download-section {
    padding: 6vh 8vw 4vh;
    background: rgba(15,23,42,0.3);
}

.download-section-title {
    text-align: center;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    margin-bottom: 8px;
}

.download-section-subtitle {
    text-align: center;
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 40px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.download-card {
    background: rgba(15,23,42,0.9);
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.3);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(15,23,42,0.6);
    border-color: rgba(148,163,184,0.5);
}

.download-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-card-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.download-images {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.download-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    object-fit: contain;
    cursor: pointer;
}

.download-image:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.download-image.single {
    max-width: 200px;
    max-height: 300px;
}

.download-image.double {
    max-width: 150px;
    max-height: 200px;
}

.download-image.triple {
    max-width: 100px;
    max-height: 150px;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.download-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    background: linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);
    color: #ffffff;
}

.download-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn.secondary {
    background: linear-gradient(135deg,#6366f1 0%,#4f46e5 100%);
}

.download-btn.secondary:hover {
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

/* 图片预览模态框 */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.image-preview-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image-preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.js-integration-box {
    margin-top: 24px;
    padding: 20px;
    background: rgba(15,23,42,0.6);
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.3);
}

.js-integration-title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 16px;
}

.js-integration-desc {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.js-integration-code {
    background: rgba(0,0,0,0.4);
    padding: 14px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #60a5fa;
    overflow-x: auto;
    border: 1px solid rgba(148,163,184,0.2);
}

/* 移动端响应式样式 */
@media (max-width: 900px) {
    .nav {
        padding: 0 4vw;
        height: auto;
        min-height: 64px;
        flex-wrap: nowrap;
        overflow: visible;
    }
    
    .nav-logo {
        font-size: 16px;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .nav-actions {
        display: flex !important;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
        flex-shrink: 0;
        justify-content: flex-end;
        margin-top: 0;
    }
    
    .lang-switcher {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 4px 8px;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .lang-switcher #langSelect {
        min-width: 80px;
        font-size: 12px;
        padding: 2px 18px 2px 4px;
    }
    
    .lang-switcher #currentLangDisplay {
        font-size: 16px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .download-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .download-section {
        padding: 4vh 5vw 3vh;
    }
    
    .download-images {
        gap: 8px;
    }
    
    .download-image.triple {
        max-width: 100px;
    }
}

/* ========== 友情链接赞助样式 ========== */
.link-sponsor-section {
    padding: 6vh 8vw 4vh;
    background: rgba(15,23,42,0.3);
}

.link-sponsor-title {
    text-align: center;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    margin-bottom: 32px;
    color: #e5e7eb;
}

.link-sponsor-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 友情链接页面专用样式 - 每行显示5条 */
.link-sponsor-grid-full {
    max-width: 1400px;
    justify-content: flex-start;
}

.link-sponsor-grid-full .link-sponsor-item {
    flex: 0 0 calc(20% - 19.2px);
    max-width: calc(20% - 19.2px);
    min-width: 0;
    width: calc(20% - 19.2px);
}

@media (max-width: 1200px) {
    .link-sponsor-grid-full .link-sponsor-item {
        flex: 0 0 calc(25% - 18px);
        max-width: calc(25% - 18px);
        width: calc(25% - 18px);
    }
}

@media (max-width: 900px) {
    .link-sponsor-grid-full {
        gap: 16px;
    }
    
    .link-sponsor-grid-full .link-sponsor-item {
        flex: 0 0 calc(33.333% - 10.67px);
        max-width: calc(33.333% - 10.67px);
        width: calc(33.333% - 10.67px);
    }
}

@media (max-width: 600px) {
    .link-sponsor-grid-full .link-sponsor-item {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
        width: calc(50% - 8px);
    }
}

.link-sponsor-grid.scrollable {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
    padding: 10px 0;
}

/* 桌面端横向滚动 */
.link-sponsor-grid.scrollable.horizontal {
    flex-direction: row;
}

/* 移动端纵向滚动样式 */
@media (max-width: 600px) {
    .link-sponsor-grid.scrollable {
        flex-direction: column !important;
        max-height: 400px;
        padding: 0 10px;
        align-items: center;
        overflow-y: hidden !important;
        overflow-x: hidden !important;
    }
    
    .link-sponsor-grid.scrollable.vertical {
        flex-direction: column !important;
        max-height: 400px;
        align-items: center;
        overflow-y: hidden !important;
        overflow-x: hidden !important;
    }
    
    .link-sponsor-grid-wrapper-vertical {
        flex-direction: column !important;
        align-items: center;
        width: 100%;
        animation: marquee-vertical 30s linear infinite !important;
    }
    
    .link-sponsor-grid-wrapper-vertical .link-sponsor-item {
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 0;
    }
    
    /* 移动端禁用横向动画 */
    .link-sponsor-grid-wrapper-horizontal {
        animation: none !important;
    }
}

/* 横向滚动遮罩（桌面端） */
.link-sponsor-grid.scrollable::before,
.link-sponsor-grid.scrollable::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    z-index: 2;
    pointer-events: none;
}

.link-sponsor-grid.scrollable::before {
    left: 0;
    background: linear-gradient(to right, rgba(15,23,42,0.95), transparent);
}

.link-sponsor-grid.scrollable::after {
    right: 0;
    background: linear-gradient(to left, rgba(15,23,42,0.95), transparent);
}

/* 纵向滚动遮罩（移动端） */
.link-sponsor-grid.scrollable.vertical::before,
.link-sponsor-grid.scrollable.vertical::after {
    width: 100%;
    height: 50px;
    left: 0;
    right: 0;
}

.link-sponsor-grid.scrollable.vertical::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(15,23,42,0.95), transparent);
}

.link-sponsor-grid.scrollable.vertical::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(15,23,42,0.95), transparent);
}

/* 横向滚动动画（桌面端） */
.link-sponsor-grid-wrapper-horizontal {
    display: flex;
    flex-direction: row;
    animation: marquee-horizontal 30s linear infinite;
    gap: 24px;
    will-change: transform;
}

.link-sponsor-grid-wrapper-horizontal:hover {
    animation-play-state: paused;
}

@keyframes marquee-horizontal {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 纵向滚动动画（移动端） */
.link-sponsor-grid-wrapper-vertical {
    display: flex;
    flex-direction: column;
    animation: marquee-vertical 30s linear infinite;
    gap: 24px;
    will-change: transform;
}

.link-sponsor-grid-wrapper-vertical:hover {
    animation-play-state: paused;
}

@keyframes marquee-vertical {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* 兼容旧版本 - 默认横向滚动 */
.link-sponsor-grid-wrapper {
    display: flex;
    flex-direction: row;
    animation: marquee-horizontal 30s linear infinite;
    gap: 24px;
    will-change: transform;
}

.link-sponsor-grid-wrapper:hover {
    animation-play-state: paused;
}

/* 移动端：确保纵向滚动优先级更高 */
@media (max-width: 600px) {
    /* 移动端强制使用纵向滚动 */
    .link-sponsor-grid-wrapper-vertical {
        animation: marquee-vertical 30s linear infinite !important;
        flex-direction: column !important;
        display: flex !important;
    }
    
    /* 移动端禁用所有横向动画 */
    .link-sponsor-grid-wrapper-horizontal {
        animation: none !important;
        display: none !important;
    }
    
    .link-sponsor-grid-wrapper {
        animation: none !important;
        display: none !important;
    }
    
    /* 确保容器是纵向的 */
    .link-sponsor-grid.scrollable,
    .link-sponsor-grid.scrollable.vertical {
        flex-direction: column !important;
    }
}

/* 确保跑马灯容器不会溢出 */
.link-sponsor-grid.scrollable {
    overflow: hidden !important;
}

.link-sponsor-grid::-webkit-scrollbar {
    height: 8px;
}

.link-sponsor-grid::-webkit-scrollbar-track {
    background: rgba(15,23,42,0.3);
    border-radius: 4px;
}

.link-sponsor-grid::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.5);
    border-radius: 4px;
}

.link-sponsor-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(148,163,184,0.7);
}

.link-sponsor-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,0.9);
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.3);
    padding: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    flex-shrink: 0;
}

.link-sponsor-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(15,23,42,0.6);
    border-color: rgba(148,163,184,0.5);
    background: rgba(15,23,42,0.95);
}

.link-sponsor-item img {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.link-sponsor-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
    text-align: center;
    word-break: break-word;
}

.link-sponsor-more {
    text-align: center;
    margin-top: 24px;
}

.link-sponsor-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.link-sponsor-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.link-sponsor-more-btn:active {
    transform: translateY(0);
}

/* 移动端适配 */
@media (max-width: 900px) {
    .link-sponsor-section {
        padding: 4vh 5vw 3vh;
    }
    
    .link-sponsor-grid {
        gap: 16px;
    }
    
    .link-sponsor-item {
        padding: 0;
    }
}

@media (max-width: 600px) {
    .link-sponsor-item {
        padding: 0;
    }
    
    .link-sponsor-more {
        margin-top: 16px;
    }
    
    .link-sponsor-more-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .link-sponsor-title {
        font-size: 20px;
        margin-bottom: 24px;
    }
    
    .hero {
        grid-template-columns: minmax(0, 1fr);
        padding: 4vh 5vw 5vh;
    }
    
    .hero-right {
        order: -1;
    }
    
    .image-preview-content {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .image-preview-close {
        top: -50px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

/* 小屏幕移动端（手机） */
@media (max-width: 480px) {
    .nav {
        padding: 0 3vw;
    }
    
    .nav-logo {
        font-size: 14px;
        gap: 6px;
    }
    
    .nav-logo-mark {
        width: 24px;
        height: 24px;
    }
    
    .nav-logo > div:last-child {
        display: none; /* 在小屏幕上隐藏 "BdChatRoom" 文字，只显示图标 */
    }
    
    .nav-actions {
        gap: 4px;
        flex-shrink: 0;
    }
    
    .lang-switcher {
        padding: 3px 6px;
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .lang-switcher #langSelect {
        min-width: 60px;
        font-size: 11px;
        padding: 2px 14px 2px 3px;
    }
    
    .lang-switcher #currentLangDisplay {
        font-size: 14px;
    }
    
    .btn {
        padding: 5px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    /* 确保按钮和语言切换器都能显示 */
    .btn-outline,
    .btn-primary {
        min-width: auto;
        flex-shrink: 0;
    }
}

/* 超小屏幕（非常小的手机） */
@media (max-width: 360px) {
    .nav {
        padding: 0 2vw;
    }
    
    .nav-actions {
        gap: 3px;
    }
    
    .lang-switcher {
        padding: 2px 4px;
    }
    
    .lang-switcher #langSelect {
        min-width: 50px;
        font-size: 10px;
        padding: 2px 12px 2px 2px;
    }
    
    .btn {
        padding: 4px 8px;
        font-size: 10px;
    }
}

