/* ============================================
   田径运动员个人主页 - 主样式表
   技术栈: HTML5 + CSS3（移动端优先 + 桌面响应式）
   ============================================ */

/* ---- CSS变量 ---- */
:root {
    --color-primary: #1a264a;        /* 深蓝主色 */
    --color-primary-light: #2c3e6b;
    --color-accent: #e8590c;         /* 橙色强调 */
    --color-accent-light: #ff7b3d;
    --color-gold: #f59e0b;           /* 金色（奖牌） */
    --color-silver: #94a3b8;         /* 银色 */
    --color-bronze: #d97706;         /* 铜色 */
    --color-bg: #f5f5f7;             /* 页面背景 */
    --color-bg-white: #ffffff;
    --color-text: #1a1a2e;
    --color-text-light: #64748b;
    --color-border: #e2e8f0;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: .25s ease;
    --max-width: 1200px;
    --header-height: 64px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height);
}
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-light); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }

/* ---- 导航栏 ---- */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(26,38,74,.95); backdrop-filter: blur(16px);
    height: var(--header-height); display: flex; align-items: center;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.2rem; font-weight: 700; }
.logo:hover { color: var(--color-accent-light); }
.logo-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-accent); }
.main-nav ul { display: flex; gap: 4px; }
.main-nav a {
    display: block; padding: 8px 16px; color: rgba(255,255,255,.8);
    border-radius: var(--radius-sm); font-size: .95rem; font-weight: 500;
}
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255,255,255,.1); }

.menu-toggle {
    display: none; flex-direction: column; gap: 5px; background: none; border: none;
    cursor: pointer; padding: 4px;
}
.menu-toggle span {
    display: block; width: 24px; height: 2px; background: #fff;
    border-radius: 2px; transition: var(--transition);
}

/* ---- Hero区域 ---- */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0f1724 100%);
    color: #fff; padding: 60px 0 50px; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(232,89,12,.15), transparent 60%);
}
.hero .container { position: relative; z-index: 1; }
.hero-avatar { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; border: 4px solid var(--color-accent); margin: 0 auto 20px; box-shadow: var(--shadow-lg); }
.hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 6px; }
.hero .hero-sub { font-size: 1.05rem; color: rgba(255,255,255,.7); margin-bottom: 20px; }
.hero-stats { display: flex; justify-content: center; gap: 32px; margin-top: 24px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat .stat-num { font-size: 1.8rem; font-weight: 800; color: var(--color-accent); }
.hero-stat .stat-label { font-size: .85rem; color: rgba(255,255,255,.6); margin-top: 2px; }

/* ---- 通用区块 ---- */
.section { padding: 50px 0; }
.section-header { text-align: center; margin-bottom: 36px; }
.section-header h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; }
.section-header .section-sub { color: var(--color-text-light); font-size: .95rem; }

/* ---- 卡片 ---- */
.card {
    background: var(--color-bg-white); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 20px; }
.card-body h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.card-body h3 a { color: var(--color-text); }
.card-body h3 a:hover { color: var(--color-accent); }
.card-meta { font-size: .85rem; color: var(--color-text-light); margin-bottom: 10px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---- 网格 ---- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

/* ---- 个人最好成绩表格 ---- */
.pb-table {
    width: 100%; border-collapse: collapse; background: var(--color-bg-white);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.pb-table thead { background: var(--color-primary); color: #fff; }
.pb-table th, .pb-table td { padding: 12px 16px; text-align: left; }
.pb-table tbody tr { border-bottom: 1px solid var(--color-border); }
.pb-table tbody tr:hover { background: #f8fafc; }
.pb-table .pb-highlight { color: var(--color-accent); font-weight: 700; }

/* ---- 比赛记录列表 ---- */
.comp-item {
    display: flex; align-items: center; gap: 20px; padding: 20px;
    background: var(--color-bg-white); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); margin-bottom: 16px;
    transition: transform var(--transition);
}
.comp-item:hover { transform: translateX(6px); }
.comp-medal { font-size: 2.2rem; flex-shrink: 0; }
.comp-info { flex: 1; }
.comp-info h3 { font-size: 1.05rem; margin-bottom: 4px; }
.comp-info .comp-event { color: var(--color-accent); font-weight: 600; font-size: .9rem; }
.comp-info .comp-meta { color: var(--color-text-light); font-size: .85rem; }
.comp-result { text-align: right; flex-shrink: 0; }
.comp-result .result-val { font-size: 1.3rem; font-weight: 700; color: var(--color-accent); }
.comp-result .result-rank { font-size: .85rem; color: var(--color-text-light); }

/* ---- 视频卡片（核心展示）---- */
.video-card { position: relative; }
.video-card .card-img-wrap {
    position: relative; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0;
    aspect-ratio: 16/9; background: #1a1a2e;
}
.video-card .card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.video-card .play-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.3); transition: background var(--transition);
}
.video-card:hover .play-overlay { background: rgba(0,0,0,.5); }
.play-icon {
    width: 60px; height: 60px; background: var(--color-accent); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 0;
    box-shadow: var(--shadow-md);
}
.play-icon::after {
    content: ''; display: block; width: 0; height: 0;
    border-style: solid; border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}
.video-card .video-duration {
    position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.8);
    color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 4px;
}

