.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.topnav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.topnav-menu {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.topnav-menu a {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
}
.topnav-menu a:hover {
  background: var(--panel);
  color: var(--text);
}
.topnav-menu a.active {
  background: var(--accent);
  color: #fff;
}
.theme-toggle {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* 다크 모드 - 기본값(화이트 클린)보다 상세도가 높아서 자동으로 덮어씀 */
html[data-theme="dark"] {
  --bg: #0d0d0d;
  --panel: #161616;
  --border: #2a2a2a;
  --text: #ededed;
  --text-dim: #8a8a8a;
}

.source-filters {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .topnav { padding: 12px 14px; gap: 10px; }
  .topnav-menu { gap: 2px; }
  .topnav-menu a { font-size: 14px; padding: 8px 10px; }
  .source-filters { padding: 12px 14px; }
}
.source-filters a {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 14px;
  white-space: nowrap;
  border: 2px solid transparent;
}
.source-filters a:hover { border-color: var(--text-dim); }
.source-filters a.active {
  border-color: var(--text);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  max-width: 760px;
  margin: 0 auto;
}
.search-box { display: flex; flex: 0 1 50%; min-width: 0; }
.search-box input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box button {
  margin-left: 8px;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.link-target-toggle {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.lt-option {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.lt-option:hover { border-color: var(--text-dim); color: var(--text); }
.lt-option.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
@media (max-width: 480px) {
  .search-row { flex-wrap: wrap; }
  .search-box { flex: 1 1 100%; order: 1; }
  .link-target-toggle { order: 2; margin-left: 0; }
}

.rolling-ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  max-width: 760px;
  margin: 0 auto;
}
.ticker-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
}
.ticker-viewport {
  flex: 1;
  min-width: 0;
  height: 18px;
  position: relative;
  overflow: hidden;
}
.ticker-item {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ticker-item.active { opacity: 1; transform: translateY(0); }
.ticker-item:hover { color: var(--accent); }
.ticker-item .num { color: var(--accent); font-weight: 700; margin-right: 6px; }

.filters {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto;
}
.filters a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
}
.filters a.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.keyword-box {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.keyword-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  white-space: nowrap;
}
.keyword-tag:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 480px) {
  .filters, .keyword-box, .search-box, .rolling-ticker { padding-left: 14px; padding-right: 14px; }
}

.item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.quote-count {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 14px;
  text-align: center;
  text-decoration: none;
}
.quote-count:hover { filter: brightness(1.15); }
.quote-btn, .share-btn {
  flex-shrink: 0;
  align-self: center;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  white-space: nowrap;
  background: none;
  cursor: pointer;
}
.quote-btn { color: var(--accent); }
.quote-btn:hover { background: var(--accent); color: #fff; }
.share-btn { color: var(--text-dim); border-color: var(--border); }
.share-btn:hover { border-color: var(--text-dim); color: var(--text); }
@media (max-width: 480px) {
  .quote-btn, .share-btn { padding: 5px 9px; font-size: 11px; }
}

.share-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.share-modal {
  background: var(--bg);
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  padding: 24px;
}
.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.share-modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.share-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}
.share-modal-close:hover { color: var(--text); }
.share-modal-post-title {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  font-size: 11px;
  padding: 0;
}
.share-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
.share-link-row {
  display: flex;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.share-link-row input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 8px;
}
.share-link-row input:focus { outline: none; }
.share-link-row button {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding: 24px 20px 40px;
}
.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.footer-brand { font-weight: 700; color: var(--text); }
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-copy { width: 100%; }
@media (min-width: 481px) {
  .footer-copy { width: auto; margin-left: auto; }
}
