<?php
require_once __DIR__ . '/common.php';

$config = get_site_config();
$teams = get_products();
$news_list = get_news();

$page_title = $config['title'];
$page_keywords = $config['keywords'];
$page_description = $config['description'];

require_once __DIR__ . '/header.php';
?>

<!-- Banner Header -->
<header class="via-slate-900 text-white to-slate-800 from-slate-950 overflow-hidden relative bg-gradient-to-br py-14 md:py-20">
  <!-- 背景装饰 -->
  <div class="absolute inset-0 overflow-hidden">
    <div class="absolute left-1/2 top-[-120px] h-72 w-72 -translate-x-1/2 rounded-full bg-white/10 blur-3xl"></div>
    <div class="absolute -left-20 bottom-0 h-64 w-64 rounded-full bg-slate-400/10 blur-3xl"></div>
    <div class="absolute -right-16 top-10 h-56 w-56 rounded-full bg-sky-400/10 blur-3xl"></div>
    <div class="absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:32px_32px]"></div>
    <div class="absolute inset-0 bg-black/30"></div>
  </div>

  <!-- 内容 -->
  <div class="relative z-10 mx-auto max-w-7xl px-4 text-center">
    <h1 class="mx-auto max-w-5xl text-3xl font-black leading-tight tracking-tight drop-shadow-[0_3px_10px_rgba(0,0,0,0.35)] md:text-5xl lg:text-6xl">
      2026世界杯赛程表
    </h1>
    <p class="mx-auto mt-5 max-w-3xl text-sm leading-7 text-white/80 md:text-lg">
      完整版赛程图包含所有比赛日程、比赛时间表、对阵图、小组赛和淘汰赛分组安排
    </p>
    <div class="mt-8 flex flex-wrap items-center justify-center gap-3">
      <a href="#schedule" class="inline-flex items-center justify-center rounded-2xl bg-white px-6 py-3 text-sm font-bold text-slate-900 shadow-lg shadow-black/20 transition duration-200 hover:scale-[1.02] hover:bg-slate-100 active:scale-95">
        查看世界杯对阵表
      </a>
      <a href="<?php echo BASE_URL; ?>faq.html" class="inline-flex items-center justify-center rounded-2xl border border-white/15 bg-white/5 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:bg-white/10 active:scale-95">
        赛程指南
      </a>
    </div>
  </div>
</header>

