/* ===========================
   기본 리셋 & 변수
   =========================== */
:root {
  --bg: #080c18;
  --bg2: #0f1629;
  --card: #131c30;
  --card2: #1a2540;
  --border: #1e2d4a;
  --text: #e8eef8;
  --text2: #8a9bbf;
  --text3: #4a5a78;
  --green: #00e676;
  --green2: #1de9b6;
  --red: #ff5252;
  --red2: #ff6b6b;
  --blue: #448aff;
  --blue2: #82b1ff;
  --yellow: #ffd740;
  --purple: #e040fb;
  --accent: #00b0ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.25s ease;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ===========================
   헤더
   =========================== */
header {
  background: linear-gradient(180deg, #0a1020 0%, var(--bg2) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 24px;
  color: var(--accent);
  animation: spin 8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--green2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 11px;
  color: var(--text3);
  margin-left: 4px;
  align-self: flex-end;
  margin-bottom: 2px;
}

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

.update-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
}

.dot.live {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.refresh-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}

.refresh-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 티커 */
.ticker-wrap {
  overflow: hidden;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 6px 0;
}

.ticker-track {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  animation: scroll 40s linear infinite;
  padding: 0 24px;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.ticker-name { color: var(--text2); }
.ticker-price { color: var(--text); }
.ticker-pct.up { color: var(--green); }
.ticker-pct.down { color: var(--red); }
.ticker-loading { color: var(--text2); font-size: 12px; }

/* ===========================
   탭 네비게이션
   =========================== */
.tab-nav {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text2);
  padding: 14px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }

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

/* ===========================
   메인 레이아웃
   =========================== */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.section { margin-bottom: 32px; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===========================
   시장 요약 배너
   =========================== */
.market-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
}

.summary-card:hover {
  border-color: var(--accent);
  background: var(--card2);
}

.s-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.s-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.s-change {
  font-size: 13px;
  font-weight: 600;
}

.s-change.up { color: var(--green); }
.s-change.down { color: var(--red); }

/* ===========================
   TOP 3 추천
   =========================== */
.top3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.top3-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.top3-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.top3-card.rank-1::before { background: linear-gradient(90deg, #ffd700, #ffb300); }
.top3-card.rank-2::before { background: linear-gradient(90deg, #c0c0c0, #9e9e9e); }
.top3-card.rank-3::before { background: linear-gradient(90deg, #cd7f32, #bf6a0a); }

.top3-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.top3-rank {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 8px;
}

.top3-rank .medal {
  font-size: 16px;
  margin-right: 4px;
}

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

.top3-price {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 12px;
}

.top3-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.score-strong-buy { background: rgba(0,230,118,0.15); color: var(--green); border: 1px solid rgba(0,230,118,0.3); }
.score-buy { background: rgba(0,176,255,0.15); color: var(--accent); border: 1px solid rgba(0,176,255,0.3); }
.score-hold { background: rgba(255,215,64,0.15); color: var(--yellow); border: 1px solid rgba(255,215,64,0.3); }
.score-sell { background: rgba(255,82,82,0.15); color: var(--red); border: 1px solid rgba(255,82,82,0.3); }
.score-strong-sell { background: rgba(255,82,82,0.2); color: var(--red2); border: 1px solid rgba(255,82,82,0.4); }

.top3-reason {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

/* ===========================
   자산 카드 그리드
   =========================== */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.asset-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.asset-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--blue);
  background: var(--card2);
}

.asset-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.asset-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}

.asset-change-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-up { background: rgba(0,230,118,0.12); color: var(--green); }
.badge-down { background: rgba(255,82,82,0.12); color: var(--red); }

.asset-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.asset-symbol {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 8px;
}

.asset-price {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.asset-price-unit {
  font-size: 12px;
  color: var(--text3);
  font-weight: 400;
}

/* 미니 스파크라인 */
.sparkline-container {
  height: 48px;
  margin: 8px 0;
}

.asset-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
  margin-top: 8px;
}

.asset-signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 8px;
}

/* ===========================
   필터 바
   =========================== */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}

.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===========================
   스켈레톤 로딩
   =========================== */
.skeleton { pointer-events: none; }

.sk-box {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  height: 80px;
}

.sk-box.tall { height: 160px; }

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

/* ===========================
   추천 그리드
   =========================== */
.rec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rec-date {
  font-size: 12px;
  color: var(--text3);
}

.rec-disclaimer {
  background: rgba(255,215,64,0.08);
  border: 1px solid rgba(255,215,64,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: #c8a200;
  margin-bottom: 20px;
  line-height: 1.5;
}

.rec-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  grid-template-columns: 60px 200px 1fr auto;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.rec-card:hover {
  border-color: var(--accent);
  background: var(--card2);
  transform: translateX(4px);
}

.rec-rank-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
}

.rec-info .rec-name {
  font-size: 16px;
  font-weight: 700;
}

.rec-info .rec-sub {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}

.rec-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.indicator-chip {
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--card2);
  border: 1px solid var(--border);
}

.rec-action {
  text-align: right;
  flex-shrink: 0;
}

.rec-signal-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.rec-period {
  font-size: 11px;
  color: var(--text3);
  text-align: right;
}

/* ===========================
   추천 상세 설명
   =========================== */
.rec-summary {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
  border-radius: 0 0 var(--radius) var(--radius);
  display: none;
}

.rec-card:hover + .rec-summary,
.rec-summary:hover,
.rec-summary.open {
  display: block;
}

.rec-summary p {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 6px;
}

.rec-summary p:last-child { margin-bottom: 0; }

.rec-summary p:last-child {
  color: var(--text);
  font-weight: 500;
}

/* 항상 펼쳐져 보이도록 (카드와 같이 래핑) */
.rec-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.rec-item:hover {
  border-color: var(--accent);
}

.rec-item .rec-card {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

.rec-item .rec-card:hover {
  transform: none;
}

/* 모달 상세 분석 */
.modal-summary-card {
  margin-top: 4px;
}

.modal-summary-text p {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.8;
  margin-top: 8px;
  padding-left: 4px;
  border-left: 2px solid var(--border);
  padding-left: 10px;
}

.modal-summary-text p:last-child {
  color: var(--text);
  font-weight: 600;
  border-left-color: var(--accent);
}

/* ===========================
   데이터 주석
   =========================== */
.data-note {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text3);
  padding: 8px 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ===========================
   모달 (상세 차트)
   =========================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.modal-title-group {}

.modal-title {
  font-size: 22px;
  font-weight: 800;
}

.modal-symbol {
  font-size: 12px;
  color: var(--text3);
}

.modal-price-group {
  text-align: right;
}

.modal-price {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.modal-change {
  font-size: 14px;
  font-weight: 600;
}

.modal-close {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: var(--transition);
}

.modal-close:hover { background: var(--red); color: #fff; border-color: var(--red); }

.period-btns {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.period-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 5px 14px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}

.period-btn:hover { border-color: var(--accent); color: var(--text); }
.period-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.chart-container {
  position: relative;
  height: 320px;
  margin-bottom: 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
}

.modal-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.indicator-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.indicator-label {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.indicator-value {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.indicator-desc {
  font-size: 11px;
  color: var(--text2);
}

.indicator-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.indicator-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ===========================
   RSI 게이지
   =========================== */
.rsi-gauge {
  position: relative;
  height: 8px;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  border-radius: 4px;
  margin-top: 8px;
}

.rsi-marker {
  position: absolute;
  top: -3px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  border: 2px solid var(--bg2);
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: left 0.5s ease;
}

/* ===========================
   로그인 모달
   =========================== */
.login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-overlay.open { display: flex; }

.login-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.login-modal .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
}

.login-desc {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 28px;
  line-height: 1.6;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #fff;
  color: #1f1f1f;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.google-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}

.google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-terms {
  font-size: 11px;
  color: var(--text3);
  margin-top: 16px;
  line-height: 1.5;
}

/* ===========================
   헤더 유저 영역
   =========================== */
.login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.login-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  transition: var(--transition);
}

.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ===========================
   별 버튼 (관심종목)
   =========================== */
.star-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}

.star-btn:hover { color: var(--yellow); transform: scale(1.2); }
.star-btn.starred { color: var(--yellow); }

/* 모달 별 버튼 */
.modal-star-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-star-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.modal-star-btn.starred { color: var(--yellow); border-color: var(--yellow); background: rgba(255,215,64,0.1); }

/* ===========================
   관심종목 탭
   =========================== */
.watchlist-tab { position: relative; }

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

.watchlist-count {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 2px;
}

.watchlist-login-prompt,
.watchlist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  text-align: center;
}

.empty-icon { font-size: 48px; }

.watchlist-login-prompt p,
.watchlist-empty p {
  color: var(--text2);
  font-size: 15px;
}

.empty-sub {
  color: var(--text3) !important;
  font-size: 13px !important;
}

/* ===========================
   뉴스
   =========================== */

/* 뉴스 탭 - 자산별 블록 */
.news-asset-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--card);
}

.news-asset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--transition);
  background: var(--card2);
}

