/* Layout-level overrides (decoupled from Tailwind-compiled site.css) */

/* Design system variables (landing.css is not loaded on all pages, so define here) */
:root {
    --accent-gold: #f9b233;
    --accent-gold-hover: #ffc44d;
    /* 导航栏背景色 - 统一首页与二级菜单的半透明深灰底色 */
    --nav-bg: rgba(37, 38, 39, 0.3);
    /* 导航栏高度 - 子页 hero 内容区 padding-top 避开导航遮挡 */
    --nav-height: 96px;
}

/* Fix back-to-top button positioning */
.back-to-top {
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999 !important;
}
/* Fix CSS dropdown z-index and hover behavior */
.css-dropdown {
    z-index: 51 !important;
}
/* Override Tailwind's opacity-0 and invisible with proper hover */
.group:hover .css-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
}

/* === Subpage redesign (taste-skill) === */
/* 子页 hero 从 y=0 开始，导航半透明浮于其上，与首页无缝衔接一致 */
.subpage-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    /* 顶部 padding 等于导航高度，确保文字不被导航遮挡；
       底部 padding 留足空间，整体高度通过 min-height 控制 */
    padding: var(--nav-height) 0 4rem;
    min-height: 450px;
    /* 移除 landing.css 中 height:360px 的固定高度限制 */
    height: auto;
}
.subpage-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(15,23,42,0.85) 0%, rgba(15,23,42,0.4) 60%, rgba(15,23,42,0.2) 100%);
    pointer-events: none;
}
.subpage-hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.75rem;
}
.subpage-hero .inner h1 {
    color: #fff;
}
.subpage-hero .inner .sub-en {
    display: none; /* badge replaces it */
}

/* Fix Tailwind .collapse visibility conflicting with Bootstrap .collapse.show */
.collapse.show {
    visibility: visible !important;
}

/* Fix v2 CSS conflict with Bootstrap navbar + Tailwind .collapse visibility
 * 仅在桌面端强制展开，移动端保留 Bootstrap collapse 行为 */
@media (min-width: 768px) {
    .menu .navbar-collapse {
        display: flex !important;
        visibility: visible !important;
        width: auto !important;
        flex: 1 !important;
    }
    .menu .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
        margin-left: 0 !important;
        /* 菜单按内容自然撑开，不被 flex 容器压缩；溢出由 body min-width:1366px 兜底 */
        width: auto !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        flex-wrap: wrap !important;
    }
    .menu .navbar-toggler {
        display: none !important;
    }
}

/* Content wrapper — no white card, full-width with max-width */
.subpage-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}
.subpage-content > .subpage-card {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

/* Card grid for list views */
.rq-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.rq-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rq-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
}
.rq-card img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
}
.rq-card-body {
    padding: 1rem 1.25rem 1.25rem;
}
.rq-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
    margin-bottom: 0.35rem;
}
.rq-card-body p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
 * Unified subpage design system — matches homepage dark+gold aesthetic
 * ============================================================ */

/* --- Breadcrumb --- */
.rq-breadcrumb {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.rq-breadcrumb-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    flex-wrap: wrap;
}
.rq-breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}
.rq-breadcrumb-link:hover {
    color: var(--accent-gold);
}
.rq-breadcrumb-sep {
    color: #cbd5e1;
    font-size: 0.75rem;
}
.rq-breadcrumb-current {
    color: var(--accent-gold);
    font-weight: 600;
}

/* --- Subpage content wrapper (unified) --- */
.rq-subpage {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}
.rq-subpage-narrow {
    max-width: 840px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* --- Section title (replaces inconsistent h2 styles) --- */
.rq-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1.5rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.rq-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #e2e8f0 0%, transparent 100%);
}

/* --- Year selector pill (Races page) --- */
.rq-year-pills {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.rq-year-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 40px;
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.rq-year-pill:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}
.rq-year-pill.active {
    color: #0f172a;
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    box-shadow: 0 4px 12px rgba(249,178,51,0.3);
}

/* --- Tab navigation (unified) --- */
.rq-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--accent-gold);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    overflow-x: auto;
}
.rq-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    color: #64748b;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    transition: color 0.15s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.rq-tab:hover {
    color: var(--accent-gold);
}
.rq-tab.active {
    color: var(--accent-gold);
    font-weight: 700;
    border-bottom-color: var(--accent-gold);
}

/* --- Meta info row (badges + dates) --- */
.rq-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.85rem;
    color: #64748b;
}
.rq-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.rq-meta-item .material-symbols-outlined {
    font-size: 1rem;
    color: var(--accent-gold);
}

/* --- Article content (NewsDetail, Privacy) --- */
.rq-article {
    max-width: 840px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}
