/* ========================================
   BYC 作品演示集 - 简约白色风格
   ======================================== */

:root {
  --bg:        #f8f9fa;
  --surface:   #ffffff;
  --border:    #e5e7eb;
  --text:      #1f2937;
  --muted:     #9ca3af;
  --accent:    #4f6ef6;
  --accent-hover: #3b54db;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.08);
  --radius:    10px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== 顶栏 ===== */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header .logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.header .logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.header .stats {
  font-size: 13px;
  color: var(--muted);
}
.header .stats b {
  color: var(--accent);
  font-weight: 600;
}

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

/* ===== 工具栏 ===== */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 36px;
  flex-wrap: wrap;
  align-items: center;
}
.search-box {
  flex: 1;
  min-width: 240px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border .2s, box-shadow .2s;
}
.search-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,110,246,.12);
}
.search-box::placeholder { color: var(--muted); }

.filter-tag {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  user-select: none;
}
.filter-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-tag.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== 分类区块 ===== */
.section {
  margin-bottom: 52px;
}
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .count {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.subsection {
  margin-bottom: 32px;
}
.subsection h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
  padding-left: 2px;
}
.subsection h3 span {
  font-weight: 400;
}

/* ===== 视频卡片网格 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .25s;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* 缩略图 */
.card .thumb {
  aspect-ratio: 16 / 9;
  background: #eef0f4;
  position: relative;
  overflow: hidden;
}
.card.portrait .thumb {
  aspect-ratio: 9 / 16;
}
.grid-portrait {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.grid-portrait.has-more {
  /* no extra padding */
}
.subsection, .section {
  position: relative;
}
.expand-wrap {
  display: none;
  position: absolute;
  bottom: 6px;
  right: 0;
  z-index: 10;
}
.expand-wrap.show {
  display: block;
}
.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  white-space: nowrap;
}
.expand-btn:hover {
  background: var(--accent);
  color: #fff;
}
.expand-btn .arrow {
  display: inline-block;
  transition: transform .3s;
  font-size: 10px;
}
.expand-btn.open .arrow {
  transform: rotate(180deg);
}
@media (max-width: 1200px) {
  .grid-portrait { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .grid-portrait { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .grid-portrait { grid-template-columns: repeat(2, 1fr); }
}
.card .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.card .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.08);
  opacity: 0;
  transition: opacity .3s;
}
.card:hover .play-overlay { opacity: 1; }
.play-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  box-shadow: 0 4px 15px rgba(0,0,0,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--accent);
}
.dur-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* 信息 */
.card .info {
  padding: 14px 16px;
}
.card .title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== 弹窗播放器 ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
.overlay.open { display: flex; }
.overlay .player-wrap {
  position: relative;
  width: 92vw;
  max-width: 1200px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.overlay video {
  width: 100%;
  display: block;
  max-height: 85vh;
}
.overlay .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.overlay .close:hover { background: rgba(255,255,255,.3); }
.overlay .info-bar {
  padding: 12px 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-size: 16px;
  display: none;
}
.empty.show { display: block; }

/* ===== 移动端 ===== */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .container { padding: 20px 12px; }
  .grid { grid-template-columns: 1fr; }
  .header .logo { font-size: 17px; }
}
