:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e8eaee;
  --text: #1a1d24;
  --text-muted: #5c6370;
  --text-hint: #9aa1ad;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0fe;
  --purple: #7c3aed;
  --purple-soft: #f3effe;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.16);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 类型颜色系统 */
.type-pinyin_abbr { --tc: #378add; --tc-soft: #e6f1fb; }
.type-homophone { --tc: #12a150; --tc-soft: #e2f6ea; }
.type-scene_quote { --tc: #e0601d; --tc-soft: #fcefe5; }
.type-behavior { --tc: #d83a72; --tc-soft: #fce9f0; }
.type-template { --tc: #c27a08; --tc-soft: #fbf3df; }
.type-image { --tc: #6f5bd8; --tc-soft: #efecfc; }
.type-music { --tc: #4d9e2c; --tc-soft: #ebf5e4; }
.type-subculture { --tc: #2273b8; --tc-soft: #e5f1fa; }
.type-slang { --tc: #6b7280; --tc-soft: #eef0f3; }

/* header */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(1.4);
}
.header-inner { max-width: 1160px; margin: 0 auto; padding: 22px 24px 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 20px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.search-bar { display: flex; gap: 10px; margin-top: 16px; }
.search-bar input {
  flex: 1; padding: 12px 18px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 15px; outline: none; background: var(--bg);
  transition: all 0.2s;
}
.search-bar input:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
button {
  cursor: pointer; border: none; border-radius: var(--radius);
  padding: 11px 18px; font-size: 14px; font-weight: 500;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; white-space: nowrap; transition: all 0.2s;
}
button:hover { opacity: 0.92; transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
button.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* tabs */
.tabs {
  display: flex; gap: 4px; max-width: 1160px; margin: 0 auto;
  padding: 14px 24px 0; border-bottom: 1px solid var(--border);
}
.tab {
  padding: 9px 22px; border-radius: 10px 10px 0 0;
  background: transparent; color: var(--text-muted);
  border: none; font-size: 14px; position: relative;
}
.tab:hover { color: var(--text); background: rgba(0,0,0,0.03); }
.tab.active {
  background: var(--surface); color: var(--accent); font-weight: 600;
  border: 1px solid var(--border); border-bottom-color: var(--surface);
  margin-bottom: -1px;
}
.view.hidden { display: none; }

/* hot section */
.hot-wrap { background: var(--surface); border-bottom: 1px solid var(--border); }
.hot-inner { max-width: 1160px; margin: 0 auto; padding: 18px 24px; }
.hot-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hot-head h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hot-head h2::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.hot-meta { font-size: 12px; color: var(--text-muted); flex: 1; }
.hot-head button { padding: 7px 15px; font-size: 13px; }
.hot-body { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.hot-body::-webkit-scrollbar { height: 6px; }
.hot-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.hot-card {
  flex: 0 0 auto; width: 230px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; transition: all 0.2s;
}
.hot-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hc-name { font-weight: 600; color: var(--purple); margin-bottom: 7px; }
.hc-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 7px; }
.hc-reason { font-size: 12px; color: var(--text-muted); }
.hot-loading { color: var(--text-hint); font-size: 13px; padding: 10px 0; }

/* daily card */
.daily-card {
  background: linear-gradient(135deg, #f3effe, #eef0fe);
  border: 1px solid #dcd6fa;
}
.daily-card .hc-name { color: var(--purple); font-size: 15px; }
.daily-card::before { content: '今日之梗'; display: block; font-size: 11px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }

/* timeline */
.timeline-wrap { background: var(--surface); border-bottom: 1px solid var(--border); }
.timeline {
  max-width: 1160px; margin: 0 auto; padding: 14px 24px;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin;
}
.timeline::-webkit-scrollbar { height: 6px; }
.timeline::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.yr {
  flex: 0 0 auto; min-width: 56px; text-align: center;
  padding: 8px 4px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: all 0.18s;
}
.yr .y { font-size: 15px; font-weight: 600; }
.yr .c { font-size: 11px; color: var(--text-hint); }
.yr:hover { background: var(--accent-soft); }
.yr.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.yr.active .c { color: rgba(255, 255, 255, 0.85); }

/* filter bar */
.filter-bar {
  max-width: 1160px; margin: 0 auto; padding: 16px 24px 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  padding: 6px 15px; border-radius: 20px; font-size: 13px;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; transition: all 0.18s; color: var(--text-muted);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* main */
main { max-width: 1160px; margin: 0 auto; padding: 20px 24px 44px; }
.list-header { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.meme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 15px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 16px 18px;
  cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; gap: 8px;
  border-left: 4px solid var(--tc, #d0d3da); position: relative; overflow: hidden;
}
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius);
  background: var(--tc-soft, transparent); opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d3d6dc; }
.card:hover::after { opacity: 0.5; }
.card .name { font-size: 19px; font-weight: 700; color: var(--text); }
.card .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.tag {
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500;
  background: var(--tc-soft, var(--purple-soft)); color: var(--tc, var(--purple));
}
.card .meaning {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 28px; }
.pagination button:disabled { opacity: 0.4; cursor: default; transform: none; }
.pagination .pg-info { font-size: 13px; color: var(--text-muted); }

footer { text-align: center; color: var(--text-hint); font-size: 12px; padding: 28px; border-top: 1px solid var(--border); }

/* modal */
.modal-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(16, 24, 40, 0.5); z-index: 50;
  align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(4px);
}
.modal-mask.show { display: flex; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: 18px;
  max-width: 580px; width: 100%; max-height: 84vh; overflow-y: auto;
  padding: 30px; box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--tc, var(--accent));
  animation: slideUp 0.25s;
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal .m-name { font-size: 26px; font-weight: 700; color: var(--text); }
.modal .m-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.modal .m-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.vote-btn { background: linear-gradient(135deg, #22c55e, #16a34a); }
.modal .m-section { margin-bottom: 16px; }
.modal .m-label { font-size: 12px; color: var(--text-hint); margin-bottom: 5px; font-weight: 600; letter-spacing: 0.5px; }
.modal .m-text { font-size: 15px; line-height: 1.7; }
.modal .m-close {
  float: right; background: var(--bg); color: var(--text-muted);
  padding: 6px 14px; font-size: 13px; border: 1px solid var(--border);
}
.modal .m-text a { color: var(--accent); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--text-hint); padding: 70px 0; }

/* identify result */
.identify-result { display: none; margin-top: 14px; padding: 16px 18px; border-radius: var(--radius); font-size: 14px; animation: fadeIn 0.2s; }
.identify-result.show { display: block; }
.identify-result.is-meme { background: #ebf7ef; border: 1px solid #b7e4c7; }
.identify-result.not-meme { background: #fdeeee; border: 1px solid #f6c6c6; }
.ir-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ir-verdict { font-size: 16px; font-weight: 700; }
.is-meme .ir-verdict { color: #15803d; }
.not-meme .ir-verdict { color: #b91c1c; }
.ir-conf { color: var(--text-muted); font-size: 13px; }
.ir-src { color: var(--text-hint); font-size: 12px; }
.ir-reason { color: var(--text-muted); margin-top: 6px; }
.ir-route { color: var(--text-hint); font-size: 12px; margin-top: 4px; }

/* yearly */
.yearly-body { max-width: 1160px; margin: 0 auto; padding: 0 24px 44px; display: flex; flex-direction: column; gap: 22px; }
.yearly-body h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.yearly-chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.yearly-bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; overflow-x: auto; padding: 6px 2px 0; scrollbar-width: thin; }
.ybar-col { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; width: 16px; }
.ybar { width: 100%; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 3px 3px 0 0; min-height: 4px; transition: opacity 0.15s; }
.ybar:hover { opacity: 0.75; }
.ybar-label { font-size: 9px; color: var(--text-hint); white-space: nowrap; transform: rotate(-55deg); transform-origin: center; }
.yearly-types { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.type-bars { display: flex; flex-direction: column; gap: 10px; }
.tbar { display: flex; align-items: center; gap: 12px; }
.tbar-label { width: 76px; font-size: 12px; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.tbar-track { flex: 1; height: 20px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.tbar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 10px; transition: width 0.5s; }
.tbar-c { width: 34px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.y-top-list { display: flex; flex-direction: column; gap: 7px; max-width: 520px; }
.y-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all 0.15s;
}
.y-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.y-name { font-weight: 600; }
.y-heat { color: var(--text-muted); font-size: 12px; }
.y-years { display: flex; flex-wrap: wrap; gap: 7px; }
.y-year {
  padding: 7px 14px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1.5px solid var(--border); font-size: 13px; cursor: pointer;
  display: flex; gap: 6px; align-items: center; transition: all 0.15s;
}
.y-year:hover { border-color: var(--accent); color: var(--accent); }
.y-year .c { color: var(--text-hint); font-size: 11px; }
.yearly-report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.y-report { font-size: 14px; line-height: 1.9; color: var(--text); }
.y-memes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

/* reviews inline */
.review-list-inline { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rv { padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); font-size: 13px; }
.rv-name { font-weight: 600; color: var(--accent); margin-right: 8px; }
.rv-stars { color: #f59e0b; }
.rv-content { color: var(--text-muted); margin-top: 3px; }
.review-form { display: flex; gap: 8px; }
.review-form input { flex: 1; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; outline: none; }
.review-form input:focus { border-color: var(--accent); }
.review-form select { padding: 8px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.review-form button { padding: 9px 15px; font-size: 13px; }

/* graph */
#graph-container { max-width: 1160px; margin: 0 auto; padding: 0 24px 44px; position: relative; }
#graph-container canvas { border-radius: 14px; display: block; max-width: 100%; box-shadow: var(--shadow); }
.graph-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.graph-legend .lg-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.graph-legend .lg-dot { width: 10px; height: 10px; border-radius: 50%; }
.graph-tooltip {
  display: none;
  position: absolute;
  pointer-events: none;
  background: rgba(15, 20, 35, 0.92);
  color: #e6e9f0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.16);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* review */
.review-head {
  max-width: 1160px; margin: 0 auto; padding: 22px 24px 12px;
  display: flex; align-items: center; gap: 12px;
}
.review-head h2 { font-size: 17px; font-weight: 600; }
.review-list { max-width: 1160px; margin: 0 auto; padding: 0 24px 44px; display: flex; flex-direction: column; gap: 12px; }
.review-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  transition: all 0.15s;
}
.review-card:hover { box-shadow: var(--shadow-sm); }
.rc-name { font-weight: 600; font-size: 17px; color: var(--purple); }
.rc-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin: 6px 0; }
.rc-reason { font-size: 13px; color: var(--text-muted); }
.rc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.rc-actions .approve { background: linear-gradient(135deg, #22c55e, #16a34a); }
.rc-actions .reject { background: var(--surface); color: #dc2626; border: 1.5px solid #f6c6c6; }

/* submit form */
.submit-form {
  max-width: 580px; margin: 22px auto 44px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column; gap: 8px;
}
.submit-form h2 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.submit-form label { font-size: 13px; color: var(--text-muted); margin-top: 8px; font-weight: 500; }
.submit-form .req { color: #dc2626; }
.submit-form input, .submit-form select, .submit-form textarea {
  padding: 11px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; font-family: inherit; transition: all 0.15s;
}
.submit-form input:focus, .submit-form textarea:focus, .submit-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.submit-form button[type="submit"] { margin-top: 16px; }
.submit-msg { font-size: 13px; margin-top: 4px; }
.submit-msg.ok { color: #15803d; }
.submit-msg.err { color: #b91c1c; }

/* 响应式 */
@media (max-width: 768px) {
  .header-inner { padding: 16px 14px 14px; }
  .brand .logo { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }
  h1 { font-size: 20px; }
  .subtitle { font-size: 12px; }
  .search-bar { flex-wrap: wrap; }
  .search-bar input { min-width: 100%; order: 1; }
  .search-bar button { order: 2; flex: 1; }
  .tabs { overflow-x: auto; padding: 10px 12px 0; gap: 2px; -webkit-overflow-scrolling: touch; }
  .tab { flex: 0 0 auto; padding: 8px 15px; font-size: 13px; white-space: nowrap; }
  .timeline { padding: 12px 12px; gap: 2px; }
  .yr { min-width: 48px; }
  .filter-bar { padding: 12px 14px 0; }
  main { padding: 16px 14px 36px; }
  .meme-grid { grid-template-columns: 1fr; gap: 12px; }
  .hot-inner { padding: 14px 14px; }
  .hot-head { flex-wrap: wrap; }
  .hot-meta { flex-basis: 100%; order: 3; }
  .review-head { padding: 16px 14px 10px; flex-wrap: wrap; }
  .review-list { padding: 0 14px 36px; }
  .review-card { flex-direction: column; align-items: flex-start; }
  .rc-actions { width: 100%; }
  .rc-actions button { flex: 1; }
  .yearly-body { padding: 0 14px 36px; }
  #graph-container { padding: 0 14px 36px; }
  #graph-container canvas { max-height: 62vh; }
  .submit-form { margin: 14px; padding: 20px; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 90vh; padding: 22px; }
  .review-form { flex-wrap: wrap; }
  .review-form input { min-width: 100%; }
  .pagination button { padding: 9px 14px; font-size: 13px; }
}
