
:root{
  --theme:#2fb3ab;
  --theme-dark:#219c96;
  --bg:#f6fbfb;
  --card:#ffffff;
  --text:#1b1f24;
  --muted:#7a8896;
  --border:rgba(0,0,0,.06);
  --shadow:0 12px 30px rgba(0,0,0,.08);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",system-ui,Segoe UI,Roboto,Arial;
  color:var(--text);
  background:var(--bg);
}

.app-bg{
  position:fixed; inset:0 0 auto 0;
  height:220px;
  background:linear-gradient(180deg, rgba(47,179,171,.18), rgba(47,179,171,0));
  pointer-events:none;
}

.app{
  min-height:100%;
  display:flex;
  flex-direction:column;
  max-width:520px;
  margin:0 auto;
}

.topbar{
  position:sticky; top:0;
  display:flex;
  align-items:center;
  padding:14px 14px 12px;
  background:rgba(246,251,251,.85);
  backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--border);
  z-index:20;
}
.topbar-left,.topbar-right{width:88px; display:flex; align-items:center; gap:10px}
.topbar-title{
  flex:1;
  text-align:center;
  font-weight:800;
  letter-spacing:1px;
  font-size:22px;
  color:#23313f;
}
.icon-badge{
  width:28px;height:28px;border-radius:10px;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(47,179,171,.18);
  color:var(--theme-dark);
  font-weight:900;
}
.icon-btn{
  width:34px;height:34px;border-radius:12px;
  display:inline-flex;align-items:center;justify-content:center;
  text-decoration:none;
  color:#3a4a58;
  border:1px solid var(--border);
  background:rgba(255,255,255,.6);
}
.icon{font-size:20px; line-height:1}
.content{padding:18px 16px 92px}

/* iOS safe-area */
.content{padding-bottom:calc(92px + env(safe-area-inset-bottom, 0px))}

.hero-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:18px 16px;
  margin-bottom:14px;
}
.hero-title{
  font-size:30px;
  font-weight:900;
  text-align:center;
  margin:10px 0 6px;
  color:#23313f;
}
.hero-sub{
  text-align:center;
  color:var(--muted);
  margin:0 0 16px;
}

.right-link{
  font-size:14px;
  color:var(--theme-dark);
  text-decoration:none;
  padding:7px 10px;
  border-radius:12px;
  border:1px solid rgba(47,179,171,.25);
  background:rgba(47,179,171,.08);
  white-space:nowrap;
}

.cards{display:flex; flex-direction:column; gap:14px; margin:14px 0}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 10px 24px rgba(0,0,0,.06);
  padding:16px 14px;
  display:flex; gap:12px; align-items:flex-start;
}
.badge-num{
  width:36px;height:36px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(47,179,171,.14);
  color:var(--theme-dark);
  font-weight:900;
  flex:0 0 auto;
}
.card-main{flex:1}
.card-title{
  font-size:20px;
  font-weight:900;
  margin:0;
  color:#1f3340;
}
.card-desc{
  margin:8px 0 0;
  color:var(--muted);
  font-size:15px;
  line-height:1.4;
}
.pill{
  flex:0 0 auto;
  background:rgba(47,179,171,.14);
  color:var(--theme-dark);
  border:1px solid rgba(47,179,171,.28);
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:13px;
}

.btn-row{display:flex; gap:12px; margin-top:16px}
.btn{
  flex:1;
  display:inline-flex; align-items:center; justify-content:center;
  height:52px;
  border-radius:16px;
  border:1px solid var(--border);
  background:#fff;
  color:#223;
  text-decoration:none;
  font-weight:900;
}
.btn.primary{
  background:var(--theme);
  border-color:rgba(0,0,0,.0);
  color:#fff;
}
.btn.ghost{
  background:#fff;
  color:var(--theme-dark);
  border-color:rgba(47,179,171,.34);
}
.btn.full{width:100%}

.section-title{
  font-size:22px;
  font-weight:900;
  margin:14px 0 12px;
}
.backline{
  display:flex; align-items:center; gap:8px;
  color:var(--theme-dark);
  text-decoration:none;
  font-weight:800;
  margin:2px 0 12px;
}
.small-muted{color:var(--muted); font-size:14px}

.notice{
  background:rgba(47,179,171,.10);
  border:1px solid rgba(47,179,171,.22);
  color:#2a5f5c;
  border-radius:14px;
  padding:12px 12px;
  margin:12px 0 14px;
  font-size:14px;
}

