:root {
  --brand: #c9f7ff;
  --brand-strong: #8eeafa;
  --bg: #f2f2f2;
  --surface: #ffffff;
  --line: #eeeeee;
  --text: #111111;
  --muted: #9a9a9a;
  --soft: #f8f8f8;
  --accent: #32cfe5;
  --danger: #ff6b8a;
  --shadow: 0 22px 70px rgba(34, 65, 76, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  height: 100%;
}

body {
  margin: 0;
  background: #e9fbff;
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.phone-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-screen {
  position: relative;
  width: min(100vw, 390px);
  height: min(calc(100vh - 48px), 844px);
  height: min(calc(100dvh - 48px), 844px);
  min-height: 720px;
  max-height: 844px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.status-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  background: var(--brand);
  font-size: 16px;
  flex-shrink: 0;
}

.status-icons {
  display: flex;
  gap: 5px;
  align-items: center;
}

.icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.status-icons .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.top-tabs,
.top-bar,
.search-top,
.qa-tabs {
  height: 44px;
  flex-shrink: 0;
  background: var(--brand);
  display: flex;
  align-items: center;
}

.top-tabs {
  display: grid;
  grid-template-columns: 36px repeat(3, 1fr) 36px;
  gap: 0;
  padding: 0 14px;
}

.top-tabs .menu-btn,
.top-tabs .search-btn {
  width: 36px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}

.top-tabs .tab {
  position: relative;
  min-width: 40px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 17px;
  min-width: 0;
}

.top-tabs .tab.active::after,
.qa-tabs .active::after,
.profile-tabs .active::after,
.search-tabs .active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 34px;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--accent);
}

.top-bar {
  gap: 10px;
  padding: 0 14px;
}

.post-detail-bar {
  height: 53px;
  padding-left: 14px;
  padding-right: 12px;
  gap: 8px;
}

.back-btn {
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex: 0 0 auto;
}

.top-title {
  flex: 1;
  font-size: 18px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-title {
  font-size: 20px;
  padding-left: 2px;
}

.top-avatar {
  width: 40px;
  height: 40px;
}

.follow-btn,
.publish-btn {
  min-width: 62px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #168fa3;
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.content {
  flex: 1;
  overflow: auto;
  min-height: 0;
  scrollbar-width: none;
}

.content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.feed-list,
.qa-list {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
}

.qa-list {
  gap: 6px;
}

.post-card,
.question-card,
.comment-card {
  background: var(--surface);
  padding: 12px 16px 10px;
}

.post-card {
  display: grid;
  gap: 8px;
}

.post-head,
.comment-card,
.answer-author,
.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #b495ff;
}

.avatar.lg {
  width: 68px;
  height: 68px;
}

.avatar.sm {
  width: 24px;
  height: 24px;
}

.author {
  min-width: 0;
}

.name {
  font-size: 16px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time,
.meta,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.post-text {
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  width: 100%;
  padding: 0;
  text-align: left;
  justify-content: flex-start;
}

.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding-top: 4px;
}

.action-btn {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  font-size: 14px;
}

.action-btn .icon {
  width: 21px;
  height: 21px;
}

.action-btn:nth-child(2) {
  justify-content: center;
}

.action-btn:nth-child(3) {
  justify-content: flex-end;
}

.action-btn.active {
  color: #009fb8;
}

.bottom-nav {
  height: 60px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.nav-btn {
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--text);
}

.nav-btn .icon {
  width: 25px;
  height: 25px;
}

.nav-btn.active {
  color: var(--accent);
}

.compose-fab {
  position: absolute;
  right: 16px;
  bottom: 78px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand);
  color: #0f91a6;
  box-shadow: 0 12px 28px rgba(77, 196, 218, 0.32);
  display: grid;
  place-items: center;
}

.compose-fab .icon {
  width: 31px;
  height: 31px;
  stroke-width: 2.1;
}

.qa-tabs {
  display: grid;
  grid-template-columns: 36px repeat(5, 1fr) 36px;
  gap: 0;
  padding: 0 10px;
  overflow: hidden;
}

.qa-tabs button {
  position: relative;
  height: 44px;
  white-space: nowrap;
  font-size: 16px;
  display: grid;
  place-items: center;
  min-width: 0;
}

.qa-tabs .icon-btn {
  width: 36px;
  min-width: 0;
}

.question-card {
  min-height: 104px;
  padding: 9px 16px 8px;
}

.question-open {
  width: 100%;
  text-align: left;
}

.question-title {
  margin: 0 0 5px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 500;
}

.question-excerpt {
  margin: 5px 0 0;
  color: #333;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.question-card .answer-author {
  gap: 7px;
  font-size: 13px;
  line-height: 18px;
}

.question-card .avatar.sm {
  width: 20px;
  height: 20px;
}

.detail-body {
  background: var(--surface);
  padding: 16px;
}

.detail-text {
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.divider {
  height: 1px;
  background: #dcdcdc;
  margin: 12px 0;
}

.comment-card {
  padding: 4px 0 12px;
  align-items: flex-start;
}

.comment-main {
  flex: 1;
}

.comment-like {
  color: var(--muted);
  text-align: center;
  min-width: 36px;
}

.reply-bar {
  height: 60px;
  background: var(--brand);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
}

.reply-bar button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 36px;
  padding: 0;
}

.reply-input {
  flex: 1;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: var(--surface);
  padding: 0 14px;
  min-width: 0;
}

.compose-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.compose-area {
  flex: 1;
  border: 0;
  resize: none;
  padding: 28px 16px;
  outline: none;
  font-size: 15px;
  line-height: 1.55;
}

.compose-tools {
  height: 48px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
}

.compose-tools .icon-btn {
  width: 24px;
  height: 36px;
}

.compose-meta {
  color: var(--muted);
  margin-right: auto;
}

.compose-actions {
  height: 60px;
  background: var(--brand);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
}

.draft-btn {
  height: 40px;
  padding: 0 10px;
}

.search-top {
  height: 72px;
  gap: 12px;
  padding: 0 16px;
}

.search-input {
  flex: 1;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: var(--surface);
  padding: 0 16px;
  outline: none;
  min-width: 0;
}

.search-tabs,
.profile-tabs {
  height: 46px;
  display: grid;
  align-items: center;
  background: var(--surface);
}

.search-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.search-tabs button,
.profile-tabs button {
  position: relative;
  height: 46px;
  color: var(--muted);
  font-size: 16px;
}

.search-tabs button.active,
.profile-tabs button.active {
  color: var(--text);
}

.result-count {
  padding: 14px 16px 8px;
  color: var(--muted);
}

.profile-cover {
  min-height: 284px;
  background-size: cover;
  background-position: center;
  color: #fff;
  position: relative;
  padding: 18px 16px 14px;
}

.profile-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(40, 78, 62, 0.24);
}

.profile-cover > * {
  position: relative;
}

.profile-actions-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

.profile-actions-top .icon-btn {
  color: #fff;
}

.profile-name {
  font-size: 20px;
  margin-bottom: 6px;
}

.profile-bio {
  margin: 18px 0;
  font-size: 14px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

.stat-num {
  font-size: 18px;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.profile-actions button {
  height: 32px;
  min-width: 76px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #fff;
}

.profile-actions .icon-btn {
  min-width: 45px;
  width: 45px;
}

.member-banner {
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--brand);
  font-size: 16px;
}

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

.empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  max-width: calc(100% - 44px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.84);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

@media (max-width: 520px) {
  .phone-shell {
    padding: 0;
    display: block;
  }

  .app-screen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
}
