/* === RESET & VARIABLES === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f0f2f5; --white: #ffffff; --text: #1d1d2e; --text-secondary: #6b7280;
  --border: #e5e7eb; --accent: #2563eb; --accent-hover: #3b82f6; --accent-light: #eff6ff;
  --danger: #ef4444; --success: #10b981; --warning: #f59e0b;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04); --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08); --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.15); --radius: 12px; --radius-sm: 8px;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* === HEADER === */
.header {
  background: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  border-bottom: 1px solid #f0f0f0;
}
.header-top {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; font-weight: 700;
  background: var(--accent);
  overflow: hidden; flex-shrink: 0;
}
.logo-icon img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.logo-icon.has-img { background: transparent; }
.logo-text {
  font-size: 18px; font-weight: 700; letter-spacing: 0.5px;
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  color: #1e293b;
}
.logo-sub { font-size: 11px; color: #94a3b8; font-weight: 400; margin-top: -1px; }
.header-right { display: flex; gap: 10px; align-items: center; }
.header-time { font-size: 12px; color: #94a3b8; margin-right: 6px; font-variant-numeric: tabular-nums; }
.btn-header {
  padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: #f1f5f9; color: #475569;
  border: 1px solid #e2e8f0; transition: all .2s;
}
.btn-header:hover { background: #e2e8f0; color: #1e293b; }
.btn-header.logged-in { background: rgba(37,99,235,.1); border-color: rgba(37,99,235,.2); color: var(--accent); }

/* === HEADER WEATHER (inline) === */
.header-weather {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 0 20px; min-width: 0;
}
.weather-location {
  display: none;
}
.weather-city { font-size: 14px; font-weight: 700; color: #1e293b; }
.weather-today, .weather-tomorrow {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; border-right: 1px solid #e5e7eb;
}
.weather-icon { font-size: 28px; line-height: 1; }
.weather-detail { display: flex; flex-direction: column; gap: 1px; }
.weather-desc { font-size: 11px; color: #64748b; font-weight: 500; }
.weather-temp { font-size: 12px; color: #1e293b; font-weight: 700; }
.weather-aqi {
  padding: 3px 10px; border-radius: 10px; font-size: 10px; font-weight: 600;
  margin-right: 4px;
}
.weather-aqi.good { background: #dcfce7; color: #16a34a; }
.weather-aqi.moderate { background: #fef9c3; color: #ca8a04; }
.weather-aqi.bad { background: #fee2e2; color: #dc2626; }
.weather-date-box {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px; background: #eff6ff; border-radius: 8px;
}
.weather-date-day { font-size: 13px; color: #1e293b; font-weight: 800; }
.weather-date-info { display: flex; flex-direction: column; gap: 0; }
.weather-date-solar { font-size: 11px; color: #475569; font-weight: 600; }
.weather-date-lunar { font-size: 10px; color: #94a3b8; }
@media (max-width: 640px) {
  .weather-tomorrow { display: none; }
  .weather-date-box { display: none; }
  .weather-icon { font-size: 22px; }
  .weather-location { padding-right: 8px; }
  .weather-today { padding: 0 8px; }
}
.header-cat-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.user-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
  background: rgba(16,185,129,.1); color: #059669; border: 1px solid rgba(16,185,129,.2);
}
.user-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; }

/* === AD BANNER === */
.ad-bar { max-width: 1280px; margin: 0 auto; padding: 16px 24px 0; }
.ad-row { display: flex; gap: 16px; }
.ad-slot {
  flex: 1; min-height: 90px; border-radius: var(--radius); overflow: hidden;
  background: var(--white); border: 1px dashed #d1d5db;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: border-color .2s, box-shadow .2s;
}
.ad-slot:hover { border-color: #93c5fd; box-shadow: var(--shadow-sm); }
.ad-slot a { display: block; width: 100%; height: 100%; }
.ad-slot a img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ad-slot .ad-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #c5c5c5; font-size: 12px; user-select: none;
}
.ad-slot .ad-placeholder svg { width: 28px; height: 28px; fill: #d1d5db; }
.ad-slot .ad-label {
  position: absolute; top: 6px; right: 8px;
  font-size: 9px; color: #b0b0b0; background: rgba(255,255,255,.85);
  padding: 1px 6px; border-radius: 4px; line-height: 1.4;
}
/* When ad has real content, hide placeholder */
.ad-slot.has-ad { border-style: solid; border-color: var(--border); }
.ad-slot.has-ad .ad-placeholder { display: none; }

/* === AD TEXT BAR === */
.ad-text-bar {
  display: flex; flex-wrap: wrap; gap: 0; margin-top: 10px;
  background: var(--white); border-radius: var(--radius-sm);
  border: 1px solid var(--border); overflow: hidden;
}
.ad-text-link {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 12px; font-weight: 500;
  color: var(--ad-color, var(--text)); transition: all .2s;
  border-right: 1px solid #f3f4f6; white-space: nowrap;
}
.ad-text-link:hover {
  background: color-mix(in srgb, var(--ad-color) 8%, transparent);
}
.ad-text-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--ad-color, #999);
}

/* === STATS BAR (双栏: 最新收录 + 随机推荐) === */
.stats-bar { max-width: 1280px; margin: 0 auto; padding: 16px 24px; }
.stats-inner {
  display: flex; gap: 16px;
}
.stats-block {
  flex: 1; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden;
  padding: 10px 14px; position: relative;
  transition: box-shadow .3s, transform .3s;
}
.stats-block:hover {
  box-shadow: var(--shadow-md); transform: translateY(-2px);
}
.stats-block-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.stats-block-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.stats-block-title .title-icon {
  width: 18px; height: 18px; border-radius: 5px; display: flex;
  align-items: center; justify-content: center; font-size: 10px;
}
.stats-block-title .title-icon.recent {
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
}
.stats-block-title .title-icon.random {
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
}
.stats-block-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  font-weight: 600; letter-spacing: 0.3px;
}
.stats-block-badge.recent { background: #eff6ff; color: #2563eb; }
.stats-block-badge.random { background: #fffbeb; color: #d97706; }
.stats-block-more {
  font-size: 11px; color: var(--text-secondary); cursor: pointer;
  transition: all .25s; padding: 4px 10px; border-radius: 12px;
  background: #f8fafc; border: 1px solid transparent;
}
.stats-block-more:hover {
  color: var(--accent); background: var(--accent-light);
  border-color: rgba(37,99,235,.15);
}
.stats-block-list {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px;
}
.stats-block-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: var(--radius-sm); transition: all .25s; cursor: pointer;
  text-decoration: none; color: inherit; border: 1px solid transparent;
  position: relative; overflow: hidden;
}
.stats-block-item::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(135deg, rgba(37,99,235,.04), rgba(37,99,235,.01));
  transition: opacity .25s;
}
.stats-block-item:hover {
  background: #f8fafc; border-color: var(--border);
  transform: translateY(-1px); box-shadow: var(--shadow-xs);
}
.stats-block-item:hover::before { opacity: 1; }
.stats-block-item-icon {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  transition: transform .25s;
}
.stats-block-item:hover .stats-block-item-icon { transform: scale(1.08); }
.stats-block-item-icon img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 8px;
}
.stats-block-item-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.stats-block-item-name {
  font-size: 11px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.stats-block-item-desc {
  font-size: 9px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.stats-block-item-tag {
  display: inline-block; font-size: 8px; padding: 1px 4px; border-radius: 3px;
  background: #f1f5f9; color: #64748b; font-weight: 500; margin-top: 1px;
  max-width: fit-content;
}
/* 滚动动画（仅用于随机推荐等动态区块） */
@keyframes statsSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 换一批按钮旋转动画 */
@keyframes spinOnce { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.stats-block-more.spinning .refresh-icon { animation: spinOnce .5s ease; }

/* === MAIN LAYOUT === */
.main { max-width: 1280px; margin: 0 auto; padding: 0 24px 40px; display: flex; gap: 16px; }

/* === SIDEBAR (left) === */
.sidebar {
  width: 140px; flex-shrink: 0; position: sticky; top: 80px; align-self: flex-start;
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 0; }
.sidebar-inner {
  background: var(--white); border-radius: var(--radius); padding: 6px;
  box-shadow: var(--shadow-xs); border: 1px solid var(--border);
}
.sidebar-link {
  display: flex; align-items: center; gap: 7px; padding: 9px 10px;
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary); transition: all .15s; white-space: nowrap;
}
.sidebar-link:hover { background: #f8fafc; color: var(--text); }
.sidebar-link.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.sidebar-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* === CONTENT === */
.content { flex: 1; min-width: 0; }
.content-tabs {
  display: flex; gap: 0; margin-bottom: 16px; background: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow-xs); border: 1px solid var(--border);
  overflow-x: auto; overflow-y: hidden;
}
.content-tabs::-webkit-scrollbar { height: 0; }
.content-tab {
  padding: 11px 20px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  transition: all .2s; position: relative; white-space: nowrap; flex-shrink: 0;
}
.content-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--accent-light); }
.content-tab:hover:not(.active) { color: var(--text); background: #fafbfc; }
.category-section {
  margin-bottom: 16px; background: var(--white); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-xs); border: 1px solid var(--border); transition: box-shadow .2s;
}
.category-section:hover { box-shadow: var(--shadow-sm); }
.category-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid #f3f4f6;
}
.category-color-bar { width: 4px; height: 18px; border-radius: 2px; }
.category-title { font-size: 14px; font-weight: 700; color: var(--text); }
.category-count {
  font-size: 10px; color: #9ca3af; background: #f3f4f6; padding: 1px 7px; border-radius: 10px; margin-left: 2px;
}
.user-add-btn {
  margin-left: auto; padding: 4px 12px; border-radius: 14px; font-size: 11px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #60a5fa); color: #fff; cursor: pointer;
  border: none; transition: all .2s; box-shadow: 0 1px 4px rgba(37,99,235,.2);
}
.user-add-btn:hover { box-shadow: 0 2px 8px rgba(37,99,235,.35); transform: translateY(-1px); }
.user-site-card { display: flex; align-items: center; gap: 0; }
.user-del-btn {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(239,68,68,.08); color: #ef4444; font-size: 12px; line-height: 1;
  display: none; align-items: center; justify-content: center; cursor: pointer;
  border: none; transition: all .15s;
}
.user-site-card:hover .user-del-btn { display: flex; }
.user-del-btn:hover { background: #ef4444; color: #fff; }

/* User Add Site Modal */
.user-add-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 2000;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(6px);
}
.user-add-overlay.show { display: flex; }
.user-add-panel {
  width: 90%; max-width: 380px; background: var(--white); border-radius: 18px;
  padding: 28px 24px; box-shadow: var(--shadow-xl); animation: modalIn .3s ease;
  position: relative;
}
.user-add-panel h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.user-add-panel .user-add-sub { font-size: 12px; color: var(--text-secondary); margin-bottom: 18px; }
.user-add-panel .form-group { margin-bottom: 14px; }
.user-add-panel .form-group label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--text-secondary); }
.user-add-panel .form-group input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; outline: none; transition: border-color .2s; background: #fafbfc;
}
.user-add-panel .form-group input:focus { border-color: var(--accent); background: #fff; }
.user-add-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.user-add-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 18px; cursor: pointer; border: none; background: none; transition: all .15s;
}
.user-add-close:hover { background: #f3f4f6; color: var(--text); }
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px;
}
.category-more-btn {
  display: inline-flex; align-items: center; gap: 3px; margin-left: auto;
  padding: 0; font-size: 11px; font-weight: 400;
  color: #9ca3af; background: none; border: none; cursor: pointer; transition: color .2s;
}
.category-more-btn:hover { color: #6b7280; }
.category-more-arrow { font-size: 9px; }
.site-card {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px;
  background: #fafbfc; border-radius: var(--radius-sm);
  border: 1px solid transparent; transition: all .2s; cursor: pointer;
}
.site-card:hover {
  background: var(--accent-light); border-color: #bfdbfe;
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.site-icon {
  width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; object-fit: contain; background: #f0f0f0;
}
.site-icon-placeholder {
  width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
}
.site-name {
  font-size: 12px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Recent tab card extras */
.recent-site-card { position: relative; flex-direction: column; align-items: center; text-align: center; padding: 14px 8px 10px; gap: 6px; }
.recent-card-badge {
  position: absolute; top: 4px; right: 4px;
  font-size: 8px; padding: 2px 6px; border-radius: 6px;
  background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; font-weight: 700;
  letter-spacing: 0.5px; box-shadow: 0 1px 4px rgba(239,68,68,.3);
}
.recent-card-cat {
  font-size: 9px; padding: 1px 6px; border-radius: 4px;
  font-weight: 500; line-height: 1.5; white-space: nowrap; margin-top: 2px;
}

/* === RIGHT SIDEBAR === */
.right-sidebar { width: 260px; flex-shrink: 0; }
#rightAdSlot { position: sticky; top: 80px; z-index: 10; }
.right-widget {
  background: var(--white); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-xs); border: 1px solid var(--border); margin-bottom: 16px;
}
/* Right sidebar ad note */
.right-ad-note {
  margin-top: 10px; text-align: center;
  font-size: 10px; color: #c5c5c5;
}
/* Right sidebar image ad */
.right-img-ad {
  display: block; position: relative; transition: opacity .2s;
}
.right-img-ad:hover { opacity: .9; }
.right-img-ad img { width: 100%; height: auto; display: block; object-fit: cover; }
.right-img-ad-label {
  position: absolute; top: 6px; right: 8px;
  font-size: 9px; color: #b0b0b0; background: rgba(255,255,255,.85);
  padding: 1px 6px; border-radius: 4px; line-height: 1.4;
}
.widget-title {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block;
}
.ai-tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ai-tool-item {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px;
  border-radius: 6px; background: #f8fafc; font-size: 11.5px; font-weight: 500;
  color: var(--text); transition: all .15s; cursor: pointer; border: 1px solid transparent;
}
.ai-tool-item:hover { background: var(--accent-light); border-color: #bfdbfe; }
.ai-tool-letter {
  width: 18px; height: 18px; border-radius: 4px; display: flex;
  align-items: center; justify-content: center; font-size: 9px;
  font-weight: 700; color: #fff; flex-shrink: 0;
}
.ai-tool-icon {
  width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0;
  object-fit: contain; background: #f0f0f0;
}
/* === NEWS & HOT ARTICLES WIDGET === */
.news-widget-list { display: flex; flex-direction: column; gap: 0; }
.news-widget-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 6px;
  font-size: 12px; color: var(--text); transition: all .2s; cursor: pointer;
  border-bottom: 1px solid #f3f4f6; text-decoration: none;
}
.news-widget-item:last-child { border-bottom: none; }
.news-widget-item:hover { background: #f8fafc; }
.news-widget-rank {
  width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; margin-top: 1px;
  background: #d1d5db;
}
.news-widget-rank.top1 { background: #ef4444; }
.news-widget-rank.top2 { background: #f97316; }
.news-widget-rank.top3 { background: #f59e0b; }
.news-widget-item-body { flex: 1; min-width: 0; }
.news-widget-title {
  font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.news-widget-item:hover .news-widget-title { color: var(--accent); }
.news-widget-meta {
  font-size: 10px; color: #9ca3af; margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.news-widget-hot { color: #ef4444; font-weight: 600; }
.news-widget-tabs {
  display: flex; gap: 0; margin-bottom: 10px; background: #f8fafc;
  border-radius: 6px; overflow: hidden; border: 1px solid #f0f0f0;
}
.news-widget-tab {
  flex: 1; padding: 6px 0; font-size: 11px; font-weight: 600;
  color: #9ca3af; text-align: center; cursor: pointer; transition: all .2s;
  border: none; background: none;
}
.news-widget-tab.active { background: var(--accent); color: #fff; }
.news-widget-tab:hover:not(.active) { color: var(--text); background: #f0f2f5; }
.news-widget-loading {
  text-align: center; padding: 20px 0; color: #c5c5c5; font-size: 12px;
}
.news-widget-empty {
  text-align: center; padding: 16px 0; color: #c5c5c5; font-size: 12px;
}

.hot-tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 500;
  background: #f3f4f6; color: var(--text-secondary); transition: all .2s;
  cursor: pointer; border: 1px solid transparent;
}
.tag-pill:hover { background: var(--accent-light); color: var(--accent); border-color: #bfdbfe; }
.recent-list { display: flex; flex-direction: column; gap: 0; }
.recent-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px;
  font-size: 12px; color: var(--text); transition: all .25s ease; cursor: pointer;
  background: transparent; border-left: 3px solid transparent; position: relative;
}
.recent-item:not(:last-child) { border-bottom: 1px solid #f3f4f6; }
.recent-item:hover { background: linear-gradient(90deg, #eff6ff, transparent); border-left-color: var(--accent); }
.recent-item.recent-top { background: linear-gradient(90deg, #fffbeb 0%, transparent 100%); }
.recent-item.recent-top:hover { background: linear-gradient(90deg, #fef3c7 0%, transparent 100%); border-left-color: #f59e0b; }
.recent-item-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; object-fit: contain;
  background: #f0f0f0; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.recent-item-icon-placeholder {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.recent-item-body { flex: 1; min-width: 0; }
.recent-item-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
  line-height: 1.4;
}
.recent-item-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
}
.recent-cat-tag {
  font-size: 9px; padding: 1px 6px; border-radius: 4px;
  font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.recent-time {
  font-size: 9px; color: #c5c5c5; white-space: nowrap;
}
.recent-badge {
  font-size: 8px; padding: 2px 6px; border-radius: 8px;
  background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; font-weight: 700; flex-shrink: 0;
  letter-spacing: 0.5px; text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(239,68,68,.3);
  animation: badgeGlow 2s ease-in-out infinite;
}
@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 1px 4px rgba(239,68,68,.3); }
  50% { box-shadow: 0 2px 10px rgba(239,68,68,.5); }
}
.recent-index {
  font-size: 11px; font-weight: 800; color: #d1d5db; flex-shrink: 0;
  width: 18px; height: 18px; text-align: center; line-height: 18px;
  border-radius: 4px;
}
.recent-index.rank-1 { background: linear-gradient(135deg, #f59e0b, #eab308); color: #fff; }
.recent-index.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.recent-index.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.recent-more {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px; margin-top: 8px; border-radius: 6px;
  font-size: 11px; font-weight: 500; color: var(--accent);
  background: var(--accent-light); transition: all .2s; cursor: pointer;
}
.recent-more:hover { background: #dbeafe; }

/* === STOCK WIDGET === */
.stock-tabs { display: flex; gap: 0; border-bottom: 2px solid #f3f4f6; margin-bottom: 8px; }
.stock-tab {
  padding: 6px 12px; font-size: 12px; font-weight: 600; color: #9ca3af;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s; background: none; border-top: none; border-left: none; border-right: none;
}
.stock-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.stock-tab:hover { color: var(--accent); }
.stock-add-row { display: flex; gap: 6px; margin-bottom: 8px; }
.stock-add-input {
  flex: 1; padding: 5px 10px; border: 1px solid #e5e7eb; border-radius: 6px;
  font-size: 12px; outline: none; transition: border-color .2s;
}
.stock-add-input:focus { border-color: var(--accent); }
.stock-add-btn {
  padding: 5px 12px; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 600;
  transition: opacity .2s; white-space: nowrap;
}
.stock-add-btn:hover { opacity: .85; }
.stock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stock-card {
  background: #f9fafb; border-radius: 8px; padding: 10px; cursor: default;
  transition: all .2s; position: relative; border: 1px solid #f3f4f6;
}
.stock-card:hover { background: #f3f4f6; border-color: #e5e7eb; }
.stock-card-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-card-code { font-size: 10px; color: #9ca3af; margin-top: 1px; display: flex; align-items: center; gap: 4px; }
.stock-card-code .stock-market-tag {
  font-size: 9px; padding: 0 4px; border-radius: 3px; font-weight: 600; line-height: 16px;
}
.stock-card-change {
  font-size: 13px; font-weight: 800; margin-top: 4px;
}
.stock-card-price { font-size: 10px; color: #6b7280; margin-top: 1px; }
.stock-up { color: #ef4444; }
.stock-down { color: #22c55e; }
.stock-flat { color: #6b7280; }
.stock-del-btn {
  position: absolute; top: 4px; right: 4px; width: 16px; height: 16px;
  border: none; background: transparent; color: #d1d5db; font-size: 14px;
  cursor: pointer; line-height: 1; display: none; border-radius: 50%;
}
.stock-card:hover .stock-del-btn { display: block; }
.stock-del-btn:hover { color: #ef4444; background: #fee2e2; }
.stock-empty { text-align: center; padding: 20px 0; color: #9ca3af; font-size: 12px; }
.stock-refresh-time { font-size: 10px; color: #9ca3af; text-align: right; margin-top: 6px; }
@keyframes fireFlicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .7; transform: scale(1.15); }
}

.recent-widget-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--accent);
}
.recent-widget-header .widget-title { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.recent-widget-count {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: #fef2f2; color: #ef4444; font-weight: 600;
}

/* === BACK TO TOP === */
.back-to-top {
  position: fixed; right: calc((100vw - 1280px) / 2 - 56px); bottom: 36px; z-index: 999;
  width: 44px; height: 44px; border-radius: 10px;
  background: #fff;
  color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  cursor: pointer; border: 1px solid #e5e7eb; font-size: 12px;
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: opacity .35s, visibility .35s, transform .35s, box-shadow .25s, background .25s;
  gap: 1px; padding: 4px 0;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(37,99,235,.3);
  transform: translateY(-2px);
}
.back-to-top:active { transform: translateY(0); }
.back-to-top.launching .rocket-icon { animation: rocketLaunch .6s ease-in-out; }
@keyframes rocketLaunch {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}
.rocket-icon { display: flex; align-items: center; justify-content: center; line-height: 1; }
.rocket-icon svg { width: 18px; height: 18px; fill: currentColor; }
.back-to-top-text { font-size: 10px; font-weight: 600; line-height: 1; }
@media (max-width: 640px) {
  .back-to-top { right: 6px; bottom: 24px; width: 40px; height: 40px; }

}

/* === FOOTER === */
.footer {
  color: rgba(255,255,255,.7); margin-top: 20px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 8px 24px 10px;
  background: #0f172a; border-radius: 12px 12px 0 0;
}
.footer-top {
  display: flex; gap: 40px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand { flex: 0 0 220px; }
.footer-brand-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-brand-logo .logo-icon {
  width: 28px; height: 28px; border-radius: 6px; font-size: 13px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.footer-brand-logo span { font-size: 16px; font-weight: 700; color: #fff; }
.footer-brand p { font-size: 12px; line-height: 1.8; color: rgba(255,255,255,.55); }
.footer-col { flex: 1; min-width: 0; }
.footer-col h4 {
  font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-col-links {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
}
.footer-col-links a {
  font-size: 12px; color: rgba(255,255,255,.45); transition: color .2s;
}
.footer-col-links a:hover { color: #60a5fa; }
.footer-bottom {
  display: flex; justify-content: center; align-items: center;
  padding-top: 10px; flex-wrap: wrap; gap: 6px;
}
.footer-bottom-center {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.footer-copy { font-size: 11px; color: rgba(255,255,255,.55); }
.footer-bottom-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.footer-bottom-links a { font-size: 11px; color: rgba(255,255,255,.55); transition: color .2s; }
.footer-bottom-links a:hover { color: rgba(255,255,255,.85); }

/* === TOAST === */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  color: #fff; box-shadow: var(--shadow-lg); animation: toastIn .3s ease;
  display: flex; align-items: center; gap: 8px; max-width: 340px;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(100px); opacity: 0; } }

/* === MODALS === */
.login-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 2000;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(8px);
}
.login-overlay.show { display: flex; }
.login-panel {
  width: 90%; max-width: 380px; background: var(--white); border-radius: 20px;
  padding: 40px 32px; box-shadow: var(--shadow-xl); animation: modalIn .35s ease;
  text-align: center; position: relative;
}
@keyframes modalIn { from { transform: scale(.92) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.login-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  margin: 0 auto 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
}
.login-avatar svg { width: 28px; height: 28px; fill: #fff; }
.login-panel h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.login-panel .login-sub { font-size: 13px; color: #9ca3af; margin-bottom: 24px; }
.login-field { position: relative; margin-bottom: 16px; text-align: left; }
.login-field label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s; background: #fafbfc;
}
.login-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); background: #fff; }
.login-error { font-size: 12px; color: var(--danger); margin-bottom: 12px; min-height: 18px; text-align: left; }
.btn-login {
  width: 100%; padding: 12px; background: var(--accent); color: #fff;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  transition: all .2s; box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-login:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(37,99,235,.4); }
.btn-login:active { transform: scale(.98); }
.login-footer { margin-top: 16px; font-size: 11px; color: #c5c5c5; }
.login-close-btn {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 18px; transition: all .15s;
}
.login-close-btn:hover { background: #f3f4f6; color: var(--text); }
.admin-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 2000;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(6px);
}
.admin-overlay.show { display: flex; }
.admin-panel {
  width: 94%; max-width: 920px; max-height: 88vh; background: var(--white);
  border-radius: 18px; box-shadow: var(--shadow-xl); display: flex; flex-direction: column;
  animation: slideUp .3s ease;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.admin-header {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.admin-header-left { display: flex; align-items: center; gap: 12px; }
.admin-header h2 { font-size: 17px; font-weight: 700; }
.admin-status { font-size: 11px; padding: 3px 10px; border-radius: 10px; background: rgba(16,185,129,.1); color: #059669; font-weight: 500; }
.admin-close {
  width: 34px; height: 34px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 18px;
  color: var(--text-secondary); transition: all .2s;
}
.admin-close:hover { background: #f3f4f6; color: var(--text); }
.admin-tabs { display: flex; gap: 0; padding: 0 24px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.admin-tab {
  padding: 12px 20px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent; transition: all .2s;
}
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--white); }
.admin-tab:hover:not(.active) { color: var(--text); }
.admin-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.admin-toolbar-left { font-size: 13px; color: var(--text-secondary); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 18px; background: var(--accent); color: #fff; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; transition: all .2s; box-shadow: 0 1px 4px rgba(37,99,235,.2);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 500; transition: all .15s; }
.btn-sm.edit { background: #eff6ff; color: var(--accent); border: 1px solid #bfdbfe; }
.btn-sm.edit:hover { background: var(--accent); color: #fff; }
.btn-sm.danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-sm.danger:hover { background: #dc2626; color: #fff; }
.admin-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #fafbfc; border-radius: var(--radius-sm);
  margin-bottom: 6px; border: 1px solid #f0f0f0; transition: all .12s; cursor: grab;
}
.admin-list-item:hover { background: #f0f5ff; border-color: #dbeafe; }
.admin-list-item.dragging { opacity: .4; transform: scale(.98); }
.admin-item-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.drag-handle { color: #d1d5db; font-size: 14px; cursor: grab; user-select: none; flex-shrink: 0; }
.admin-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.form-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 2100;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px);
}
.form-overlay.show { display: flex; }
.form-panel {
  background: var(--white); border-radius: 16px; padding: 28px; width: 92%;
  max-width: 440px; box-shadow: var(--shadow-xl); animation: slideUp .25s ease;
}
.form-panel h3 { font-size: 16px; font-weight: 700; margin-bottom: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--text-secondary); }
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; outline: none; transition: border-color .2s; background: #fafbfc;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent); background: #fff; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.btn-cancel { padding: 9px 18px; background: #f3f4f6; color: var(--text-secondary); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }
.btn-cancel:hover { background: #e5e7eb; }

/* === SUBMIT SITE OVERLAY === */
.submit-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 2000;
  display: none; align-items: flex-start; justify-content: center;
  backdrop-filter: blur(8px); overflow-y: auto; padding: 40px 16px;
}
.submit-overlay.show { display: flex; }
.submit-panel {
  width: 100%; max-width: 580px; background: var(--white); border-radius: 20px;
  box-shadow: var(--shadow-xl); animation: modalIn .35s ease; position: relative;
}
.submit-header {
  padding: 28px 32px 0; display: flex; align-items: center; gap: 14px;
}
.submit-header-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #34d399);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(16,185,129,.3); flex-shrink: 0;
}
.submit-header-icon svg { width: 24px; height: 24px; fill: #fff; }
.submit-header-text h3 { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.submit-header-text p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.submit-close {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 20px; transition: all .15s;
}
.submit-close:hover { background: #f3f4f6; color: var(--text); }
.submit-body { padding: 24px 32px 28px; }
.submit-row { display: flex; gap: 12px; }
.submit-row .form-group { flex: 1; }
.form-group textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; outline: none;
  transition: border-color .2s; background: #fafbfc; resize: vertical;
  min-height: 72px; line-height: 1.6; font-family: inherit;
}
.form-group textarea:focus { border-color: var(--accent); background: #fff; }
.form-group .field-hint { font-size: 11px; color: #b0b0b0; margin-top: 4px; }
.submit-rules {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 18px;
}
.submit-rules h4 { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.submit-rules ul { list-style: none; padding: 0; }
.submit-rules li {
  font-size: 11.5px; color: var(--text-secondary); line-height: 1.8;
  padding-left: 16px; position: relative;
}
.submit-rules li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px; border-radius: 50%; background: #d1d5db;
}
.submit-rules--terms { background: #f0f7ff; border-color: #bfdbfe; padding: 16px 18px; }
.submit-rules--terms h4 { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.submit-rules-sub { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 12px; }
.submit-terms-section { margin-bottom: 14px; }
.submit-terms-section:last-of-type { margin-bottom: 10px; }
.submit-terms-section h5 {
  font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.submit-terms-section h5 .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #3b82f6; flex-shrink: 0;
}
.submit-terms-section p { font-size: 11.5px; color: var(--text-secondary); line-height: 1.7; margin: 0; }
.submit-link-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom: 6px;
}
.submit-link-box .label { font-size: 11px; color: var(--text-secondary); white-space: nowrap; min-width: 120px; }
.submit-link-box code {
  flex: 1; font-size: 11px; color: #3b82f6; background: transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.submit-link-box .btn-copy-code {
  padding: 3px 12px; font-size: 11px; background: #3b82f6; color: #fff;
  border-radius: 4px; cursor: pointer; white-space: nowrap; border: none;
}
.submit-link-box .btn-copy-code:hover { background: #2563eb; }
.submit-conditions { padding-left: 18px; margin: 4px 0 0; }
.submit-conditions li {
  font-size: 11.5px; color: var(--text-secondary); line-height: 1.8;
}
.submit-terms-note {
  background: #eff6ff; border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 11.5px; color: #3b82f6; text-align: center; margin-top: 4px;
}
.submit-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 4px;
}
.submit-footer .note { font-size: 11px; color: #b0b0b0; }
.submit-footer .actions { display: flex; gap: 8px; }
.btn-submit-primary {
  padding: 10px 28px; background: linear-gradient(135deg, #10b981, #059669);
  color: #fff; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  transition: all .2s; box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
.btn-submit-primary:hover { box-shadow: 0 4px 16px rgba(16,185,129,.4); transform: translateY(-1px); }
.btn-submit-primary:active { transform: scale(.98); }
.btn-submit-primary:disabled {
  opacity: .5; cursor: not-allowed; transform: none !important;
  box-shadow: none !important;
}

/* === TERMS MODAL === */
.terms-overlay {
  position: fixed; inset: 0; z-index: 2000; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: all .3s;
}
.terms-overlay.show { opacity: 1; visibility: visible; }
.terms-panel {
  background: var(--white); border-radius: 16px; width: 620px; max-width: 92vw;
  max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(.97); transition: transform .3s;
}
.terms-overlay.show .terms-panel { transform: translateY(0) scale(1); }
.terms-header {
  display: flex; align-items: center; gap: 14px; padding: 28px 32px 0;
}
.terms-header-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.terms-header-icon svg { width: 22px; height: 22px; fill: #fff; }
.terms-header-text h3 { font-size: 18px; font-weight: 700; }
.terms-header-text p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.terms-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 20px; transition: all .15s;
}
.terms-close:hover { background: #f3f4f6; color: var(--text); }
.terms-body { padding: 24px 32px 28px; }
.terms-body .terms-section {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; margin-bottom: 16px;
}
.terms-body .terms-section h4 {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.terms-body .terms-section h4 .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.terms-body .terms-section p {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 8px;
}
.terms-body .terms-link-box {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 8px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.terms-body .terms-link-box .label {
  font-size: 12px; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0;
}
.terms-body .terms-link-box code {
  font-size: 11.5px; color: var(--accent); background: var(--accent-light);
  padding: 3px 8px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1; min-width: 0; font-family: 'Courier New', monospace;
}
.terms-body .terms-link-box .btn-copy-code {
  padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 500;
  background: var(--accent); color: #fff; transition: all .2s; flex-shrink: 0;
}
.terms-body .terms-link-box .btn-copy-code:hover { background: var(--accent-hover); }
.terms-body .terms-conditions ol {
  padding-left: 20px; margin: 0;
}
.terms-body .terms-conditions li {
  font-size: 12.5px; color: var(--text-secondary); line-height: 2; margin-bottom: 2px;
}
.terms-body .terms-note {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 12px 16px; font-size: 12px; color: #92400e; line-height: 1.7;
}

/* Admin pending items */
.pending-card {
  background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 10px; transition: all .15s;
}
.pending-card:hover { border-color: #bfdbfe; background: #f0f5ff; }
.pending-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pending-name { font-size: 14px; font-weight: 600; color: var(--text); }
.pending-time { font-size: 11px; color: #b0b0b0; }
.pending-url { font-size: 12px; color: var(--accent); margin-bottom: 6px; word-break: break-all; }
.pending-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 6px; }
.pending-meta { display: flex; gap: 12px; font-size: 11px; color: #9ca3af; margin-bottom: 10px; flex-wrap: wrap; }
.pending-meta span { display: flex; align-items: center; gap: 3px; }
.pending-actions { display: flex; gap: 6px; }
.btn-sm.approve { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.btn-sm.approve:hover { background: #059669; color: #fff; }
.pending-empty {
  text-align: center; padding: 40px 20px; color: #b0b0b0;
}
.pending-empty svg { width: 48px; height: 48px; fill: #e5e7eb; margin-bottom: 12px; }
.pending-empty p { font-size: 13px; }

/* Feedback overlay */
.feedback-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 2000;
  display: none; align-items: flex-start; justify-content: center;
  backdrop-filter: blur(8px); overflow-y: auto; padding: 40px 16px;
}
.feedback-overlay.show { display: flex; }
.feedback-panel {
  width: 100%; max-width: 620px; background: var(--white); border-radius: 20px;
  box-shadow: var(--shadow-xl); animation: modalIn .35s ease; position: relative;
}
.feedback-header {
  padding: 28px 32px 0; display: flex; align-items: center; gap: 14px;
}
.feedback-header-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(59,130,246,.3); flex-shrink: 0;
}
.feedback-header-icon svg { width: 24px; height: 24px; fill: #fff; }
.feedback-header-text h3 { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.feedback-header-text p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.feedback-close {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 20px; transition: all .15s; cursor: pointer; border: none; background: none;
}
.feedback-close:hover { background: #f3f4f6; color: var(--text); }
.feedback-body { padding: 20px 32px 28px; }
.feedback-type-label { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.feedback-type-hint { font-size: 12px; color: #f59e0b; margin-bottom: 14px; line-height: 1.6; }
.feedback-types { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.feedback-type-tag {
  padding: 7px 18px; border: 1.5px solid #dbeafe; border-radius: 20px;
  font-size: 13px; color: #3b82f6; background: #f0f7ff; cursor: pointer;
  transition: all .2s; user-select: none;
}
.feedback-type-tag:hover { background: #dbeafe; border-color: #93c5fd; }
.feedback-type-tag.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.feedback-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.feedback-row .fb-label { font-size: 13px; font-weight: 600; color: var(--text); min-width: 70px; flex-shrink: 0; white-space: nowrap; }
.feedback-row .fb-label .req { color: #ef4444; }
.feedback-row input, .feedback-row textarea {
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; outline: none;
  transition: border-color .2s; background: #fafbfc; font-family: inherit;
}
.feedback-row input:focus, .feedback-row textarea:focus { border-color: var(--accent); background: #fff; }
.feedback-row textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.feedback-textarea-wrap { flex: 1; position: relative; }
.feedback-textarea-wrap textarea { width: 100%; }
.feedback-textarea-wrap .fb-count { position: absolute; bottom: 8px; right: 10px; font-size: 11px; color: #b0b0b0; }
.feedback-textarea-wrap .fb-img-hint { font-size: 11px; color: #f59e0b; margin-top: 4px; }
.feedback-submit-row { text-align: center; padding-top: 6px; }
.btn-feedback-submit {
  padding: 11px 48px; background: linear-gradient(135deg, #93c5fd, #3b82f6);
  color: #fff; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  transition: all .2s; box-shadow: 0 2px 8px rgba(59,130,246,.3); border: none; cursor: pointer;
}
.btn-feedback-submit:hover { box-shadow: 0 4px 16px rgba(59,130,246,.4); transform: translateY(-1px); }
.btn-feedback-submit:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.feedback-card {
  background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 10px; transition: all .15s;
}
.feedback-card:hover { border-color: #bfdbfe; background: #f0f5ff; }
.feedback-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.feedback-card-type { font-size: 12px; padding: 2px 10px; border-radius: 10px; background: #dbeafe; color: #2563eb; font-weight: 600; }
.feedback-card-time { font-size: 11px; color: #b0b0b0; }
.feedback-card-content { font-size: 13px; color: var(--text); line-height: 1.7; margin-bottom: 8px; white-space: pre-wrap; word-break: break-all; }
.feedback-card-meta { display: flex; gap: 14px; font-size: 11px; color: #9ca3af; flex-wrap: wrap; }
.feedback-card-meta span { display: flex; align-items: center; gap: 3px; }
@media (max-width: 640px) {
  .feedback-body { padding: 16px 16px 22px; }
  .feedback-header { padding: 20px 16px 0; }
  .feedback-row { flex-direction: column; gap: 4px; }
  .feedback-row .fb-label { min-width: auto; }
}

/* Header submit button */
.btn-header.submit-btn {
  background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899); color: #fff;
  border-color: rgba(245,158,11,.5); font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.2);
  box-shadow: 0 2px 10px rgba(239,68,68,.3);
}
.btn-header.submit-btn:hover { background: linear-gradient(135deg, #fbbf24, #f87171, #f472b6); color: #fff; box-shadow: 0 4px 16px rgba(239,68,68,.45); }

/* === RESPONSIVE === */
@media (max-width: 1024px) { .right-sidebar { display: none; } }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { padding: 0 12px 30px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .category-section { padding: 12px; margin-bottom: 10px; }
  .site-card { padding: 7px 8px; gap: 5px; }
  .site-name { font-size: 11px; }
  .stats-bar { padding: 12px 12px; }
  .stats-inner { flex-direction: column; gap: 10px; }
  .stats-block-list { grid-template-columns: 1fr 1fr; }
  .stats-block { padding: 12px 14px; }
  .stats-block-item-desc { display: none; }
  .header-top { padding: 10px 12px; }
  .header-time { display: none; }
  .ad-bar { padding: 10px 12px 0; }
  .ad-row { flex-direction: column; gap: 10px; }
  .ad-slot { min-height: 70px; }
  .ad-text-bar { gap: 0; }
  .ad-text-link { padding: 6px 10px; font-size: 11px; }
  .admin-panel { width: 98%; max-height: 94vh; border-radius: 14px; }
  .form-panel { width: 96%; padding: 22px; }
  .content-tabs { display: none; }
  .footer-top { flex-direction: column; gap: 20px; }
  .footer-brand { flex: none; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }
  .submit-overlay { padding: 20px 10px; }
  .submit-panel { border-radius: 16px; }
  .submit-header { padding: 20px 18px 0; }
  .submit-body { padding: 18px 18px 22px; }
  .submit-row { flex-direction: column; gap: 0; }
  .submit-footer { flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
  .submit-footer .actions { justify-content: stretch; }
  .submit-footer .actions button { flex: 1; }
}
@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .logo-text { font-size: 15px; }
  .logo-sub { display: none; }
  .logo-icon { width: 28px; height: 28px; font-size: 13px; }
  .footer-top { flex-direction: column; gap: 20px; }
  .footer-brand { flex: none; }
}

/* === REDIRECT OVERLAY === */
.redirect-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  animation: rdFadeIn .25s ease;
}
.redirect-overlay.active { display: flex; }
@keyframes rdFadeIn { from { opacity: 0; } to { opacity: 1; } }
.redirect-card {
  background: #fff;
  border-radius: 16px;
  width: 420px;
  max-width: 92vw;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  overflow: hidden;
  animation: rdSlideUp .3s ease;
}
@keyframes rdSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.redirect-header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}
.redirect-header .rh-icon {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.redirect-body {
  padding: 36px 28px 32px;
  text-align: center;
}
.redirect-spinner {
  width: 44px; height: 44px;
  border: 4px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: rdSpin .8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes rdSpin { to { transform: rotate(360deg); } }
.redirect-opening {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 6px;
}
.redirect-site-name {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
}
.redirect-clicks {
  font-size: 13px;
  color: #ef4444;
  font-weight: 600;
  margin-bottom: 18px;
}
.redirect-tip {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.7;
  margin-bottom: 20px;
}
.redirect-link-btn {
  display: inline-block;
  padding: 8px 22px;
  background: #f3f4f6;
  color: #3b82f6;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  word-break: break-all;
  transition: background .2s, color .2s;
  max-width: 100%;
}
.redirect-link-btn:hover {
  background: #3b82f6;
  color: #fff;
}
