/* ============================================
   main.css — 主界面专属样式
   非遗棋类文化平台
   ============================================ */

/* --- 基础重置 --- */
@font-face {
    font-family: 'TigerFont';
    src: url('../ziti/YanZhenQingDuoBaoTaBei-2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'TigerFont', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #14181a;
    color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}


/* --- 首屏视觉区 --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #14181a;
}

/* 背景光晕 */
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    /* filter: blur(120px); */
    will-change: transform;
    opacity: 0.15;
}

.hero-glow-1 {
    width: 600px;
    height: 600px;
    /* 原彩虹红光晕（备份保留）：background: #FF6B6B; */
    /* background: #C89B4B; */
    background: radial-gradient(circle, #C89B4B 0%, rgba(200,155,75,0) 70%);
    top: -200px;
    left: -100px;
    animation: glow-drift 12s ease-in-out infinite alternate;
}

.hero-glow-2 {
    width: 500px;
    height: 500px;
    /* 原彩虹青光晕（备份保留）：background: #4ECDC4; */
    /* background: #9E3B33; */
    background: radial-gradient(circle, #9E3B33 0%, rgba(158,59,51,0) 70%);
    bottom: -150px;
    right: -100px;
    animation: glow-drift 10s ease-in-out infinite alternate-reverse;
}

@keyframes glow-drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.1); }
}

/* 飘动书法字 */
.float-chars {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.float-char {
    position: absolute;
    font-family: 'TigerFont', serif;
    font-size: 48px;
    font-weight: 300;
    color: rgba(158, 59, 51, 0.32);
    user-select: none;
    white-space: nowrap;
    animation: float-bob 8s linear infinite;
    will-change: transform;
}

.float-vertical {
    writing-mode: vertical-rl;
    text-orientation: upright;
}

@keyframes float-bob {
    0% {
        opacity: 0;
        transform: translateY(32px);
    }
    25% {
        opacity: 1;
        transform: translateY(0);
    }
    70% {
        opacity: 1;
        transform: translateY(-48px);
    }
    80% {
        opacity: 0;
        transform: translateY(-48px);
    }
    100% {
        opacity: 0;
        transform: translateY(-48px);
    }
}

/* 首屏内容 */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
    margin-top: -120px;
}

.hero-title {
    margin: 0 0 24px;
}

.hero-title-line {
    display: block;
    font-size: 80px;
    font-weight: 800;
    letter-spacing: 0.15em;
    line-height: 1.3;
    color: #fff;
    opacity: 0;
    transform: translateY(30px);
    animation: hero-line-in 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.hero-title-line[data-delay="0"] {
    animation-delay: 0.2s;
}

.hero-title-line[data-delay="1"] {
    animation-delay: 0.45s;
}

@keyframes hero-line-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.3em;
    margin-bottom: 48px;
    opacity: 0;
    animation: hero-fade-in 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) 0.7s forwards;
}

@keyframes hero-fade-in {
    to {
        opacity: 1;
    }
}

.hero-cta {
    display: inline-block;
    padding: 14px 40px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 100px;
    color: #fff;
    font-size: 15px;
    letter-spacing: 0.15em;
    transition: background 0.3s, border-color 0.3s;
    opacity: 0;
    animation: hero-fade-in 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) 0.95s forwards;
}

.hero-cta:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.45);
}

/* 下滑指示器 */
.hero-scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
    animation: hero-fade-in 0.6s ease 1.4s forwards;
}

/* 主屏底部过渡模糊线 */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #14181a);
    filter: blur(8px);
    z-index: 3;
    pointer-events: none;
}

.scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-dot {
    width: 3px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%      { transform: translateY(10px); opacity: 0.3; }
}


/* --- 棋谚跑马灯 --- */
.marquee {
    background: #14181a;
    padding: 30px 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.marquee-item {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 20px;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

.marquee-item::after {
    content: '·';
    margin: 0 1.4em;
    color: rgba(200, 155, 75, 0.6);
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
    }
}


/* --- 概览区 --- */
.about-section {
    background: #14181a;
}

.about-section .section-desc {
    font-size: 18px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}


/* --- 棋类展示区（占位） --- */
.showcase-section {
    background: #14181a;
    padding-bottom: 120px;
}

.showcase-grid {
    min-height: 200px;
}

.showcase-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.showcase-placeholder-icon {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.12);
    margin-bottom: 12px;
}

