/* ===== 全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== 头部与导航 ===== */
header {
  background: linear-gradient(135deg, #a8ede0, #fed6e3);
  padding: 20px;
  text-align: center;
}

header h1 {
  margin: 0 0 15px 0;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  font-size: 2.5rem;
}

nav {
  background-color: rgba(44, 62, 80, 0.85);
  padding: 12px;
  border-radius: 40px;
  display: inline-block;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

nav a, nav strong {
  color: white;
  text-decoration: none;
  margin: 0 15px;
  padding: 5px 10px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

nav strong {
  background-color: #ffcc00;
  color: #2c3e50;
  font-weight: bold;
}

/* ===== 主内容区域 ===== */
main {
  flex: 1;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  width: 100%;
}

/* ===== 标题样式 ===== */
h1 {
  font-size: 2.5rem;
  color: #2c3e50;
}

h2 {
  font-size: 2rem;
  color: #34495e;
  border-bottom: 3px solid #ddd;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.5rem;
  color: #2c3e50;
  margin: 20px 0 10px;
}

h4 {
  font-size: 1.2rem;
  color: #555;
  margin: 15px 0 5px;
}

/* ===== 段落与引用 ===== */
p {
  margin-bottom: 15px;
}

blockquote {
  font-style: italic;
  background-color: #ecf0f1;
  padding: 15px 20px;
  border-left: 5px solid #3498db;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
}

/* ===== 列表样式 ===== */
ul, ol, dl {
  margin: 10px 0 20px 20px;
}

li, dd {
  margin-bottom: 5px;
}

dt {
  font-weight: bold;
  color: #2c3e50;
  margin-top: 10px;
}

/* ===== 链接样式 ===== */
a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* ===== 按钮样式 ===== */
.btn {
  display: inline-block;
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s, transform 0.2s;
  border: none;
}

.btn:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: #95a5a6;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

/* ===== 页脚样式 ===== */
footer {
  text-align: center;
  padding: 20px;
  background-color: #2c3e50;
  color: white;
  margin-top: 40px;
}

/* ===== 首页特有样式 ===== */
.home-article {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.quote-section {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.welcome-section {
  text-align: center;
  padding: 20px;
}

/* ===== 角色页样式 ===== */
.character-list {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin: 30px 0;
}

.character-card {
  flex: 1 1 300px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.character-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.character-card img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 15px;
  border-radius: 10px;
}

.character-card figcaption {
  text-align: center;
  font-style: italic;
  color: #666;
  margin-bottom: 15px;
}

.character-card ul {
  margin-left: 0;
  list-style-position: inside;
}

.story-steps, .terms {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 30px 0;
}

/* ===== 时间线页表格样式 ===== */
.timeline-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 1rem;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.timeline-table caption {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 15px;
  color: #2c3e50;
}

.timeline-table th,
.timeline-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.timeline-table th {
  background-color: #2c3e50;
  color: white;
  font-weight: bold;
}

.timeline-table tr:nth-child(even) {
  background-color: #f2f2f2;
}

.timeline-table tr:hover {
  background-color: #e0e0e0;
}

.timeline-table tfoot td {
  text-align: center;
  font-weight: bold;
  background-color: #ecf0f1;
}

/* ===== 关于页样式 ===== */
.about-article {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.video-section {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 30px 0;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 比例 */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 20px 0;
  border-radius: 10px;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-note {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  text-align: center;
}

.contact-section {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 30px 0;
}

/* ===== 弹幕墙样式 ===== */
.danmu-container {
  position: relative;
  height: 400px;
  border: 2px dashed #ccc;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin-bottom: 20px;
  border-radius: 10px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.danmu-controls {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.danmu-input {
  flex: 1;
  min-width: 250px;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.danmu-input:focus {
  outline: none;
  border-color: #3498db;
}

.danmu-tips {
  background-color: #ecf0f1;
  padding: 15px;
  border-radius: 10px;
  margin: 20px 0;
  color: #2c3e50;
}

/* ===== 弹幕元素样式（JS动态创建） ===== */
.danmu-item {
  position: absolute;
  white-space: nowrap;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 100;
  pointer-events: none; /* 让弹幕不阻挡点击 */
  user-select: none;    /* 防止选中 */
  animation: danmuMove 8s linear forwards;
}

@keyframes danmuMove {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 20px;
  }

  nav a, nav strong {
    margin: 5px 10px;
  }

  h2 {
    font-size: 1.5rem;
  }

  .character-list {
    flex-direction: column;
  }

  .character-card {
    flex: 1 1 auto;
  }

  .timeline-table {
    font-size: 0.9rem;
  }

  .timeline-table th,
  .timeline-table td {
    padding: 8px 10px;
  }

  .danmu-controls {
    flex-direction: column;
  }

  .danmu-input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0 10px;
  }

  h1 {
    font-size: 1.8rem;
  }

  nav a, nav strong {
    margin: 3px 5px;
    font-size: 0.9rem;
  }

  blockquote {
    padding: 10px 15px;
    font-size: 0.95rem;
  }

  .timeline-table {
    font-size: 0.8rem;
  }

  .timeline-table th,
  .timeline-table td {
    padding: 6px 8px;
  }
}