/* ══════════════════════════════════════════════
   学生福利站  ·  style.css
   设计稿还原版 · Plus Jakarta Sans + Noto Sans SC
══════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  /* Brand */
  --blue-900:  #1a2b5e;
  --blue-800:  #1e3a7a;
  --blue-700:  #1d4ed8;
  --blue-500:  #3b6cf4;
  --blue-100:  #e8eeff;
  --blue-50:   #f0f4ff;
  --orange:    #f07d35;
  --orange-d:  #d96820;
  --orange-l:  #fff4ec;
  --green:     #12b76a;
  --green-l:   #d1fae5;
  --purple:    #7c3aed;
  --purple-l:  #ede9fe;

  /* Neutrals */
  --ink:       #111827;
  --ink-2:     #374151;
  --ink-3:     #6b7280;
  --ink-4:     #9ca3af;
  --ink-5:     #d1d5db;
  --surface:   #ffffff;
  --bg:        #f7f8fc;
  --bg-hero:   #f0f4ff;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.07);
  --shadow-s:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-m:  0 6px 24px rgba(0,0,0,0.10);
  --shadow-l:  0 16px 48px rgba(0,0,0,0.12);

  /* Shape */
  --radius-s:  8px;
  --radius:    16px;
  --radius-l:  24px;

  /* Typography */
  --font:     'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  --font-cn:  'Noto Sans SC', sans-serif;

  /* Motion */
  --ease:     cubic-bezier(.4,0,.2,1);
  --dur:      0.2s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════
   NAV
══════════════════════════════════════════════ */
.site-nav {
  position: sticky; top: 0; z-index: 300;
  background: var(--surface);
  border-bottom: 1px solid var(--ink-5);
  height: 56px;
}

.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex; align-items: center; gap: 0;
}

/* Brand */
.nav-brand {
  display: flex; align-items: center; gap: 7px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 20px;
}
.brand-icon  { font-size: 1.1rem; }
.brand-text  {
  font-family: var(--font-cn); font-size: 1rem; font-weight: 700;
  color: var(--blue-900);
  white-space: nowrap;
}

/* Nav links */
.nav-links {
  display: flex; align-items: center; gap: 0;
  flex: 1;
  overflow-x: auto;
  -ms-overflow-style: none; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  text-decoration: none;
  font-family: var(--font-cn); font-size: 0.82rem; font-weight: 500;
  color: var(--ink-3);
  padding: 6px 10px; border-radius: 6px;
  position: relative;
  transition: color var(--dur) var(--ease);
  white-space: nowrap;
}
.nav-link:hover { color: var(--blue-700); }
.nav-link.active {
  color: var(--blue-700); font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute; bottom: -16px; left: 14px; right: 14px; height: 2px;
  background: var(--blue-700); border-radius: 2px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
  margin-left: auto;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink-2); border-radius: 2px;
}

/* ══════════════════════════════════════════════
   HERO
══════════════════════════════════════════════ */
.hero {
  background: var(--bg-hero);
  padding: 64px 32px 72px;
  text-align: center;
}

.hero-inner {
  max-width: 680px; margin: 0 auto;
}

.hero-title {
  font-family: var(--font-cn);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--blue-900);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-family: var(--font-cn);
  font-size: 1rem; color: var(--ink-3);
  line-height: 1.7; margin-bottom: 36px;
}

/* Search card */
.search-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-m);
  display: flex; align-items: center;
  padding: 6px 6px 6px 18px;
  margin-bottom: 20px;
  gap: 12px;
}

.search-icon-wrap {
  color: var(--ink-4);
  display: flex; align-items: center; flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none; outline: none; background: none;
  font-family: var(--font-cn); font-size: 0.95rem; color: var(--ink);
  padding: 8px 0;
}
.search-input::placeholder { color: var(--ink-4); }

.search-btn {
  background: var(--orange);
  color: #fff;
  border: none; cursor: pointer;
  font-family: var(--font-cn); font-size: 0.95rem; font-weight: 700;
  padding: 12px 22px; border-radius: var(--radius-s);
  display: flex; flex-direction: column; align-items: center;
  gap: 0; line-height: 1.1;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease), transform var(--dur);
  min-width: 52px;
}
.search-btn:hover { background: var(--orange-d); transform: scale(1.03); }

/* Hot chips */
.hot-row {
  display: flex; align-items: center; gap: 8px;
  justify-content: center; flex-wrap: wrap;
}
.hot-label {
  font-family: var(--font-cn); font-size: 0.82rem; color: var(--ink-4);
}
.hot-chip {
  border: 1px solid var(--ink-5);
  background: var(--surface);
  font-family: var(--font-cn); font-size: 0.80rem; color: var(--ink-2);
  padding: 4px 14px; border-radius: 99px; cursor: pointer;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}
.hot-chip:hover {
  border-color: var(--blue-700); color: var(--blue-700);
  background: var(--blue-50);
}

/* ══════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════ */
.main-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 40px 32px 72px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

/* ── SECTION HEADER ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-cn); font-size: 1.35rem; font-weight: 800;
  color: var(--ink); white-space: nowrap;
}

/* Filter tabs */
.filter-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.filter-tab {
  border: none; cursor: pointer;
  font-family: var(--font-cn); font-size: 0.85rem; font-weight: 600;
  padding: 8px 20px; border-radius: 8px;
  background: var(--bg); color: var(--ink-2);
  transition: background var(--dur), color var(--dur);
}
.filter-tab:hover { background: var(--blue-100); color: var(--blue-700); }
.filter-tab.active {
  background: var(--blue-900); color: #fff;
}

