/* ===== 网球评级 H5 · 移动端优先，桌面自适应 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --green-deep: #0d3b2e;
  --green: #14805e;
  --lime: #c9f24b;
  --lime-dark: #a8d329;
  --bg: #f4f7f4;
  --card: #ffffff;
  --text: #1c2b26;
  --muted: #7a8a83;
  --line: #e4ece7;
  --red: #e0574f;
  --amber: #e8a13c;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(13, 59, 46, .08);
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }

.view { display: none; padding: 0 16px 32px; animation: fadeIn .3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .85rem; }

/* ===== 首页 hero ===== */
.hero {
  position: relative;
  margin: 0 -16px 20px;
  padding: 44px 24px 56px;
  background: radial-gradient(120% 100% at 80% 0%, #1a6b4f 0%, var(--green-deep) 60%);
  color: #fff;
  text-align: center;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
}
.hero-badge {
  display: inline-block;
  font-size: .75rem;
  padding: 4px 12px;
  border: 1px solid rgba(201, 242, 75, .5);
  color: var(--lime);
  border-radius: 999px;
  margin-bottom: 14px;
  letter-spacing: .05em;
}
.hero h1 { font-size: 1.9rem; letter-spacing: .04em; }
.hero-sub { margin-top: 10px; font-size: .9rem; opacity: .85; }
.hero-ball {
  position: absolute; right: -30px; bottom: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8ff7a, var(--lime-dark));
  opacity: .25;
}
.hero-ball::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.5);
  clip-path: inset(0 0 0 55%);
}

/* ===== 卡片 ===== */
.cards { display: grid; gap: 14px; margin-top: -28px; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}
.cards .card { margin-bottom: 0; }

/* ===== SVG 图标体系 ===== */
.icon {
  width: 1.15em; height: 1.15em;
  vertical-align: -0.22em;
  margin-right: 7px;
  color: var(--green);
  flex: none;
}
.icon-xl { width: 28px; height: 28px; margin: 0; }
.card-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eafbe9, #d7f0e3);
  box-shadow: inset 0 0 0 1px rgba(20, 128, 94, .08);
}
.tips-card summary .icon { vertical-align: -0.24em; }

.service-card .card-icon { font-size: 2rem; }
.service-card h2 { font-size: 1.15rem; margin: 8px 0 6px; }
.service-card p { font-size: .85rem; color: var(--muted); min-height: 3.4em; }
.card-tag {
  position: absolute; top: 14px; right: 14px;
  background: var(--red); color: #fff;
  font-size: .7rem; padding: 2px 10px; border-radius: 999px;
}
.card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.price { color: var(--red); font-weight: 800; font-size: 1.6rem; }
.price em { font-style: normal; font-size: .9rem; }
.price small { color: var(--muted); font-weight: 400; font-size: .8rem; }

.info-card { margin-top: 18px; }
.info-card h3 { margin-bottom: 8px; }
.info-card p { font-size: .85rem; color: var(--muted); }
.ntrp-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; text-align: center; }
.ntrp-scale div { background: var(--bg); border-radius: 10px; padding: 10px 4px; }
.ntrp-scale b { display: block; color: var(--green); font-size: .95rem; }
.ntrp-scale span { font-size: .72rem; color: var(--muted); }

.footer { text-align: center; padding: 20px 24px 8px; }
.footer p { font-size: .72rem; color: var(--muted); }

/* ===== 按钮 ===== */
.btn {
  border: none; cursor: pointer; font-size: .95rem; font-weight: 600;
  padding: 11px 22px; border-radius: 999px; transition: transform .1s, opacity .2s;
  font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--green), #0f6a4c); color: #fff; }
