:root {
  --bg: #ede2cf;
  --bg-deep: #d8c6a6;
  --paper: rgba(255, 251, 244, 0.94);
  --paper-strong: rgba(255, 255, 255, 0.86);
  --ink: #1a1610;
  --muted: #756956;
  --line: rgba(32, 23, 13, 0.11);
  --accent: #1f5446;
  --accent-soft: #dbe9e3;
  --danger: #a53a2f;
  --danger-soft: #f1d9d3;
  --shadow: 0 24px 80px rgba(44, 29, 11, 0.12);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 28%),
    radial-gradient(circle at bottom right, rgba(139, 96, 54, 0.16), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
}

.sidebar,
.profile-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(247, 237, 223, 0.9));
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px;
  border-radius: 30px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.sidebar-brand {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(25, 21, 16, 0.92);
  color: #fff7ee;
  font-family: var(--serif);
  font-size: 24px;
}

.menu-group {
  display: grid;
  gap: 8px;
}

.menu-title {
  padding: 4px 4px 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-item,
.nav-button,
.action-button {
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.78);
  border-radius: 999px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.menu-item {
  min-height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  color: var(--ink);
  cursor: pointer;
}

.menu-item strong {
  color: var(--muted);
}

.menu-item.active {
  background: rgba(31, 84, 70, 0.95);
  color: #fff9f2;
  border-color: transparent;
}

.menu-item.active strong {
  color: rgba(255, 249, 242, 0.76);
}

.menu-item.placeholder {
  color: rgba(117, 105, 86, 0.7);
  cursor: default;
}

.main-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 16px;
  align-items: center;
}

.status-strip {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-strip span {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.78);
  color: var(--muted);
}

.card-stage {
  min-height: calc(100vh - 36px - 88px);
}

.profile-card {
  min-height: 100%;
  padding: 26px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  position: relative;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.28), transparent 40%),
    linear-gradient(180deg, transparent, rgba(44, 29, 11, 0.03));
  pointer-events: none;
}

.profile-head,
.action-ribbon,
.bio,
.tweet-list {
  position: relative;
  z-index: 1;
}

.profile-head {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.avatar {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.08);
}

.identity h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.identity a {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  text-decoration: none;
}

.action-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.action-ribbon::-webkit-scrollbar {
  display: none;
}

.bio {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: clamp(18px, 2vw, 24px);
}

.tweet-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.tweet-item {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(32, 23, 13, 0.08);
  background: rgba(255, 255, 255, 0.52);
  display: grid;
  gap: 10px;
}

.tweet-item p {
  margin: 0;
  line-height: 1.7;
  color: #2e261b;
}

.tweet-item.tweet-placeholder {
  min-height: 92px;
  place-items: center;
}

.tweet-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.tweet-link {
  color: var(--accent);
  text-decoration: none;
}

.list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.nav-button,
.action-button {
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(44, 29, 11, 0.08);
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 14px;
}

.nav-button {
  width: 60px;
  font-size: 22px;
}

.action-button.list-button {
  background: var(--accent-soft);
  color: var(--accent);
}

.action-button.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.action-button:disabled,
.menu-item:disabled {
  opacity: 0.5;
}

.loading-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(24, 19, 13, 0.2);
  backdrop-filter: blur(10px);
  z-index: 20;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loading-mask.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-card {
  min-width: 180px;
  padding: 18px 24px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
  font-family: var(--serif);
  font-size: 28px;
}

.is-entering {
  animation: card-slide 260ms ease;
}

@keyframes card-slide {
  from {
    transform: translateX(18px) translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

.menu-item:hover:not(:disabled),
.nav-button:hover,
.action-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(44, 29, 11, 0.12);
}

.menu-item:active:not(:disabled),
.nav-button:active,
.action-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .sidebar-brand {
    align-self: center;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
    gap: 14px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 52px 1fr 52px;
    gap: 10px;
  }

  .profile-card {
    padding: 20px;
  }

  .profile-head {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .avatar {
    width: 72px;
    height: 72px;
  }

  .identity h1 {
    font-size: 32px;
  }

  .action-ribbon {
    padding-bottom: 2px;
  }
}
