:root {
  --primary-color: #0078d7;
  --primary-text-color: white;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  background-color: #171717;
  color: white;
  min-height: 100vh;
}

body {
  overflow-x: hidden;
}

/* ==================== 顶栏 =================== */
.top-bar {
  background-color: #1f1f1f;
  border-bottom: 1px solid #333;
  padding: 15px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
}

.top-bar-logo img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.top-bar-logo span {
  font-size: 16px;
  font-weight: 500;
}

.top-bar-nav {
  display: flex;
  gap: 20px;
}

.top-bar-nav a {
  color: #888;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.top-bar-nav a:hover {
  color: var(--primary-color);
}

.top-bar-nav a.active {
  color: var(--primary-color);
}

/* ==================== 容器 ==================== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ==================== 头部区域 ==================== */
.hero {
  text-align: center;
  padding: 40px 0 60px 0;
  border-bottom: 1px solid #333;
  margin-bottom: 40px;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  object-fit: cover;
}

.hero h1 {
  font-size: 48px;
  font-weight: 300;
  color: var(--primary-color);
  letter-spacing: 2px;
}

.hero .subtitle {
  font-size: 18px;
  color: #a2a2a2;
  font-weight: 300;
}

/* ==================== 项目卡片 ==================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.project-card {
  background-color: #2a2a2a;
  padding: 25px;
  border-left: 3px solid var(--primary-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: white;
  display: block;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.project-card h3 {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: 10px;
  font-weight: 400;
}

.project-card p {
  font-size: 14px;
  color: #a2a2a2;
  line-height: 1.6;
}

.project-card .tags {
  margin-top: 15px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background-color: #333;
  padding: 4px 10px;
  font-size: 12px;
  color: #888;
}

/* ==================== 链接按钮 ==================== */
.links-section {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.link-button {
  background-color: #333;
  border: 1px solid transparent;
  color: white;
  padding: 12px 24px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.link-button:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--primary-text-color);
}

/* ==================== 内容区块 ==================== */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 11px;
  color: #a2a2a2;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

/* ==================== 昵称史时间线 ==================== */
.nickname-timeline {
  position: relative;
  padding: 20px 0;
}

.nickname-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, 
    transparent 0%, 
    var(--primary-color) 10%, 
    var(--primary-color) 90%, 
    transparent 100%);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
  text-align: right;
}

.timeline-item:nth-child(odd) .timeline-content {
  flex-direction: row-reverse;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background-color: #333;
  border: 3px solid var(--primary-color);
  z-index: 1;
}

.timeline-item.current .timeline-dot {
  background-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
}

.timeline-content {
  display: flex;
  align-items: center;
  gap: 15px;
  width: calc(50% - 30px);
  padding: 15px 20px;
  background-color: #2a2a2a;
  border-left: 3px solid var(--primary-color);
}

.timeline-item:nth-child(odd) .timeline-content {
  border-left: none;
  border-right: 3px solid var(--primary-color);
}

.nickname-name {
  font-size: 16px;
  font-weight: 500;
  color: white;
}

.nickname-period {
  font-size: 13px;
  color: #888;
}

.timeline-item.current .nickname-name {
  color: var(--primary-color);
}

/* ==================== 页脚 ==================== */
.footer {
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid #333;
  color: #666;
  font-size: 13px;
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #555;
}

::-webkit-scrollbar-thumb:hover {
  background: #777;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}

/* ==================== 响应式 ==================== */
@media (max-width: 600px) {
  .top-bar-logo span {
    display: none;
  }

  .top-bar-nav {
    gap: 15px;
  }

  .top-bar-nav a {
    font-size: 13px;
  }

  .hero-content {
    flex-direction: column;
    gap: 15px;
  }

  .hero-avatar {
    width: 80px;
    height: 80px;
  }

  .hero h1 {
    font-size: 32px;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .nickname-timeline::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(odd) {
    flex-direction: row;
    text-align: left;
    padding-left: 40px;
  }

  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-content {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    border-left: 3px solid var(--primary-color);
    border-right: none;
  }

  .timeline-dot {
    left: 20px;
    transform: translateX(-50%);
  }
}

/* ==================== fans.html 特有样式 ==================== */

/* 粉丝数页面头部 */
.fans-header {
  text-align: center;
  margin-bottom: 60px;
  margin-top: 20px;
}

.fans-header h1 {
  font-size: 36px;
  font-weight: 300;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.fans-header p {
  color: #888;
  font-size: 14px;
}

/* 粉丝数显示 */
.fan-count-section {
  text-align: center;
  margin-bottom: 50px;
}

.fan-number {
  font-size: 72px;
  font-weight: 300;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 10px;
}

.fan-label {
  font-size: 18px;
  color: #888;
}

/* 进度条容器 */
.progress-section {
  background-color: #2a2a2a;
  padding: 40px;
  border-left: 3px solid var(--primary-color);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.progress-current {
  font-size: 24px;
  color: white;
}

.progress-target {
  font-size: 16px;
  color: #888;
}

.progress-target span {
  color: var(--primary-color);
  font-size: 20px;
  font-weight: 500;
}

/* 进度条 */
.progress-bar-container {
  width: 100%;
  height: 30px;
  background-color: #333;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color) 0%, #4da6ff 100%);
  transition: width 0.5s ease-out;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

.progress-bar.near-goal {
  background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
  animation: pulse-green 1s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes pulse-green {
  0%, 100% {
    box-shadow: 0 0 5px #27ae60;
  }
  50% {
    box-shadow: 0 0 20px #27ae60, 0 0 30px #2ecc71;
  }
}

.progress-percentage {
  text-align: center;
  margin-top: 15px;
  font-size: 28px;
  color: var(--primary-color);
  font-weight: 300;
}

.progress-percentage.near-goal {
  color: #27ae60;
}

/* 即将达成提示 */
.near-goal-banner {
  display: none;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  color: white;
  padding: 12px 20px;
  text-align: center;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 500;
  animation: banner-pulse 1.5s infinite;
}

.near-goal-banner.show {
  display: block;
}

@keyframes banner-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* 状态信息 */
.status-section {
  margin-top: 40px;
  text-align: center;
}

.status-text {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.refresh-btn {
  background-color: #333;
  border: 1px solid transparent;
  color: white;
  padding: 12px 30px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out;
}

.refresh-btn:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.refresh-btn:disabled {
  background-color: #444;
  color: #666;
  cursor: not-allowed;
}

/* 返回链接 */
.back-link {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 30px;
}

.back-link a {
  color: #888;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.back-link a:hover {
  color: var(--primary-color);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #333;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 错误提示 */
.error-message {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 10px;
}

/* fans.html 响应式 */
@media (max-width: 600px) {
  .fans-header h1 {
    font-size: 28px;
  }

  .fan-number {
    font-size: 56px;
  }

  .progress-section {
    padding: 25px;
  }

  .progress-current {
    font-size: 20px;
  }

  .progress-target {
    font-size: 14px;
  }
}