.rq-article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.rq-article-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin: 0 0 1rem;
    letter-spacing: -0.025em;
}
.rq-article-summary {
    background: #f8fafc;
    border-left: 3px solid var(--accent-gold);
    border-radius: 0 6px 6px 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 1rem;
    color: #475569;
    line-height: 1.7;
}
.rq-article-content {
    color: #334155;
    font-size: 1rem;
    line-height: 1.85;
}
.rq-article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2rem 0 1rem;
}
.rq-article-content p {
    margin-bottom: 1rem;
}
.rq-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* --- Search bar (unified) --- */
.rq-search-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.rq-search-input {
    flex: 1;
    min-width: 200px;
    height: 42px;
    padding: 0 1rem 0 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rq-search-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(249,178,51,0.15);
}
.rq-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.rq-search-wrapper .material-symbols-outlined {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    color: #94a3b8;
    pointer-events: none;
}
.rq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 42px;
    padding: 0 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.rq-btn-primary {
    background: var(--accent-gold);
    color: #fff;
}
.rq-btn-primary:hover {
    background: var(--accent-gold-hover);
    color: #fff;
}
.rq-btn-outline {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}
.rq-btn-outline:hover {
    background: var(--accent-gold);
    color: #fff;
}

/* --- Detail page logo box (TeamDetail) --- */
.rq-logo-box {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}
.rq-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.rq-logo-box-placeholder {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border-radius: 12px;
    font-size: 4rem;
}

/* --- Cover image (detail pages) --- */
.rq-cover-img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 1.5rem;
}

/* --- Text content (detail pages) --- */
.rq-text-content {
    white-space: pre-wrap;
    line-height: 1.85;
    color: #475569;
    font-size: 0.95rem;
    margin: 0;
}

/* --- Divider with back link --- */
.rq-detail-footer {
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

/* ============================================================
 * Gold-primary opacity variants (ensure Tailwind /10 /20 classes
 * resolve to accent-gold instead of the Tailwind-config blue)
 * ============================================================ */
.bg-primary\/10,
.bg-primary\/5 { background-color: rgba(249,178,51,0.1) !important; }
.bg-primary\/20 { background-color: rgba(249,178,51,0.2) !important; }
.hover\:bg-primary\/10:hover { background-color: rgba(249,178,51,0.1) !important; }
.hover\:bg-primary\/20:hover { background-color: rgba(249,178,51,0.2) !important; }
.focus\:ring-primary\/20:focus { --tw-ring-color: rgba(249,178,51,0.2) !important; }
.border-primary\/10 { border-color: rgba(249,178,51,0.1) !important; }
.border-primary\/20 { border-color: rgba(249,178,51,0.2) !important; }

/* ============================================================
 * User center unification helpers
 * ============================================================ */
.rq-user-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}
.rq-user-table thead {
    background: #f8fafc;
}
.rq-user-table th,
.rq-user-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.875rem;
}
.rq-user-table th {
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.rq-user-table tbody tr {
    border-top: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}
.rq-user-table tbody tr:hover {
    background: #f8fafc;
}
.rq-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.rq-status--pending { background: #fef3c7; color: #a16207; }
.rq-status--paid { background: #dcfce7; color: #15803d; }
.rq-status--shipped { background: #dbeafe; color: #1d4ed8; }
.rq-status--done { background: #f1f5f9; color: #475569; }
.rq-status--cancelled { background: #fee2e2; color: #b91c1c; }
.rq-status--enrolled { background: #dbeafe; color: #1d4ed8; }
.rq-user-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rq-user-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(249,178,51,0.15);
}
.rq-user-input-icon {
    position: relative;
}
.rq-user-input-icon .material-symbols-outlined {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.rq-user-input-icon input,
.rq-user-input-icon select {
    padding-left: 2.75rem;
}
.rq-user-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.15s ease;
    text-decoration: none;
}
.rq-user-btn--primary {
    background: var(--accent-gold);
    color: #fff;
    border: none;
}
.rq-user-btn--primary:hover {
    background: var(--accent-gold-hover);
}
.rq-user-btn--outline {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}
.rq-user-btn--outline:hover {
    background: var(--accent-gold);
    color: #fff;
}
.rq-user-sidebar .sidebar-header {
    background: var(--accent-gold);
}
.rq-user-sidebar .nav-link.active {
    color: var(--accent-gold);
    background: rgba(249,178,51,0.1);
    font-weight: 600;
}
.rq-user-sidebar .nav-link:hover {
    color: var(--accent-gold);
}

/* --- Auth (login/register/verify) card --- */
.rq-auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 2rem;
}
@media (min-width: 768px) {
    .rq-auth-card { padding: 2.5rem; }
}
.rq-auth-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(249,178,51,0.1);
    color: var(--accent-gold);
    margin-bottom: 1rem;
}
.rq-auth-alert {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}
.rq-auth-alert--info {
    background: rgba(249,178,51,0.1);
    border: 1px solid rgba(249,178,51,0.2);
    color: #92400e;
}
.rq-auth-alert--warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
}
.rq-auth-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}
.rq-auth-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}