@import url("./modal_ui.css");

/* 移动端主站 UI — 参考绿/橙主题 */
:root {
  --m-green: #2b7ce6;
  --m-green-dark: #1e62c4;
  --m-orange: #ffb84d;
  --m-bg: #f4f6f8;
  --m-text: #1a1a1a;
  --m-muted: #8a8a8a;
  --m-card: #fff;
  --m-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body.m-app {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--m-bg);
  color: var(--m-text);
  padding-bottom: calc(56px + var(--m-safe-bottom));
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* 顶栏 */
.m-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, var(--m-green) 0%, var(--m-green-dark) 100%);
  color: #fff;
  padding: 10px 14px 12px;
  box-shadow: 0 2px 8px rgba(43, 124, 230, 0.25);
}
.m-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.m-header__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.m-header__online {
  font-size: 12px;
  opacity: 0.95;
}

/* 首页顶栏：纯白底，强制盖掉 .m-header 绿渐变（含缓存旧样式时） */
body.m-app.m-app--home {
  background: #fff;
}
.m-app--home .m-header.m-header--lite {
  background: #fff !important;
  background-image: none !important;
  color: var(--m-text) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06) !important;
  padding: 10px 14px 11px;
}
.m-header__row--home {
  gap: 12px;
}
.m-header__logo {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.m-header__logo img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.m-header__dl {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #4a9eea 0%, #357abd 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(53, 122, 189, 0.35);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.m-header__dl:active {
  opacity: 0.92;
}
.m-header__dl-icon {
  flex-shrink: 0;
}

/* 首页海报轮播：卡片留白（勿用 width:100%+margin，部分浏览器会全宽顶边）；圆角与公告条对齐 12px 边距 */
.m-hero.m-hero--carousel {
  box-sizing: border-box;
  width: calc(100% - 24px);
  max-width: calc(100vw - 24px);
  margin: 10px 12px 0;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(243, 156, 18, 0.22);
  background: #0c0c0c;
  overflow: hidden;
}
.m-hero-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 11px;
}
.m-hero-carousel__viewport {
  width: 100%;
  max-width: 100%;
  height: 156px;
  max-height: 28vh;
  overflow: hidden;
  position: relative;
  touch-action: pan-y pinch-zoom;
  box-sizing: border-box;
  border-radius: 11px;
}
.m-hero-carousel__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  will-change: transform;
  transition: transform 0.38s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.m-hero-carousel__slide {
  flex: 0 0 auto;
  display: block;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}
.m-hero-carousel__imgwrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background-color: #111;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  position: relative;
  box-sizing: border-box;
}
.m-hero-carousel__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
}
.m-hero-carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.38);
  transition: width 0.2s, border-radius 0.2s, background 0.2s;
}
.m-hero-carousel__dot--on {
  width: 16px;
  border-radius: 4px;
  background: rgba(255,255,255,.95);
}