.showcase-placeholder-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.15em;
}


/* --- 今日推荐 --- */
.featured {
    background: #1e2429;
    border: 2px solid #C89B4B;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 48px;
    cursor: pointer;
}

.featured-media {
    display: flex;
    align-items: stretch;
    aspect-ratio: 2847 / 1586;
    overflow: hidden;
    background: #14181a;
}

.featured-media-intro {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-size: 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: rgba(255, 255, 255, 0.78);
}

.featured-media-intro p {
    margin: 0;
    writing-mode: vertical-rl;
    letter-spacing: 0.25em;
    line-height: 1.9;
}

.featured-media img {
    flex: none;
    display: block;
    height: 100%;
    width: auto;
    margin-left: auto;
}

.featured-info {
    display: flex;
    align-items: center;
    gap: 24px 48px;
    padding: 28px 36px;
}

.featured-head {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.featured-btn {
    display: inline-block;
    margin: 0 auto;
    padding: 12px 34px;
    border: 2px solid #C89B4B;
    border-radius: 100px;
    color: #C89B4B;
    font-size: 20px;
    letter-spacing: 0.15em;
    text-align: center;
    transition: background 0.3s, color 0.3s;
}

.featured-btn:hover {
    background: #C89B4B;
    color: #1e2429;
}

.featured-label {
    display: inline-block;
    font-size: 24px;
    letter-spacing: 0.3em;
    color: #C89B4B;
}

.featured-title {
    margin: 10px 0 0;
    font-size: 34px;
    color: #fff;
    letter-spacing: 0.1em;
}

.featured-desc {
    margin: 0;
    font-size: 15px;
    line-height: 1.8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: rgba(255, 255, 255, 0.75);
}


/* --- 棋类卡片墙（横向错版：图片左右交替） --- */
.chess-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chess-card {
    display: flex;
    align-items: stretch;
    background: #1e2429;
    border-radius: 16px;
    overflow: hidden;
    height: 160px;
    cursor: pointer;
}

/* 图片统一在右、文字统一在左 */

.chess-body {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 32px;
}

.chess-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.chess-name {
    font-size: 20px;
    letter-spacing: 0.15em;
    color: #fff;
}

.chess-desc {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 340px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    letter-spacing: normal;
    line-height: 1.6;
}

.chess-btn {
    display: inline-block;
    padding: 10px 26px;
    border: 2px solid #C89B4B;
    border-radius: 100px;
    color: #C89B4B;
    font-size: 16px;
    letter-spacing: 0.15em;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.chess-btn:hover {
    background: #C89B4B;
    color: #1e2429;
}

.chess-media {
    position: relative;
    width: 200px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chess-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chess-detail-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 14px;
    border: 1px solid #C89B4B;
    border-radius: 100px;
    background: rgba(20, 24, 26, 0.8);
    color: #C89B4B;
    font-size: 13px;
    letter-spacing: 0.15em;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.chess-detail-btn:hover {
    background: #C89B4B;
    color: #1e2429;
}

@media (max-width: 768px) {
    .chess-card {
        height: 120px;
    }
    .chess-media {
        width: 120px;
    }
    .chess-body {
        padding: 0 20px;
    }
}


/* --- 响应式 --- */
@media (max-width: 768px) {
    .hero-title-line {
        font-size: 40px;
    }

    .hero-subtitle {
        font-size: 14px;
        letter-spacing: 0.2em;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section {
        padding: 60px 20px;
    }

    .section-title {
        font-size: 28px;
    }

    .navbar-inner {
        padding: 0 20px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
    }

    .featured-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* --- 英文模式：使用系统默认字体（不用书法字体） --- */
html[lang="en"] body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* --- 登录弹窗 --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: #1e2429;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 36px 32px 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-title {
    margin: 0 0 24px;
    font-size: 24px;
    letter-spacing: 0.1em;
    color: #fff;
    text-align: center;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.modal-input:focus {
    border-color: rgba(200, 155, 75, 0.6);
}

.modal-submit {
    padding: 12px;
    border: 1px solid #C89B4B;
    border-radius: 100px;
    background: #C89B4B;
    color: #1e2429;
    font-size: 15px;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.modal-submit:hover {
    background: #d8a852;
}

.modal-forgot {
    display: block;
    margin-top: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    transition: color 0.2s;
}

.modal-forgot:hover {
    color: #C89B4B;
}

.modal-hint {
    margin: 18px 0 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.05em;
}

.modal-error {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13px;
    color: #e0675f;
    letter-spacing: 0.05em;
}

.modal-error[hidden] {
    display: none;
}

.modal-wide {
    max-width: 480px;
}

.contact-modal {
    max-width: 560px;
}

.contact-email-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.contact-email {
    color: #fff;
    font-size: 15px;
}

.contact-copy {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    background: transparent;
    color: #C89B4B;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.contact-copy:hover {
    color: #fff;
    border-color: #C89B4B;
}

.contact-copy-tip {
    margin: 10px 0 0;
    text-align: center;
    font-size: 12px;
    color: #7ecb8f;
}

.contact-copy-tip[hidden] {
    display: none;
}

#feedback-modal {
    align-items: flex-start;
}

.feedback-textarea {
    resize: vertical;
}

#feedback-fields[hidden] {
    display: none;
}

#feedback-type {
    background: #262d33;
    cursor: pointer;
}

#feedback-type option {
    background: #1e2429;
    color: #fff;
}

.feedback-file {
    color: rgba(255, 255, 255, 0.65);
}

.feedback-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.feedback-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.feedback-file-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.feedback-file-ext {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(200, 155, 75, 0.15);
    color: #C89B4B;
    font-size: 10px;
    text-transform: uppercase;
    overflow: hidden;
}

.feedback-file-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- AI 聊天浮窗（从 FAB 按钮上方长出，浅色智能助手风格） --- */
.ai-panel {
    position: fixed;
    right: 32px;
    bottom: 104px;
    z-index: 200;
    width: 380px;
    height: 560px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    transform-origin: bottom right;
    transform: scale(0.3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.4, 0, 1, 1), opacity 0.18s ease, visibility 0.22s;
}

.ai-panel.open {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
}

/* 顶栏 */
.ai-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #F0F1F3;
    flex-shrink: 0;
}

.ai-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6C7CFF, #9B6CF6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ai-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1A1A1A;
}

