/* ============================================================
   乐知 2.0 · 组件样式 components.css
   糖果卡片 / 圆润 Tab / 弹层 / 播放器 / 手风琴 / 标签 / 按钮
   ============================================================ */

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s;
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #F0D9A8; }
.card-body { padding: 22px; }
.card-title { font-family: var(--font-serif); font-size: var(--fs-h3); color: var(--navy); }
.card-text { font-size: 15.5px; color: var(--ink-soft); }

/* ---------- 乐器卡片（真实照片版） ---------- */
.inst-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .28s, box-shadow .28s, border-color .28s;
  position: relative;
}
.inst-card:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: var(--shadow-hover); border-color: #F0D9A8; }
.inst-card .inst-img {
  aspect-ratio: 4 / 3;
  background: #F7F1E6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.inst-card .inst-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform .45s ease;
}
.inst-card:hover .inst-img img { transform: scale(1.05); }
.inst-card .inst-info { padding: 15px 18px 18px; flex: 1; }
.inst-card .inst-name {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--navy);
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.inst-card .inst-name .en { font-size: 12px; color: var(--ink-soft); font-family: var(--font-sans); letter-spacing: .5px; }
.inst-card .inst-spot {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-top: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.inst-card .inst-cat-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(43, 58, 103, .82);
  color: #fff;
  letter-spacing: 1px;
  backdrop-filter: blur(4px);
  z-index: 3;
}
.inst-card .card-link-cover { position: absolute; inset: 0; z-index: 2; }
/* 家族色顶条 */
.inst-card.family-strings::before,
.inst-card.family-woodwinds::before,
.inst-card.family-brass::before,
.inst-card.family-percussion::before,
.inst-card.family-color::before,
.inst-card.family-wind::before,
.inst-card.family-bowed::before,
.inst-card.family-plucked::before,
.inst-card.family-percussion-cn::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  z-index: 3;
}
.inst-card.family-strings::before { background: var(--c-strings); }
.inst-card.family-woodwinds::before { background: var(--c-woodwinds); }
.inst-card.family-brass::before { background: var(--c-brass); }
.inst-card.family-percussion::before { background: var(--c-percussion); }
.inst-card.family-color::before { background: var(--c-color); }
.inst-card.family-wind::before { background: var(--c-wind); }
.inst-card.family-bowed::before { background: var(--c-bowed); }
.inst-card.family-plucked::before { background: var(--c-plucked); }
.inst-card.family-percussion-cn::before { background: var(--c-perc-cn); }

/* ---------- Tab（圆润糖果） ---------- */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.tab-btn {
  padding: 11px 24px;
  border-radius: 999px;
  border: 2px solid #EFE3CE;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 600;
  transition: all .22s;
  min-height: 48px;
}
.tab-btn:hover { border-color: var(--gold); color: var(--navy); transform: translateY(-1px); }
.tab-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 6px 16px rgba(43, 58, 103, .28);
}
.tab-btn.active.cn { background: #B03A2E; border-color: #B03A2E; box-shadow: 0 6px 16px rgba(176, 58, 46, .28); }

/* ---------- 分类锚点小导航 ---------- */
.cat-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 26px;
  padding: 14px 18px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  box-shadow: var(--shadow);
}
.cat-nav .cat-nav-label { color: var(--ink-soft); margin-right: 4px; font-weight: 600; }
.cat-nav a { color: var(--navy); padding: 5px 12px; border-radius: 999px; }
.cat-nav a:hover { background: var(--gold-soft); color: var(--navy); }

