/* 赛事中心 · 列表页（赛事大厅）
   青蓝科技风；颜色 / 圆角 / 阴影统一引用 design-tokens.css 令牌，
   仅在本页作用域内定义少量局部渐变变量（赛事级别色）。 */

.ct-app {
    /* 本页局部变量：赛事级别 logo 渐变（不新增/修改全局 token） */
    --ct-grad-1: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --ct-grad-2: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    --ct-grad-3: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --ct-grad-4: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);

    min-height: 70vh;
    padding: 0 0 56px;
    box-sizing: border-box;
    color: var(--tech-text);
    /* 科技背景与 Element Plus 主色由 .ds-app 提供 */
}

.ct-app *,
.ct-app *::before,
.ct-app *::after {
    box-sizing: border-box;
}

/* ===== 全宽渐变 Hero ===== */
.ct-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    color: #fff;
    background: var(--tech-grad);
}

.ct-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 34px 34px, 34px 34px;
    pointer-events: none;
}

.ct-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(560px 300px at 88% -20%, rgba(255, 255, 255, .28), transparent 62%),
        radial-gradient(620px 320px at 6% 120%, rgba(2, 8, 20, .30), transparent 60%);
    pointer-events: none;
}

.ct-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-6);
    padding: 46px 24px 50px;
}

.ct-hero-main {
    flex: 1 1 520px;
    min-width: 0;
}

.ct-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ct-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: var(--radius-pill);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.ct-pill b {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ct-hero-title {
    margin: 16px 0 0;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.15;
    color: #fff;
}

.ct-hero-sub {
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .88);
}

/* 关键词搜索框 */
.ct-search {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 520px;
    margin-top: 24px;
    padding: 5px 5px 5px 18px;
    background: #fff;
    border-radius: var(--radius-pill);
    box-shadow: 0 14px 32px rgba(2, 8, 20, .20);
}

.ct-search-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    color: var(--tech-text);
    background: transparent;
    border: none;
    outline: none;
}

.ct-search-input::placeholder {
    color: var(--tech-text-3);
}

.ct-search-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--tech-grad);
    border: none;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-brand);
    cursor: pointer;
    transition: filter var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.ct-search-btn:hover {
    filter: brightness(1.06);
}

.ct-search-btn:active {
    transform: scale(.98);
}

/* 热门推荐 · 玻璃卡 */
.ct-hot {
    flex: 0 1 340px;
    min-width: 280px;
    padding: 22px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .30);
    border-radius: var(--radius-xl);
    box-shadow: 0 18px 42px rgba(2, 8, 20, .22);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.ct-hot-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #fff;
    background: rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: var(--radius-pill);
}

.ct-hot-title {
    margin: 14px 0 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.ct-hot-org {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, .82);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ct-hot-stats {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.ct-hot-stat {
    flex: 1;
    min-width: 0;
    padding: 10px 4px;
    text-align: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: var(--radius-md);
}

.ct-hot-stat b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ct-hot-stat span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: rgba(255, 255, 255, .80);
}

.ct-hot-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding-bottom: 2px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .55);
    transition: opacity var(--dur-fast) var(--ease), gap var(--dur-fast) var(--ease);
}

.ct-hot-link:hover {
    opacity: .9;
    gap: 10px;
}

/* 热门推荐卡 · 信息小徽标 */
.ct-hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ct-hot-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, .92);
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .30);
    border-radius: var(--radius-pill);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ct-hot-tag.is-recommend {
    color: #fff;
    background: var(--tech-vip-grad);
    border-color: transparent;
}

.ct-hot-tag.is-activity {
    color: #fff;
    background: rgba(129, 140, 248, .30);
    border-color: rgba(165, 180, 252, .55);
}

/* ===== 内容区 ===== */
.ct-body {
    padding-top: 28px;
}

.ct-body-inner {
    padding: 0 24px;
}

/* 胶囊筛选条 */
.ct-filters {
    padding: 18px 22px;
    background: var(--tech-panel);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.ct-filter-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.ct-filter-row+.ct-filter-row {
    margin-top: 14px;
}

.ct-filter-label {
    flex-shrink: 0;
    width: 76px;
    padding-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tech-text-2);
}

.ct-chips {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ct-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--tech-text-2);
    background: var(--tech-panel);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
        border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.ct-chip:hover {
    color: var(--tech-accent-strong);
    background: var(--tech-accent-soft);
    border-color: var(--tech-accent-line);
}

.ct-chip.is-active {
    color: #fff;
    background: var(--tech-grad);
    border-color: transparent;
    box-shadow: var(--shadow-brand);
}

.ct-chip.is-active:hover {
    color: #fff;
    background: var(--tech-grad);
    border-color: transparent;
}

/* 计数行 + 分页 */
.ct-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin: 22px 2px 14px;
}

.ct-bar-total {
    font-size: 14px;
    color: var(--tech-text-2);
}

.ct-bar-total b {
    margin: 0 3px;
    font-size: 18px;
    font-weight: 800;
    color: var(--tech-text);
    font-variant-numeric: tabular-nums;
}