.ai-head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-new,
.ai-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 50%;
    color: #444;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ai-new:hover,
.ai-close:hover {
    background: #F2F3F5;
    color: #6C7CFF;
}

/* 消息区 */
.ai-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    background: #F7F8FA;
}

.ai-welcome[hidden] {
    display: none;
}

.ai-hello {
    margin: 8px 0 0;
    font-size: 24px;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.35;
}

.ai-ask {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.35;
}

.ai-tip {
    margin: 0 0 14px;
    font-size: 13px;
    color: #6B7280;
    line-height: 1.5;
}

.ai-chip {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    background: #EFF1F4;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-chip:hover {
    background: #E4E7EC;
}

.ai-chip + .ai-chip {
    margin-top: 12px;
}

.ai-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.ai-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6C7CFF, #9B6CF6);
    color: #fff;
}

.ai-bot {
    align-self: flex-start;
    background: #EFF1F4;
    color: #333;
}

.ai-loading {
    width: 36px;
    height: 36px;
    align-self: flex-start;
}

.ai-loading[hidden] {
    display: none;
}

/* 输入区 */
.ai-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 14px;
    background: #FFFFFF;
    flex-shrink: 0;
}

.ai-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 100px;
    background: #F7F8FA;
    color: #1A1A1A;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.ai-input::placeholder {
    color: #9CA3AF;
}

.ai-input:focus {
    border-color: #8B8FF8;
    background: #FFFFFF;
}

.ai-send {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #EFF1F4;
    color: #9CA3AF;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ai-send.active {
    background: linear-gradient(135deg, #6C7CFF, #9B6CF6);
    color: #fff;
}
