:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-hover: #21262d;
  --bg-input: #0d1117;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --accent-yellow: #d29922;
  --accent-orange: #db6d28;
  --accent-purple: #bc8cff;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
}

.handle {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 14px;
}

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

.header-right {
  display: flex;
  gap: 8px;
}

.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Nav */
.nav-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 81px;
  z-index: 99;
  overflow-x: auto;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  padding: 0 24px;
}

.nav-tab {
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Main */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.view { display: none; }
.view.active { display: block; }

.section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Stat Cards Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: var(--accent-blue);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Summary Card */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  border-left: 3px solid var(--accent-blue);
}

.summary-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}

/* Trading System Layers */
.system-layers {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.layer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  transition: border-color 0.2s;
}

.layer-card:hover {
  border-color: var(--accent-blue);
}

.layer-left {
  text-align: center;
}

.layer-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.layer-en {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.layer-pct {
  font-size: 20px;
  font-weight: 700;
  margin-top: 8px;
}

.layer-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.layer-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

.layer-quote {
  background: var(--bg-primary);
  border-left: 3px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
}

.layer-quote .quote-date {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  margin-top: 4px;
}

/* Strategy Cards */
.strategies-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.strategy-card:hover {
  border-color: var(--accent-blue);
}

.strategy-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.strategy-header:hover {
  background: var(--bg-hover);
}

.strategy-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.strategy-icon {
  font-size: 28px;
}

.strategy-name {
  font-size: 16px;
  font-weight: 600;
}

.strategy-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.strategy-result {
  font-size: 13px;
  color: var(--accent-green);
  font-weight: 500;
}

.strategy-chevron {
  color: var(--text-muted);
  font-size: 18px;
  transition: transform 0.2s;
}

.strategy-card.expanded .strategy-chevron {
  transform: rotate(180deg);
}

.strategy-body {
  display: none;
  padding: 0 24px 24px;
  border-top: 1px solid var(--border);
}

.strategy-card.expanded .strategy-body {
  display: block;
  padding-top: 20px;
}

.strategy-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.strategy-principles {
  list-style: none;
  margin-bottom: 20px;
}

.strategy-principles li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-hover);
}

.strategy-principles li::before {
  content: "→ ";
  color: var(--accent-blue);
}

.quote-block {
  background: var(--bg-primary);
  border-left: 3px solid var(--accent-blue);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.quote-block .quote-date {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 6px;
}

/* Philosophy Grid */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.phil-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.phil-card:hover {
  border-color: var(--accent-purple);
}

.phil-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.phil-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.phil-title-en {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.phil-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.phil-quote {
  background: var(--bg-primary);
  border-left: 3px solid var(--accent-purple);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Track Record */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  max-height: 360px;
}

.trades-section {
  margin-bottom: 32px;
}

.trades-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.trade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.2s;
}

.trade-card:hover {
  border-color: var(--accent-blue);
}

.trade-card.success {
  border-left: 3px solid var(--accent-green);
}

.trade-card.loss {
  border-left: 3px solid var(--accent-red);
}

.trade-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trade-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.trade-detail {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.trade-pnl {
  font-size: 13px;
  font-weight: 600;
}

.trade-pnl.positive { color: var(--accent-green); }
.trade-pnl.negative { color: var(--accent-red); }

/* Predictions */
.predictions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.pred-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.pred-card.success { border-left: 3px solid var(--accent-green); }
.pred-card.fail { border-left: 3px solid var(--accent-red); }

.pred-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 8px;
}

.pred-card.success .pred-badge {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
}

.pred-card.fail .pred-badge {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
}

.pred-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.pred-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pred-detail {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Market Views */
.market-views {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
}

.mv-card:hover {
  border-color: var(--accent-blue);
}

.mv-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mv-icon { font-size: 24px; }

.mv-asset {
  font-size: 16px;
  font-weight: 600;
}

.mv-view {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.mv-quote {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* Top Tweets */
.tweet-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tweet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.tweet-card:hover {
  border-color: var(--accent-blue);
}

.tweet-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tweet-text {
  font-size: 14px;
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: 1.7;
  margin-bottom: 12px;
}

.tweet-metrics {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.tweet-metrics span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-icon { font-size: 14px; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--border);
  margin-bottom: 32px;
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid var(--bg-primary);
}

.timeline-year {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 4px;
}

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

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 48px;
}

/* ===== ALL TWEETS FEED (Twitter-style) ===== */

.feed-header-bar {
  margin-bottom: 16px;
}

.feed-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.feed-page-title {
  font-size: 22px;
  font-weight: 700;
}

.feed-stats-mini {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.feed-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-search-box {
  flex: 1;
  position: relative;
}

.feed-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

#feed-search {
  width: 100%;
  padding: 10px 12px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#feed-search:focus {
  border-color: var(--accent-blue);
}

#feed-search::placeholder {
  color: var(--text-muted);
}

.feed-counter {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Tweet feed timeline */
.feed-timeline {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feed-tweet {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: default;
}

.feed-tweet:hover {
  background: var(--bg-hover);
}

.feed-tweet:last-child {
  border-bottom: none;
}

.feed-tweet-left {
  flex-shrink: 0;
}

.feed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.feed-tweet-right {
  flex: 1;
  min-width: 0;
}

.feed-tweet-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.feed-name {
  font-weight: 700;
  font-size: 14px;
}

.feed-handle {
  color: var(--text-muted);
  font-size: 14px;
}

.feed-dot {
  color: var(--text-muted);
  font-size: 14px;
}

.feed-time {
  color: var(--text-muted);
  font-size: 14px;
}

.feed-tweet-body {
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
  margin-bottom: 10px;
}

/* Tweet action bar */
.feed-tweet-actions {
  display: flex;
  gap: 0;
  justify-content: space-between;
  max-width: 400px;
}

.feed-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 20px;
  transition: all 0.15s;
  cursor: default;
}

.feed-action svg {
  flex-shrink: 0;
}

.feed-action.reply:hover { color: var(--accent-blue); background: rgba(88,166,255,0.1); }
.feed-action.retweet:hover { color: var(--accent-green); background: rgba(63,185,80,0.1); }
.feed-action.like:hover { color: #f91880; background: rgba(249,24,128,0.1); }
.feed-action.views:hover { color: var(--accent-blue); background: rgba(88,166,255,0.1); }

/* Loading spinner */
.feed-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.feed-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    flex-wrap: wrap;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .philosophy-grid,
  .trade-cards {
    grid-template-columns: 1fr;
  }

  .predictions-grid,
  .market-views {
    grid-template-columns: 1fr;
  }

  .layer-card {
    grid-template-columns: 1fr;
  }

  .nav-content {
    padding: 0 12px;
  }

  .nav-tab {
    padding: 10px 12px;
    font-size: 12px;
  }

  .main {
    padding: 16px;
  }

  .feed-title-row {
    flex-direction: column;
    gap: 4px;
  }

  .feed-tweet-actions {
    max-width: 100%;
  }
}
