/* 手机版壳层 — 参照知乎：搜索顶栏 + 信息流 + 底部 Tab */
body.mobile-shell {
  background: var(--theme-surface2, #f6f6f6);
  color: var(--theme-text, #121212);
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
}

body.mobile-shell.has-app-nav {
  padding-top: calc(56px + env(safe-area-inset-top, 0px)) !important;
}

.mobile-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 0 16px;
}

.mobile-feed {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-card {
  display: block;
  background: var(--theme-surface, #fff);
  border-radius: 10px;
  padding: 14px 14px 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--theme-border, #f0f0f0);
}
.mobile-card:active { opacity: 0.92; }
.mobile-card .card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.mobile-card .card-title {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
  flex: 1;
}
.mobile-card .card-tag {
  flex-shrink: 0;
  font-size: 0.62rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #0066ff12;
  color: #0066ff;
  font-weight: 600;
}
.mobile-card .card-tag.hot { background: #fef3c7; color: #b45309; }
.mobile-card .card-desc {
  font-size: 0.8rem;
  color: var(--theme-muted, #8590a6);
  line-height: 1.55;
  margin-bottom: 10px;
}
.mobile-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--theme-muted, #8590a6);
  padding-top: 10px;
  border-top: 1px solid var(--theme-border, #f0f0f0);
}
.mobile-card .card-foot em {
  font-style: normal;
  color: #0066ff;
  font-weight: 600;
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: calc(52px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--theme-surface, #fff);
  border-top: 1px solid var(--theme-border, #ebebeb);
  box-shadow: 0 -1px 8px rgba(15, 23, 42, 0.04);
}
.mobile-tabbar a,
.mobile-tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--theme-muted, #8590a6);
  font-size: 0.62rem;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 0 4px;
  font-family: inherit;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.mobile-tabbar .ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.mobile-tabbar .ico svg {
  width: 22px;
  height: 22px;
  display: block;
}
.mobile-tabbar .lbl {
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.02em;
}
.mobile-tabbar a.active,
.mobile-tabbar button.active {
  color: #0066ff;
  font-weight: 600;
}
.mobile-tabbar a.active .ico svg,
.mobile-tabbar button.active .ico svg {
  stroke-width: 2;
}

.mobile-account-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.32);
}
.mobile-account-mask.open { display: block; }

.mobile-account-sheet {
  display: none !important;
  position: fixed !important;
  top: auto !important;
  left: 12px !important;
  right: 12px !important;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10002 !important;
  border-radius: 16px !important;
  background: var(--theme-surface, #fff) !important;
  border: 1px solid var(--theme-border, #ebebeb) !important;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14) !important;
  max-height: min(68vh, 480px);
  overflow: hidden;
}
.mobile-account-sheet.open {
  display: block !important;
  animation: mobile-panel-up 0.24s ease-out;
}
.mobile-account-sheet .account-sheet-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 14px;
  background: linear-gradient(135deg, #eef4ff 0%, #f0f9ff 100%);
  border-bottom: 1px solid #dbeafe;
}
.mobile-account-sheet .account-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066ff, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
}
.mobile-account-sheet .account-avatar svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}
.mobile-account-sheet .account-head-main h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #0066ff;
}
.mobile-account-sheet .account-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.3;
}
.mobile-account-sheet .account-badge.premium {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.mobile-account-sheet .account-badge.free {
  background: #eff6ff;
  color: #0066ff;
  border: 1px solid #bfdbfe;
}
.mobile-account-sheet .account-badge.offline,
.mobile-account-sheet .account-badge.loading {
  background: #f3f4f6;
  color: #646e82;
  border: 1px solid #e5e7eb;
}
.mobile-account-sheet .account-sheet-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  max-height: calc(68vh - 90px);
  -webkit-overflow-scrolling: touch;
}
.mobile-account-sheet .account-detail {
  font-size: 0.84rem;
  line-height: 1.65;
  color: #4b5563;
  margin: 0 0 12px;
}
.mobile-account-sheet .account-detail-sub,
.mobile-account-sheet .account-meta {
  font-size: 0.78rem;
  color: #646e82;
}
.mobile-account-sheet .account-highlight {
  color: #0066ff;
  font-weight: 600;
}
.mobile-account-sheet .mobile-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: rgba(0, 102, 255, 0.2);
}
.mobile-account-sheet .mobile-sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #646e82;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}
.mobile-account-sheet .acts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}
.mobile-account-sheet .acts a {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--theme-border, #ebebeb);
  background: var(--theme-surface2, #f6f6f6);
  color: var(--theme-text, #374151);
  text-decoration: none;
  font-size: 0.88rem;
  text-align: center;
}
.mobile-account-sheet .acts a.primary {
  background: linear-gradient(135deg, #0066ff, #0052cc);
  border-color: #0066ff;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.22);
}
.mobile-account-sheet .acts a.account-link-secondary {
  color: #0066ff;
  background: #0066ff0a;
  border-color: #0066ff33;
  font-weight: 600;
}
.mobile-account-sheet .panel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 12px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: center;
}
.mobile-account-sheet .nav-ico svg {
  width: 16px;
  height: 16px;
}

html[data-theme="dark"] .mobile-account-sheet .account-sheet-hero {
  background: linear-gradient(135deg, #1e3a5f55, #1a2332);
  border-bottom-color: #2d3f56;
}
html[data-theme="dark"] .mobile-account-sheet .account-head-main h3 {
  color: #93c5fd;
}
html[data-theme="dark"] .mobile-account-sheet .account-detail {
  color: #b6c2d1;
}
html[data-theme="dark"] .mobile-account-sheet .account-badge.free {
  background: #1e3a5f44;
  color: #93c5fd;
  border-color: #3b82f666;
}
html[data-theme="dark"] .mobile-account-sheet .account-highlight {
  color: #93c5fd;
}
html[data-theme="dark"] .mobile-account-sheet .acts a.account-link-secondary {
  background: #0066ff18;
  color: #93c5fd;
}
html[data-theme="dark"] .mobile-account-sheet .panel-btn {
  background: #42200644;
  border-color: #78350f66;
  color: #fcd34d;
}

@keyframes mobile-panel-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

html[data-theme="dark"] body.mobile-shell {
  background: var(--theme-bg, #0f1419);
}
html[data-theme="dark"] .mobile-card {
  border-color: var(--theme-border, #2d3f56);
}