.ct-bar-pager {
    margin-left: auto;
}

/* ===== 赛事卡片网格 ===== */
.ct-list {
    position: relative;
    min-height: 240px;
}

.contest-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.contest-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px;
    background: var(--tech-panel);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease),
        border-color var(--dur-base) var(--ease);
}

.contest-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(14, 165, 233, .40);
}

.ct-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

/* 圆角 logo 方块（纯 CSS，取赛事名首字） */
.ct-logo {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    border-radius: var(--radius-md);
    background: var(--ct-grad-1);
    box-shadow: var(--shadow-brand);
    user-select: none;
}

.logo-level-1 {
    background: var(--ct-grad-1);
}

.logo-level-2 {
    background: var(--ct-grad-2);
}

.logo-level-3 {
    background: var(--ct-grad-3);
}

.logo-level-4 {
    background: var(--ct-grad-4);
}

.ct-card-heading {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.contest-name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--tech-text);
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.ct-card-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
}

.ct-card-sub-label {
    flex-shrink: 0;
    color: var(--tech-text-3);
}

.ct-card-sub-value {
    min-width: 0;
    color: var(--tech-text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.level-tag {
    flex-shrink: 0;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tech-accent-strong);
    background: var(--tech-accent-soft);
    border: 1px solid var(--tech-accent-line);
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.status-badge {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
}

.status-badge.status-1 {
    color: #047857;
    background: var(--tech-success-soft);
    border-color: rgba(16, 185, 129, .30);
}

.status-badge.status-2 {
    color: #b45309;
    background: var(--tech-warning-soft);
    border-color: rgba(245, 158, 11, .30);
}

.status-badge.status-3 {
    color: var(--tech-accent-strong);
    background: var(--tech-accent-soft);
    border-color: var(--tech-accent-line);
}

.status-badge.status-4 {
    color: var(--tech-text-2);
    background: var(--tech-info-soft);
    border-color: var(--tech-line);
}

.status-badge.status-5 {
    color: var(--tech-text-2);
    background: var(--tech-panel-2);
    border-color: var(--tech-line);
}

.status-badge.status-6 {
    color: var(--tech-danger);
    background: var(--tech-danger-soft);
    border-color: rgba(244, 63, 94, .30);
}

/* ===== 卡片信息徽标（推荐 / 白名单 / 完整度 / 赛区 / 赛季 / 学段） ===== */
.ct-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ct-card-badges:empty {
    display: none;
}

.ct-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--tech-text-2);
    background: var(--tech-panel-2);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-pill);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ct-badge.is-recommend {
    color: #b45309;
    background: var(--tech-warning-soft);
    border-color: rgba(245, 158, 11, .35);
}

.ct-badge.is-whitelist {
    color: #047857;
    background: var(--tech-success-soft);
    border-color: rgba(16, 185, 129, .32);
}

.ct-badge.is-completeness-high {
    color: var(--tech-accent-strong);
    background: var(--tech-accent-soft);
    border-color: var(--tech-accent-line);
}

.ct-badge.is-completeness-medium {
    color: var(--tech-text-2);
    background: var(--tech-info-soft);
    border-color: var(--tech-line);
}

.ct-badge.is-completeness-low {
    color: #b45309;
    background: var(--tech-warning-soft);
    border-color: rgba(245, 158, 11, .30);
}

.ct-badge.is-region {
    color: #6d28d9;
    background: rgba(99, 102, 241, .10);
    border-color: rgba(99, 102, 241, .28);
}

.ct-badge.is-season {
    color: var(--tech-text-2);
    background: var(--tech-panel-2);
    border-color: var(--tech-line);
}

.ct-badge.is-stage {
    color: var(--tech-accent-strong);
    background: var(--tech-accent-soft);
    border-color: var(--tech-accent-line);
}

.ct-badge.is-activity {
    color: var(--tech-accent-strong);
    background: var(--tech-info-soft);
    border-color: var(--tech-accent-line);
}

/* ===== 赛事进度时间轴 ===== */
.ct-progress {
    padding: 14px 16px;
    background: var(--tech-panel-2);
    border: 1px solid var(--tech-line);
    border-radius: var(--radius-md);
}

.ct-timeline {
    display: flex;
    align-items: flex-start;
}

