@charset "utf-8";
/* ==========================================================
   前台模板「参考风格」：顶部公告 + 横幅 + 搜索 + 侧栏分类 + 列表
   适配：手机（默认）/ 平板（≥768px）/ 电脑（≥1024px）
   ========================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.m5-body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: #333;
  background: #e8e9ed;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

body.m5-body [hidden] {
  display: none !important;
}

img {
  max-width: 100%;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

input {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

:root {
  --m5-accent: #ff7c00;
  --m5-accent-2: #ff9a3c;
  --m5-teal: #20c5c5;
  --m5-tag: #f28a44;
  --m5-text: #222;
  --m5-sub: #999;
  --m5-line: #e0e0e6;
  --m5-bg: #f5f6fa;
}

.m5-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 8px 14px;
  border-radius: 0 0 8px 0;
  background: var(--m5-accent);
  color: #fff;
  font-size: 13px;
}

.m5-skip:focus {
  left: 0;
}

/* ================= 页面外壳 ================= */
.m5-page {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 750px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  background: var(--m5-bg);
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ================= 顶部滚动公告 ================= */
.m5-notice {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 36px;
  overflow: hidden;
  background: linear-gradient(90deg, #fff8f0, #fff3e6);
  border-bottom: 1px solid #ffe4cc;
}

.m5-notice-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0 8px 0 12px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffb347, var(--m5-accent));
  box-shadow: 0 1px 3px rgba(255, 124, 0, .35);
}

.m5-notice-icon svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  color: #fff;
  transform: translate(-50%, -50%);
}

.m5-notice-win {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent);
}

.m5-notice-track {
  display: inline-flex;
  width: max-content;
  color: var(--m5-accent);
  font-size: 13px;
  line-height: 36px;
  animation: m5-marquee 26s linear infinite;
}

.m5-notice-track span {
  flex: 0 0 auto;
  padding-right: 48px;
}

.m5-notice:active .m5-notice-track {
  animation-play-state: paused;
}

@keyframes m5-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ================= 顶部横幅 ================= */
.m5-banner {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 152px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 20% 20%, rgba(255, 158, 66, .35), transparent 55%),
    radial-gradient(130% 120% at 85% 90%, rgba(66, 160, 255, .35), transparent 60%),
    linear-gradient(135deg, #0c1e35 0%, #10335c 48%, #1b5594 100%);
}

.m5-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 16px);
  opacity: .7;
}

.m5-banner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .28));
}

.m5-banner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  text-align: center;
}

.m5-banner-logo {
  width: 46px;
  height: 46px;
  margin-bottom: 2px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.m5-banner-title {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 9vw, 46px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .04em;
  text-shadow:
    0 2px 0 #c2560f,
    0 3px 0 #a8460b,
    0 6px 20px rgba(255, 140, 40, .55);
}

.m5-banner-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  color: #ffd9a8;
  font-size: 12.5px;
  letter-spacing: .04em;
}

.m5-banner-sub::before,
.m5-banner-sub::after {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffb874);
}

.m5-banner-sub::after {
  background: linear-gradient(90deg, #ffb874, transparent);
}

.m5-banner-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 11px;
  backdrop-filter: blur(4px);
}

.m5-banner-stats i {
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, .45);
}

/* ================= 搜索区域 ================= */
.m5-search {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #f0f0f4;
}

.m5-search-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ebebf0;
  border-radius: 18px;
  background: #f7f8fb;
}

.m5-search-icon {
  margin-right: 4px;
  color: #aaa;
  font-size: 18px;
  line-height: 1;
}

.m5-search-wrap input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: #333;
  background: transparent;
  font-size: 14px;
}

.m5-search-wrap input::placeholder {
  color: #bbb;
}