/* ---- 视频弹窗 ---- */
.video-modal {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,.85); align-items: center; justify-content: center;
}
.video-modal.active { display: flex; }
.video-modal-content {
    position: relative; width: 90%; max-width: 960px; aspect-ratio: 16/9;
    background: #000; border-radius: var(--radius); overflow: hidden;
}
.video-modal-content iframe, .video-modal-content video {
    width: 100%; height: 100%; border: none;
}
.video-modal-close {
    position: absolute; top: -40px; right: 0; background: none; border: none;
    color: #fff; font-size: 2rem; cursor: pointer; line-height: 1;
}

/* ---- 新闻卡片 ---- */
.news-card .card-body .news-date {
    font-size: .8rem; color: var(--color-text-light);
}
.news-card .card-body .news-summary {
    font-size: .9rem; color: var(--color-text-light); margin-top: 8px;
}

/* ---- 关于我 ---- */
.about-grid {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 40px; align-items: start;
}
.about-avatar img { border-radius: var(--radius); box-shadow: var(--shadow-md); }
.about-info h2 { margin-bottom: 16px; }
.about-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0; }
.about-meta dt { font-size: .85rem; color: var(--color-text-light); }
.about-meta dd { font-weight: 600; }

/* ---- 按钮 ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px;
    font-size: .95rem; font-weight: 600; border: none; border-radius: var(--radius-sm);
    cursor: pointer; transition: all var(--transition); text-align: center;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-light); color: #fff; }
.btn-outline { background: transparent; color: var(--color-accent); border: 2px solid var(--color-accent); }
.btn-outline:hover { background: var(--color-accent); color: #fff; }
.btn-block { display: block; width: 100%; }

/* ---- 分页 ---- */
.pagination { display: flex; justify-content: center; margin-top: 36px; }
.pagination ul { display: flex; gap: 6px; }
.pagination li a, .pagination li span {
    display: block; padding: 8px 14px; border-radius: var(--radius-sm);
    background: var(--color-bg-white); color: var(--color-text);
    box-shadow: var(--shadow-sm); font-size: .9rem;
}
.pagination li span.active { background: var(--color-accent); color: #fff; }
.pagination li a:hover { background: var(--color-primary); color: #fff; }

/* ---- 页脚 ---- */
.site-footer {
    background: var(--color-primary); color: rgba(255,255,255,.7); padding: 50px 0 20px; margin-top: 50px;
}
.site-footer h4 { color: #fff; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,.6); }
.site-footer a:hover { color: var(--color-accent-light); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 30px; }
.footer-col li { margin-bottom: 6px; }
.footer-social { display: flex; gap: 12px; margin-top: 14px; }
.footer-social a {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3);
    display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.footer-social a:hover { border-color: var(--color-accent); color: var(--color-accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; text-align: center; font-size: .85rem; }

/* ---- 面包屑 ---- */
.breadcrumb { padding: 20px 0; font-size: .9rem; color: var(--color-text-light); }
.breadcrumb a { color: var(--color-text-light); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb span { color: var(--color-text); }

/* ---- 精选标签 ---- */
.featured-tag {
    display: inline-block; padding: 2px 10px; font-size: .75rem;
    background: var(--color-accent); color: #fff; border-radius: 20px; font-weight: 600;
}
.badge-new {
    display: inline-block; padding: 2px 8px; font-size: .75rem;
    background: var(--color-success); color: #fff; border-radius: 3px; font-weight: 600;
}

/* ------------------------------------------
   移动端响应式（Mobile First 增强）
   ------------------------------------------ */
@media (max-width: 768px) {
    :root { --header-height: 56px; }

    /* 导航 */
    .menu-toggle { display: flex; z-index: 1100; }
    .main-nav {
        position: fixed; top: 0; right: -100%; width: 70%; max-width: 300px; height: 100vh;
        background: var(--color-primary); padding: 80px 24px 24px;
        transition: right var(--transition); z-index: 1050;
    }
    .main-nav.open { right: 0; }
    .main-nav ul { flex-direction: column; gap: 8px; }
    .main-nav a { font-size: 1.05rem; padding: 12px 16px; }

    /* Hero */
    .hero { padding: 40px 0 30px; }
    .hero-avatar { width: 100px; height: 100px; }
    .hero h1 { font-size: 1.5rem; }
    .hero-stats { gap: 20px; }
    .hero-stat .stat-num { font-size: 1.4rem; }

    /* 关于 */
    .about-grid { grid-template-columns: 1fr; gap: 24px; }
    .about-meta { grid-template-columns: 1fr 1fr; }

    /* 比赛 */
    .comp-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .comp-result { text-align: left; }

    /* 网格 */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    /* 页脚 */
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }

    /* 表格滚动 */
    .pb-table-wrap { overflow-x: auto; }
    .pb-table { min-width: 600px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- 无内容状态 ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-light); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }

/* ---- 加载动画 ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .5s ease forwards; }
