* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #ececec; color: #1a1a1a; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 640px; margin: 0 auto; min-height: 100vh; background: #fff; box-shadow: 0 0 16px rgba(0,0,0,.08); }

/* ---------- hero / header ---------- */
.home-hero {
  background: linear-gradient(135deg, #2b2b2b 0%, #000 100%);
  color: #fff; padding: 40px 20px 56px; text-align: center;
}
.home-hero h1 { font-size: 26px; letter-spacing: 2px; }
.home-hero p { margin-top: 8px; font-size: 13px; opacity: .7; }

.page-head {
  position: sticky; top: 0; z-index: 10;
  background: #111; color: #fff;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; font-size: 17px; font-weight: 600;
}
.page-head .back { font-size: 20px; line-height: 1; padding: 2px 8px 2px 0; }
.page-head .spacer { flex: 1; }
.btn-share {
  background: rgba(255,255,255,.18); color: #fff; border: none;
  font-size: 12px; padding: 5px 12px; border-radius: 20px; cursor: pointer;
}

/* ---------- home menu grid ---------- */
.menu-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 20px 12px 30px; margin-top: -32px;
}
.menu-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: #fff; border-radius: 12px; padding: 16px 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .15s;
}
.menu-item:active { transform: scale(.95); }
.menu-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: #f0f0f0; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.menu-icon img { width: 30px; height: 30px; object-fit: contain; }
.menu-title { font-size: 13px; color: #333; }

/* ---------- category list ---------- */
.cat-list { padding: 12px 14px 30px; }
.cat-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e8e8e8; border-radius: 12px;
  padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.cat-card:active { background: #f4f4f4; }
.cat-cover { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #eee; flex-shrink: 0; }
.cat-info { flex: 1; min-width: 0; }
.cat-title { font-size: 16px; font-weight: 600; }
.cat-desc { font-size: 12px; color: #888; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-arrow { color: #bbb; font-size: 18px; }

/* ---------- detail (catalog) cover ---------- */
.detail-cover { width: 100%; height: 180px; object-fit: cover; display: block; background: #000; }
.detail-cover-fallback {
  width: 100%; height: 130px;
  background: linear-gradient(135deg, #2b2b2b 0%, #000 100%);
  color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
}
.detail-cover-fallback .t { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.detail-cover-fallback .s { font-size: 12px; opacity: .65; }

/* ---------- catalog (content list) ---------- */
.catalog { padding: 12px 14px 30px; }
.catalog-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 10px; border-bottom: 1px solid #f0f0f0; background: #fff;
}
.catalog-item:active { background: #f4f4f4; }
.catalog-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: #eee; color: #111; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.catalog-info { flex: 1; min-width: 0; }
.catalog-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-intro { font-size: 12px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; flex-shrink: 0;
}
.type-video { background: #e8e8e8; color: #111; }
.type-audio { background: #ececec; color: #3a3a3a; }
.type-article { background: #f0f0f0; color: #666; }

/* ---------- play page ---------- */
.play-cover { width: 100%; max-height: 260px; object-fit: cover; background: #000; }
.player-box { background: #000; }
.player-box video, .player-box iframe { width: 100%; aspect-ratio: 16/9; display: block; border: none; }
.player-box audio { width: 100%; display: block; margin: 20px 0; }
.audio-wrap { padding: 30px 20px; background: linear-gradient(135deg,#1a1a1a,#333); }

/* ---------- 自定义音频播放器（大按钮） ---------- */
.aplayer {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px; padding: 18px 16px;
}
.ap-btn {
  width: 66px; height: 66px; border-radius: 50%; flex-shrink: 0;
  background: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.ap-btn:active { transform: scale(.94); }
.ap-btn svg { width: 28px; height: 28px; fill: #111; }
.ap-mid { flex: 1; min-width: 0; }
.ap-progress {
  position: relative; height: 30px; display: flex; align-items: center;
  cursor: pointer; touch-action: none;
}
.ap-progress::before {
  content: ''; width: 100%; height: 6px; background: rgba(255,255,255,.22); border-radius: 3px;
}
.ap-played {
  position: absolute; left: 0; height: 6px; background: #fff; border-radius: 3px; width: 0;
}
.ap-dot {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; left: 0; transform: translateX(-50%);
  box-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.ap-times {
  display: flex; justify-content: space-between;
  color: #bbb; font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums;
}
.play-body { padding: 16px; }
.play-title { font-size: 19px; font-weight: 700; }
.play-intro { margin-top: 8px; font-size: 13px; color: #888; }
.article-body { margin-top: 14px; font-size: 16px; line-height: 1.9; color: #333; word-break: break-word; }
.article-body p { margin-bottom: 1em; }
.article-body img { margin: 8px auto; border-radius: 6px; }
.play-actions { padding: 0 16px 30px; display: flex; gap: 10px; }
.btn-block {
  flex: 1; text-align: center; padding: 12px; border-radius: 10px;
  font-size: 15px; cursor: pointer; border: none;
}
.btn-primary { background: #111; color: #fff; }
.btn-plain { background: #f0f0f0; color: #333; }

/* ---------- misc ---------- */
.empty { text-align: center; color: #999; padding: 60px 20px; font-size: 14px; grid-column: 1 / -1; }
.foot { text-align: center; color: #bbb; font-size: 12px; padding: 24px 0; }
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 24px;
  font-size: 14px; opacity: 0; transition: all .3s; z-index: 999; max-width: 80%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- admin ---------- */
.admin-wrap { max-width: 760px; margin: 0 auto; min-height: 100vh; background: #fff; }
.admin-top {
  display: flex; align-items: center; gap: 10px;
  background: #000; color: #fff; padding: 14px 16px;
  position: sticky; top: 0; z-index: 20;
}
.admin-top .spacer { flex: 1; }
.admin-top a { color: #bbb; font-size: 13px; }
.admin-top button { background: #2c2c2c; color: #fff; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.tabs { display: flex; border-bottom: 1px solid #eee; position: sticky; top: 49px; background: #fff; z-index: 15; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabs button {
  flex: 0 0 auto; padding: 12px 14px; border: none; background: none; font-size: 14px;
  color: #666; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: #111; border-bottom-color: #111; font-weight: 600; }
.tab-pane { display: none; padding: 16px 14px 60px; }
.tab-pane.active { display: block; }

.form-card { background: #f7f7f7; border: 1px solid #e6e6e6; border-radius: 12px; padding: 14px; margin-bottom: 18px; }
.form-card h3 { font-size: 15px; margin-bottom: 10px; color: #111; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
.field input[type=text], .field input[type=password], .field select, .field textarea {
  width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
  font-family: inherit; background: #fff;
}
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 12px; color: #999; margin-top: 4px; }
.loc-hint {
  font-size: 13px; color: #111; background: #eee; border-radius: 8px;
  padding: 8px 12px; margin-bottom: 12px;
}
.btn {
  background: #111; color: #fff; border: none; padding: 10px 22px;
  border-radius: 8px; font-size: 14px; cursor: pointer;
}
.btn-gray { background: #ececec; color: #555; }
.btn-danger { background: #b3261e; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-list { }
.admin-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; border-bottom: 1px solid #f0f0f0;
}
.admin-row .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #eee; flex-shrink: 0; }
.admin-row .icon-thumb { width: 36px; height: 36px; border-radius: 50%; background: #f0f0f0; padding: 6px; flex-shrink: 0; }
.admin-row .info { flex: 1; min-width: 0; }
.admin-row .info .t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .info .s { font-size: 12px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.login-box { max-width: 360px; margin: 80px auto; background: #fff; border-radius: 14px; padding: 30px 24px; box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.login-box h2 { text-align: center; font-size: 20px; margin-bottom: 6px; }
.login-box .sub { text-align: center; color: #999; font-size: 13px; margin-bottom: 20px; }
.login-box .btn { width: 100%; margin-top: 6px; }
.preview-img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #eee; margin-top: 6px; }
