﻿@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #05070b;
  --bg-strong: #0a0d12;
  --surface: #11151c;
  --surface-2: #171c24;
  --ink: #e6e9ef;
  --muted: #9aa4b2;
  --accent: #1d9bf0;
  --accent-strong: #66b9ff;
  --accent-soft: rgba(29, 155, 240, 0.16);
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  --radius: 22px;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Sora', 'Noto Sans SC', sans-serif;
  background: radial-gradient(circle at 10% 15%, rgba(29, 155, 240, 0.2), transparent 42%),
    radial-gradient(circle at 85% 10%, rgba(86, 232, 211, 0.12), transparent 46%),
    linear-gradient(155deg, var(--bg) 0%, var(--bg-strong) 100%);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
  overflow: hidden;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

.ambient {
  position: fixed;
  inset: -10% 0 0;
  background: radial-gradient(circle at 25% 20%, rgba(29, 155, 240, 0.22), transparent 55%),
    radial-gradient(circle at 75% 0%, rgba(72, 214, 192, 0.14), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.entry-splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 4;
  animation: splashFade var(--splash-duration, 1.2s) ease forwards;
}

.entry-splash.is-hidden {
  display: none;
}

.splash-curtain {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.98), rgba(12, 15, 20, 0.95));
  z-index: 1;
  animation: curtainOpen var(--curtain-duration, 0.85s) ease forwards;
}

.splash-curtain-left {
  left: 0;
  transform: translateX(0);
}

.splash-curtain-right {
  right: 0;
  transform: translateX(0);
}

