:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #111827;
  --text-soft: #6b7280;
  --line: #e5e7eb;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --ai: #38bdf8;
  --success: #10b981;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(420px, 680px) 320px;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 36px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

nav a {
  padding: 14px 16px;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
}

nav a.active,
nav a:hover {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.new-post,
.composer-tools button,
.topbar button {
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: white;
  font-weight: 700;
  padding: 13px 20px;
  cursor: pointer;
}

.feed {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: 28px;
  margin: 0;
}

.topbar button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.composer {
  padding: 18px;
  margin-bottom: 18px;
}

.composer-row,
.post-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--ai));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.avatar.pink {
  background: linear-gradient(135deg, #ec4899, #f97316);
}

.composer input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 16px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  color: var(--text-soft);
  font-size: 14px;
}

.composer-tools button {
  margin-left: auto;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.post {
  padding: 18px;
  margin-bottom: 18px;
}

.post-head small {
  display: block;
  color: var(--text-soft);
  margin-top: 2px;
}

.more {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.post p {
  font-size: 16px;
  line-height: 1.7;
}

.chart-placeholder {
  position: relative;
  height: 220px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(99,102,241,0.25), transparent),
    #0f172a;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  font-weight: 700;
}

.chart-line {
  position: absolute;
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, #22d3ee, #6366f1, #f97316);
  transform: rotate(-10deg);
  border-radius: 999px;
  box-shadow: 0 0 30px rgba(99,102,241,0.8);
}

.tags {
  display: flex;
  gap: 14px;
  margin: 14px 0;
}

.tags a {
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 24px;
  color: var(--text-soft);
  padding-top: 8px;
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.search {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  padding: 14px 18px;
}

.right-panel .card {
  padding: 18px;
}

.right-panel h2 {
  font-size: 18px;
  margin: 0 0 16px;
}

.trend-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.trend-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.trend-list span {
  color: var(--text-soft);
  font-size: 13px;
}

.ai-card {
  background: linear-gradient(180deg, #ffffff, #eef2ff);
}

.mini-graph {
  height: 72px;
  margin-top: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(56,189,248,.25));
}

.wallet-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.wallet-card p {
  color: rgba(255,255,255,.8);
}

.balance {
  font-size: 30px;
  font-weight: 800;
}

.balance small {
  font-size: 13px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
    padding-bottom: 90px;
  }

  .sidebar,
  .right-panel {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    background: rgba(248,250,252,.85);
    backdrop-filter: blur(16px);
    z-index: 10;
    padding: 12px 4px;
  }

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 10px;
    backdrop-filter: blur(16px);
  }

  .mobile-nav a {
    text-align: center;
    font-size: 12px;
    color: var(--text-soft);
  }

  .mobile-nav button {
    width: 46px;
    height: 46px;
    margin: auto;
    border: 0;
    border-radius: 50%;
    background: var(--text);
    color: white;
    font-size: 24px;
  }
}