.news-asset-header:hover { background: var(--border); }

.news-asset-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.news-asset-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

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

.news-asset-symbol {
  font-size: 11px;
  color: var(--text3);
  margin-left: 2px;
}

.news-toggle-icon {
  font-size: 14px;
  color: var(--text3);
  transition: transform var(--transition);
}

/* 뉴스 목록 */
.news-list {
  padding: 4px 0;
}

.news-item {
  display: block;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
  cursor: pointer;
}

.news-item:last-child { border-bottom: none; }

.news-item:hover {
  background: var(--card2);
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.news-source {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0,176,255,0.1);
  padding: 2px 7px;
  border-radius: 8px;
}

.news-time {
  font-size: 11px;
  color: var(--text3);
}

.news-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item:hover .news-title { color: var(--accent); }

.news-empty {
  padding: 20px 18px;
  color: var(--text3);
  font-size: 13px;
}

/* 뉴스 스켈레톤 */
.skeleton-news {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.sk-line {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  display: block;
}

/* 모달 뉴스 섹션 */
.modal-news-section {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.modal-news-title {
  font-size: 14px;
  font-weight: 700;
  padding: 12px 18px;
  background: var(--card2);
  border-bottom: 1px solid var(--border);
}

/* ===========================
   마이페이지
   =========================== */
.mypage-login-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  text-align: center;
}

/* 프로필 히어로 */
.mypage-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 28px;
}

