/* 全局样式 */
:root {
  --primary-color: #FB7299; /* B站粉色系 */
  --secondary-color: #23ADE5; /* 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);
}

body {
  font-family: 'Open Sans', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* 容器样式 */
.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: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#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: 8px;
  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);
}

/* 结果区域样式 */
.result {
  min-height: 100px;
  padding: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  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);
  margin-bottom: 1rem;
  word-break: break-word;
}

.video-cover {
  width: 100%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.video-info {
  line-height: 1.8;
}

.video-desc {
  margin-top: 1rem;
  padding: 1rem;
  background-color: rgba(251, 114, 153, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.video-desc p {
  margin: 0.5rem 0 0 0;
  white-space: pre-line;
}

.video-player {
  margin-top: 1rem;
}

/* 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;
}

.owner-info:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* UP 主信息标题 */
.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);
}

.owner-verified {
  color: var(--secondary-color);
  font-size: 1rem;
}

.owner-stats {
  display: flex;
  gap: 1.5rem;
  color: var(--light-text-color);
  font-size: 0.9rem;
}

.owner-stat-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* 统计信息样式 */
.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: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.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);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
  }

  .input-group {
    flex-direction: column;
  }

  #parse-button {
    width: 100%;
  }

  h1 {
    font-size: 1.8rem;
  }

  .owner-info {
    flex-direction: column;
    text-align: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}