* { margin: 0; padding: 0; box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #f0f9ff;
  --bg: #f0f4f8;
  --bg2: #ffffff;
  --text: #1a1a2e;
  --text2: #555;
  --text3: #999;
  --border: #e0e0e0;
  --sidebar-w: 220px;
  --accent: #f59e0b;
  --hot: #ef4444;
}
body { font-family: 'Apple SD Gothic Neo','Malgun Gothic','Noto Sans KR',sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

/* TOP BAR */
.topbar { background: #0c1a2e; color: #aaa; font-size: 12px; padding: 5px 0; border-bottom: 1px solid #1e3a5f; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 12px; display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: #aaa; } .topbar a:hover { color: #fff; }
.topbar-links { display: flex; gap: 14px; }
.topbar-links a::before { content: '·'; margin-right: 14px; color: #333; }
.topbar-links a:first-child::before { content: ''; margin-right: 0; }

/* HEADER */
header { background: #fff; border-bottom: 2px solid var(--primary); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 0 12px; display: flex; align-items: center; gap: 20px; height: 54px; }
.logo { font-size: 22px; font-weight: 900; color: var(--primary); letter-spacing: -1px; white-space: nowrap; flex-shrink: 0; }
.logo em { color: var(--accent); font-style: normal; }
.search-bar { flex: 1; max-width: 500px; display: flex; border: 1.5px solid var(--border); border-radius: 4px; overflow: hidden; }
.search-bar input { flex: 1; border: none; outline: none; padding: 7px 12px; font-size: 13px; background: #fafafa; }
.search-bar button { background: var(--primary); border: none; color: #fff; padding: 0 14px; cursor: pointer; font-size: 16px; }
.header-actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; align-items: center; }
.btn-sm { padding: 5px 12px; border-radius: 3px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--text2); }
.btn-sm.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.write-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; padding: 5px 10px; border-radius: 3px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; flex-shrink: 0; }

/* GNB */
.gnb { background: var(--primary); }
.gnb-inner { max-width: 1280px; margin: 0 auto; padding: 0 12px; display: flex; align-items: center; overflow-x: auto; scrollbar-width: none; }
.gnb-inner::-webkit-scrollbar { display: none; }
.gnb-item { padding: 9px 16px; color: rgba(255,255,255,0.88); font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 5px; border-bottom: 2px solid transparent; transition: background 0.15s; white-space: nowrap; flex-shrink: 0; }
.gnb-item:hover { background: rgba(255,255,255,0.12); color: #fff; }
.gnb-item.active { background: rgba(0,0,0,0.15); color: #fff; border-bottom-color: #fff; }
.gnb-item i { font-size: 15px; }

/* TICKER */
.ticker { background: #f0f9ff; border-bottom: 1px solid #bae6fd; padding: 6px 0; overflow: hidden; }
.ticker-inner { max-width: 1280px; margin: 0 auto; padding: 0 12px; display: flex; align-items: center; gap: 12px; }
.ticker-label { background: var(--hot); color: #fff; padding: 2px 8px; border-radius: 2px; font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.ticker-mask { flex: 1; overflow: hidden; }
.ticker-track { display: inline-flex; gap: 24px; white-space: nowrap; will-change: transform; animation: ticker-scroll 32s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
.ticker-item { font-size: 12px; color: var(--text2); flex-shrink: 0; }
.ticker-item .hot { color: var(--hot); font-weight: 600; }

/* LAYOUT */
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 14px 12px; display: grid; grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-w); gap: 12px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 10px; }
.widget { background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.widget-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--border); background: #fafafa; }
.widget-head .title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 5px; }
.widget-head .title i { color: var(--primary); font-size: 15px; }
.widget-head .more { font-size: 11px; color: var(--text3); }
.widget-body { padding: 8px 0; }

.cat-list { list-style: none; }
.cat-list li a { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; font-size: 13px; color: var(--text2); transition: background 0.1s; cursor: pointer; }
.cat-list li a:hover { background: var(--primary-light); color: var(--primary); }
.cat-list li.active a { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.cat-list .cnt { background: #f0f0f0; color: var(--text3); font-size: 10px; padding: 1px 6px; border-radius: 10px; min-width: 24px; text-align: center; }
.cat-list li.active .cnt { background: var(--primary); color: #fff; }

.popular-list { list-style: none; }
.popular-list li { display: flex; align-items: flex-start; gap: 8px; padding: 7px 12px; border-bottom: 1px solid #f5f5f5; }
.popular-list li:last-child { border-bottom: none; }
.pop-rank { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 16px; flex-shrink: 0; }
.pop-rank.gray { color: var(--text3); }
.popular-list .pop-title { font-size: 12px; color: var(--text); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; cursor: pointer; }
.popular-list .pop-title:hover { color: var(--primary); }

.source-list { list-style: none; }
.source-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; border-bottom: 1px solid #f5f5f5; font-size: 12px; }
.source-item:last-child { border-bottom: none; }
.source-name { display: flex; align-items: center; gap: 6px; color: var(--text2); }
.source-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.source-status { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 2px; }
.source-status.live { background: #d1fae5; color: #065f46; }

.ad-box { background: #f9f9f9; border: 1px dashed #ddd; border-radius: 4px; height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #bbb; font-size: 12px; gap: 6px; }
.ad-box i { font-size: 28px; color: #ddd; }

/* CENTER */
.center { display: flex; flex-direction: column; gap: 10px; }
.banner-slot { background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%); border-radius: 6px; overflow: hidden; height: 90px; display: flex; align-items: center; padding: 0 24px; gap: 16px; position: relative; }
.banner-slot .b-text { color: #fff; }
.banner-slot .b-title { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
.banner-slot .b-sub { font-size: 13px; color: rgba(255,255,255,0.75); margin-top: 4px; }
.banner-slot .b-btn { margin-left: auto; background: #fff; color: var(--primary); padding: 8px 18px; border-radius: 4px; font-size: 13px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.banner-deco { position: absolute; right: 120px; top: 50%; transform: translateY(-50%); font-size: 52px; opacity: 0.15; }

.notice-bar { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 8px 14px; display: flex; align-items: center; gap: 10px; }
.notice-tag { background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 2px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.notice-text { font-size: 13px; color: var(--text2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.notice-time { font-size: 11px; color: var(--text3); flex-shrink: 0; margin-left: auto; }

/* FEATURED GRID */
.featured-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: auto auto; gap: 8px; }
.issue-card { border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; background: #1a1a2e; }
.issue-card.big { grid-row: 1 / 3; min-height: 280px; }
.issue-card.sm { min-height: 136px; }
.issue-thumb-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 56px; opacity: 0.3; }
.issue-card.big .issue-thumb-bg { font-size: 80px; }
.issue-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 60%); }
.issue-body { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px; }
.issue-source { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.7); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.issue-source .dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; }
.issue-title { color: #fff; font-weight: 700; line-height: 1.35; }
.issue-card.big .issue-title { font-size: 17px; }
.issue-card.sm .issue-title { font-size: 13px; }
.issue-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.issue-meta span { font-size: 11px; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 3px; }
.issue-tag { display: inline-block; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 2px; margin-bottom: 5px; }
.issue-tag.red { background: var(--hot); }
.issue-tag.green { background: #10b981; }
.issue-tag.purple { background: #7c3aed; }
.issue-tag.yellow { background: var(--accent); color: #1a1a1a; }

/* BOARD */
.board-section { background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.board-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 2px solid var(--primary); background: #fafafa; flex-wrap: wrap; gap: 6px; }
.board-head-left { display: flex; align-items: center; gap: 10px; }
.board-title { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.board-title i { color: var(--primary); }
.board-tabs { display: flex; }
.board-tab { padding: 4px 12px; font-size: 12px; color: var(--text3); border: 1px solid var(--border); cursor: pointer; background: #fff; transition: all 0.1s; }
.board-tab:first-child { border-radius: 3px 0 0 3px; }
.board-tab:last-child { border-radius: 0 3px 3px 0; }
.board-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.board-more { font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 2px; cursor: pointer; }
.board-more:hover { color: var(--primary); }

/* ISSUE LIST */
.issue-list { list-style: none; }
.issue-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #f5f5f5; transition: background 0.1s; cursor: pointer; }
.issue-item:last-child { border-bottom: none; }
.issue-item:hover { background: #fafafa; }
.issue-emoji { font-size: 22px; flex-shrink: 0; width: 36px; text-align: center; }
.issue-content { flex: 1; min-width: 0; }
.issue-item-title { font-size: 13px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.issue-item-title:hover { color: var(--primary); }
.issue-item-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.issue-item-sub .src { font-size: 11px; color: var(--text3); background: #f5f5f5; padding: 1px 6px; border-radius: 2px; }
.issue-item-sub .views { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 2px; }
.issue-item-sub .cmt { font-size: 11px; color: var(--primary); display: flex; align-items: center; gap: 2px; }
.issue-item-sub .like { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 2px; cursor: pointer; }
.issue-item-sub .like.liked { color: var(--hot); font-weight: 600; }
.issue-item-sub .time { font-size: 11px; color: var(--text3); }

.badge { flex-shrink: 0; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 2px; white-space: nowrap; }
.badge.hot { background: #fee2e2; color: #991b1b; }
.badge.new { background: var(--primary-light); color: var(--primary-dark); }
.badge.ent { background: #fef3c7; color: #92400e; }
.badge.pol { background: #f5f3ff; color: #6d28d9; }
.badge.sport { background: #d1fae5; color: #065f46; }
.badge.tech { background: #dbeafe; color: #1e40af; }
.badge.live { background: #fee2e2; color: #991b1b; }
.badge.sns { background: #fce7f3; color: #9d174d; }

/* 3col mini boards */
.board-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-board { background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.mini-board-head { padding: 9px 12px; border-bottom: 2px solid var(--primary); display: flex; align-items: center; justify-content: space-between; background: #fafafa; }
.mini-board-head .t { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.mini-board-head .t i { color: var(--primary); font-size: 15px; }
.mini-board-head .m { font-size: 11px; color: var(--text3); cursor: pointer; }
.mini-post-list { list-style: none; }
.mini-post { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-bottom: 1px solid #f5f5f5; }
.mini-post:last-child { border-bottom: none; }
.mini-post:hover { background: #fafafa; }
.mini-post .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.mini-post .mt { flex: 1; font-size: 12px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.mini-post .mt:hover { color: var(--primary); }
.mini-post .time { font-size: 11px; color: var(--text3); white-space: nowrap; }
.mini-post .cnt { font-size: 11px; color: var(--primary); font-weight: 600; white-space: nowrap; }

/* PAGINATION */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 12px; }
.page-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 3px; font-size: 12px; color: var(--text2); cursor: pointer; background: #fff; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

.empty-state { padding: 30px 16px; text-align: center; color: var(--text3); font-size: 13px; }

/* FOOTER */
footer { background: #0c1a2e; color: #888; padding: 24px 12px; margin-top: 20px; font-size: 12px; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; }
.footer-logo { font-size: 18px; font-weight: 900; color: var(--primary); margin-bottom: 8px; }
.footer-desc { font-size: 12px; color: #555; line-height: 1.7; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: #666; font-size: 12px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { max-width: 1280px; margin: 16px auto 0; padding-top: 16px; border-top: 1px solid #1e3a5f; text-align: center; font-size: 11px; color: #444; }

.auto-badge { display: inline-flex; align-items: center; gap: 4px; background: #d1fae5; color: #065f46; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; }
.auto-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: #10b981; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 420px; max-height: 92vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.modal.wide { max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.modal-close { font-size: 22px; color: var(--text3); cursor: pointer; background: none; border: none; line-height: 1; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-body .field { display: flex; flex-direction: column; gap: 5px; }
.modal-body label { font-size: 12px; color: var(--text2); font-weight: 600; }
.modal-body input, .modal-body select, .modal-body textarea { border: 1px solid var(--border); border-radius: 6px; padding: 9px 11px; font-size: 13px; outline: none; font-family: inherit; }
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { border-color: var(--primary); }
.modal-body textarea { resize: vertical; min-height: 70px; }
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 11px; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.modal-switch { text-align: center; font-size: 12px; color: var(--text2); }
.modal-switch a { color: var(--primary); font-weight: 600; cursor: pointer; }
.form-error { color: var(--hot); font-size: 12px; min-height: 16px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* TOAST */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #222; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,0.3); animation: toastIn 0.2s ease; }
.toast.ok { background: #16a34a; } .toast.err { background: #dc2626; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .page-wrap { grid-template-columns: var(--sidebar-w) 1fr; }
  .sidebar-right { display: none; }
}
@media (max-width: 768px) {
  .topbar { display: none; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 8px; }
  .logo { font-size: 20px; }
  /* full-width search on its own row (flex-basis beats desktop flex:1/basis:0) */
  .search-bar { order: 3; flex: 1 0 100%; width: 100%; max-width: 100%; }
  .header-actions { gap: 6px; }
  .btn-sm.hide-xs { display: none; }
  /* GNB wraps to multiple rows so nothing is cut off */
  .gnb-inner { flex-wrap: wrap; overflow-x: visible; padding: 4px 6px; gap: 2px; }
  .gnb-item { padding: 7px 9px; font-size: 12px; border-bottom: none; border-radius: 4px; flex-shrink: 1; }
  .gnb-item.active { border-bottom: none; background: rgba(0,0,0,0.18); }
  .ticker-label { font-size: 10px; }
  .page-wrap { grid-template-columns: 1fr; padding: 8px; gap: 8px; }
  .sidebar-left, .sidebar-right { display: none; }
  .featured-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .issue-card.big { grid-row: 1; grid-column: 1 / 3; min-height: 180px; }
  .issue-card.sm { min-height: 110px; }
  .issue-card.big .issue-title { font-size: 14px; }
  .board-3col { grid-template-columns: 1fr; }
  .notice-bar { padding: 6px 10px; }
  .notice-time { display: none; }
  .issue-item { padding: 7px 10px; }
  .banner-slot { height: 70px; padding: 0 14px; }
  .banner-slot .b-title { font-size: 14px; }
  .banner-slot .b-sub { font-size: 11px; }
  .banner-deco { display: none; }
  .board-tabs { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  body { padding-bottom: 56px; }
}

/* BOTTOM NAV */
.bottom-nav { display: none; }
@media (max-width: 768px) {
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #e0e0e0; z-index: 200; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,0.08); }
  .bottom-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0 6px; gap: 3px; cursor: pointer; color: #999; font-size: 10px; }
  .bottom-tab i { font-size: 22px; }
  .bottom-tab.active { color: var(--primary); }
  footer { padding-bottom: 70px; }
}