/* 发布页入口按钮组 */
.m-publish-quick {
  margin: 12px 12px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.m-publish-quick__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  line-height: 1.25;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.m-publish-quick__btn:nth-child(1) {
  background: linear-gradient(135deg, #2b7ce6, #1e62c4);
}
.m-publish-quick__btn:nth-child(2) {
  background: linear-gradient(135deg, #5b7cfa, #7b5cfa);
}
.m-publish-quick__btn:nth-child(3) {
  background: linear-gradient(135deg, #ff9f43, #ff6b35);
}
.m-publish-quick__btn:active {
  opacity: 0.9;
}

/* 公告条 */
.m-marquee {
  margin: 10px 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #e74c3c;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.m-marquee__icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* 公告左侧用 <img> 替换 emoji 时限制尺寸，避免原图过大撑版 */
.m-marquee__icon img {
  display: block;
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  object-fit: contain;
  vertical-align: middle;
}
.m-marquee__text {
  flex: 1;
  overflow: hidden;
  white-space: normal;
  line-height: 1.45;
  max-height: 4.35em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* Tab 切换 */
.m-tabs {
  display: flex;
  margin: 14px 12px 8px;
  gap: 24px;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 0;
}
.m-tabs__item {
  padding: 8px 0 10px;
  font-size: 15px;
  color: #666;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-weight: 500;
}
.m-tabs__item--active {
  color: var(--m-green);
  border-bottom-color: var(--m-green);
  font-weight: 600;
}

/* 信息流卡片 */
.m-feed { padding: 0 12px 16px; }
.m-card-pro-link {
  display: block;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}
.m-card-pro-link:active .m-card-pro {
  opacity: 0.96;
}
.m-card-pro {
  background: var(--m-card);
  border-radius: 10px;
  padding: 10px 10px 8px;
  margin-bottom: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  min-width: 0;
}
.m-card-pro__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.32;
  margin-bottom: 6px;
  color: #111;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: calc(1.32em * 2);
  min-width: 0;
}
/* 四宫格：固定行高缩略图，小屏一屏可多露几条卡片 */
.m-card-pro__imgs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
  width: 100%;
  min-width: 0;
}
.m-card-pro__imgWrap {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 58px;
  padding-bottom: 0;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(135deg, #e8f8ef 0%, #d4f0e0 100%);
}
.m-card-pro__imgWrap > img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border: 0;
}
.m-card-pro__imgWrap--ph {
  padding-bottom: 0;
  height: 58px;
}
.m-card-pro__imgWrap--ph .m-card-pro__ph-inner {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--m-green);
  text-align: center;
  padding: 2px;
  box-sizing: border-box;
  line-height: 1.2;
}
.m-card-pro__refresh {
  font-size: 10px;
  color: #888;
  line-height: 1.3;
  margin: 0 0 6px;
}
.m-card-pro__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.m-card-pro__btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.m-card-pro .m-tag {
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.m-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.m-tag--top { background: rgba(43, 124, 230, 0.15); color: var(--m-green); }
.m-tag--rf { background: rgba(255, 184, 77, 0.25); color: #d35400; }
.m-card-pro__views {
  font-size: 12px;
  color: var(--m-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 2px 0;
  margin: 0;
}
.m-card-pro__views:active { opacity: 0.7; }
.m-divider {
  height: 1px;
  background: #eee;
  margin: 12px 0 0;
}
.m-card-pro .m-divider {
  margin: 8px 0 0;
}

/* 应用页 */
.m-apps-head {
  margin: 12px 12px 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--m-green);
  padding-left: 8px;
  border-left: 4px solid var(--m-green);
}
.m-apps-hot {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 4px;
  padding: 0 10px 12px;
  text-align: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* 固定 48×48，避免任意分辨率图标撑破宫格 */
.m-apps-hot__icon {
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 0;
  max-width: 48px;
  margin: 0 auto 4px;
  border-radius: 12px;
  background: linear-gradient(145deg, #e8f5e9, #c8e6c9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #2e7d32;
  padding: 0;
  line-height: 1.15;
  overflow: hidden;
  box-sizing: border-box;
}
.m-apps-hot__icon img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  display: block;
}
.m-apps-hot__label {
  font-size: 10px;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-cat-scroll {
  display: flex;
  gap: 18px;
  padding: 8px 12px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}
.m-cat-scroll::-webkit-scrollbar { display: none; }
.m-cat {
  flex-shrink: 0;
  font-size: 14px;
  color: #888;
  padding-bottom: 6px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.m-cat--on {
  color: var(--m-green);
  font-weight: 600;
  border-bottom-color: var(--m-green);
}
.m-apps-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px 6px;
  padding: 8px 10px 80px;
  text-align: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.m-apps-item {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
a.m-apps-item--link {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* 我的 */
.m-mine-top {
  background: linear-gradient(180deg, var(--m-green) 0%, #2268c4 45%, var(--m-bg) 45%);
  padding: 16px 14px 0;
}
.m-mine-user {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
}
.m-mine-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd54f, #ffb300);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  object-fit: cover;
}
.m-mine-name { font-size: 17px; font-weight: 700; color: #fff; }
.m-mine-code {
  font-size: 12px;
  color: rgba(255,255,255,.9);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.m-mine-code button {
  border: 0;
  background: rgba(255,255,255,.25);
  color: #fff;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
}
.m-mine-edit {
  position: absolute;
  top: 0;
  right: 12px;
  z-index: 2;
  font-size: 13px;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  background: rgba(255,255,255,.2);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.35);
}
.m-mine-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 12px;
  padding: 14px 8px;
  margin: 0 0 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  text-align: center;
  overflow: hidden;
  background-color: #eef2f6;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
    url("https://s1.aigei.com/src/img/jpg/f2/f27c5f67b526438683a7f0f41315d387.jpg?imageMogr2/auto-orient/thumbnail/!282x172r/gravity/Center/crop/282x172/quality/85/%7CimageView2/2/w/282&e=2051020800&token=P7S2Xpzfz11vAkASLTkfHN7Fw-oOZBecqeJaxypL:UfHFvXrcRICHlIkd5h_BnEXGktw=");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat;
}
.m-mine-stats__val { font-size: 18px; font-weight: 700; color: #222; }
.m-mine-stats__lab { font-size: 11px; color: #888; margin-top: 4px; }

.m-vip-banner {
  margin: 0 12px 12px;
  background: linear-gradient(90deg, #2c2c2c, #444);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f1c40f;
  font-size: 13px;
  font-weight: 600;
}
.m-vip-banner__btn {
  background: #f5e6c8;
  color: #5d4e37;
  border: 0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

.m-mine-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px 12px;
}
.m-mine-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}
.m-mine-card__t { font-size: 15px; font-weight: 600; }
.m-mine-card__s { font-size: 11px; color: #999; margin-top: 4px; }
.m-mine-card__ic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.m-mine-card__img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}
.m-mine-card__ic--g { background: #e8f8ef; }
.m-mine-card__ic--o { background: #fff3e0; }

.m-section-title {
  margin: 16px 12px 10px;
  font-size: 15px;
  font-weight: 700;
  color: #333;
}
/* 我的页：我的服务（深色动图背景 + 浅色字） */
.m-mine-services {
  margin: 16px 12px 12px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  background-color: #0d0d0d;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 100%),
    url("https://s1.aigei.com/src/img/gif/fe/fe91cc2e484149f793f0a7b681f47e1f.gif?imageMogr2/auto-orient/thumbnail/!282x282r/gravity/Center/crop/282x282/quality/85/%7CimageView2/2/w/282&e=2051020800&token=P7S2Xpzfz11vAkASLTkfHN7Fw-oOZBecqeJaxypL:KEh36cpWdbRr516ANWLsJdYOUjY=");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat;
}
.m-mine-services__title {
  padding: 14px 14px 6px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.02em;
}
.m-mine-services .m-service-grid {
  margin: 0;
  background: transparent;
  box-shadow: none;
  padding: 10px 12px 18px;
}
.m-mine-services .m-service-grid a {
  color: rgba(255, 255, 255, 0.96);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.m-mine-services .m-service-ic {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.m-service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
  background: #fff;
  margin: 0 12px 12px;
  padding: 18px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  text-align: center;
}
.m-service-grid a {
  text-decoration: none;
  color: #333;
  font-size: 12px;
}
.m-service-ic {
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.m-service-ic__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.m-service-ic.c1 { background: #e3f2fd; }
.m-service-ic.c2 { background: #fff3e0; }
.m-service-ic.c3 { background: #e0f7fa; }
.m-service-ic.c4 { background: #f3e5f5; }
.m-service-ic.c5 {
  background: linear-gradient(145deg, #f3e5f5, #e1bee7);
  color: #7b1fa2;
  font-size: 20px;
  font-weight: 800;
}

/* 表单 */
.m-form-card {
  margin: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.m-input, .m-textarea {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  margin-bottom: 12px;
}
.m-textarea { min-height: 140px; resize: vertical; }
.m-btn-primary {
  width: 100%;
  border: 0;
  border-radius: 24px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, var(--m-green), var(--m-green-dark));
  cursor: pointer;
}

/* FAB */
.m-fab {
  position: fixed;
  right: 16px;
  bottom: calc(68px + var(--m-safe-bottom));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--m-green), var(--m-green-dark));
  color: #fff;
  font-size: 28px;
  line-height: 52px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(43, 124, 230, 0.45);
  text-decoration: none;
  z-index: 200;
  font-weight: 300;
}

/* 底栏 */
.m-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(56px + var(--m-safe-bottom));
  padding-bottom: var(--m-safe-bottom);
  background: #fff;
  border-top: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 6px;
  z-index: 300;
  box-shadow: 0 -2px 10px rgba(0,0,0,.04);
}
.m-tabbar__item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #999;
  font-size: 10px;
  padding-top: 2px;
}
.m-tabbar__item--active {
  color: var(--m-green);
}
/* 底栏图标：使用 <img class="m-tabbar__img">，由脚本切换 data-icon / data-icon-on */
.m-tabbar__img {
  display: block;
  margin: 0 auto 2px;
  width: 24px;
  height: 24px;
  object-fit: contain;
  -webkit-tap-highlight-color: transparent;
}
/* 若某页仍使用内联 SVG（旧版），保留样式 */
.m-tabbar__item--active .m-tabbar__svg {
  stroke: var(--m-green);
  fill: var(--m-green);
}
.m-tabbar__svg {
  display: block;
  margin: 0 auto 2px;
  width: 24px;
  height: 24px;
  stroke: #aaa;
  fill: none;
  stroke-width: 1.8;
}
.m-tabbar__item--active .m-tabbar__svg--fill {
  fill: var(--m-green);
  stroke: var(--m-green);
}
.m-tabbar__item:not(.m-tabbar__item--active) .m-tabbar__svg--fill path {
  fill: #bbb;
}

.m-empty { text-align: center; color: #999; padding: 40px 20px; font-size: 14px; }