.splash-bubbles {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.splash-bubble {
  position: absolute;
  left: calc(var(--bubble-x, 50) * 1%);
  top: calc(var(--bubble-y, 50) * 1%);
  transform: translate(-50%, -50%);
  animation: bubbleFloat var(--float-duration, 7s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

.bubble-core {
  width: var(--bubble-size, 120px);
  height: var(--bubble-size, 120px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), rgba(29, 155, 240, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  position: relative;
  opacity: var(--bubble-opacity, 0.88);
  transform: scale(0.6);
  animation: bubblePop 0.55s ease forwards;
  animation-delay: var(--pop-delay, 0s);
}

.bubble-core::after {
  content: '';
  position: absolute;
  inset: -24%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 185, 255, 0.7), transparent 65%);
  opacity: calc(var(--glow-opacity, 0.5) * 0.7);
  filter: blur(12px);
  z-index: -1;
  animation: glowPulse var(--glow-duration, 4s) ease-in-out infinite;
  animation-delay: var(--glow-delay, 0s);
}

.splash-icon {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  display: block;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  height: 100svh;
  max-height: 100svh;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: shellIn 0.6s ease both;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: rgba(12, 15, 20, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d9bf0, #54d2c2);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
}

.app-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: linear-gradient(180deg, rgba(17, 20, 26, 0.98), rgba(10, 12, 16, 0.98));
  min-height: 0;
}

.app-body.is-chat {
  overflow: hidden;
}

.app-body.is-chat .screen.is-active {
  flex: 1;
  min-height: 0;
}

.app-body.is-chat .group-chat-panel {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.app-body.is-chat .group-chat-body {
  min-height: 0;
}

.app-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.screen {
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: screenIn 0.4s ease both;
}

.screen.is-active {
  display: flex;
}

.hero {
  background: linear-gradient(135deg, rgba(29, 155, 240, 0.16), rgba(84, 210, 194, 0.12));
  border: 1px solid rgba(29, 155, 240, 0.35);
  padding: 18px;
  border-radius: var(--radius);
}

.hero-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-subtitle {
  color: var(--muted);
  line-height: 1.5;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tab {
  border: 1px solid transparent;
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
}

.tab.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(29, 155, 240, 0.35);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.field input,
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #0d1117;
  color: var(--ink);
  outline: none;
  resize: none;
}

.field input:focus,
textarea:focus {
  border-color: rgba(29, 155, 240, 0.55);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.15);
}

.primary-btn,
.ghost-btn,
.icon-btn {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(29, 155, 240, 0.25);
}

.primary-btn:hover {
  box-shadow: 0 14px 28px rgba(29, 155, 240, 0.3);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.98);
}

.primary-btn.is-hidden {
  display: none;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0d1117;
  border: 1px solid var(--line);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.auth-message {
  min-height: 18px;
  font-size: 0.85rem;
  color: var(--danger);
}

.auth-message.is-success {
  color: var(--accent-strong);
}

.is-hidden {
  display: none !important;
}

.avatar-upload {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.image-upload {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.image-preview {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: #0d1117;
  background-size: cover;
  background-position: center;
}

.image-preview.has-image {
  border-style: solid;
}

.small-btn {
  padding: 8px 10px;
  font-size: 0.8rem;
  width: fit-content;
}

.avatar-upload input[type='file'] {
  padding: 10px 0;
  border: none;
  background: transparent;
}

.avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  font-weight: 700;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(29, 155, 240, 0.35);
}

.avatar-preview::after {
  content: attr(data-initial);
}

.avatar-preview.has-image::after {
  content: '';
}

.upload-tip {
  font-size: 0.72rem;
  color: var(--muted);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-header.split {
  justify-content: space-between;
}

.section-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(29, 155, 240, 0.3);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent-strong);
  background-size: cover;
  background-position: center;
}

.avatar::after {
  content: attr(data-initial);
}

.avatar.has-image::after {
  content: '';
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  animation: feedRise 0.45s ease both;
  animation-delay: var(--delay, 0ms);
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.feed-name {
  font-weight: 700;
}

.feed-handle,
.feed-time {
  color: var(--muted);
}

.feed-type {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 600;
}

.feed-text {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 8px 0;
}

.feed-image {
  width: 100%;
  border-radius: 14px;
  margin-top: 10px;
  display: block;
  border: 1px solid var(--line);
  object-fit: cover;
}

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

.feed-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.action-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.action-btn.is-active {
  color: var(--accent-strong);
  border-color: rgba(29, 155, 240, 0.4);
  background: var(--accent-soft);
}

.comment-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.feed-muted {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.comment-item .avatar {
  width: 30px;
  height: 30px;
  font-size: 0.7rem;
}

.comment-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.comment-text {
  font-size: 0.85rem;
  color: var(--ink);
  word-break: break-word;
}

.comment-empty {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.comment-form input {
  padding: 10px 12px;
}

.comment-panel {
  margin-top: 10px;
}

.delete-btn {
  border-color: rgba(229, 75, 75, 0.4);
  color: #f26b6b;
}

.user-posts-bio {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.user-posts-stats {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}

.tag-pill {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #0d1117;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.empty-state {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.search-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.search-panel input {
  flex: 1;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.group-panel .group-card {
  padding: 12px;
}

.group-chat-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 60svh;
  flex: 1;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.group-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.group-chat-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.group-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.group-hint {
  min-height: 18px;
  font-size: 0.8rem;
  color: var(--danger);
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
}

.chat-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.chat-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-snippet {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-size: 0.7rem;
  color: var(--muted);
}

.chat-time {
  white-space: nowrap;
}

.chat-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-status {
  font-size: 0.75rem;
  color: var(--accent-strong);
  margin-left: 6px;
  font-weight: 600;
}

.pin-btn {
  padding: 6px 8px;
  font-size: 0.7rem;
}

.group-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
}

.group-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-id {
  font-size: 0.75rem;
  color: var(--muted);
}

.user-posts-sheet {
  max-height: 86svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-posts-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-posts-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 2px;
}

.user-posts-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.user-posts-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}

.group-chat-sheet {
  max-height: 86svh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.group-chat-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  min-height: 0;
}

@supports (scrollbar-width: none) {
  .app-body,
  .user-posts-body {
    scrollbar-width: none;
  }
}

.group-chat-body.chat-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 185, 255, 0.65) transparent;
}

.group-chat-body.chat-scroll::-webkit-scrollbar {
  width: 6px;
}

.group-chat-body.chat-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.group-chat-body.chat-scroll::-webkit-scrollbar-thumb {
  background: rgba(102, 185, 255, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.group-chat-body.chat-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 185, 255, 0.75);
}

.group-message {
  display: block;
}

.group-message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.group-message.is-me .group-message-row {
  flex-direction: row-reverse;
}

.group-message-avatar {
  flex: 0 0 auto;
}

.group-message-avatar .avatar {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
}

.group-message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 74%;
}

.group-message.is-me .group-message-content {
  align-items: flex-end;
}

.group-message-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.group-message.is-me .group-message-meta {
  text-align: right;
}

.group-message-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  max-width: 100%;
  word-break: break-word;
}

.group-message.is-me .group-message-bubble {
  background: var(--accent-soft);
  border-color: rgba(29, 155, 240, 0.4);
  color: var(--ink);
}

.group-chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.search-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.follow-btn {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.follow-btn.is-following {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 60px;
  height: 60px;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-message {
  min-height: 18px;
  font-size: 0.85rem;
  color: var(--danger);
}

.profile-message.is-success {
  color: var(--accent-strong);
}

.danger-btn {
  border-color: rgba(229, 75, 75, 0.35);
  color: var(--danger);
}

.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(10, 12, 16, 0.92);
}


.nav-item {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav-item.compose {
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.nav-item.compose .compose-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  z-index: 5;
}

.sheet {
  width: min(100%, 430px);
  background: var(--surface);
  border-radius: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: sheetUp 0.35s ease both;
}

.sheet-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.sheet-text {
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.compose-sheet {
  max-height: 86svh;
  overflow-y: auto;
}

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

.sheet-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
}

.compose-stage {
  font-weight: 600;
  margin-bottom: 10px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.option-btn {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0d1117;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}

.option-btn.is-selected {
  background: var(--accent-soft);
  border-color: rgba(29, 155, 240, 0.4);
  color: var(--accent-strong);
}

.tag-panel {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0d1117;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--muted);
}

.tag-btn.is-selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(29, 155, 240, 0.4);
}

.tag-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.note-panel {
  margin-top: 16px;
}

#composeNote {
  height: 120px;
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.compose-hint {
  margin-top: 8px;
  color: var(--danger);
  min-height: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 6;
}

.toast.is-visible {
  opacity: 1;
}

@media (max-width: 520px) {
  body {
    padding: 0;
  }

  .app-shell {
    border-radius: 0;
    border: none;
  }
}

@keyframes shellIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheetUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes feedRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bubblePop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.05);
    opacity: var(--bubble-opacity, 0.88);
  }
  100% {
    transform: scale(1);
    opacity: var(--bubble-opacity, 0.88);
  }
}

@keyframes bubbleFloat {
  0%,
  100% {
    transform: translate(-50%, -50%) translate(0, 0);
  }
  50% {
    transform: translate(-50%, -50%) translate(var(--float-x, 0px), var(--float-y, 0px));
  }
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: calc(var(--glow-opacity, 0.5) * 0.55);
  }
  50% {
    opacity: calc(var(--glow-opacity, 0.5) * 0.95);
  }
}

@keyframes splashFade {
  0% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes curtainOpen {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(var(--curtain-dir) * 100%));
  }
}

.splash-curtain-left {
  --curtain-dir: -1;
}

.splash-curtain-right {
  --curtain-dir: 1;
}

@media (prefers-reduced-motion: reduce) {
  .entry-splash {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