.material-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px 14px;
  box-shadow:0 10px 24px rgba(0,0,0,.06);
  margin-bottom:14px;
}
.material-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
}
.material-title{
  font-size:18px;
  font-weight:900;
  margin:0;
}
.material-meta{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}
.kv{margin:6px 0 0; color:#44515e}
.kv b{color:#22313f}
.m-actions{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}
.m-actions .btn-sm{
  height:38px;
  border-radius:12px;
  padding:0 14px;
  font-weight:900;
  border:1px solid var(--border);
  background:#fff;
  color:#23313f;
  cursor:pointer;
}
.m-actions .btn-sm.primary{background:var(--theme); color:#fff; border-color:transparent}
.m-actions .btn-sm.ghost{border-color:rgba(47,179,171,.34); color:var(--theme-dark); background:#fff}
.copy-btn{
  border:1px solid rgba(47,179,171,.35);
  background:#fff;
  color:var(--theme-dark);
}

.cta{
  margin-top:18px;
}
.cta .btn{
  height:58px;
  border-radius:18px;
  font-size:18px;
}

.form-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 10px 24px rgba(0,0,0,.06);
  padding:16px 14px;
}
.field{
  margin:14px 0;
}
.label{
  font-weight:900;
  margin-bottom:8px;
  display:flex; align-items:center; gap:6px;
}
.req{color:#e24; font-weight:900}
.input, .textarea{
  width:100%;
  padding:14px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  outline:none;
  font-size:15px;
  background:rgba(255,255,255,.9);
}
.textarea{min-height:96px; resize:vertical}
.radio-row{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.radio{
  display:flex; align-items:center; gap:10px;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
}
.radio input{transform:scale(1.05)}
.help{color:var(--muted); font-size:13px; margin-top:6px}

.toast{
  position:fixed;
  left:50%; bottom:90px;
  transform:translateX(-50%);
  background:rgba(27,31,36,.92);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  font-size:14px;
  display:none;
  z-index:999;
  max-width:80vw;
}

.tabbar{
  position:fixed;
  left:0; right:0; bottom:0;
  background:rgba(246,251,251,.92);
  border-top:1px solid var(--border);
  backdrop-filter:saturate(180%) blur(14px);
  display:flex;
  justify-content:center;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  gap:14px;
}
.tabbar .tab{
  flex:1;
  max-width:260px;
  text-align:center;
  padding:14px 10px;
  border-radius:18px;
  text-decoration:none;
  font-weight:900;
  color:#6b7a87;
  border:1px solid transparent;
}
.tabbar .tab.active{
  color:var(--theme-dark);
  background:rgba(47,179,171,.12);
  border-color:rgba(47,179,171,.22);
}

.empty{
  text-align:center;
  color:#7a8896;
  padding:42px 10px 12px;
}
.empty h2{
  margin:0 0 8px;
  font-size:28px;
  font-weight:900;
  color:#23313f;
}
.empty p{margin:0 0 18px}
.center-btn{display:flex; justify-content:center}
.center-btn .btn{max-width:220px}

.alert{
  margin:12px 0;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(226,68,68,.25);
  background:rgba(226,68,68,.08);
  color:#8a1f1f;
  font-weight:800;
}
.ok{
  border-color:rgba(47,179,171,.25);
  background:rgba(47,179,171,.10);
  color:#1f5e5b;
}

.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
}

.table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* Admin cards */
.admin-stats{display:flex; gap:10px; flex-wrap:wrap; margin:10px 0 14px}
.admin-stat{flex:1; min-width:120px; background:#fff; border:1px solid var(--border); border-radius:14px; padding:10px 12px; box-shadow:0 8px 18px rgba(0,0,0,.05)}
.admin-stat .k{color:var(--muted); font-weight:800; font-size:12px}
.admin-stat .v{font-weight:900; font-size:20px; margin-top:4px}

.admin-grid{display:grid; grid-template-columns:1fr; gap:14px}
@media (min-width: 860px){
  .admin-grid{grid-template-columns:1fr 1fr}
}

.admin-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
.admin-actions .input{padding:10px 10px; border-radius:12px; font-size:14px}
.admin-actions .btn-sm{height:40px}

/* Small screens fine tuning */
@media (max-width: 420px){
  .topbar-left,.topbar-right{width:64px}
  .topbar-title{font-size:18px; letter-spacing:.5px}
  .hero-title{font-size:26px}
  .card-title{font-size:18px}
}

@media (max-width: 360px){
  .btn-row{flex-direction:column}
  .btn{height:50px}
  .cta .btn{height:56px}
}
.table th,.table td{
  padding:12px 10px;
  border-bottom:1px solid var(--border);
  font-size:14px;
  text-align:left;
}
.table th{color:#51606f; font-weight:900}
.table tr:last-child td{border-bottom:none}
.status{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  border:1px solid var(--border);
  background:#fff;
}
.status.pending{color:#8a6b11; background:rgba(255,193,7,.10); border-color:rgba(255,193,7,.28)}
.status.approved{color:#1f6b2f; background:rgba(76,175,80,.10); border-color:rgba(76,175,80,.28)}
.status.rejected{color:#8a1f1f; background:rgba(226,68,68,.08); border-color:rgba(226,68,68,.25)}

a{color:inherit}

/* Links */
.inline-link{
  color: var(--theme-dark);
  text-decoration: none;
  font-weight: 900;
}
.inline-link:hover{ text-decoration: underline; }

/* Media preview */
.media{margin-top:12px; border-radius:16px; overflow:hidden; border:1px solid var(--border); background:#fff}
.media-video{background:#000}
.media-video .video{width:100%; height:auto; display:block}
.media-image{background:#fff}
.media-image img{width:100%; height:auto; display:block}
.qr-img{max-width:100%}

/* Do not auto-render external media; show placeholder instead */
.media-placeholder{
  margin-top:12px;
  border-radius:16px;
  border:1px dashed rgba(0,0,0,.14);
  background:rgba(255,255,255,.65);
  padding:14px 12px;
  display:flex;
  align-items:center;
  gap:12px;
}
.ph-icon{
  width:38px;
  height:38px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(47,179,171,.14);
  color:var(--theme-dark);
  font-weight:900;
  flex:0 0 auto;
}
.ph-text{
  color:var(--muted);
  font-size:14px;
  font-weight:800;
  line-height:1.35;
}

/* Image thumbs */
.thumb-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
@media (max-width: 380px){
  .thumb-grid{grid-template-columns: repeat(2, 1fr);}
}
.thumb{
  display:block;
  text-decoration:none;
  color:#2a3642;
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}
.thumb img{width:100%; aspect-ratio: 3 / 4; object-fit: cover; display:block; background:#f3f6f8}
.thumb span{display:block; padding:8px 10px; font-weight:900; font-size:13px; color:#3a4a58}

/* Custom reference videos */
/* 图一同款：两列卡片 + 封面 */
.ref-grid2{
  margin-top:12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 360px){
  .ref-grid2{grid-template-columns:1fr;}
}
.ref-tile{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 10px 24px rgba(0,0,0,.06);
}
.ref-cover{
  width:100%;
  border:0;
  padding:0;
  margin:0;
  background:#0b121a;
  display:block;
  position:relative;
  cursor:pointer;
}
.ref-cover::before{
  content:"";
  display:block;
  width:100%;
  aspect-ratio: 16 / 9;
}
.ref-cover-img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:none; /* 由 JS 载入成功后显示 */
}
.ref-cover-video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:none; /* JS 控制显示 */
  pointer-events:none; /* 避免出现可播放交互 */
}
.ref-cover-fallback{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  background:linear-gradient(135deg, rgba(47,179,171,.22), rgba(0,0,0,.25));
  color:#fff;
}
.ref-cover-fallback .ph-icon{
  background:rgba(255,255,255,.18);
  color:#fff;
}
.ref-cover-fallback .ph-text{color:rgba(255,255,255,.92)}
.ref-cover-mask{
  position:absolute;
  inset:0;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding:10px 10px;
  pointer-events:none;
}
.ref-tag{
  font-size:12px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(0,0,0,.38);
  color:#fff;
}
.ref-play{
  width:38px;
  height:38px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.38);
  color:#fff;
  font-weight:900;
}
.ref-caption{
  padding:10px 12px 6px;
  display:flex;
  gap:6px;
  align-items:baseline;
  justify-content:center;
}
.ref-cap-title{font-weight:900; font-size:15px; color:#23313f}
.ref-cap-sub{font-weight:900; font-size:13px; color:var(--muted)}

/* Login switch row */
.switch-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px 0 6px;
}

/* Modal */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.42);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:16px;
  z-index:1000;
}
.modal{
  width:100%;
  max-width:520px;
  background:#fff;
  border-radius:22px;
  border:1px solid var(--border);
  box-shadow:0 18px 50px rgba(0,0,0,.22);
  overflow:hidden;
  position:relative;
}
.modal-close{
  position:absolute;
  right:12px;
  top:10px;
  width:38px;
  height:38px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.7);
  font-size:22px;
  cursor:pointer;
}
.modal-body{padding:18px 16px 16px}
.modal-title{font-size:18px; font-weight:900; color:#23313f}
.modal-desc{margin-top:6px; color:var(--muted); font-size:13px}
.modal-img{
  width:100%;
  margin-top:12px;
  border-radius:16px;
  border:1px solid var(--border);
  background:#fff;
}
.modal-video{
  width:100%;
  margin-top:12px;
  border-radius:16px;
  border:1px solid var(--border);
  background:#000;
}
.modal-actions{display:flex; gap:10px; margin-top:12px; justify-content:center; flex-wrap:wrap}

/* Responsive helpers for admin */
.desktop-only{display:none}
.mobile-only{display:block}
@media (min-width: 860px){
  .desktop-only{display:block}
  .mobile-only{display:none}
}
.admin-table .btn-sm{height:34px; border-radius:10px; padding:0 12px; font-weight:900; border:1px solid var(--border); background:#fff; color:#23313f; cursor:pointer}
.admin-table .btn-sm.primary{background:var(--theme); color:#fff; border-color:transparent}
.admin-table .btn-sm.ghost{border-color:rgba(47,179,171,.34); color:var(--theme-dark); background:#fff}
.admin-table .admin-actions{gap:8px}
.admin-table .admin-actions .input{min-width:220px}