.m5-search-clear {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: #c8c8ce;
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.m5-search-btn {
  flex: 0 0 60px;
  height: 36px;
  border-radius: 18px;
  background: linear-gradient(90deg, var(--m5-accent-2), var(--m5-accent));
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.m5-search-btn:active {
  filter: brightness(.94);
}

.m5-tutorial-btn {
  flex: 0 1 auto;
  max-width: 8.5em;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--m5-accent);
  border-radius: 18px;
  background: #fff;
  color: var(--m5-accent);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= 主体：侧栏 + 列表 ================= */
.m5-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: #fff;
}

.m5-nav {
  width: 84px;
  flex: 0 0 84px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f7f9;
  border-right: 1px solid #e9e9ee;
}

.m5-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.m5-nav-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.m5-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 6px;
  color: #999;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  word-break: break-all;
  cursor: pointer;
}

.m5-nav-item:not(:last-child) {
  border-bottom: 1px dashed var(--m5-line);
}

.m5-nav-item:active {
  background: #f0f0f4;
}

.m5-nav-item.is-active {
  color: var(--m5-accent);
  font-weight: 600;
  background: #fff;
}

.m5-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--m5-accent);
  transform: translateY(-50%);
}

.m5-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 12px;
  background: #fff;
}

.m5-listhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 44px;
  flex: 0 0 44px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.m5-listhead-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m5-listhead-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.m5-hbtn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--m5-accent);
  border-radius: 13px;
  background: #fff;
  color: var(--m5-accent);
  font-size: 12px;
  line-height: 24px;
  white-space: nowrap;
}

.m5-hbtn:active {
  background: #fff4e8;
}

.m5-list {
  flex: 1;
  min-height: 0;
  padding-top: 2px;
  padding-bottom: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.m5-list::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.m5-list::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #dcdce2;
}

/* ================= 列表条目 ================= */
.m5-item {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 2px 0;
  color: inherit;
}

.m5-item:not(:last-child) {
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--m5-line);
}

.m5-item:active {
  background: #fafafc;
}

.m5-item.is-hidden {
  display: none;
}

.m5-icon {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: hsl(var(--hue, 24) 90% 95%);
}

.m5-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m5-icon-ph {
  color: hsl(var(--hue, 24) 70% 45%);
  font-size: 24px;
  font-weight: 700;
}

.m5-badge-new {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  padding: 0 5px;
  border-radius: 12px 0 8px 0;
  background: linear-gradient(135deg, #ff6b4a, #ff3b5c);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(255, 59, 92, .35);
  pointer-events: none;
}

.m5-txt {
  flex: 1;
  min-width: 0;
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.m5-th {
  font-size: 14px;
  font-weight: 500;
  color: var(--m5-text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m5-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  overflow: hidden;
}

.m5-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  max-width: 46%;
  height: 18px;
  padding: 0 6px;
  border: 1px solid var(--m5-tag);
  border-radius: 3px;
  color: var(--m5-tag);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m5-tag--teal {
  border-color: var(--m5-teal);
  color: var(--m5-teal);
}

.m5-tag--hot {
  border-color: var(--m5-tag);
  color: var(--m5-tag);
}

.m5-tb {
  color: var(--m5-sub);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m5-view {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  margin-left: 10px;
  padding: 0 12px;
  border: 1px solid var(--m5-teal);
  border-radius: 14px;
  color: var(--m5-teal);
  background: #fff;
  font-size: 12px;
}

.m5-item:active .m5-view {
  background: #effcfc;
}

/* ================= 列表尾部 / 空状态 / 分页 ================= */
.m5-listfoot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0 10px;
  color: #b3b3ba;
  font-size: 11px;
}

.m5-listfoot a {
  color: var(--m5-accent);
}

.m5-empty {
  padding: 46px 10px;
  color: #bbb;
  font-size: 13px;
  text-align: center;
}

.m5-empty strong {
  display: block;
  margin-bottom: 6px;
  color: #d0d0d6;
  font-size: 40px;
  line-height: 1;
}

.m5-empty .m5-btn {
  margin-top: 14px;
}

.pager {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 12px;
}

.pager-btn,
.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 14px;
  background: #f5f6fa;
  color: #666;
  font-size: 12px;
}

.pager-num.is-active {
  background: var(--m5-accent);
  color: #fff;
}

.pager-btn.is-disabled {
  opacity: .45;
}

.pager-dots {
  color: #bbb;
  font-size: 12px;
}

/* ================= 底部栏 ================= */
.m5-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #f0f0f4;
  color: #999;
  font-size: 11px;
  text-align: center;
}

.m5-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  line-height: 1.5;
}

