/* ============================
   丝芭瓜条汇总 — 样式表
   ============================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f14;
  --bg-card: #1a1a24;
  --bg-modal: #1e1e2a;
  --text: #e4e4ec;
  --text-dim: #8888a0;
  --accent: #ff6b6b;
  --accent2: #feca57;
  --border: #2a2a3a;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* --- Header --- */
.site-header {
  text-align: center;
  padding: 40px 20px 20px;
  background: linear-gradient(180deg, #1a1a2e 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 2rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: 2px;
}
.logo-icon {
  font-size: 2rem;
  margin-right: 8px;
}
.site-subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 6px;
}
.site-header nav,
.header-nav {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  justify-content: center;
}
.site-header nav a,
.header-nav a,
.admin-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.site-header nav a:hover,
.header-nav a:hover,
.admin-link:hover {
  color: #fff;
}

/* --- Filter Bar --- */
.filter-bar {
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.search-box input {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus {
  border-color: var(--accent);
}
.search-box input::placeholder {
  color: var(--text-dim);
}
.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  display: none;
  border-radius: 50%;
}
.clear-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.clear-btn.visible {
  display: block;
}

.group-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.group-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.group-btn:hover {
  border-color: var(--accent);
  color: #fff;
}
.group-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.team-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.team-btn {
  padding: 5px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.team-btn:hover {
  border-color: var(--accent);
  color: #fff;
}
.team-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* --- Member Grid --- */
.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

/* --- Member Card --- */
.member-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 12px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}
.member-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.member-card:active {
  transform: scale(0.97);
}

.card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  position: relative;
}
.card-avatar .status-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}
.status-badge.active {
  background: #2ecc71;
}
.status-badge.graduated {
  background: #f39c12;
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.card-group {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}
.card-team {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.card-gossip-count {
  display: inline-block;
  margin-top: 8px;
  background: rgba(255,107,107,0.15);
  color: var(--accent);
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.empty-hint {
  font-size: 0.85rem;
  margin-top: 6px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  padding: 20px;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-modal);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  transition: background 0.2s;
}
.modal-close:hover {
  background: rgba(255,255,255,0.2);
}

.modal-content {
  padding: 8px 24px 28px;
}

/* --- Modal Header --- */
.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.modal-info h2 {
  font-size: 1.3rem;
  color: #fff;
}
.modal-info .meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}
.modal-info .meta span {
  margin-right: 12px;
}

/* --- Gossip Timeline --- */
.timeline-title {
  font-size: 1rem;
  color: var(--accent2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding-left: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-modal);
}
.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-date {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.timeline-item h4 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 4px;
}
.timeline-summary {
  font-size: 0.85rem;
  color: #b0b0c0;
  line-height: 1.5;
}
.timeline-footer {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
  align-items: center;
}
.timeline-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 600;
}
.tag-总选 { background: rgba(254,202,87,0.2); color: #feca57; }
.tag-毕业 { background: rgba(255,107,107,0.2); color: #ff6b6b; }
.tag-争议 { background: rgba(255,71,87,0.2); color: #ff4757; }
.tag-解约 { background: rgba(255,71,87,0.25); color: #ff4757; }
.tag-出道 { background: rgba(46,213,115,0.2); color: #2ed573; }
.tag-综艺 { background: rgba(83,82,237,0.2); color: #5352ed; }
.tag-CP   { background: rgba(255,99,132,0.2); color: #ff6384; }
.tag-影视 { background: rgba(0,206,201,0.2); color: #00cec9; }
.tag-话题 { background: rgba(162,155,254,0.2); color: #a29bfe; }
.tag-荣誉 { background: rgba(241,196,15,0.2); color: #f1c40f; }
.tag-兼任 { background: rgba(155,89,182,0.2); color: #9b59b6; }
.tag-移籍 { background: rgba(230,126,34,0.2); color: #e67e22; }
.tag-升格 { background: rgba(46,204,113,0.2); color: #2ecc71; }
.tag-退团 { background: rgba(192,57,43,0.25); color: #e74c3c; }

/* --- Team History Section --- */
.history-section {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.history-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0 2px;
}
.history-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 8px 14px;
  min-width: 110px;
  text-align: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.history-group {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent2);
}
.history-team {
  font-size: 0.78rem;
  color: #fff;
  margin: 2px 0;
}
.history-dates {
  font-size: 0.65rem;
  color: var(--text-dim);
}
.history-arrow {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 6px;
  flex-shrink: 0;
  line-height: 1;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 24px 20px 32px;
  color: var(--text-dim);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .site-title {
    font-size: 1.5rem;
  }
  .member-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }
  .card-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }
  .card-name {
    font-size: 0.9rem;
  }
  .filter-bar {
    flex-direction: column;
  }
  .search-box {
    max-width: 100%;
  }
  .modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }
}

@media (max-width: 380px) {
  .member-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .member-card {
    padding: 14px 8px 12px;
  }
  .card-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
}
