/* ===== 羽球技术库 ===== */
:root {
  --court: #2E7D46;
  --court-dark: #1F5A33;
  --court-light: #E8F5EC;
  --accent: #F5A623;
  --bg: #FAFAF7;
  --card: #FFFFFF;
  --text: #243B2E;
  --muted: #7C8A80;
  --line: #E4EAE5;
  --dot-none: #C9D3CB;
  --dot-doing: #E6B422;
  --dot-done: #2E7D46;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
}

/* ===== 顶栏 ===== */
header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 700; font-size: 18px; color: var(--court-dark); white-space: nowrap; }
.logo-sub { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
nav { display: flex; gap: 6px; margin-left: 8px; }
.tab {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 7px 18px; border-radius: 999px; cursor: pointer; font-size: 14px;
  transition: all .15s;
}
.tab:hover { border-color: var(--court); color: var(--court); }
.tab.active { background: var(--court); border-color: var(--court); color: #fff; font-weight: 600; }
.profile { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ghost-btn {
  border: none; background: none; color: var(--court); cursor: pointer; font-size: 13px;
}
.ghost-btn:hover { text-decoration: underline; }

/* ===== 视图 ===== */
main { max-width: 1080px; margin: 0 auto; padding: 18px 16px 60px; }
.view { display: none; }
.view.active { display: block; }

/* ===== 工具栏 ===== */
.toolbar { margin-bottom: 14px; }
#search {
  width: 100%; max-width: 420px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 15px;
  background: #fff; outline: none;
}
#search:focus { border-color: var(--court); box-shadow: 0 0 0 3px var(--court-light); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips-sub { margin-top: 8px; padding-left: 2px; }
.chips-sub .chip { font-size: 12px; padding: 4px 11px; color: var(--court-dark); }
.chips-sub .chip.active { color: #fff; }
.chip {
  border: 1px solid var(--line); background: #fff; padding: 5px 14px;
  border-radius: 999px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--court); }
.chip.active { background: var(--court); border-color: var(--court); color: #fff; }
/* 假动作专项课程入口：金色描边，和普通技术分类区分 */
.chip[data-key="g-fake"] {
  border-color: #F0CE7A; background: #FFF9EC; color: #8A5B00; font-weight: 600;
}
.chip[data-key="g-fake"]:hover { border-color: var(--accent); }
.chip[data-key="g-fake"].active {
  background: var(--accent); border-color: var(--accent); color: #3A2A00;
}
.chips-sub .chip[data-key="g-all"] { color: var(--court-dark); }

/* ===== 卡片网格 ===== */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.t-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; position: relative;
  transition: transform .12s, box-shadow .12s;
}
.t-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(46,125,70,.12);
  border-color: #BFDCC8;
}
.t-card .cat-tag {
  font-size: 11px; color: var(--court); background: var(--court-light);
  padding: 2px 8px; border-radius: 999px; display: inline-block; margin-bottom: 8px;
}
.t-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.t-card .stars { color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.t-card .dot {
  position: absolute; top: 14px; right: 14px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--dot-none);
}
.t-card .dot.s1 { background: var(--dot-doing); }
.t-card .dot.s2 { background: var(--dot-done); box-shadow: 0 0 0 3px var(--court-light); }
.t-card .has-video {
  position: absolute; top: 15px; right: 34px; font-size: 12px; color: var(--muted);
}

/* ===== 说明条 ===== */
.legend {
  font-size: 12.5px; color: var(--muted); margin: 4px 2px 12px;
}
.legend b { color: var(--text); font-weight: 600; }
.legend .ld { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px; vertical-align: -1px; }

/* ===== 进度页 ===== */
.prog-top { display: grid; gap: 14px; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.4fr); }
@media (max-width: 720px) { .prog-top { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px;
}
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; color: var(--court-dark); }
.card .hint { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

.ring-wrap { position: relative; width: 150px; height: 150px; margin: 6px auto; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--court-light); stroke-width: 11; }
.ring-fg {
  fill: none; stroke: var(--court); stroke-width: 11; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .6s ease;
}
.ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num b { font-size: 30px; color: var(--court-dark); }
.ring-num span { font-size: 12px; color: var(--muted); }
.mini-stats { display: flex; justify-content: space-around; text-align: center; margin-top: 8px; }
.mini-stats div b { display: block; font-size: 20px; }
.mini-stats div span { font-size: 12px; color: var(--muted); }

