/* ============================================
   components.css — 共享UI组件
   非遗棋类文化平台
   ============================================ */

/* --- 导航栏 --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 100;
    /* background: rgba(20, 24, 26, 0.8); */
    background: rgba(20, 24, 26, 0.94);
    /* backdrop-filter: blur(12px); */
    /* -webkit-backdrop-filter: blur(12px); */
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.navbar.scrolled {
    background: rgba(20, 24, 26, 0.95);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.navbar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    /* 原彩虹渐变（备份保留）：background: linear-gradient(135deg, #FF6B6B, #FFE66D, #4ECDC4, #6C5CE7); */
    /* 金红渐变（备份保留）：background: linear-gradient(135deg, #C89B4B, #9E3B33); */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.navbar-logo-icon img,
.footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.navbar-logo-text {
    font-family: 'TigerFont', "Microsoft YaHei", "SimHei", sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.navbar-user {
    position: relative;
}

.navbar-user-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    min-width: 128px;
    background: #1e2429;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 300;
}

.navbar-user-menu[hidden] {
    display: none;
}

.navbar-user-menu-item {
    padding: 8px 12px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    letter-spacing: 1px;
    transition: background 0.2s, color 0.2s;
}

.navbar-user-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.navbar-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 1px;
    transition: color 0.2s;
    position: relative;
    min-width: 72px;
    text-align: center;
}

.navbar-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #fff;
    transition: width 0.2s;
}

.navbar-link:hover {
    color: #fff;
}

.navbar-link:hover::after {
    width: 100%;
}

.navbar-search {
    display: flex;
    align-items: center;
    position: relative;
}

.navbar-search-input {
    width: 140px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, width 0.2s;
}

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

.navbar-search-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    width: 180px;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, 82vw);
    max-height: 420px;
    overflow-y: auto;
    background: #1e2429;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 300;
}

.search-results[hidden] {
    display: none;
}

.search-result-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    width: 100%;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.search-result-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

.search-result-desc {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.search-result-action {
    flex-shrink: 0;
    font-size: 12px;
    color: #C89B4B;
    border: 1px solid rgba(200, 155, 75, 0.4);
    border-radius: 100px;
    padding: 4px 10px;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
}

.search-result-action:hover {
    background: rgba(200, 155, 75, 0.15);
}

.search-fallback {
    padding: 10px 12px;
    font-size: 13px;
    color: #aaa;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}

.search-fallback:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.lang-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 4px 12px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    min-width: 52px;
    text-align: center;
}

.lang-toggle:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}


/* --- Section 通用 --- */
.section {
    width: 100%;
    padding: 100px 24px;
    background: #14181a;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
    font-weight: 500;
}

.section-title {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.1em;
    margin: 0;
}

.section-divider {
    width: 40px;
    height: 2px;
    /* 原彩虹分隔线（备份保留）：background: linear-gradient(90deg, #FF6B6B, #4ECDC4); */
    background: linear-gradient(90deg, #C89B4B, #9E3B33);
    margin: 20px auto;
    border-radius: 1px;
}

.section-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.8;
    max-width: 520px;
    margin: 0 auto;
}


/* --- 卡片基础 --- */
.about-card {
    background: #1e2429;
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.about-card-click {
    cursor: pointer;
}

.about-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 auto 20px;
}

.about-card-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: 0.05em;
}

.about-card-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.7;
    margin: 0;
}


/* --- 彩色圆形按钮 (FAB) --- */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 60;
    background: linear-gradient(135deg, #FF6B6B, #FFE66D, #4ECDC4, #6C5CE7);
    background-size: 300% 300%;
    animation: fab-gradient 6s ease infinite;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.45);
}

.fab:active {
    transform: scale(0.95);
}

.fab-icon {
    font-size: 22px;
    color: #fff;
    pointer-events: none;
}

@keyframes fab-gradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* --- 页脚 --- */
.footer {
    background: #0f1214;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 32px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    /* 原彩虹渐变（备份保留）：background: linear-gradient(135deg, #FF6B6B, #FFE66D, #4ECDC4, #6C5CE7); */
    /* 金红渐变（备份保留）：background: linear-gradient(135deg, #C89B4B, #9E3B33); */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.footer-brand {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom {
    text-align: center;
    padding: 16px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    max-width: 1100px;
    margin: 0 auto;
}

.footer-bottom span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 1px;
}


/* --- 滚动入场动画 --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.8, 0.25, 1),
                transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}
