/* 全局样式（统一为B站风格） */
:root {
  --primary-color: #e70f0f; /* B站粉色系 */
  --secondary-color: #ec1a1a; /* B站蓝色系 */
  --background-color: #f5f5f5;
  --text-color: #333;
  --light-text-color: #666;
  --border-color: #ddd;
  --box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  --radius: 8px; /* 统一圆角为8px */
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Open Sans', sans-serif; /* 统一字体 */
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

/* 容器样式（与B站保持一致） */
.container {
  background-color: #fff;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--box-shadow);
  width: 100%;
  max-width: 800px;
  animation: fadeIn 0.5s ease-out; /* 添加渐入动画 */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 头部样式 */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

h1 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 2.2rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

header p {
  color: var(--light-text-color);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* 输入区域样式 */
.input-group {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

#input-url {
  flex: 1;
  padding: 1rem 1.2rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  color: var(--text-color); /* 文本颜色统一为深色 */
  background-color: #fff;
}

#input-url::placeholder {
  color: var(--light-text-color);
}

#input-url:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(35, 173, 229, 0.2);
}

#parse-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 1rem 2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#parse-button:hover {
  background-color: #f85a8a;
  transform: translateY(-1px);
}

#parse-button:active {
  transform: translateY(0);
}

/* 结果区域样式 */
.background-error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff4444;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 9999;
}

.result {
  min-height: 100px;
  padding: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  background-color: #f9f9f9;
  transition: all 0.3s ease;
  position: relative;
  overflow: auto;
}

.result:empty::before {
  content: "等待解析结果...";
  color: var(--light-text-color);
  opacity: 0.7;
}

/* 视频卡片样式 */
.video-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.video-header {
  text-align: center;
}

.video-title {
  color: var(--primary-color);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
  word-break: break-word;
}

.video-cover {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.video-info {
  line-height: 1.8;
  color: var(--text-color);
  font-size: 0.95rem;
}

.video-desc {
  margin-top: 1rem;
  padding: 1rem;
  background-color: rgba(251, 114, 153, 0.05);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary-color);
}

.video-desc p {
  margin: 0.5rem 0 0 0;
  white-space: pre-line;
  color: var(--text-color);
}

.video-player {
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
}

/* 作者信息样式（与B站UP主信息统一） */
.owner-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-top: 1rem;
}

.owner-info:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
}

.author-signature {
  color: var(--light-text-color);
  margin-top: 0.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.owner-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  text-align: center;
}

.owner-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--secondary-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.owner-details {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.owner-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
}

.owner-uid {
  font-size: 1rem;
  color: var(--light-text-color);
}

/* 统计信息样式 */
.video-stats {
  margin-top: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  background-color: #fff;
  padding: 0.8rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.stat-item span:first-child {
  display: block;
  color: var(--light-text-color);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.stat-item span:last-child {
  display: block;
  font-weight: 600;
  color: var(--secondary-color);
}

/* 加载状态样式 */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--light-text-color);
}

.loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-left: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式设计（与B站保持一致） */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
  }

  .input-group {
    flex-direction: column;
  }

  #parse-button {
    width: 100%;
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: 1.8rem;
  }

  .owner-info {
    flex-direction: column;
    text-align: center;
  }
}

.note-media {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.note-media h4 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 图集样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.image-gallery img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.modal-close:hover {
    color: #bbb;
}

.image-gallery img:hover {
    transform: scale(1.03);
}