:root {
  --bg: #121212;
  --bg-elev-1: #1e1e1e;
  --bg-elev-2: #252525;
  --bg-elev-3: #1a1713;
  --brand: #e1a044;
  --brand-soft: rgba(225, 160, 68, 0.14);
  --brand-strong: #f0b45d;
  --text-primary: #f4ede3;
  --text-secondary: #baa996;
  --text-body: #dfd5c8;
  --text-muted: #8f8274;
  --danger: #ee5f4e;
  --success: #70c68a;
  --border: rgba(225, 160, 68, 0.14);
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(225, 160, 68, 0.15), transparent 30%),
    var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

a {
  color: var(--brand);
}

.hidden {
  display: none !important;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background:
    radial-gradient(circle at 50% 18%, rgba(225, 160, 68, 0.18), transparent 34%),
    linear-gradient(180deg, #141414, #101010);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: opacity 0.45s ease;
}

.splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(225, 160, 68, 0.12);
  filter: blur(32px);
}

.splash-boat,
.brand-badge {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #c68131);
  color: #24180d;
  font-weight: 700;
  box-shadow: 0 14px 42px rgba(225, 160, 68, 0.2);
}

.splash-boat {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  font-size: 34px;
  position: relative;
}

.splash-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.splash-subtitle {
  color: var(--text-secondary);
  letter-spacing: 0.18em;
  font-size: 13px;
}

.splash-bar {
  width: 150px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.splash-bar span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  animation: loading 1.5s ease infinite;
}

@keyframes loading {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.auth-screen {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card,
.section-card,
.hero-panel,
.profile-panel,
.post-card,
.timeline-card,
.notice-panel,
.service-hero {
  background: rgba(30, 30, 30, 0.98);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 436px);
  border-radius: var(--radius-xl);
  padding: 28px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 26px;
}

.brand-badge {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  font-size: 30px;
  margin: 0 auto 16px;
}

.auth-brand h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.auth-brand p,
.field span,
.auth-tabs,
.hello-sub,
.section-meta,
.pc-meta,
.help-meta,
.guide-meta,
.timeline-meta,
.profile-meta p,
.profile-meta small,
.empty-state p,
.service-hero p {
  color: var(--text-secondary);
}

.auth-tabs,
.chips,
.hero-actions,
.profile-actions,
.modal-actions,
.topbar-actions,
.bullet-list,
.publication-list {
  display: flex;
  gap: 10px;
}

.auth-tabs {
  margin-bottom: 22px;
}

.auth-tab,
.chip,
.bottom-item,
.bottom-create,
.nav-btn,
.select-chip {
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  font-size: 14px;
  line-height: 1;
}

.nav-text {
  line-height: 1;
}

.auth-tab,
.chip,
.select-chip {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-secondary);
}

.auth-tab {
  flex: 1;
  padding: 12px 16px;
  transition: 0.2s ease;
}

.auth-tab.active,
.chip.active {
  background: var(--brand);
  color: #24180d;
  font-weight: 700;
}

.auth-form,
.modal-form,
.toolbar-block {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
}

