/* --- 变量和基础设置 --- */
:root {
  --primary: #00356b; /* 主题色：深蓝 */
  --accent: #d62828;  /* 强调色：红色 */
  --bg-light: #f8f9fa; /* 浅背景色 */
  --bg-dark: #212529;   /* 深背景色 */
  --text-dark: #343a40; /* 主要文字颜色 */
  --text-light: #f8f9fa; /* 亮色文字 */
  --radius: 8px;       /* 圆角 */
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* 阴影效果 */
  --shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.12); /* 悬停时的阴影 */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- 重置和全局样式 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  line-height: 1.8;
  color: var(--text-dark);
  background-color: var(--bg-light); /* 统一设置页面基础背景色 */
  overflow-x: hidden;
}

/* --- 头部导航 --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 3rem;
}

.logo {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 1.5px;
  color: var(--text-light);
  transition: var(--transition);
  z-index: 1002;
}

.header.scrolled .logo {
  color: var(--primary);
}

.nav {
  display: flex;
}

.nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav a {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  position: relative;
  color: var(--text-light);
  transition: var(--transition);
}

.header.scrolled .nav a {
  color: var(--text-dark);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -6px;
  width: 0%;
  height: 3px;
  background: var(--accent);
  transition: var(--transition);
}

.nav a:hover,
.nav a.active {
  color: var(--accent) !important;
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

/* --- 汉堡菜单 (移动端) --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
  transition: var(--transition);
  transform-origin: center;
}

.header.scrolled .hamburger span {
  background: var(--text-dark);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}
.hamburger.active span {
  background: var(--text-dark);
}

/* --- Hero区域 --- */
.hero {
  height: 100vh;
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 15vw;
  max-height: 150px;
  background: var(--bg-light);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0, 10, 30, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 10%;
  color: #fff;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.catch {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 2rem;
}

.catch .line {
  display: block;
  overflow: hidden;
}

.catch .word {
  display: block;
  transform: translateY(100%);
}

.catch small {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  letter-spacing: 1px;
}

/* --- 通用区块样式 --- */
.section {
  padding: 80px 5%;
  position: relative;
  overflow: hidden;
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 4rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: var(--accent);
  margin: 0.75rem auto 0;
}

.section-title-en {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  color: #aaa;
  letter-spacing: 2px;
  margin-top: 0.5rem;
}

/* --- 为各个部分设置不同的背景色 --- */
.news, .achievements { background-color: #fff; }
.profile, .playstyle, .contact { background-color: var(--bg-light); }

/* --- 新闻区块 --- */
.news-swiper {
  padding-bottom: 4rem !important;
}
.news-card {
  background: #fff;
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  min-height: 180px;
  height: 200px; /* 固定高度 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 5px solid var(--primary);
  transition: var(--transition);
  cursor: pointer; /* 添加点击指针 */
  text-decoration: none; /* 移除链接下划线 */
}
.news-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-left-color: var(--accent);
}
.news-card time {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}
.news-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 最多两行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  word-break: break-word;
  margin: 0.5rem 0;
  flex: 1; /* 让文本区域占据剩余空间 */
}
.news-card .tag {
  align-self: flex-start;
  margin-top: auto; /* 推到底部 */
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  color: #fff;
  background-color: var(--primary);
}
.tag.result { background: #4caf50; }
.tag.media { background: #2196f3; }
.tag.event { background: #ff9800; }
.swiper-pagination-bullet {
  background: var(--primary);
  width: 12px;
  height: 12px;
  opacity: 0.5;
}
.swiper-pagination-bullet-active {
  background: var(--accent);
  opacity: 1;
}
.more-link {
  text-align: center;
  margin-top: 2rem;
}

/* --- Profile (个人资料) --- */
.profile .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
}
.profile-img {
  flex: 1 1 400px;
  max-width: 450px;
}
.profile-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}
.profile-text-wrapper {
  flex: 1 1 500px;
}
.profile .section-title {
  text-align: left;
  margin-bottom: 2rem;
}
.profile .section-title::after {
  margin-left: 0;
}
.profile-text dl {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.8rem 1rem;
  margin-bottom: 1.5rem;
}
.profile-text dt {
  font-weight: 700;
  color: var(--primary);
}
.profile-text dd {
  margin: 0;
}
.profile-text .bio {
  font-size: 0.95rem;
}

/* --- 比赛风格 --- */
.playstyle-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}
.playstyle-item {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}
.playstyle-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}
.playstyle-item i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.playstyle-item h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* --- 主要战绩 --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 4rem;
}
.timeline-year {
  position: absolute;
  left: -20px;
  top: 0;
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  background: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transform: translateX(-50%) rotate(-10deg);
  box-shadow: var(--shadow);
  white-space: nowrap; /* 防止 U-19 等文字换行 */
}
.timeline-list {
  list-style: none;
}
.timeline-list li {
  background: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.timeline-list span {
  font-weight: bold;
  margin-left: 0.5rem;
  color: var(--primary);
}

/* --- 联系表单 --- */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group label {
  font-weight: 700;
  color: var(--primary);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}
.form-group textarea {
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.2);
}
.contact-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
  font-size: 1.1rem;
  padding: 1rem;
}