.btn-ghost { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn-block { display: block; width: 100%; margin-top: 16px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* ===== 顶栏 ===== */
.topbar { display: flex; align-items: center; gap: 10px; padding: 16px 0 14px; }
.topbar h2 { font-size: 1.15rem; }
.btn-back {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--text);
}

/* ===== 上传页 ===== */
.tips-card summary { font-size: .92rem; font-weight: 600; cursor: pointer; }
.tips-card ul { list-style: none; margin-top: 8px; }
.tips-card li { font-size: .85rem; color: var(--muted); padding-left: 18px; position: relative; margin: 4px 0; }
.tips-card li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* 拍摄清单 */
.checklist-card h3 { margin-bottom: 4px; }
.checklist-tip { margin-bottom: 10px; }
.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.check-item:has(input:checked) { border-color: var(--green); background: #f2fbf5; }
.check-item input {
  width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none;
}
.check-body b { font-size: .92rem; display: block; }
.check-body b em { font-style: normal; color: var(--green); font-size: .8rem; margin-left: 4px; }
.check-body span { font-size: .78rem; color: var(--muted); }

.coverage-preview {
  background: var(--bg); border-radius: 12px; padding: 12px 14px; margin-top: 4px;
}
.coverage-preview .cov-head { font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.coverage-preview .cov-head b { color: var(--green); }
.cov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cov-chip {
  font-size: .74rem; padding: 3px 10px; border-radius: 999px;
  background: #e3f3e9; color: var(--green); font-weight: 600;
}
.cov-chip.off { background: #ececec; color: #9aa5a0; font-weight: 400; text-decoration: line-through; }
.cov-chip.na { background: #ececec; color: #9aa5a0; font-weight: 400; }

/* 视频场景选择 */
.scene-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scene-opts label {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 4px;
  font-size: .82rem; cursor: pointer; transition: all .15s;
}
.scene-opts label:has(input:checked) { border-color: var(--green); background: #f2fbf5; font-weight: 600; color: var(--green); }
.scene-opts input { accent-color: var(--green); margin: 0; }
.scene-note { margin-top: 8px; color: var(--amber); }
.scene-note:empty { display: none; }

/* 内测免费标签 */
.free-tag {
  color: var(--green); font-weight: 800; font-size: 1.05rem;
  background: #e3f3e9; padding: 4px 14px; border-radius: 999px;
}

/* 准确性反馈 */
.fb-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.fb-btn {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 4px; font-size: .88rem; cursor: pointer; font-family: inherit; color: var(--text);
  transition: all .15s;
}
.fb-btn.active { border-color: var(--green); background: #f2fbf5; color: var(--green); font-weight: 700; }
#fb-level {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--text);
}
#fb-thanks { text-align: center; margin-top: 10px; }

.upload-zone {
  display: block;
  border: 2px dashed #b8ccbf;
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s;
}
.upload-zone.dragover { border-color: var(--green); background: #eefbf2; }
.upload-zone-inner { padding: 44px 20px; }
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-icon .icon { width: 36px; height: 36px; margin: 0; opacity: .85; }
#video-preview { width: 100%; max-height: 320px; display: block; background: #000; }
.file-meta { font-size: .78rem; color: var(--muted); margin-top: 8px; text-align: center; }

.field { margin-top: 16px; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--text);
}
.field input:focus { outline: none; border-color: var(--green); }

/* ===== 分析中 ===== */
.analyzing-wrap { text-align: center; padding-top: 15vh; }
.analyzing-wrap h2 { font-size: 1.1rem; margin: 22px 0 18px; }
.radar-spin {
  width: 110px; height: 110px; margin: 0 auto; border-radius: 50%;
  border: 2px solid var(--line); position: relative;
  background:
    radial-gradient(circle, transparent 58%, var(--line) 59%, transparent 60%),
    radial-gradient(circle, transparent 28%, var(--line) 29%, transparent 30%);
}
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(20,128,94,.55), transparent 90deg);
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }

.analyze-steps { list-style: none; display: inline-block; text-align: left; }
.analyze-steps li { color: var(--muted); font-size: .9rem; padding: 5px 0 5px 26px; position: relative; transition: color .3s; }
.analyze-steps li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: #fff;
}
.analyze-steps li.doing { color: var(--text); font-weight: 600; }
.analyze-steps li.doing::before { border-color: var(--green); animation: pulse 1s infinite; }
.analyze-steps li.done { color: var(--green); }
.analyze-steps li.done::before { border-color: var(--green); background: var(--green); }
@keyframes pulse { 50% { transform: scale(1.25); } }

.progress { height: 6px; background: var(--line); border-radius: 3px; margin: 24px auto 0; max-width: 320px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--lime-dark)); transition: width .4s ease; }

/* ===== 结果页 ===== */
.result-hero { text-align: center; background: linear-gradient(150deg, var(--green-deep), #17614a); color: #fff; }
.result-label { font-size: .85rem; opacity: .8; }
.result-score { font-size: 4.2rem; font-weight: 800; line-height: 1.1; color: var(--lime); }
.result-score small { font-size: 1.2rem; color: #fff; opacity: .8; margin-left: 4px; }
.result-itn { font-size: .95rem; margin-top: 2px; }
.result-desc { font-size: .85rem; opacity: .85; margin-top: 10px; }
.result-hero.small .result-score { font-size: 3.2rem; }

.card h3 { font-size: 1rem; margin-bottom: 12px; }
#radar-chart { width: 100%; height: auto; display: block; }

.dim-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-top: 10px; }
.dim-item { font-size: .85rem; }
.dim-item .dim-head { display: flex; justify-content: space-between; margin-bottom: 3px; }
.dim-item b { color: var(--green); }
.dim-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.dim-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--lime-dark)); border-radius: 3px; }
.dim-item.unobserved { opacity: .55; }
.dim-item .na { color: var(--muted); font-weight: 400; }