/* ---------- 弹层 Modal / 底部抽屉 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(29, 39, 67, .55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  backdrop-filter: blur(3px);
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal-card {
  background: var(--card);
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  transform: translateY(20px) scale(.97);
  transition: transform .28s ease;
  position: relative;
  border: 1px solid #F0E4D0;
}
.modal-mask.show .modal-card { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(43, 58, 103, .1);
  color: var(--navy);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: background .2s, transform .2s;
}
.modal-close:hover { background: rgba(43, 58, 103, .2); transform: rotate(90deg); }
.modal-card .modal-img {
  height: 200px;
  background: #F7F1E6;
  display: flex; align-items: center; justify-content: center;
}
.modal-card .modal-img img { max-height: 170px; width: 100%; object-fit: cover; }
.modal-card .modal-body { padding: 22px 26px 28px; }
.modal-card .modal-title {
  font-family: var(--font-serif); font-size: 26px; color: var(--navy);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.modal-card .modal-title .en { font-size: 14px; color: var(--ink-soft); font-family: var(--font-sans); }
.modal-card .modal-pos { font-size: 14px; color: var(--gold); margin: 5px 0 12px; }
.modal-card .modal-spot { font-size: 15.5px; line-height: 1.85; color: var(--ink); margin-bottom: 16px; }
.modal-card .modal-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.modal-card .detail-link { font-size: 15px; color: var(--navy); border-bottom: 2px solid var(--gold); padding-bottom: 1px; }
.modal-card .detail-link:hover { color: var(--gold); }

@media (max-width: 720px) {
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal-card { max-width: none; border-radius: 26px 26px 0 0; max-height: 74vh; transform: translateY(100%); }
  .modal-mask.show .modal-card { transform: translateY(0); }
  .modal-card .modal-img { height: 160px; }
  .modal-card .modal-img img { max-height: 150px; }
}

/* ---------- 音频播放按钮 ---------- */
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  min-height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2B3A67 0%, #46579E 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  position: relative;
  box-shadow: 0 6px 14px rgba(43, 58, 103, .3);
}
.play-btn:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(43, 58, 103, .38); }
.play-btn .play-icon { font-size: 13px; width: 16px; text-align: center; }
.play-btn.playing { background: linear-gradient(135deg, #E9A83A 0%, #F5C15C 100%); color: #3A2E1A; }
.play-btn.loading { opacity: .7; pointer-events: none; }
.play-btn.unavailable { background: #E9E2D2; color: #9C917E; box-shadow: none; pointer-events: none; }
.play-btn .play-progress {
  position: absolute; left: 16px; right: 16px; bottom: 5px; height: 3px;
  background: rgba(255,255,255,.35); border-radius: 2px; overflow: hidden; display: none;
}
.play-btn.playing .play-progress { display: block; }
.play-btn .play-progress i { display: block; height: 100%; width: 0; background: currentColor; border-radius: 2px; }

/* 详情页完整播放条 */
.audio-block {
  background: linear-gradient(135deg, #FFF 0%, #FDF6EA 100%);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.audio-block .audio-meta { flex: 1; min-width: 180px; }
.audio-block .audio-title { font-size: 16px; color: var(--navy); font-weight: 700; }
.audio-block .audio-credit { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.audio-block .audio-track { flex: 2; min-width: 200px; height: 8px; background: #F0E4CE; border-radius: 4px; overflow: hidden; }
.audio-block .audio-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #F5C15C); }
.audio-block .audio-time { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- 手风琴 ---------- */
.accordion-item {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color .25s;
}
.accordion-item:hover { border-color: #F0D9A8; }
.accordion-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 26px;
  text-align: left;
  min-height: 48px;
}
.accordion-head:hover { background: #FFFBF3; }
.accordion-head .acc-title { font-family: var(--font-serif); font-size: 21px; color: var(--navy); }
.accordion-head .acc-icon {
  color: var(--gold); font-size: 22px; font-weight: 700;
  transition: transform .28s; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold-soft); display: flex; align-items: center; justify-content: center;
}
.accordion-item.open .acc-icon { transform: rotate(45deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.accordion-item.open .accordion-body { max-height: 2200px; }
.accordion-content { padding: 0 26px 26px; border-top: 1px dashed #F0E4CE; padding-top: 20px; }

/* ---------- 数据表格 ---------- */
.data-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 660px; }
.data-table th {
  background: linear-gradient(135deg, #2B3A67, #46579E);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 14px 18px;
  font-size: 15px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.data-table td { padding: 13px 18px; border-top: 1px solid var(--line); vertical-align: top; }
.data-table tbody tr:nth-child(even) { background: #FFFBF4; }
.data-table tbody tr:hover { background: var(--gold-soft); }

/* ---------- 标签 / 徽章 ---------- */
.tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--navy);
  letter-spacing: .5px;
}
.tag.navy { background: var(--navy); color: #fff; }
.tag.cn { background: #F5DCD8; color: var(--c-bowed); }
.tag.green { background: #DFF0E5; color: var(--c-woodwinds); }
.stars { color: var(--gold); letter-spacing: 2px; font-size: 16px; }

/* ---------- 搜索框 ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 2px solid #EFE3CE;
  border-radius: 999px;
  padding: 6px 8px 6px 22px;
  max-width: 480px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(233, 168, 58, .18); }
.search-bar .search-icon { font-size: 18px; }
.search-bar input {
  flex: 1;
  border: none; outline: none; background: none;
  font-size: 16px; font-family: inherit; color: var(--ink);
  height: 44px; min-width: 0;
}
.search-bar input::placeholder { color: #C2B59D; }

/* ---------- 识别特征列表 ---------- */
.check-list li { position: relative; padding-left: 34px; margin-bottom: 11px; line-height: 1.75; }
.check-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #DFF0E5; color: var(--c-woodwinds);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 提示条 ---------- */
.notice-bar {
  background: linear-gradient(90deg, #FFF6E0, #FFFBF0);
  border: 1.5px solid #F7E3B4;
  border-left: 5px solid var(--gold);
  border-radius: 14px;
  padding: 15px 20px;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 22px 0;
  line-height: 1.85;
}
.notice-bar strong { color: var(--navy); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  min-height: 48px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  transition: all .22s;
  border: 2px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, #E9A83A 0%, #F5C15C 100%);
  color: #3A2E1A;
  box-shadow: 0 8px 18px rgba(233, 168, 58, .35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(233, 168, 58, .45); color: #3A2E1A; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost-light { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(6px); border-color: rgba(255,255,255,.3); }
.btn-ghost-light:hover { background: rgba(233, 168, 58, .35); color: #fff; border-color: #FFD77A; }