.m5-footer a {
  color: #888;
}

/* ================= 子页面顶栏 ================= */
.m5-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 6px;
  background: #fff;
  border-bottom: 1px solid #f1f1f3;
}

.m5-topbar h1 {
  flex: 1;
  margin: 0;
  color: #222;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m5-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #333;
  font-size: 28px;
  line-height: 1;
}

.m5-topbar-space {
  width: 44px;
  flex: 0 0 44px;
}

.m5-scroll {
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--m5-bg);
}

.m5-scroll::-webkit-scrollbar {
  width: 4px;
}

.m5-scroll::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #dcdce2;
}

.m5-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 16px;
}

.m5-dcard,
.m5-block {
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.m5-dcard {
  display: flex;
  align-items: center;
  gap: 14px;
}

.m5-dicon {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: hsl(var(--hue, 24) 90% 95%);
}

.m5-dicon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m5-dicon .m5-icon-ph {
  font-size: 30px;
}

.m5-dinfo {
  flex: 1;
  min-width: 0;
}

.m5-dinfo h1 {
  margin: 0 0 6px;
  color: #1c1c1e;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.m5-dtags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.m5-dmeta {
  margin: 0;
  color: #9a9aa2;
  font-size: 11.5px;
}

.m5-dactions {
  display: flex;
  gap: 10px;
}

.m5-dactions .m5-btn {
  flex: 1;
}

.m5-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 21px;
  background: linear-gradient(90deg, var(--m5-accent-2), var(--m5-accent));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.m5-btn:active {
  filter: brightness(.95);
}

.m5-btn--ghost {
  border: 1.5px solid var(--m5-accent);
  background: #fff;
  color: var(--m5-accent);
}

.m5-btn--plain {
  background: #f3f4f6;
  color: #4b5563;
}

.m5-btn--green {
  background: linear-gradient(90deg, #29c583, #12a86b);
  color: #fff;
}

.m5-btn--off {
  background: #e9eaee;
  color: #a0a0a8;
  cursor: default;
}

.m5-btn--block {
  width: 100%;
}

.m5-block-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.m5-block-hd h2 {
  position: relative;
  margin: 0;
  padding-left: 10px;
  color: #222;
  font-size: 14px;
  font-weight: 600;
}

.m5-block-hd h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--m5-accent);
  transform: translateY(-50%);
}

.m5-block-hd span {
  color: #aaa;
  font-size: 11px;
}

.m5-prose {
  color: #555;
  font-size: 13.5px;
  line-height: 1.8;
  word-break: break-word;
}

.m5-prose p {
  margin: 0 0 8px;
}

.m5-prose p:last-child {
  margin-bottom: 0;
}

.m5-prose h2,
.m5-prose h3,
.m5-prose h4 {
  margin: 14px 0 8px;
  color: #2a2a30;
  font-size: 14.5px;
  font-weight: 600;
}

.m5-prose ul,
.m5-prose ol {
  margin: 0 0 8px;
  padding-left: 18px;
}

.m5-prose li {
  margin-bottom: 4px;
}

.m5-prose img {
  height: auto;
  border-radius: 8px;
}

.m5-prose a {
  color: var(--m5-accent);
  text-decoration: underline;
}

.m5-prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 12.5px;
}

.m5-prose th,
.m5-prose td {
  padding: 6px 8px;
  border: 1px solid #eee;
  text-align: left;
}

.m5-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff8f0;
  color: #b4661a;
  font-size: 12.5px;
}

.m5-coderow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f7f8fb;
  font-size: 13px;
}