.reason-list p { font-size: .88rem; margin-bottom: 10px; padding-left: 18px; position: relative; }
.reason-list p::before {
  content: ""; position: absolute; left: 2px; top: .48em;
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--lime-dark));
}
/* 提醒/上限/质量类条目用琥珀色方点区分 */
.reason-list p[data-icon="⚠️"]::before,
.reason-list p[data-icon="🧱"]::before,
.reason-list p[data-icon="🔍"]::before,
.reason-list p[data-icon="📷"]::before {
  background: var(--amber); border-radius: 2px;
}

/* ===== 证书 ===== */
.cert-canvas { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.15); }

/* ===== 纠正报告 ===== */
.issue-list { display: grid; gap: 12px; }
.issue {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  border-left: 4px solid var(--amber);
}
.issue.high { border-left-color: var(--red); }
.issue-head { display: flex; justify-content: space-between; align-items: center; }
.issue-head b { font-size: .92rem; }
.issue-sev { font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: #fdf3e3; color: var(--amber); white-space: nowrap; }
.issue.high .issue-sev { background: #fdeceb; color: var(--red); }
.issue p { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.issue .fix { color: var(--green); font-weight: 600; }

/* ===== 动作分解动画 ===== */
.anim-stage {
  background: linear-gradient(#eaf3ec 70%, #d7e6cf 70%);
  border-radius: 12px; margin-top: 10px; overflow: hidden;
}
#coach-svg { width: 100%; height: auto; display: block; }

.phase-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.phase-tab {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 8px 2px; font-size: .78rem; cursor: pointer; font-family: inherit; color: var(--text);
  transition: all .15s;
}
.phase-tab.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.phase-tab small { display: block; font-size: .65rem; opacity: .7; }

.anim-controls { display: flex; gap: 10px; margin-top: 12px; }
.anim-controls .btn { flex: 1; }
.stroke-select {
  flex: 1; border: 1.5px solid var(--green); border-radius: 999px; color: var(--green);
  font-weight: 600; font-size: .9rem; padding: 0 14px; background: #fff; font-family: inherit;
}

.keypoints { margin-top: 12px; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.keypoints h4 { font-size: .85rem; color: var(--green); margin-bottom: 6px; }
.keypoints li { font-size: .82rem; margin-left: 18px; margin-bottom: 3px; }

/* ===== 支付弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 560px) { .modal-mask { align-items: center; } }
.modal {
  background: #fff; width: 100%; max-width: 420px;
  border-radius: 20px 20px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  position: relative; text-align: center; animation: slideUp .25s ease;
}
@media (min-width: 560px) { .modal { border-radius: 20px; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 1.3rem; }
.modal-close {
  position: absolute; top: 12px; right: 14px; border: none; background: none;
  font-size: 1.5rem; color: var(--muted); cursor: pointer;
}
.pay-tabs { display: flex; gap: 10px; margin: 16px 0 14px; }
.pay-tab {
  flex: 1; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font-size: .92rem; cursor: pointer; font-family: inherit; color: var(--text);
}
.pay-tab.active { border-color: var(--green); color: var(--green); font-weight: 700; background: #eefbf2; }
#pay-qr { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 10px; }
.pay-note { margin: 8px 0 4px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 12vh; transform: translateX(-50%);
  background: rgba(20, 30, 26, .9); color: #fff; padding: 10px 20px;
  border-radius: 999px; font-size: .85rem; z-index: 99; white-space: nowrap;
  animation: fadeIn .2s;
}
