/* Prevent browser double-tap zoom while keeping vertical page scrolling. */
html {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

body {
  touch-action: pan-y;
  -ms-touch-action: pan-y;
}

button,
a,
input,
[data-ip],
[data-article],
[data-slide] {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

/* 首页首屏更紧凑，作者榜单作为独立卡片展示。 */
.banner {
  height: 168px;
  padding: 0;
}

.author-rail {
  border: 1px solid #e8e8ed;
  border-radius: 16px;
  background: #fff;
  padding: 13px 10px 12px;
}

@media (min-width: 700px) {
  .banner {
    height: 220px;
    padding: 0;
  }
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin: 8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.auth-tabs button {
  flex: 1;
  padding: 0 0 10px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.auth-tabs button.active {
  color: var(--accent);
  border-color: var(--accent);
}

.code-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.code-row input {
  margin-top: 0 !important;
}

.code-btn {
  flex: 0 0 100px;
  border-radius: 8px;
  background: #fff0f4;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.auth-hint {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.balance-tip {
  display: block;
  margin: 10px 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.profile-card,
.points-card,
.profile-edit,
.profile-login {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.points-ledger {
  margin-top: 12px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.ledger-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ledger-head h3 {
  margin: 0;
  font-size: 17px;
}

.ledger-head > strong {
  color: var(--accent);
  font-size: 14px;
}

.ledger-list {
  border-top: 1px solid var(--line);
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.ledger-row b,
.ledger-row small {
  display: block;
}

.ledger-row b {
  font-size: 12px;
  font-weight: 600;
}

.ledger-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.ledger-row > strong {
  font-size: 14px;
  white-space: nowrap;
}

.ledger-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  white-space: nowrap;
}

.ledger-amount strong {
  font-size: 14px;
}

.ledger-amount small {
  margin-top: 0;
  font-size: 10px;
}

.ledger-row .plus {
  color: #49a979;
}

.ledger-row .minus {
  color: var(--accent);
}

.ledger-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-card {
  padding: 20px;
}

.profile-main {
  display: flex;
  align-items: center;
  gap: 13px;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  flex: none;
  font-size: 25px;
}

.profile-main h3 {
  margin: 0 0 5px;
  font-size: 19px;
}

.profile-main p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.profile-main .link-btn {
  margin-left: auto;
}

.profile-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.profile-meta small,
.profile-meta strong {
  display: block;
}

.profile-meta small {
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 5px;
}

.profile-meta strong {
  font-size: 14px;
}

.points-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 18px 20px;
  background: linear-gradient(120deg, #fff4f7, #fff);
}

.points-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.points-card small {
  color: var(--muted);
  font-size: 11px;
}

.points-card > strong {
  color: var(--accent);
  font-size: 32px;
}

.recharge-inline {
  margin-left: auto;
  margin-right: 12px;
  padding: 8px 12px;
  border-radius: 18px;
  background: #fff0f4;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.recharge-page {
  padding-bottom: 180px;
}
/* 充值页面：隐藏全局返回按钮（顶部已有 .recharge-back） */
body:has(#rechargePage:not(.hidden)) .floating-back { display: none !important; }
/* 充值页面：提交栏固定在底部，客服、公告浮窗整体上移并保持「公告在下、客服在上」的顺序 */
body:has(#rechargePage:not(.hidden)) .announce-widget { bottom: calc(160px + env(safe-area-inset-bottom)) !important; }
body:has(#rechargePage:not(.hidden)) .cs-widget { bottom: calc(208px + env(safe-area-inset-bottom)) !important; }
@media (min-width: 700px) {
  body:has(#rechargePage:not(.hidden)) .announce-widget { bottom: 160px !important; }
  body:has(#rechargePage:not(.hidden)) .cs-widget { bottom: 208px !important; }
}

.recharge-top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 4px 0 18px;
  padding: 0 3px;
}

.recharge-back {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.recharge-top h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.recharge-top p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.recharge-card {
  margin-bottom: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.recharge-card h3 {
  margin: 0 0 17px;
  font-size: 17px;
}

.recharge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.recharge-option {
  position: relative;
  min-height: 106px;
  padding: 15px 8px 12px;
  border: 2px solid #e5e5e9;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
}

.recharge-option.selected {
  border-color: var(--accent);
  background: #fff8fa;
}

.recharge-option strong,
.recharge-option small {
  display: block;
}

.recharge-option strong {
  font-size: 22px;
}

.recharge-option small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.recharge-option .pkg-name {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.recharge-option .bonus {
  position: absolute;
  top: -10px;
  right: -5px;
  padding: 4px 7px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.custom-title {
  margin: 22px 0 10px;
  padding-top: 17px;
  border-top: 1px dashed var(--line);
  font-size: 15px;
  font-weight: 700;
}

.custom-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.custom-input {
  display: flex;
  align-items: center;
  height: 47px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.custom-input span {
  color: var(--muted);
  font-size: 18px;
}

.custom-input input {
  width: 100%;
  border: 0;
  outline: 0;
  padding-left: 8px;
}

.rate-tip {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.pay-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.wechat-icon {
  color: #42bd76;
  font-size: 18px;
}

.alipay-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: #1677ff;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.pay-tip {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.pay-row .check {
  margin-left: auto;
  color: var(--accent);
  font-weight: 800;
}

.recharge-submit {
  position: fixed;
  right: 0;
  bottom: 70px;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(16px, calc((100% - 948px) / 2));
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -5px 18px #302f3c0d;
}

.recharge-submit small,
.recharge-submit strong {
  display: block;
}

.recharge-submit small {
  color: var(--muted);
  font-size: 11px;
}

.recharge-submit strong {
  margin-top: 3px;
  color: var(--accent);
  font-size: 21px;
}

.recharge-submit .primary-btn {
  min-width: 145px;
  border-radius: 24px;
  background: linear-gradient(90deg, #f184a3, var(--accent));
}

.recharge-submit .primary-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.profile-edit {
  margin-top: 12px;
  padding: 18px 20px;
}

.profile-fields {
  display: grid;
  gap: 10px;
}

.profile-fields label {
  color: var(--muted);
  font-size: 11px;
}

.profile-fields input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline-color: var(--accent);
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
}

.profile-logout {
  margin: 14px 0 4px;
}

.profile-logout button {
  width: 100%;
  min-height: 44px;
  border: 1px solid #f0c4ca;
  border-radius: 10px;
  background: #fff;
  color: #c94d5d;
  font-size: 13px;
  font-weight: 700;
}

.profile-logout button:active {
  background: #fff2f4;
}

.profile-login {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* 顶部品牌居中，隐藏右侧搜索入口。 */
.appbar {
  justify-content: center;
}

.appbar .brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.appbar #topSearch {
  display: none;
}

.page-back {
  display: inline-flex;
  align-items: center;
  margin: 2px 0 22px;
  padding: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

/* 返回按钮：药丸样式（图标 + 文字） */
.floating-back {
  position: fixed;
  right: 18px;
  bottom: calc(170px + env(safe-area-inset-bottom));
  z-index: 7;
  min-width: 76px;
  height: 40px;
  padding: 0 14px 0 12px;
  border-radius: 22px;
  border: 1px solid #f3c1d0;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 8px 22px rgba(243, 95, 134, .22);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: .02em;
}
.floating-back .fab-icon {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.floating-back .fab-label {
  display: inline-block;
}
.floating-back:active {
  transform: scale(.94);
}

/* 返回按钮固定位置：桌面端排在客服（72px）上方 */
@media (min-width: 700px) {
  .floating-back {
    right: max(24px, calc((100vw - 980px) / 2));
    bottom: 120px;
  }
}
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 13px;
  border-radius: 22px;
  background: #f0f0f4;
}
.segmented button {
  padding: 7px 12px;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.segmented button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 8px #302f3c12;
}
.author-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 4px 0 22px;
}
.author-head .detail-avatar {
  width: 112px;
  height: 112px;
  flex: none;
  margin: 0;
}
.author-head .author-meta {
  min-width: 0;
  flex: 1;
}
.author-head .author-meta .eyebrow {
  margin-bottom: 7px;
}
.author-head .author-meta h1 {
  margin: 0 0 8px;
  font-size: 28px;
}
.author-head .author-meta .author-stats {
  margin: 0 0 8px;
}
.author-head .author-meta .hero-copy {
  margin: 0;
}
.author-head .follow-btn {
  flex: none;
}
.follow-btn {
  padding: 9px 15px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.follow-btn.followed {
  background: #fff0f4;
  color: var(--accent);
}
.author-stats {
  display: flex;
  gap: 16px;
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 11px;
}
.author-stats b { color: var(--ink); }
.follow-grid { display: grid; gap: 11px; }
.follow-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.follow-card .avatar { flex: none; width: 48px; height: 48px; }
.follow-card h3 { margin: 0 0 4px; font-size: 15px; }
.follow-card p { margin: 0 0 5px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow-card small { color: var(--muted); font-size: 10px; }
.follow-card > div:nth-child(2) { min-width: 0; flex: 1; }
.follow-card { position: relative; }
.follow-update { flex: none; padding: 5px 8px; border-radius: 12px; background: #fff0f4; color: var(--accent); font-size: 10px; font-weight: 800; white-space: nowrap; }
.follow-no-update { background: #f1f1f4; color: var(--muted); }
.author-article-tabs { margin: 18px 0 14px; }

.author-search-row {
  position: relative;
  margin: 14px 0 0;
}

.author-search-row input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  outline: 0;
  font-size: 14px;
}

.author-search-row input:focus {
  border-color: var(--accent);
}

.author-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #ececf0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.author-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.author-pagination + .author-pagination { display: none; }
.author-pagination button:disabled { color: #c8c7cd; cursor: not-allowed; }
.purchase-info { min-width: 0; flex: 1; }
.purchase-price { display: block; margin-top: 6px; color: var(--accent); font-size: 12px; font-weight: 800; }