.radar-wrap { display: flex; justify-content: center; }
#radar { width: min(100%, 380px); aspect-ratio: 1; }

.cbar { margin: 8px 0; }
.cbar .cb-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.cbar .cb-top b { font-weight: 600; }
.cbar .cb-top span { color: var(--muted); font-size: 12.5px; }
.cbar .track { height: 10px; border-radius: 999px; background: var(--court-light); overflow: hidden; }
.cbar .fill { height: 100%; background: linear-gradient(90deg, #59A97A, var(--court)); border-radius: 999px; transition: width .6s; }
.cb-group { margin: 14px 0 6px; }
.cb-group:first-child { margin-top: 2px; }
.cb-gtitle {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 700; color: var(--court-dark);
  background: var(--court-light); border-radius: 8px;
  padding: 6px 10px; font-size: 13.5px; margin-bottom: 2px;
}
.cb-group .cbar { margin: 8px 4px 8px 10px; }
.cb-group .cbar .track { height: 8px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 1px solid var(--court); background: #fff; color: var(--court);
  padding: 9px 20px; border-radius: 999px; font-size: 14px; cursor: pointer; transition: all .15s;
}
.btn:hover { background: var(--court); color: #fff; }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,30,24,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal.hidden { display: none; }
.modal-box {
  position: relative; background: #fff; border-radius: 18px;
  width: min(720px, 100%); max-height: 90vh; overflow-y: auto; padding: 26px;
}
.close-btn {
  position: sticky; top: 0; float: right;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: #F1F4F1; color: var(--muted); font-size: 15px;
}
.close-btn:hover { background: var(--line); color: var(--text); }

.modal-box h2 { font-size: 21px; margin-bottom: 4px; padding-right: 40px; }
.modal-box .m-cat { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.modal-box .m-cat .stars { color: var(--accent); }

.sec { margin: 16px 0; }
.sec > .sec-t {
  font-size: 14px; font-weight: 700; color: var(--court-dark); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.sec ul { padding-left: 20px; font-size: 14.5px; }
.sec li { margin: 3px 0; }
.sec.errs li { color: #A84A32; }
.sec.prac li { color: var(--court-dark); }

/* 状态按钮 */
.status-row { display: flex; gap: 10px; flex-wrap: wrap; }
.status-btn {
  flex: 1; min-width: 90px; padding: 10px 6px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; font-size: 14px; transition: all .15s;
}
.status-btn:hover { border-color: var(--court); }
.status-btn.on { border-color: var(--court); background: var(--court-light); font-weight: 600; }
.status-btn small { display: block; font-size: 11px; color: var(--muted); }
.status-btn.on small { color: var(--court); }

/* 笔记 */
.notes textarea {
  width: 100%; min-height: 88px; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
  font-family: inherit; outline: none;
}
.notes textarea:focus { border-color: var(--court); box-shadow: 0 0 0 3px var(--court-light); }
.notes .saved-tip { font-size: 12px; color: var(--court); margin-top: 4px; visibility: hidden; }
.notes .saved-tip.show { visibility: visible; }

/* ===== 视频区 ===== */
video-area { display: block; }
.vid-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.vid-tab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 14px; font-size: 13px; cursor: pointer;
}
.vid-tab.active { background: var(--court-dark); border-color: var(--court-dark); color: #fff; }
.vid-desc { font-size: 12.5px; color: var(--muted); margin: 6px 2px 2px; }

.vbox { position: relative; background: #000; border-radius: 12px; overflow: hidden; }
.vbox iframe, .vbox video { width: 100%; aspect-ratio: 16/9; display: block; border: 0; }

.vid-controls {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px;
}
.vid-controls .ctl {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.vid-controls .ctl:hover { border-color: var(--court); color: var(--court); }
.vid-controls .ctl.on { background: var(--court); border-color: var(--court); color: #fff; }
.vid-controls .ctl.rate.on { background: var(--court-dark); color: #fff; border-color: var(--court-dark); }
.vid-controls .speed-label { font-size: 12px; color: var(--muted); }
.loop-banner {
  font-size: 12.5px; color: var(--accent); background: #FFF7E6;
  border: 1px solid #F5D98F; border-radius: 8px; padding: 4px 10px;
}

/* 锚点 */
.anchors { margin-top: 10px; }
.anchors .a-title { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.anchors .a-row { display: flex; flex-wrap: wrap; gap: 8px; }
.anchor-btn {
  border: 1.5px solid var(--accent); background: #fff; color: #9A6A00;
  border-radius: 999px; padding: 5px 13px; font-size: 13px; cursor: pointer;
  position: relative; transition: all .15s;
}
.anchor-btn:hover { background: var(--accent); color: #fff; }
.anchor-btn b { font-weight: 700; }
.anchor-btn i { font-style: normal; font-size: 11px; opacity: .75; margin-left: 4px; }
.vid-empty {
  padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13.5px;
  background: var(--court-light); border-radius: 12px;
}

/* ===== 假动作专项课程（fake.js） ===== */
.course-banner {
  display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px;
  background: linear-gradient(135deg, #1F5A33, #2E7D46 62%, #3C8F58);
  color: #fff; border-radius: var(--radius); padding: 18px 20px; margin: 0 0 14px;
  box-shadow: 0 8px 24px rgba(31, 90, 51, .18);
}
.course-banner[hidden] { display: none; }
.course-banner .course-kicker { font-size: 12px; opacity: .8; letter-spacing: .04em; }
.course-banner h2 { font-size: 21px; margin: 4px 0 6px; }
.course-banner p { font-size: 13px; line-height: 1.65; opacity: .9; max-width: 620px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.course-meta span {
  font-size: 11.5px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18); padding: 3px 9px; border-radius: 999px;
}
.course-side { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.course-pct { display: flex; align-items: baseline; gap: 8px; }
.course-pct b { font-size: 30px; line-height: 1; }
.course-pct span { font-size: 11.5px; opacity: .85; }
.course-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.2); overflow: hidden; }
.course-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s; }
.course-start { align-self: flex-start; background: var(--accent); border-color: var(--accent); color: #3A2A00; font-weight: 600; }
.course-start:hover { background: #fff; border-color: #fff; color: var(--court-dark); }
@media (max-width: 720px) {
  .course-banner { grid-template-columns: 1fr; gap: 12px; }
  .course-side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .course-pct { margin-right: 8px; }
  .course-bar { flex: 1; min-width: 100px; }
  .course-start { margin-left: auto; }
}

.t-card.course { border-left: 3px solid var(--accent); background: linear-gradient(180deg, #FFFDF6, #fff 40%); }
.t-card.course .cat-tag { color: #8A5B00; background: #FFF3D6; }
.t-card .course-quote {
  font-size: 11.5px; color: var(--muted); margin: 2px 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.course-quote-line {
  font-size: 13.5px; color: #8A5B00; background: #FFF7E6; border: 1px solid #F5D98F;
  border-radius: 10px; padding: 8px 12px; margin: 2px 0 10px;
}
.course-nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.course-nav .nav-btn {
  border: 1px solid var(--line); background: #fff; color: var(--court-dark);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer;
  max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.course-nav .nav-btn:hover { border-color: var(--court); background: var(--court-light); }
.course-nav .nav-pos { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.course-nav .nav-ghost { display: none; }

.rel-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-chip {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.rel-chip:hover { border-color: var(--court); color: var(--court); background: var(--court-light); }
.rel-sec { background: #FBFCFA; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