<main class="px-4 py-4 container mx-auto max-w-7xl">
  <!-- 赛程对阵表 -->
  <section id="schedule" class="bg-white border-slate-200 border rounded-2xl overflow-hidden shadow-sm">
    <div class="relative overflow-hidden bg-gradient-to-br from-slate-950 via-slate-900 to-slate-800 p-6 md:p-8">
      <div class="absolute -left-10 top-0 h-40 w-40 rounded-full bg-blue-500/20 blur-3xl"></div>
      <div class="absolute right-0 top-0 h-48 w-48 rounded-full bg-emerald-500/10 blur-3xl"></div>
      <div class="relative flex flex-col gap-5 lg:flex-row lg:items-center lg:justify-between">
        <div>
          <div class="mb-3 inline-flex items-center rounded-full border border-white/10 bg-white/10 px-3 py-1 text-xs font-semibold text-slate-200 backdrop-blur">
            FIFA WORLD CUP 2026
          </div>
          <h2 class="text-2xl font-black text-white md:text-4xl">
            世界杯对阵阶段
          </h2>
          <p class="mt-4 max-w-3xl text-sm text-slate-300">
            2026世界杯首次扩军至48支球队，由美、加、墨三国联合举办。共进行104场比赛，包含小组赛、32强淘汰赛、16强赛、8强赛、半决赛、季军赛及总决赛。
          </p>
        </div>
        <div class="grid grid-cols-3 gap-3">
          <div class="rounded-2xl border border-white/10 bg-white/10 px-4 py-4 text-center backdrop-blur">
            <div class="text-2xl font-black text-white">48</div>
            <div class="mt-1 text-xs text-slate-300">球队</div>
          </div>
          <div class="rounded-2xl border border-white/10 bg-white/10 px-4 py-4 text-center backdrop-blur">
            <div class="text-2xl font-black text-white">104</div>
            <div class="mt-1 text-xs text-slate-300">比赛</div>
          </div>
          <div class="rounded-2xl bg-gradient-to-r from-yellow-400 to-amber-500 px-4 py-4 text-center">
            <div class="text-2xl font-black text-slate-900">39</div>
            <div class="mt-1 text-xs font-semibold text-slate-800">天赛程</div>
          </div>
        </div>
      </div>
    </div>

    <!-- 赛程时间线 -->
    <div class="relative bg-white divide-y divide-slate-100">
      <div class="group relative px-6 py-6 hover:bg-slate-50 transition">
        <div class="flex items-start gap-4">
          <div class="flex h-11 w-11 items-center justify-center rounded-full bg-blue-600 font-bold text-white shrink-0">1</div>
          <div class="flex-1">
            <div class="flex flex-col gap-2 md:flex-row md:items-center md:justify-between">
              <h3 class="text-lg font-bold text-slate-900">小组赛 (Group Stage)</h3>
              <span class="text-xs px-3 py-1 bg-slate-100 text-slate-600 rounded-full">2026/06/12 - 2026/06/27</span>
            </div>
            <p class="mt-2 text-sm text-slate-500">48支球队分为12个小组循环比赛，小组前两名和成绩最好的4个小组第三晋级32强。</p>
          </div>
        </div>
      </div>
      <div class="group relative px-6 py-6 hover:bg-slate-50 transition">
        <div class="flex items-start gap-4">
          <div class="flex h-11 w-11 items-center justify-center rounded-full bg-emerald-600 font-bold text-white shrink-0">2</div>
          <div class="flex-1">
            <div class="flex flex-col gap-2 md:flex-row md:items-center md:justify-between">
              <h3 class="text-lg font-bold text-slate-900">1/16 淘汰赛 (Round of 32)</h3>
              <span class="text-xs px-3 py-1 bg-slate-100 text-slate-600 rounded-full">2026/06/28 - 2026/07/03</span>
            </div>
            <p class="mt-2 text-sm text-slate-500">单场淘汰赛，32强捉对厮杀，胜者晋级16强。</p>
          </div>
        </div>
      </div>
      <div class="group relative px-6 py-6 hover:bg-slate-50 transition">
        <div class="flex items-start gap-4">
          <div class="flex h-11 w-11 items-center justify-center rounded-full bg-purple-600 font-bold text-white shrink-0">3</div>
          <div class="flex-1">
            <div class="flex flex-col gap-2 md:flex-row md:items-center md:justify-between">
              <h3 class="text-lg font-bold text-slate-900">1/8 淘汰赛 (Round of 16)</h3>
              <span class="text-xs px-3 py-1 bg-slate-100 text-slate-600 rounded-full">2026/07/04 - 2026/07/07</span>
            </div>
            <p class="mt-2 text-sm text-slate-500">欧洲、美洲、亚洲及非洲强队汇聚，争夺8强名额。</p>
          </div>
        </div>
      </div>
      <div class="group relative px-6 py-6 hover:bg-slate-50 transition">
        <div class="flex items-start gap-4">
          <div class="flex h-11 w-11 items-center justify-center rounded-full bg-amber-500 font-bold text-white shrink-0">4</div>
          <div class="flex-1">
            <div class="flex flex-col gap-2 md:flex-row md:items-center md:justify-between">
              <h3 class="text-lg font-bold text-slate-900">1/4 决赛 (Quarter-Finals)</h3>
              <span class="text-xs px-3 py-1 bg-slate-100 text-slate-600 rounded-full">2026/07/09 - 2026/07/10</span>
            </div>
            <p class="mt-2 text-sm text-slate-500">四场巅峰对决，决出最终半决赛的四强豪门。</p>
          </div>
        </div>
      </div>
      <div class="group relative px-6 py-6 bg-gradient-to-r from-yellow-50 to-amber-50">
        <div class="flex items-start gap-4">
          <div class="flex h-11 w-11 items-center justify-center rounded-full bg-gradient-to-br from-yellow-400 to-amber-600 font-bold text-white shrink-0">★</div>
          <div class="flex-1">
            <div class="flex flex-col gap-2 md:flex-row md:items-center md:justify-between">
              <h3 class="text-lg font-bold text-slate-900">总决赛 (FIFA Final)</h3>
              <span class="text-xs px-3 py-1 bg-yellow-100 text-yellow-800 rounded-full">2026/07/20</span>
            </div>
            <p class="mt-2 text-sm text-slate-700">在美国纽约大都会人寿体育场决出第23届世界杯得主。</p>
          </div>
        </div>
      </div>
    </div>
  </section>

  <!-- 参赛球队展示 (Team Showcase) -->
  <section class="mt-8 bg-white border border-slate-200 rounded-2xl p-6 shadow-sm">
    <div class="flex justify-between items-center border-b border-slate-100 pb-4 mb-6">
      <h2 class="text-xl font-bold text-slate-900 flex items-center gap-2">
        <span class="h-5 w-1.5 rounded-full bg-blue-600"></span>
        焦点参赛球队
      </h2>
      <a href="<?php echo BASE_URL; ?>sjj/index.html" class="text-sm font-semibold text-blue-600 hover:text-blue-700">全部球队 &rarr;</a>
    </div>
    <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6">
      <?php 
      $showcase_teams = array_slice($teams, 0, 5);
      foreach ($showcase_teams as $team):
          $team_url = BASE_URL . "sjj/" . $team['category_id'] . "/2026/0119/" . $team['id'] . ".html";
      ?>
          <a href="<?php echo htmlspecialchars($team_url); ?>" class="group block text-center p-4 border border-slate-100 hover:border-blue-500 rounded-2xl transition hover:shadow-md">
            <img src="<?php echo BASE_URL . htmlspecialchars($team['image']); ?>" alt="<?php echo htmlspecialchars($team['name']); ?>" class="w-16 h-12 object-contain mx-auto group-hover:scale-105 transition" />
            <h3 class="mt-3 font-bold text-slate-800 text-sm group-hover:text-blue-600 truncate"><?php echo htmlspecialchars($team['name']); ?></h3>
            <span class="inline-block mt-1 text-[11px] px-2 py-0.5 bg-slate-100 text-slate-500 rounded-full font-medium"><?php echo htmlspecialchars($team['category_name']); ?></span>
          </a>
      <?php endforeach; ?>
    </div>
  </section>

  <!-- 比赛日程/时间表 (Interactive Tab Simulation) -->
  <section id="fixtures" class="mt-8 bg-white border border-slate-200 rounded-2xl overflow-hidden shadow-sm" x-data="{ activeTab: 'group' }">
    <div class="border-b border-slate-100 bg-gradient-to-r from-slate-50 to-white px-6 py-5">
      <h2 class="text-xl font-bold text-slate-900 flex items-center gap-2">
        <span class="h-5 w-1.5 rounded-full bg-blue-600"></span>
        焦点比赛时间表
      </h2>
      <p class="mt-2 text-sm text-slate-500">球迷可以提前了解各阶段焦点比赛的开赛时间与比分预测，不错过精彩豪强对决。</p>
      
      <!-- Tabs -->
      <div class="mt-4 flex gap-2 overflow-x-auto pb-1 scrollbar-none">
        <button type="button" @click="activeTab = 'group'" :class="activeTab === 'group' ? 'bg-slate-900 text-white' : 'bg-slate-100 text-slate-600 hover:bg-slate-200'" class="shrink-0 rounded-xl px-4 py-2 text-sm font-semibold transition">
          小组赛
        </button>
        <button type="button" @click="activeTab = 'knockout'" :class="activeTab === 'knockout' ? 'bg-slate-900 text-white' : 'bg-slate-100 text-slate-600 hover:bg-slate-200'" class="shrink-0 rounded-xl px-4 py-2 text-sm font-semibold transition">
          淘汰赛
        </button>
      </div>
    </div>

    <!-- Match Tables -->
    <div class="p-6">
      <div x-show="activeTab === 'group'" class="space-y-4">
        <!-- Match Day 1 -->
        <div class="border border-slate-100 rounded-xl overflow-hidden">
          <div class="flex justify-between p-3 bg-slate-50 border-b border-slate-100 text-xs font-semibold text-slate-500">
            <span>2026-06-12 (周五) - 小组赛 A组</span>
            <span class="text-blue-600">揭幕战</span>
          </div>
          <div class="p-4 flex items-center justify-between text-sm">
            <div class="flex items-center gap-2 justify-end w-2/5">
              <span class="font-semibold text-slate-700">墨西哥</span>
              <img src="<?php echo BASE_URL; ?>static/images/logo/墨西哥.png" class="w-6 h-5 object-contain" alt="墨西哥" />
            </div>
            <div class="text-center font-bold text-slate-800 px-3 bg-slate-100 py-1 rounded">0 VS 0</div>
            <div class="flex items-center gap-2 w-2/5">
              <img src="<?php echo BASE_URL; ?>static/images/logo/南非.png" class="w-6 h-5 object-contain" alt="南非" />
              <span class="font-semibold text-slate-700">南非</span>
            </div>
          </div>
        </div>
        <!-- Match Day 2 -->
        <div class="border border-slate-100 rounded-xl overflow-hidden">
          <div class="flex justify-between p-3 bg-slate-50 border-b border-slate-100 text-xs font-semibold text-slate-500">
            <span>2026-06-13 (周六) - 小组赛 B组</span>
            <span>焦点战</span>
          </div>
          <div class="p-4 flex items-center justify-between text-sm">
            <div class="flex items-center gap-2 justify-end w-2/5">
              <span class="font-semibold text-slate-700">韩国</span>
              <img src="<?php echo BASE_URL; ?>static/images/logo/韩国.png" class="w-6 h-5 object-contain" alt="韩国" />
            </div>
            <div class="text-center font-bold text-slate-800 px-3 bg-slate-100 py-1 rounded">0 VS 0</div>
            <div class="flex items-center gap-2 w-2/5">
              <img src="<?php echo BASE_URL; ?>static/images/logo/捷克.png" class="w-6 h-5 object-contain" alt="捷克" />
              <span class="font-semibold text-slate-700">捷克</span>
            </div>
          </div>
        </div>
      </div>

      <div x-show="activeTab === 'knockout'" class="space-y-4" style="display:none;">
        <div class="border border-slate-100 rounded-xl overflow-hidden">
          <div class="flex justify-between p-3 bg-slate-50 border-b border-slate-100 text-xs font-semibold text-slate-500">
            <span>2026-07-20 (周一) - 总决赛</span>
            <span class="text-amber-600">冠军争夺</span>
          </div>
          <div class="p-4 flex items-center justify-between text-sm">
            <div class="flex items-center gap-2 justify-end w-2/5">
              <span class="font-semibold text-slate-700">阿根廷</span>
              <img src="<?php echo BASE_URL; ?>static/images/logo/阿根廷.png" class="w-6 h-5 object-contain" alt="阿根廷" />
            </div>
            <div class="text-center font-bold text-slate-800 px-3 bg-slate-100 py-1 rounded">0 VS 0</div>
            <div class="flex items-center gap-2 w-2/5">
              <img src="<?php echo BASE_URL; ?>static/images/logo/法国.png" class="w-6 h-5 object-contain" alt="法国" />
              <span class="font-semibold text-slate-700">法国</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <!-- 赛事资讯 & 动态 (Dynamic News Blocks) -->
  <section class="mt-8 grid gap-6 md:grid-cols-2">
    <!-- 赛事动态 -->
    <div class="bg-white border border-slate-200 rounded-2xl p-6 shadow-sm">
      <div class="flex justify-between items-center border-b border-slate-100 pb-3 mb-4">
        <h2 class="text-lg font-bold text-slate-900 flex items-center gap-2">
          <span class="h-4 w-1 rounded-full bg-blue-600"></span>
          赛事动态
        </h2>
        <a href="<?php echo BASE_URL; ?>a/saishidongtai/index.html" class="text-xs font-semibold text-slate-500 hover:text-blue-600">更多 &rarr;</a>
      </div>
      <ul class="space-y-3 text-sm">
        <?php 
        $c_news = array();
        foreach ($news_list as $n) { if ($n['category_id'] === 'saishidongtai') $c_news[] = $n; }
        $c_news_slice = array_slice($c_news, 0, 4);
        foreach ($c_news_slice as $news):
            $news_url = BASE_URL . "a/" . $news['category_id'] . "/2026/0119/" . $news['id'] . ".html";
        ?>
            <li class="flex justify-between items-center py-1">
              <a href="<?php echo htmlspecialchars($news_url); ?>" class="hover:text-blue-600 truncate max-w-xs md:max-w-md"><?php echo htmlspecialchars($news['title']); ?></a>
              <span class="text-xs text-slate-400 shrink-0">[<?php echo htmlspecialchars($news['date']); ?>]</span>
            </li>
        <?php endforeach; ?>
      </ul>
    </div>

    <!-- 球队动态 -->
    <div class="bg-white border border-slate-200 rounded-2xl p-6 shadow-sm">
      <div class="flex justify-between items-center border-b border-slate-100 pb-3 mb-4">
        <h2 class="text-lg font-bold text-slate-900 flex items-center gap-2">
          <span class="h-4 w-1 rounded-full bg-emerald-600"></span>
          球队动态
        </h2>
        <a href="<?php echo BASE_URL; ?>a/qiuduidongtai/index.html" class="text-xs font-semibold text-slate-500 hover:text-blue-600">更多 &rarr;</a>
      </div>
      <ul class="space-y-3 text-sm">
        <?php 
        $q_news = array();
        foreach ($news_list as $n) { if ($n['category_id'] === 'qiuduidongtai') $q_news[] = $n; }
        $q_news_slice = array_slice($q_news, 0, 4);
        foreach ($q_news_slice as $news):
            $news_url = BASE_URL . "a/" . $news['category_id'] . "/2026/0119/" . $news['id'] . ".html";
        ?>
            <li class="flex justify-between items-center py-1">
              <a href="<?php echo htmlspecialchars($news_url); ?>" class="hover:text-blue-600 truncate max-w-xs md:max-w-md"><?php echo htmlspecialchars($news['title']); ?></a>
              <span class="text-xs text-slate-400 shrink-0">[<?php echo htmlspecialchars($news['date']); ?>]</span>
            </li>
        <?php endforeach; ?>
      </ul>
    </div>
  </section>

  <!-- 场馆介绍 -->
  <section id="stadiums" class="mt-8 bg-white border border-slate-200 rounded-2xl overflow-hidden shadow-sm">
    <div class="border-b border-slate-100 bg-gradient-to-r from-slate-50 to-white px-6 py-5">
      <h2 class="text-xl font-bold text-slate-900 flex items-center gap-2">
        <span class="h-5 w-1.5 rounded-full bg-blue-600"></span>
        世界杯球场信息
      </h2>
      <p class="mt-2 text-sm text-slate-500">2026世界杯设16座比赛场馆，覆盖北美三大核心国家。</p>
    </div>
    <div class="grid gap-6 p-6 md:grid-cols-2 lg:grid-cols-3">
      <!-- Stadium 1 -->
      <article class="group rounded-2xl border border-slate-200 overflow-hidden shadow-sm hover:shadow-md transition">
        <img src="<?php echo BASE_URL; ?>static/images/1.png" class="h-48 w-full object-cover transition duration-300 group-hover:scale-102" alt="阿兹特克体育场" />
        <div class="p-4">
          <div class="flex justify-between items-center mb-3">
            <h3 class="font-bold text-slate-900">阿兹特克体育场</h3>
            <span class="text-xs px-2 py-0.5 bg-slate-100 text-slate-600 rounded">墨西哥</span>
          </div>
          <p class="text-xs text-slate-500 leading-5">传奇的阿兹特克球场将承办揭幕战，这里承载着无数世界杯的光辉历史回忆。</p>
        </div>
      </article>
      <!-- Stadium 2 -->
      <article class="group rounded-2xl border border-slate-200 overflow-hidden shadow-sm hover:shadow-md transition">
        <img src="<?php echo BASE_URL; ?>static/images/1.png" class="h-48 w-full object-cover transition duration-300 group-hover:scale-102" alt="大都会人寿体育场" />
        <div class="p-4">
          <div class="flex justify-between items-center mb-3">
            <h3 class="font-bold text-slate-900">大都会人寿体育场</h3>
            <span class="text-xs px-2 py-0.5 bg-slate-100 text-slate-600 rounded">美国纽约</span>
          </div>
          <p class="text-xs text-slate-500 leading-5">可容纳超82,500名观众，已确定承办2026世界杯最为关键的总决赛夺冠之战。</p>
        </div>
      </article>
      <!-- Stadium 3 -->
      <article class="group rounded-2xl border border-slate-200 overflow-hidden shadow-sm hover:shadow-md transition">
        <img src="<?php echo BASE_URL; ?>static/images/1.png" class="h-48 w-full object-cover transition duration-300 group-hover:scale-102" alt="SoFi体育场" />
        <div class="p-4">
          <div class="flex justify-between items-center mb-3">
            <h3 class="font-bold text-slate-900">SoFi 体育场</h3>
            <span class="text-xs px-2 py-0.5 bg-slate-100 text-slate-600 rounded">美国洛杉矶</span>
          </div>
          <p class="text-xs text-slate-500 leading-5">最现代化的专业大球场之一，以令人叹为观止的高端屏幕和硬件设计闻名于世。</p>
        </div>
      </article>
    </div>
  </section>
</main>

<?php
require_once __DIR__ . '/footer.php';
?>