/* ══════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.deal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 16px 20px;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-xs);
  border: 1.5px solid transparent;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  animation: cardFade 0.3s var(--ease) both;
  cursor: pointer;
}
@keyframes cardFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-l);
  border-color: var(--blue-100);
}

/* Icon area */
.card-icon-wrap {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: var(--blue-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

/* Product name */
.card-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem; font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.3;
}

/* Description */
.card-desc {
  font-family: var(--font-cn); font-size: 0.78rem;
  color: var(--ink-3); text-align: center; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

/* Footer row */
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-top: auto; padding-top: 4px;
}
.card-badge {
  font-family: var(--font-cn); font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 6px;
}
.badge-free     { background: var(--green-l);   color: var(--green); }
.badge-discount { background: var(--orange-l);  color: var(--orange-d); }
.badge-credit   { background: var(--blue-100);  color: var(--blue-700); }
.badge-campus   { background: var(--purple-l);  color: var(--purple); }

.card-views {
  font-family: var(--font-cn); font-size: 0.72rem; color: var(--ink-4);
  display: flex; align-items: center; gap: 3px;
}

/* empty state */
.empty-wrap {
  text-align: center; padding: 80px 20px;
}
.empty-wrap[hidden] { display: none; }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-wrap p {
  font-family: var(--font-cn); color: var(--ink-3); margin-bottom: 20px;
}
.empty-wrap button {
  font-family: var(--font-cn); font-size: 0.85rem;
  background: var(--blue-900); color: #fff;
  border: none; border-radius: 8px; padding: 10px 24px;
  cursor: pointer; transition: background var(--dur);
}
.empty-wrap button:hover { background: var(--blue-800); }

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
.sidebar-col {
  position: sticky; top: 74px;
}

.rank-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-s);
  border: 1px solid var(--ink-5);
}

.rank-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.rank-trophy { font-size: 1.1rem; }
.rank-title {
  font-family: var(--font-cn); font-size: 1rem; font-weight: 800;
  color: var(--ink);
}

.rank-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 0;
  margin-bottom: 16px;
}

.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 6px;
  border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: background var(--dur);
  cursor: pointer;
}
.rank-item:hover { background: var(--bg); }

.rank-num {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800;
  flex-shrink: 0;
}
.rank-num-1 { background: #1e3a7a; color: #fff; }
.rank-num-2 { background: #3b6cf4; color: #fff; }
.rank-num-3 { background: #6b9cf4; color: #fff; }
.rank-num-n { background: var(--bg); color: var(--ink-3); }

.rank-name {
  flex: 1; min-width: 0;
  font-family: var(--font-cn); font-size: 0.83rem; font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-count {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem; color: var(--ink-4);
  flex-shrink: 0;
}

.rank-more {
  display: block; text-align: center;
  border: 1.5px solid var(--ink-5);
  border-radius: 10px; padding: 10px;
  font-family: var(--font-cn); font-size: 0.83rem; font-weight: 600;
  color: var(--ink-2); text-decoration: none;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}
.rank-more:hover {
  border-color: var(--blue-700); color: var(--blue-700);
  background: var(--blue-50);
}

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.site-footer {
  background: var(--blue-900);
  padding: 36px 32px 20px;
}

.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 16px;
}

.footer-brand {
  font-family: var(--font-cn); font-size: 1.1rem; font-weight: 800;
  color: #fff; margin-bottom: 8px;
}
.footer-copy {
  font-family: var(--font-cn); font-size: 0.78rem;
  color: rgba(255,255,255,0.40); line-height: 1.6; max-width: 360px;
}

.footer-links {
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
}
.footer-links a {
  font-family: var(--font-cn); font-size: 0.82rem;
  color: rgba(255,255,255,0.50); text-decoration: none;
  transition: color var(--dur);
}
.footer-links a:hover { color: rgba(255,255,255,0.90); }

.footer-icp {
  max-width: 1280px; margin: 0 auto;
  text-align: center;
}
.footer-icp a {
  font-family: var(--font-cn); font-size: 0.72rem;
  color: rgba(255,255,255,0.25); text-decoration: none;
}
.footer-icp a:hover { color: rgba(255,255,255,0.55); }

/* ══════════════════════════════════════════════
   FAB
══════════════════════════════════════════════ */
.fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--orange);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(240,125,53,0.45);
  transition: background var(--dur), transform var(--dur), box-shadow var(--dur);
}
.fab:hover {
  background: var(--orange-d);
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 28px rgba(240,125,53,0.55);
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .main-wrap { grid-template-columns: 1fr; padding: 28px 20px 56px; }
  .sidebar-col { display: none; }
  .nav-links, .nav-actions { display: none; }
  .hamburger { display: flex; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-inner { padding: 0 20px; }
}

@media (max-width: 600px) {
  .hero { padding: 44px 20px 52px; }
  .hero-title { font-size: 1.6rem; }
  .search-card { padding: 4px 4px 4px 14px; }
  .search-btn { padding: 10px 16px; font-size: 0.82rem; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .deal-card { padding: 18px 12px 14px; }
  .card-icon-wrap { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 14px; }
  .card-name { font-size: 0.88rem; }
  .section-header { flex-direction: column; align-items: flex-start; }
}

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