.mypage-profile-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.mypage-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.mypage-profile-info {
  flex: 1;
}

.mypage-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.mypage-email {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 3px;
}

.mypage-joined {
  font-size: 12px;
  color: var(--text3);
}

.logout-btn-lg {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  white-space: nowrap;
}

.logout-btn-lg:hover {
  border-color: var(--red);
  color: var(--red);
}

/* 통계 */
.mypage-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.mypage-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: var(--bg2);
  border-radius: var(--radius-sm);
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 마이페이지 섹션 헤더 */
.mypage-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* 관심종목 테이블 */
.watchlist-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.watchlist-table thead tr {
  background: var(--card2);
  border-bottom: 1px solid var(--border);
}

.watchlist-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  white-space: nowrap;
}

.watchlist-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.watchlist-table tbody tr:last-child td { border-bottom: none; }

.watchlist-table tbody tr {
  background: var(--card);
  transition: background var(--transition);
}

.watchlist-table tbody tr:hover { background: var(--card2); }

/* 종목 셀 */
.wl-asset {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.wl-asset:hover .wl-name { color: var(--accent); }

.wl-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.wl-name {
  font-size: 14px;
  font-weight: 700;
  transition: color var(--transition);
}

.wl-symbol {
  font-size: 11px;
  color: var(--text3);
}

.wl-price  { font-weight: 700; white-space: nowrap; }
.wl-change { font-weight: 600; white-space: nowrap; }
.wl-date   { font-size: 12px; color: var(--text3); white-space: nowrap; }

/* 메모 셀 */
.wl-note-cell {
  min-width: 180px;
  max-width: 260px;
  position: relative;
}

.note-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  padding: 7px 10px;
  resize: none;
  min-height: 56px;
  line-height: 1.5;
  font-family: inherit;
  transition: border-color var(--transition);
}

.note-input:focus {
  outline: none;
  border-color: var(--accent);
}

.note-input::placeholder { color: var(--text3); }

.note-saved {
  display: block;
  font-size: 10px;
  margin-top: 3px;
  height: 14px;
  transition: color var(--transition);
}

.note-saved.saving { color: var(--text3); }
.note-saved.saved  { color: var(--green); }
.note-saved.error  { color: var(--red); }

/* 제거 버튼 */
.wl-remove-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.wl-remove-btn:hover {
  background: rgba(255,82,82,0.1);
  border-color: var(--red);
  color: var(--red);
}

@media (max-width: 768px) {
  .mypage-stats-row { grid-template-columns: repeat(2, 1fr); }
  .mypage-profile-row { flex-wrap: wrap; }
  .logout-btn-lg { width: 100%; text-align: center; }
}

/* ===========================
   토스트 알림
   =========================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 22px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 3000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===========================
   푸터
   =========================== */
footer {
  text-align: center;
  padding: 24px;
  color: var(--text3);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ===========================
   반응형
   =========================== */
@media (max-width: 1024px) {
  .market-summary { grid-template-columns: repeat(2, 1fr); }
  .top3-grid { grid-template-columns: 1fr; }
  .rec-card { grid-template-columns: 48px 1fr; grid-template-rows: auto auto; }
  .rec-indicators { grid-column: 1 / -1; }
  .rec-action { grid-column: 2; }
}

@media (max-width: 768px) {
  main { padding: 16px; }
  .header-inner { padding: 10px 16px; }
  .tab-nav { padding: 0 8px; }
  .tab-btn { padding: 12px 14px; font-size: 13px; }
  .market-summary { grid-template-columns: repeat(2, 1fr); }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
  .logo-sub { display: none; }
}

@media (max-width: 480px) {
  .market-summary { grid-template-columns: 1fr 1fr; }
  .asset-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 16px; }
  .modal-header { flex-wrap: wrap; }
  .period-btns { flex-wrap: wrap; }
}

/* ===========================
   스크롤바
   =========================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ===========================
   유틸
   =========================== */
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }
.neutral { color: var(--yellow) !important; }

.type-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.type-crypto { background: rgba(224,64,251,0.15); color: var(--purple); }
.type-us { background: rgba(68,138,255,0.15); color: var(--blue); }
.type-kr { background: rgba(0,230,118,0.15); color: var(--green); }