.field input,
.field textarea,
.field select,
.select-chip select {
  width: 100%;
  background: var(--bg-elev-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 132px;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.select-chip select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(225, 160, 68, 0.12);
}

.consent-row,
.toggle-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.consent-row {
  color: var(--text-secondary);
  font-size: 13px;
}

.toggle-row {
  justify-content: space-between;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.toggle-row strong {
  display: block;
}

.toggle-row span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.danger-btn:active,
.bottom-item:active,
.bottom-create:active,
.nav-btn:active {
  transform: scale(0.95);
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #24180d;
  font-weight: 700;
}

.secondary-btn,
.ghost-btn {
  background: var(--bg-elev-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.danger-btn {
  background: rgba(238, 95, 78, 0.12);
  color: var(--danger);
  border: 1px solid rgba(238, 95, 78, 0.4);
}

.disabled-btn,
.primary-btn:disabled {
  background: #333 !important;
  color: #888 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(36, 23, 13, 0.25);
  border-top-color: #24180d;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.sidebar {
  display: none;
}

.main-shell {
  min-height: 100vh;
  padding-bottom: 86px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 18px;
  background: rgba(18, 18, 18, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-copy h2 {
  font-size: 22px;
}

.topbar-copy p {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 13px;
}

.topbar-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.select-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 42px;
}

.select-chip span {
  color: var(--text-primary);
  font-size: 13px;
}

.select-chip select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.page {
  display: none;
  padding: 18px;
}

.page.active {
  display: block;
  animation: pageFadeUp 0.28s ease;
}

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

.warm-panel,
.service-hero {
  border-radius: var(--radius-xl);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.warm-panel::before,
.service-hero::before {
  content: "";
  position: absolute;
  inset: -40px auto auto -10px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(225, 160, 68, 0.13);
  filter: blur(24px);
  pointer-events: none;
}

.hero-copy,
.hero-actions,
.section-head,
.service-hero > * {
  position: relative;
}

.hello-line {
  font-size: 30px;
  font-weight: 700;
}

.hello-sub {
  margin-top: 10px;
  font-size: 14px;
}

.hero-actions {
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-actions .primary-btn,
.hero-actions .secondary-btn {
  min-height: 44px;
  font-size: 14px;
}

.section-card {
  margin-top: 18px;
  border-radius: var(--radius-lg);
  padding: 18px;
}

.slim-card {
  margin-top: 18px;
}

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

.inline-head {
  margin: 22px 0 14px;
}

.section-head h3 {
  font-size: 19px;
}

.section-meta {
  font-size: 12px;
}

.bullet-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.bullet-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.bullet-dot {
  color: var(--brand);
  font-weight: 700;
}

.bullet-copy {
  color: var(--text-body);
  font-size: 14px;
}

.no-wrap-scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.no-wrap-scroll::-webkit-scrollbar {
  display: none;
}

.card-grid,
.timeline-list,
.publication-list {
  display: grid;
  gap: 16px;
}

.post-card,
.timeline-card {
  border-radius: 18px;
  overflow: hidden;
}

.post-card > *,
.timeline-card > * {
  padding: 15px 16px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-badge,
.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(225, 160, 68, 0.14);
  color: var(--brand);
  font-weight: 700;
  flex: 0 0 44px;
  line-height: 1;
}

.card-head-copy {
  flex: 1;
}

.card-head-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.pc-meta,
.help-meta,
.guide-meta,
.timeline-meta {
  margin-top: 3px;
  font-size: 12px;
}

.card-type {
  border-radius: var(--radius-pill);
  background: rgba(225, 160, 68, 0.14);
  color: var(--brand);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.card-body h4 {
  font-size: 17px;
  line-height: 1.3;
}

.card-body p {
  margin-top: 8px;
  color: var(--text-body);
}

.card-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-tag {
  font-size: 11px;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  background: var(--bg-elev-2);
  padding: 4px 10px;
  white-space: nowrap;
}

.card-actions {
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
}

.action-btn:hover {
  color: var(--brand);
}

.liked {
  color: var(--danger);
  animation: bounceLike 0.35s ease;
}

@keyframes bounceLike {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.profile-panel {
  border-radius: var(--radius-xl);
  padding: 22px;
  display: grid;
  gap: 18px;
}

.profile-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
  justify-self: center;
}

.profile-meta h3 {
  font-size: 22px;
  line-height: 1.2;
}

.profile-meta p,
.profile-meta small {
  display: block;
  margin-top: 4px;
}

.stats-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-box {
  border-radius: 18px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 18px;
  text-align: center;
}

.stat-box strong {
  display: block;
  color: var(--brand);
  font-size: 24px;
}

.stat-box span {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.publication-item,
.timeline-item {
  border-radius: 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 16px;
}

.publication-item h4,
.timeline-item h4 {
  font-size: 16px;
}

.publication-item p,
.timeline-item p {
  margin-top: 8px;
  color: var(--text-body);
}

.empty-state {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  padding: 34px 18px;
  text-align: center;
}

.empty-state .empty-illustration {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  background: rgba(225, 160, 68, 0.12);
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
}

.empty-state strong {
  display: block;
  font-size: 17px;
}

.empty-state p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.skeleton-card {
  min-height: 158px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg, #1c1c1c 25%, #272727 37%, #1c1c1c 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(30, 30, 30, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 12px 10px;
}

.bottom-item,
.bottom-create,
.nav-btn {
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}

.bottom-item.active,
.nav-btn.active {
  color: var(--brand);
}

.bottom-create {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #24180d;
  font-weight: 700;
}

.modal,
.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.modal-backdrop,
.privacy-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.64);
}

.modal-panel,
.privacy-modal-panel {
  position: relative;
  width: min(100% - 24px, 560px);
  margin: 7vh auto 0;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.modal-panel {
  padding: 20px;
  animation: modalScaleIn 0.25s ease;
}

.composer-panel {
  max-height: 86vh;
  overflow: auto;
}

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

.modal-head,
.privacy-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  color: var(--text-primary);
}

.modal-kind-row {
  margin-bottom: 14px;
}

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

.confirm-panel h3,
.notice-panel h3 {
  font-size: 22px;
}

.confirm-panel p,
.notice-panel p {
  margin-top: 10px;
  color: var(--text-secondary);
}

.privacy-modal-panel {
  margin-top: 10vh;
  padding: 20px;
}

.privacy-title-stack h3 {
  font-size: 24px;
  line-height: 1.25;
}

.privacy-title-stack p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.privacy-lang-switch {
  margin-bottom: 14px;
}

.privacy-scroll {
  max-height: 46vh;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding-right: 4px;
}

.privacy-section {
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}

.privacy-section h4 {
  font-size: 15px;
  margin-bottom: 6px;
}

.privacy-section p {
  color: var(--text-secondary);
  font-size: 13px;
}

.privacy-section ul {
  margin-top: 8px;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 13px;
  display: grid;
  gap: 6px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 102px;
  transform: translateX(-50%);
  z-index: 80;
  min-width: 180px;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid var(--border);
  text-align: center;
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.shake {
  animation: shake 0.28s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-6px); }
  70% { transform: translateX(6px); }
}

@media (min-width: 980px) {
  .app-shell {
    grid-template-columns: 248px 1fr;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px 18px;
    border-right: 1px solid var(--border);
    background: rgba(20, 20, 20, 0.96);
    min-height: 100vh;
    position: sticky;
    top: 0;
  }

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

  .side-nav {
    display: grid;
    gap: 10px;
  }

  .nav-btn {
    text-align: left;
    padding: 12px 14px;
    border: 1px solid transparent;
    justify-content: flex-start;
  }

  .nav-btn.active {
    background: var(--brand-soft);
    border-color: var(--border);
  }

  .sidebar-note {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .sidebar-note span {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 10px;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
  }

  .main-shell {
    padding-bottom: 0;
  }

  .page {
    padding: 24px;
  }

  .bottom-nav {
    display: none;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .privacy-modal-panel {
    width: min(100% - 48px, 820px);
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-copy h2 {
    font-size: 20px;
  }

  .topbar-copy p {
    font-size: 12px;
  }

  .select-chip {
    min-height: 38px;
    padding: 0 10px;
  }

  .select-chip span {
    font-size: 12px;
  }

  .field-grid,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .section-head h3 {
    font-size: 17px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-actions .primary-btn,
  .hero-actions .secondary-btn {
    padding: 12px 8px;
    font-size: 12px;
    gap: 6px;
  }

  .inline-head {
    margin: 18px 0 12px;
  }

  .chip {
    padding: 8px 12px;
    font-size: 12px;
  }

  .card-head {
    align-items: flex-start;
  }

  .card-type {
    padding: 4px 8px;
    font-size: 10px;
  }

  .profile-card {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }

  .profile-avatar {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }

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

  .profile-actions .ghost-btn,
  .profile-actions .danger-btn {
    width: 100%;
    padding: 12px 10px;
    font-size: 13px;
  }

  .bottom-nav {
    gap: 4px;
    padding: 10px 8px;
  }

  .bottom-item,
  .bottom-create {
    gap: 4px;
    padding: 8px 0;
    font-size: 11px;
  }

  .bottom-item .nav-text,
  .bottom-create .nav-text {
    font-size: 11px;
  }

  .modal-panel {
    width: 100%;
    margin-top: auto;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 88vh;
    overflow: auto;
    animation: modalSlideUp 0.25s ease;
  }

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

  .privacy-modal-panel {
    width: min(100% - 20px, 520px);
    margin-top: 8vh;
  }

  .privacy-title-stack h3 {
    font-size: 20px;
  }

  .privacy-title-stack p,
  .privacy-section p,
  .privacy-section ul {
    font-size: 12px;
  }
}