/* --- 按钮样式 --- */
.btn {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.8rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

/* 支持多行文本的按钮样式 */
.btn-multiline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  height: 4rem; /* 固定高度 */
  max-width: 300px; /* 最大宽度 */
  text-align: center;
}

.btn-multiline .btn-text {
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 最多两行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  word-break: break-word;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-secondary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

/* --- 页脚 --- */
.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 4rem 5% 2rem;
  text-align: center;
}
.footer .logo {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}
.footer-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: #aaa;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--accent);
}
.copyright {
  font-size: 0.8rem;
  color: #888;
}

/* ==============================================
   响应式设计 (Media Queries)
   ============================================== */

/* --- 平板 (<= 992px) --- */
@media (max-width: 992px) {
  .section { padding: 4rem 5%; }
  .header { padding: 0.75rem 1.5rem; }
  .header.scrolled { padding: 0.5rem 1.5rem; }

  /* Profile 响应式调整 (平板) */
  .profile .container {
    flex-direction: column;
    gap: 2rem;
  }
  .profile-img {
    max-width: 350px;
    margin: 0 auto;
  }
  .profile-text-wrapper {
    text-align: center;
  }
  .profile .section-title {
    text-align: center;
  }
  .profile .section-title::after {
    margin: 0.5rem auto 0;
  }
  .profile-text dl {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .profile-text dt {
    margin-top: 1rem;
  }
}

/* --- 手机 (<= 768px) --- */
@media (max-width: 768px) {
  /* 移动端导航菜单 */
  .nav {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
  }
  .nav.open {
    display: flex;
    transform: translateY(0);
  }
  .nav ul {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
  }
  .nav a {
    color: var(--text-dark) !important;
    font-size: 1.2rem;
  }
  .hamburger {
    display: flex;
  }

  /* 其他手机样式调整 */
  .hero-content {
    align-items: center;
    text-align: center;
  }
  .catch { font-size: 2rem; }
  .catch small { font-size: 1.1rem; }
  .section { padding: 3rem 5%; }
  .section-title { font-size: 1.8rem; margin-bottom: 2rem; }
  .section-title-en { display: none; }
  
  .profile-img {
      max-width: 80%;
  }

  /* ↓↓↓ 战绩 (Timeline) 移动端样式修正 ↓↓↓ */
  .timeline {
    padding: 0; /* 移除容器的左右内边距 */
  }
  .timeline::before {
    left: 15px; /* 调整时间轴竖线的位置，使其更靠近左侧 */
  }
  .timeline-item {
    padding-left: 45px; /* 为年份标签和内容留出足够空间 */
    margin-bottom: 2rem;
  }
  .timeline-year {
    font-size: 1rem; /* 调整字体大小 */
    padding: 0.4rem 0.8rem;
    left: 15px; /* 与竖线位置对齐 */
    top: -5px;
    transform: translateX(-50%) rotate(0); /* 水平居中并取消旋转 */
  }
  .timeline-list li {
    padding: 0.8rem 1rem;
  }
  /* ↑↑↑ 修正结束 ↑↑↑ */
}

.floating-window {
  position: fixed;
  right: 32px;
  bottom: 32px;
  height: 60px;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  transition: box-shadow 0.25s, transform 0.25s;
}
.floating-window:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transform: translateY(-6px) scale(1.03);
}
.floating-logo {
  max-height: 80%;
  max-width: 90%;
  display: block;
  margin-right: 8px;
}
.floating-text {
  margin-left: 0;
  font-size: 0.95rem;
  color: #222;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.social-links {
  display: flex;
  align-items: center;
  margin-left: 0;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 12px;
}
.social-icon {
  color: #fff;
  font-size: 1.25rem;
  margin: 0 12px;
  transition: color 0.2s;
  text-decoration: none;
}
.social-icon:hover {
  color: #007aff;
}