/* 根容器，对应HTML中的.container */
.container {
  max-width: 960px;
  margin: 20px auto;
  padding: 20px;
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  position: relative; /* 用于锻造师链接定位 */
  overflow: hidden; /* 防止内容溢出圆角 */
}

/* 锻造师链接 */
.container .forge-link {
  font-size: 0.85em;
  text-align: center;
  padding: 8px 0;
  background-color: #f8f8f8;
  border-bottom: 1px solid #eee;
  margin: -20px -20px 20px -20px; /* 扩展到容器边缘 */
  color: #777;
}

.container .forge-link a {
  color: #6a0dad;
  text-decoration: none;
  font-weight: bold;
}

.container .forge-link a:hover {
  text-decoration: underline;
  color: #8a2be2;
}

/* 头部样式 */
.container header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
}

.container header h1 {
  color: #6a0dad;
  font-size: 2.8em;
  margin-bottom: 8px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.container header p {
  color: #666;
  font-size: 1.1em;
  font-style: italic;
}

/* 导航标签页 */
.container .nav-tabs {
  display: flex;
  justify-content: space-around;
  margin-bottom: 25px;
  background-color: #f0f0f0;
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.container .nav-tab {
  padding: 12px 25px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  font-weight: bold;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-grow: 1;
  text-align: center;
  border-radius: 8px;
}

.container .nav-tab:hover {
  background-color: #e8e8e8;
  color: #6a0dad;
}

.container .nav-tab.active {
  border-bottom-color: #6a0dad;
  color: #6a0dad;
  background-color: #fff;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}

/* 内容区通用样式 */
.container .content-section {
  padding: 15px 0;
}

.container h2 {
  color: #6a0dad;
  font-size: 2em;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 8px;
  margin-top: 30px;
  margin-bottom: 20px;
}

.container h3 {
  color: #8a2be2;
  font-size: 1.4em;
  margin-top: 25px;
  margin-bottom: 15px;
}

.container p {
  margin-bottom: 1em;
  color: #444;
}

.container ul {
  margin-bottom: 1em;
  padding-left: 25px;
  list-style-type: disc;
  color: #444;
}

.container li {
  margin-bottom: 0.5em;
}

/* 角色表单样式 */
.container .character-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
}

.container .character-form input[type="text"],
.container .character-form textarea,
.container .character-form select {
  width: calc(100% - 24px); /* 减去padding和border */
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  box-sizing: border-box; /* 确保padding和border包含在width内 */
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.container .character-form input[type="text"]:focus,
.container .character-form textarea:focus,
.container .character-form select:focus {
  border-color: #8a2be2;
  box-shadow: 0 0 5px rgba(138, 43, 226, 0.3);
  outline: none;
}

.container .character-form textarea {
  resize: vertical;
  min-height: 100px;
}

/* 按钮组 */
.container .button-group {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 20px;
}

.container .btn {
  background-color: #6a0dad;
  color: #fff;
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1em;
  margin: 0 8px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(106, 13, 173, 0.3);
}

.container .btn:hover {
  background-color: #5a0baa;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(106, 13, 173, 0.4);
}

/* 预览区域 */
.container #copy_preview {
  background-color: #fcfcfc;
  border: 1px dashed #ddd;
  padding: 20px;
  border-radius: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-top: 25px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.95em;
  color: #444;
  box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.05);
}

/* 角色卡片 */
.container .character-card {
  background-color: #fdfdff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex; /* 使用flex布局 */
  align-items: flex-start; /* 顶部对齐 */
  gap: 20px; /* 间距 */
}

.container .character-card img {
  width: 120px; /* 图片尺寸 */
  height: 120px;
  object-fit: cover; /* 保持图片比例 */
  border-radius: 50%;
  border: 3px solid #6a0dad;
  flex-shrink: 0; /* 防止图片缩小 */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.container .character-card .text-content {
  flex-grow: 1; /* 文本内容占据剩余空间 */
}

.container .character-card h3 {
  margin-top: 0;
  color: #6a0dad;
  font-size: 1.6em;
  margin-bottom: 10px;
}

.container .character-card p {
  margin-bottom: 0.8em;
  color: #555;
}

.container .character-card strong {
  color: #8a2be2;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .container {
    margin: 10px;
    padding: 15px;
  }

  .container header h1 {
    font-size: 2em;
  }

  .container .nav-tab {
    padding: 10px 15px;
    font-size: 0.9em;
  }

  .container h2 {
    font-size: 1.6em;
    margin-top: 20px;
    margin-bottom: 15px;
  }

  .container h3 {
    font-size: 1.2em;
    margin-top: 15px;
    margin-bottom: 10px;
  }

  .container .character-form input[type="text"],
  .container .character-form textarea,
  .container .character-form select {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
  }

  .container .btn {
    padding: 10px 20px;
    font-size: 1em;
    margin: 5px;
  }

  .container .character-card {
    flex-direction: column; /* 堆叠布局 */
    align-items: center; /* 居中 */
    text-align: center;
    padding: 15px;
  }

  .container .character-card img {
    margin-bottom: 15px;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .container header h1 {
    font-size: 1.8em;
  }
  .container .nav-tabs {
    flex-wrap: wrap; /* 允许换行 */
  }
  .container .nav-tab {
    flex-basis: 45%; /* 每行两个 */
    margin: 5px;
    padding: 8px 10px;
  }
  .container .button-group {
    flex-direction: column;
  }
  .container .btn {
    width: 90%;
    margin: 5px auto;
  }
}