.m5-coderow strong {
  color: var(--m5-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
}

.m5-coderow .m5-mini {
  margin-left: auto;
}

.m5-mini {
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--m5-accent);
  border-radius: 12px;
  background: #fff;
  color: var(--m5-accent);
  font-size: 11px;
}

.m5-shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.m5-shots a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #f3f4f6;
}

.m5-shots img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.m5-infolist {
  margin: 0;
}

.m5-infolist div {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed #eee;
}

.m5-infolist div:last-child {
  border-bottom: 0;
}

.m5-infolist dt {
  flex: 0 0 62px;
  color: #9a9aa2;
}

.m5-infolist dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: #444;
  word-break: break-all;
}

.m5-infolist dd a {
  color: var(--m5-accent);
}

.m5-article-title {
  margin: 2px 0 6px;
  color: #1c1c1e;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}

.m5-article-date {
  margin: 0 0 12px;
  color: #a8a8b0;
  font-size: 11.5px;
}

.m5-list--embed {
  flex: none;
  display: block;
  overflow: visible;
  padding: 0;
}

/* 详情页相关推荐：桌面双列 */
@media (min-width: 1024px) {
  .m5-list--embed {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 18px;
  }
}

.m5-empty--404 {
  padding-top: 70px;
}

.m5-empty--tut {
  line-height: 1.9;
  color: #9a9aa2;
}

.m5-empty--tut strong {
  color: #d8d8de;
}

/* ================= 弹层通用 ================= */
.m5-mask {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  background: rgba(15, 23, 42, .45);
}

.m5-mask[hidden] {
  display: none !important;
}

.m5-mask-bg {
  position: absolute;
  inset: 0;
}

.m5-mask--bottom {
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.m5-mask--center {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.m5-card {
  position: relative;
  z-index: 1;
  width: 100%;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}

.m5-dlwrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
}

.m5-card.m5-dl {
  max-height: min(82vh, 620px);
  padding: 18px 16px 16px;
  border-radius: 16px 16px 12px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.m5-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #666;
  font-size: 19px;
  line-height: 30px;
  text-align: center;
}

.m5-dl-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 28px;
  margin-bottom: 14px;
}

.m5-dl-icon {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  background: #fff3e6;
}

.m5-dl-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m5-dl-icon .m5-badge-new {
  border-radius: 14px 0 8px 0;
}

.m5-dl-headtxt {
  min-width: 0;
  flex: 1;
}

.m5-dl-name {
  display: block;
  margin-bottom: 6px;
  color: #222;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m5-dl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.m5-dl-sec {
  margin-bottom: 8px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
}

.m5-dl-desc {
  color: #555;
  font-size: 13px;
  line-height: 1.7;
  word-break: break-all;
}

.m5-dl-desc p {
  margin: 0 0 6px;
}

.m5-dl-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.m5-dl-media:empty {
  display: none;
}

.m5-dl-media img {
  width: auto;
  max-width: 132px;
  max-height: 76px;
  object-fit: contain;
  border-radius: 8px;
  background: #f3f3f3;
}

.m5-dl-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.m5-dl-actions .m5-btn {
  flex: 1;
  height: 44px;
  border-radius: 22px;
}

.m5-dl-actions .m5-btn--ghost {
  flex: 0 0 108px;
  font-size: 14px;
}

.m5-dl-detail {
  display: block;
  margin-top: 10px;
  color: #a0a0a8;
  font-size: 11.5px;
  text-align: center;
}

/* 弹窗上方置顶广告 */
.m5-pinad {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff9a4a 0%, #ff7a5c 48%, #ff6b8a 100%);
  box-shadow: 0 4px 12px rgba(255, 120, 70, .2);
  overflow: hidden;
}

.m5-pinad-text {
  min-width: 0;
  flex: 1;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m5-pinad-btn {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: #e11d48;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  animation: m5-pulse 1.6s ease-in-out infinite;
}

@keyframes m5-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* 客服 / 群 弹窗 */
.m5-card.m5-kefu {
  max-width: 340px;
  padding: 22px 18px 18px;
  border-radius: 18px;
  text-align: center;
}

.m5-kefu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(145deg, #2fd694, #12a86b);
  box-shadow: 0 6px 16px rgba(18, 168, 107, .28);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.m5-kefu-icon--orange {
  background: linear-gradient(145deg, #ffb347, var(--m5-accent));
  box-shadow: 0 6px 16px rgba(255, 124, 0, .28);
}

.m5-kefu h3 {
  margin: 10px 0 14px;
  color: #1c1c1e;
  font-size: 17px;
  font-weight: 600;
}

.m5-qqrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #eefaf6;
  text-align: left;
}

.m5-qqrow-label {
  color: #4b8f78;
  font-size: 12px;
  white-space: nowrap;
}

.m5-qqrow-no {
  flex: 1;
  min-width: 0;
  color: #14a06f;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .02em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m5-qqrow-copy {
  flex: 0 0 auto;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  background: #d9f5ea;
  color: #14a06f;
  font-size: 11px;
}

.m5-qqrow-copy.is-done {
  background: #14a06f;
  color: #fff;
}

.m5-kefu-tip {
  margin: 12px 0 16px;
  color: #8a8a92;
  font-size: 12px;
  line-height: 1.6;
}

.m5-kefu-actions {
  display: flex;
  gap: 10px;
}

.m5-kefu-actions .m5-btn {
  flex: 1;
  height: 42px;
  border-radius: 21px;
}

/* ================= 教程面板 ================= */
.m5-panel {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.m5-panel[hidden] {
  display: none !important;
}

.m5-panel-hd {
  flex: 0 0 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f1f3;
}

.m5-panel-hd h2 {
  flex: 1;
  margin: 0;
  color: #222;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}

.m5-panel-body {
  flex: 1;
  min-height: 0;
  padding: 14px 14px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.m5-tut {
  margin-bottom: 12px;
  border-radius: 12px;
  background: #f7f8fb;
  overflow: hidden;
}

.m5-tut-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  text-align: left;
}

.m5-tut-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  background: #ffe8d2;
  color: var(--m5-accent);
  font-size: 20px;
  font-weight: 800;
}

.m5-tut-body {
  flex: 1;
  min-width: 0;
}

.m5-tut-body strong {
  display: block;
  margin-bottom: 4px;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m5-tut-body small {
  color: #999;
  font-size: 11px;
}

.m5-tut-chevron {
  flex: 0 0 auto;
  color: #c0c0c8;
  font-size: 18px;
  transition: transform .2s ease;
}

.m5-tut.is-open .m5-tut-chevron {
  transform: rotate(90deg);
}

.m5-tut-detail {
  display: none;
  padding: 0 12px 12px 68px;
}

.m5-tut.is-open .m5-tut-detail {
  display: block;
}

/* ================= Toast ================= */
.m5-toast {
  position: fixed;
  left: 50%;
  bottom: calc(18% + env(safe-area-inset-bottom));
  z-index: 120;
  max-width: min(80vw, 320px);
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.m5-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================= 平板 ≥768px ================= */
@media (min-width: 768px) {
  .m5-page {
    max-width: 900px;
  }

  .m5-banner {
    height: 200px;
  }

  .m5-banner-logo {
    width: 54px;
    height: 54px;
  }

  .m5-banner-sub {
    font-size: 13.5px;
  }

  .m5-banner-stats {
    font-size: 12px;
  }

  .m5-search {
    padding: 12px 16px;
    gap: 10px;
  }

  .m5-search-wrap,
  .m5-search-btn,
  .m5-tutorial-btn {
    height: 40px;
  }

  .m5-search-btn {
    flex-basis: 72px;
  }

  .m5-nav {
    width: 108px;
    flex-basis: 108px;
  }

  .m5-nav-item {
    min-height: 54px;
    font-size: 13px;
  }

  .m5-content {
    padding: 0 16px;
  }

  .m5-listhead {
    height: 50px;
    flex-basis: 50px;
    font-size: 15px;
  }

  .m5-icon {
    width: 66px;
    height: 66px;
    flex-basis: 66px;
  }

  .m5-th {
    font-size: 15px;
  }

  .m5-view {
    height: 30px;
    min-width: 58px;
    font-size: 12.5px;
  }

  .m5-scroll {
    padding: 16px;
  }

  .m5-dcard,
  .m5-block {
    padding: 16px;
  }

  .m5-card.m5-dl {
    max-width: 420px;
    border-radius: 16px;
  }

  .m5-mask--bottom {
    align-items: center;
    padding: 24px;
  }

  .m5-dlwrap {
    max-width: 420px;
  }

  .m5-prose {
    font-size: 14px;
  }
}

/* ================= 电脑 ≥1024px ================= */
@media (min-width: 1024px) {
  body.m5-body {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 22px 20px;
    background:
      radial-gradient(1100px 620px at 50% -10%, #1d4166, transparent 65%),
      linear-gradient(160deg, #0b1723 0%, #0f2133 55%, #0a1420 100%);
  }

  .m5-page {
    max-width: 1180px;
    height: calc(100dvh - 44px);
    min-height: 560px;
    flex: 1;
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
    border: 1px solid rgba(255, 255, 255, .07);
  }

  .m5-banner {
    height: 250px;
  }

  .m5-banner-logo {
    width: 62px;
    height: 62px;
  }

  .m5-banner-title {
    font-size: 54px;
  }

  .m5-banner-sub {
    font-size: 14.5px;
  }

  .m5-banner-stats {
    margin-top: 10px;
    padding: 4px 16px;
    font-size: 12px;
  }

  .m5-search {
    padding: 14px 22px;
    gap: 12px;
  }

  .m5-search-wrap {
    max-width: 620px;
  }

  .m5-nav {
    width: 168px;
    flex-basis: 168px;
  }

  .m5-nav-item {
    min-height: 60px;
    padding: 12px 10px;
    font-size: 13.5px;
  }

  .m5-content {
    padding: 0 22px;
  }

  .m5-listhead {
    height: 56px;
    flex-basis: 56px;
    font-size: 16px;
  }

  .m5-hbtn {
    height: 28px;
    padding: 0 12px;
    font-size: 12.5px;
    line-height: 26px;
  }

  .m5-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 30px;
    align-content: start;
  }

  .m5-item {
    min-height: 72px;
  }

  /* 双列时不再用虚线分隔，改用留白 */
  .m5-item:not(:last-child) {
    margin-bottom: 4px;
    padding: 8px 10px;
    border-bottom: 0;
    border-radius: 12px;
  }

  .m5-item:not(:last-child):hover {
    background: #fafafc;
  }

  .m5-icon {
    width: 70px;
    height: 70px;
    flex-basis: 70px;
    border-radius: 14px;
  }

  .m5-th {
    font-size: 15px;
  }

  .m5-tag {
    height: 19px;
    font-size: 10.5px;
  }

  .m5-scroll {
    padding: 20px 22px;
  }

  .m5-detail {
    max-width: 880px;
  }

  .m5-shots {
    grid-template-columns: repeat(4, 1fr);
  }

  .m5-panel {
    border-radius: 20px;
  }
}

/* ================= 小屏兜底 + 动效偏好 ================= */
@media (max-width: 340px) {
  .m5-search-btn {
    flex-basis: 52px;
    padding: 0;
    font-size: 13px;
  }

  .m5-tutorial-btn {
    padding: 0 8px;
    font-size: 12px;
  }

  .m5-nav {
    width: 76px;
    flex-basis: 76px;
  }

  .m5-view {
    min-width: 46px;
    padding: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .m5-notice-track,
  .m5-pinad-btn {
    animation: none !important;
  }

  .m5-banner-track {
    transition: none !important;
  }
}
