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

:root {
  --accent:           #c0392b;
  --bg:               #fafafa;
  --card:             #fff;
  --text:             #222;
  --text-sub:         #888;
  --border:           #e0e0e0;
  --form-accent:      #c0392b;
  --form-accent-dark: #a93226;
}

body {
  font-family: 'Georgia', 'Times New Roman', 'PingFang SC', 'Microsoft YaHei', serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--accent);
  padding: 12px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
}

.header-nav { display: flex; gap: 16px; flex-wrap: wrap; }

.header-nav a {
  color: var(--text-sub);
  font-size: 13px;
  font-family: system-ui, sans-serif;
}

.header-nav a:hover { color: var(--accent); text-decoration: none; }

.header-nav a.submit-btn {
  background: var(--accent);
  color: #fff !important;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 700;
}
.header-nav a.submit-btn:hover { background: #a93226; }

/* Friend Links */
.friend-links { background: #f9f9f9; border-top: 1px solid #e8e8e8; padding: 16px 0; }
.fl-title { font-size: 11px; font-weight: 700; color: #bbb; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
.fl-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.fl-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #888; text-decoration: none; font-family: system-ui, sans-serif; }
.fl-item:hover { color: var(--accent); text-decoration: none; }
.fl-item img { width: 13px; height: 13px; object-fit: contain; }

/* Main */
.main { padding: 24px 0 40px; }

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

@media (max-width: 800px) { .cat-grid { grid-template-columns: 1fr; } }

/* Card */
.cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.cat-card-header {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-card-header h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.cat-count { font-size: 11px; opacity: .8; }

/* Site list */
.site-list { list-style: none; flex: 1; }

.site-item {
  display: flex;
  align-items: center;
  padding: 5px 14px;
  border-bottom: 1px solid #f5f5f5;
  gap: 6px;
  font-family: system-ui, sans-serif;
}

.site-item:last-child { border-bottom: none; }
.site-item:hover { background: #fdf5f5; }

.site-rank {
  width: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #ccc;
  text-align: right;
  flex-shrink: 0;
  font-family: monospace;
}

.site-rank.r1 { color: #c0392b; }
.site-rank.r2 { color: #888; }
.site-rank.r3 { color: #a0522d; }

.site-favicon { width: 14px; height: 14px; flex-shrink: 0; opacity: .7; }

.site-link {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-link:hover { color: var(--accent); text-decoration: none; }

.site-clicks {
  font-size: 10px;
  color: var(--accent);
  font-family: monospace;
  flex-shrink: 0;
}

.site-clicks.hot { color: #e67e22; font-weight: 700; }

/* Card footer */
.card-footer {
  border-top: 1px solid var(--border);
  padding: 6px 14px;
  font-family: system-ui, sans-serif;
}

.view-all { font-size: 12px; color: var(--accent); }
.view-all:hover { text-decoration: underline; }

/* Full page */
.page-bar {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  font-size: 12px;
  color: var(--text-sub);
  font-family: system-ui, sans-serif;
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--accent); }

.cat-full {
  background: var(--card);
  border: 1px solid var(--border);
}

.cat-full-header {
  padding: 14px 20px;
  background: var(--accent);
  color: #fff;
}

.cat-full-header h2 { font-size: 18px; }
.cat-full-header p  { font-size: 12px; opacity: .8; margin-top: 4px; }

.site-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.site-grid .site-item { border-right: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; padding: 6px 14px; }

@media (max-width: 1000px) { .site-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .site-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .site-grid { grid-template-columns: 1fr; } }

.empty { padding: 40px; text-align: center; color: var(--text-sub); font-family: system-ui, sans-serif; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-sub);
  font-size: 12px;
  font-family: system-ui, sans-serif;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ── Mobile: 手机端头部只保留「提交网站」按钮 ── */
@media (max-width: 767px) {
  .header-nav a:not(.submit-btn) { display: none; }
  .header-nav { margin-left: auto; }
}