.ct-step {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.ct-step::before,
.ct-step::after {
    content: '';
    position: absolute;
    top: 5px;
    height: 2px;
    background: var(--tech-line);
}

.ct-step::before {
    left: 0;
    right: 50%;
}

.ct-step::after {
    left: 50%;
    right: 0;
}

.ct-step:first-child::before {
    display: none;
}

.ct-step:last-child::after {
    display: none;
}

.ct-step-dot {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    background: var(--tech-line);
    border: 2px solid var(--tech-panel-2);
    border-radius: var(--radius-circle);
}

.ct-step-name {
    max-width: 100%;
    font-size: 12px;
    line-height: 1.3;
    color: var(--tech-text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ct-step.is-done .ct-step-dot {
    background: var(--tech-accent);
}

.ct-step.is-done::before,
.ct-step.is-done::after {
    background: var(--tech-accent);
}

.ct-step.is-done .ct-step-name {
    color: var(--tech-text-2);
}

.ct-step.is-current .ct-step-dot {
    background: var(--tech-grad);
    box-shadow: 0 0 0 4px var(--tech-accent-soft);
}

.ct-step.is-current::before {
    background: var(--tech-accent);
}

.ct-step.is-current .ct-step-name {
    color: var(--tech-accent-strong);
    font-weight: 700;
}

/* 无 stages 时的降级时间行 */
.ct-range-fallback {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-size: 13px;
    color: var(--tech-text);
    font-variant-numeric: tabular-nums;
}

.ct-range-label {
    margin-right: 6px;
    color: var(--tech-text-3);
}

.ct-range-sep {
    color: var(--tech-text-3);
}

/* 元信息行 */
.ct-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 13px;
    color: var(--tech-text-2);
}

.ct-meta-line b {
    font-weight: 700;
    color: var(--tech-text);
    font-variant-numeric: tabular-nums;
}

.ct-meta-dot {
    color: var(--tech-text-3);
}

.ct-meta-groups {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 底部操作按钮 */
.ct-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.ct-btn {
    flex: 1 1 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
        background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
        border-color var(--dur-fast) var(--ease);
}

.ct-btn-primary {
    color: #fff;
    background: var(--tech-grad);
    border: 1px solid transparent;
    box-shadow: var(--shadow-brand);
}

.ct-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(14, 165, 233, .34);
}

.ct-btn-ghost {
    color: var(--tech-accent-strong);
    background: var(--tech-panel);
    border: 1px solid var(--tech-line);
}

.ct-btn-ghost:hover {
    color: #fff;
    background: var(--tech-grad);
    border-color: transparent;
    box-shadow: var(--shadow-brand);
    transform: translateY(-2px);
}

/* 立即报名外链 */
.ct-btn-signup {
    color: #b45309;
    background: var(--tech-warning-soft);
    border: 1px solid rgba(245, 158, 11, .40);
}

.ct-btn-signup:hover {
    color: #fff;
    background: var(--tech-vip-grad);
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(245, 158, 11, .32);
    transform: translateY(-2px);
}

/* ===== 加载蒙层（纯 Vue，无 v-loading） ===== */
.ct-loading {
    position: absolute;
    inset: 0;
    z-index: var(--z-loading);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: var(--tech-text-2);
    background: rgba(244, 247, 251, .72);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-lg);
}

.ct-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(14, 165, 233, .22);
    border-top-color: var(--tech-accent);
    border-radius: var(--radius-circle);
    animation: ct-spin .8s linear infinite;
}

@keyframes ct-spin {
    to {
        transform: rotate(360deg);
    }
}

.ct-fade-enter-active,
.ct-fade-leave-active {
    transition: opacity var(--dur-fast) var(--ease);
}

.ct-fade-enter-from,
.ct-fade-leave-to {
    opacity: 0;
}

/* ===== 空状态 ===== */
.contest-empty {
    padding: 64px 20px;
    text-align: center;
    background: var(--tech-panel);
    border: 1px dashed var(--tech-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.empty-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--tech-accent);
    background: var(--tech-accent-soft);
    border: 1px solid var(--tech-accent-line);
    border-radius: var(--radius-circle);
}

.empty-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--tech-text);
}

.empty-tip {
    margin-top: 6px;
    font-size: 13px;
    color: var(--tech-text-2);
}

/* ===== 自适应 ===== */
@media (max-width: 1024px) {
    .ct-hero-inner {
        padding: 40px 18px 44px;
    }

    .ct-hero-main {
        flex: 1 1 100%;
    }

    .ct-hero-title {
        font-size: 34px;
    }

    .ct-hot {
        flex: 1 1 100%;
        max-width: none;
    }

    .ct-body-inner {
        padding: 0 18px;
    }
}

@media (max-width: 768px) {
    .ct-app {
        padding: 0 0 40px;
    }

    .ct-hero-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 32px 14px 34px;
    }

    .ct-hero-title {
        font-size: 30px;
    }

    .ct-hero-sub {
        font-size: 13px;
    }

    .ct-search {
        max-width: none;
    }

    .ct-body {
        padding-top: 20px;
    }

    .ct-body-inner {
        padding: 0 14px;
    }

    .ct-filters {
        padding: 14px 14px;
    }

    .ct-filter-label {
        width: 100%;
        padding-top: 0;
    }

    .contest-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ct-bar {
        align-items: flex-start;
    }

    .ct-bar-pager {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .contest-card {
        padding: 16px;
    }

    .ct-logo {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
}

/* GEO：服务端直出的赛事列表，Vue 挂载后隐藏（保留 DOM 供爬虫与 AI 读取） */
.ct-ssr.is-hydrated {
    display: none;
}

.ct-ssr .contest-name a {
    color: inherit;
    text-decoration: none;
}
