/* ============================================================
   羊毛线报站 · 主题样式 v3
   文件为新版独立文件（theme.css），页面已改从此文件加载。
   特点：流体宽度 / 渐变背景 / 模块化分区 / 卡片网格 / 响应式
   ============================================================ */

:root {
  --brand: #e0432f;
  --brand-dark: #c4341f;
  --brand-soft: #fff2ef;
  --ink: #171b21;
  --muted: #78808c;
  --line: rgba(24, 30, 40, .08);
  --surface: #ffffff;
  --radius: 16px;
  --shadow-sm: 0 3px 14px rgba(24, 30, 40, .045);
  --shadow-md: 0 12px 30px rgba(24, 30, 40, .10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* ---------- 渐变背景 ---------- */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-color: #f5f7fb;
  background-image:
    radial-gradient(900px 460px at 6% -6%, rgba(224, 67, 47, .11), transparent 62%),
    radial-gradient(820px 440px at 98% 2%, rgba(72, 128, 200, .11), transparent 60%),
    radial-gradient(760px 520px at 50% 104%, rgba(140, 100, 190, .07), transparent 64%),
    linear-gradient(180deg, #fcfdfe 0%, #f3f6fb 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
svg { display: block; }
img { max-width: 100%; }

/* ---------- 容器：流体宽度 ---------- */
.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   模块一：顶部导航
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(24, 30, 40, .07);
  box-shadow: 0 4px 22px rgba(24, 30, 40, .035);
}
.header-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #f4684d, var(--brand));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex: none;
  box-shadow: 0 4px 10px rgba(224, 67, 47, .24);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.nav a {
  position: relative; padding: 8px 14px; border-radius: 9px;
  transition: color .18s, background .18s; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: rgba(24, 30, 40, .04); }
.nav a.active { color: var(--brand); font-weight: 600; }
.nav a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--brand);
}
.nav-admin {
  margin-left: 6px; padding: 7px 15px !important;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.nav-admin:hover, .nav-admin.active {
  border-color: var(--brand); color: var(--brand); background: var(--brand-soft);
}
.nav-admin.active::after { display: none; }

/* ============================================================
   模块二：主视觉 Hero
   ============================================================ */
.main { padding: 26px 0 64px; }
.hero {
  position: relative; overflow: hidden;
  margin-bottom: 20px; padding: 34px 38px 30px;
  background: linear-gradient(115deg, #ffffff 0%, #fff8f5 52%, #ffeee9 100%);
  border: 1px solid rgba(224, 67, 47, .13);
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(224, 67, 47, .07);
}
.hero::before {
  content: ''; position: absolute; right: -60px; top: -110px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 67, 47, .13) 0%, rgba(224, 67, 47, 0) 70%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; right: 90px; bottom: -130px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 140, 210, .10) 0%, rgba(90, 140, 210, 0) 70%);
  pointer-events: none;
}
.hero-bg { display: none; }
.hero-layout {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.hero-main { flex: 1; min-width: 0; }
.hero-text { position: relative; z-index: 1; }

/* 二维码模块（Hero 右侧） */
.hero-qr {
  flex: 0 0 150px; width: 150px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 12px 12px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(224, 67, 47, .16);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(224, 67, 47, .10);
}
.qr-frame {
  width: 118px; height: 118px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #eceef1; border-radius: 10px;
  overflow: hidden;
}
.qr-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-placeholder { color: #c2c7ce; font-size: 12px; }
.qr-title {
  margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--ink);
  line-height: 1.35;
}
.qr-desc {
  margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-eyebrow {
  display: inline-block; margin-bottom: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
  color: var(--brand); text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 10px; font-size: 27px; font-weight: 750;
  letter-spacing: -.035em; line-height: 1.3;
}
.hero-meta {
  margin: 0; color: var(--muted); font-size: 13px;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.hero-meta strong { color: var(--ink); font-weight: 700; }
.meta-sep { color: #c8ccd2; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #23a06b; display: inline-block;
  box-shadow: 0 0 0 3px rgba(35, 160, 107, .14);
}

/* 搜索框：图标与按钮固定尺寸，杜绝被拉伸 */
.search {
  display: flex; align-items: center; gap: 0;
  margin-top: 22px; position: relative; z-index: 1; max-width: 660px;
}
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px !important; height: 18px !important;
  flex: none !important; color: #9aa1ab; pointer-events: none;
}
.search input {
  flex: 1 1 auto; min-width: 0; height: 46px;
  padding: 0 15px 0 44px;
  border: 1px solid rgba(24, 30, 40, .10); border-right: 0;
  border-radius: 11px 0 0 11px; background: #fff;
  font-size: 14px; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(224, 67, 47, .09);
  position: relative; z-index: 2;
}
.search button {
  flex: none !important; white-space: nowrap !important;
  border: 0; padding: 0 26px; height: 46px;
  border-radius: 0 11px 11px 0;
  background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .18s;
}
.search button:hover { background: var(--brand); }

/* ============================================================
   模块三：提示条
   ============================================================ */
.tip-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 15px; margin-bottom: 18px;
  background: #fff8e9; border: 1px solid #f3e2b6;
  border-radius: 12px; font-size: 12.5px; color: #84631d; line-height: 1.55;
}
.tip-icon {
  flex: 0 0 19px; width: 19px; height: 19px; border-radius: 50%;
  background: #dfa325; color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.tip-banner a { margin-left: auto; white-space: nowrap; color: #9c6b0e; font-weight: 600; }

/* ============================================================
   模块四：筛选工具条
   ============================================================ */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 18px; padding: 10px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.tabs { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; flex: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap; padding: 7px 15px; border-radius: 9px;
  background: transparent; border: 1px solid transparent;
  color: var(--muted); font-size: 13px; transition: all .18s;
}
.tab:hover { color: var(--ink); background: rgba(24, 30, 40, .04); }
.tab.active {
  background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(24, 30, 40, .16);
}
.sort-switch {
  display: flex; gap: 2px; padding: 3px; flex: 0 0 auto;
  background: rgba(24, 30, 40, .055); border-radius: 10px;
}
.sort-switch a { padding: 5px 12px; border-radius: 8px; font-size: 12px; color: var(--muted); }
.sort-switch a.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

/* ============================================================
   模块五：线报卡片（PC 三列 / 平板两列 / 手机单列）
   ============================================================ */
.list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.card {
  display: flex; flex-direction: column;
  min-width: 0; padding: 0; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(224, 67, 47, .24);
  box-shadow: var(--shadow-md);
}
.card-img {
  width: 100%; height: 168px; flex: none;
  background: linear-gradient(135deg, #f3f5f8, #e9edf3);
  overflow: hidden;
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease;
}
.card:hover .card-img img { transform: scale(1.045); }
.card-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  padding: 15px 17px 17px;
}

.card-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted);
}
.card-head .dot { color: #cdd2d8; }
.card-head .comments { margin-left: auto; white-space: nowrap; }
.tag {
  padding: 2px 8px; border-radius: 5px;
  background: #f0f2f5; color: #5f6873; font-size: 10.5px; font-weight: 600;
}
.tag-taobao { background: #fff1ec; color: #d1492a; }
.tag-jd     { background: #fdecec; color: #c73b3b; }
.tag-pdd    { background: #fceef3; color: #bd3a6b; }
.tag-local  { background: #eaf6ef; color: #257a50; }
.tag-douyin { background: #f0eefb; color: #5b47a8; }
.tag-vip    { background: #eef3fb; color: #35619c; }
.tag-jutuike { background: #fff1ec; color: #d1492a; }

.card-title {
  margin: 10px 0 6px; font-size: 15px; font-weight: 650;
  line-height: 1.5; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc {
  margin: 0; color: #8a919b; font-size: 12.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  display: flex; flex-direction: column; gap: 11px;
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid #f0f1f3;
}
.price-wrap { display: flex; align-items: baseline; gap: 8px; line-height: 1.2; }
.price-label { font-size: 11px; color: #a2a8b0; }
.price {
  color: var(--brand); font-size: 22px; font-weight: 700;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.actions { display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: all .18s;
}
.btn svg { width: 14px; height: 14px; flex: none; }
.btn-primary { flex: 1; background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(224, 67, 47, .2); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(224, 67, 47, .28); }
.btn-disabled { flex: 1; background: #f2f3f5; color: #a2a8b0; cursor: default; }
.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.origin { color: var(--muted); font-size: 12px; white-space: nowrap; }
.origin:hover { color: var(--brand); }

/* ---------- 热榜卡片 ---------- */
.rank-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rank-card { flex-direction: row; align-items: flex-start; gap: 12px; padding: 16px; }
.rank-no {
  width: 30px; flex: 0 0 30px; text-align: center; padding-top: 2px;
  font-size: 19px; font-weight: 750; color: #c2c7ce;
  font-variant-numeric: tabular-nums;
}
.rank-no.top { color: var(--brand); }
.rank-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-body .card-foot { margin-top: 12px; }

/* ---------- 空状态 / 分页 / 页脚 ---------- */
.empty {
  padding: 60px 20px; text-align: center;
  background: rgba(255, 255, 255, .8);
  border: 1px dashed #dfe2e6; border-radius: var(--radius);
  grid-column: 1 / -1;
}
.empty-icon {
  width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px;
  background: #f2f3f5; color: #a2a8b0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.empty p { margin: 0 0 4px; color: var(--ink); font-size: 14px; font-weight: 600; }
.empty span { color: var(--muted); font-size: 12px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 28px; font-size: 13px; color: var(--muted); }
.pager a {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.footer { margin-top: 44px; text-align: center; color: #a8adb4; font-size: 11.5px; line-height: 1.7; }

/* ============================================================
   模块六：后台管理面板
   ============================================================ */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.panel h2 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.panel-jtk { border-color: rgba(224, 67, 47, .18); background: linear-gradient(180deg, #fffaf8, var(--surface)); }
.panel-jtk h2 { color: var(--brand); }
.check-row { display: flex !important; align-items: center; gap: 8px; cursor: pointer; margin: 4px 0 12px !important; }
.check-row input { width: 15px !important; height: 15px; margin: 0 !important; accent-color: var(--brand); }
.form-actions { margin-top: 4px; }
.panel h3.sub {
  margin: 22px 0 10px; font-size: 13px; font-weight: 700; color: #35619c;
  padding-top: 14px; border-top: 1px dashed var(--line);
}
.panel label { display: block; margin-bottom: 11px; font-size: 12px; color: var(--muted); }
.panel label input, .panel label select, .panel label textarea {
  display: block; width: 100%; margin-top: 5px;
  padding: 9px 11px; border: 1px solid #dfe2e6; border-radius: 8px;
  background: #fff; color: var(--ink);
  font-size: 13px; font-family: inherit; outline: none;
}
.panel label input:focus, .panel label select:focus, .panel label textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(224, 67, 47, .08);
}
.panel label textarea { resize: vertical; line-height: 1.6; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.inline-form { margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 8px 0; }
.hint code, .notice code { background: #f2f3f5; padding: 1px 5px; border-radius: 4px; font-size: 11px; word-break: break-all; }
.notice { padding: 11px 14px; border-radius: 9px; font-size: 12.5px; margin-bottom: 14px; line-height: 1.7; }
.notice.ok { background: #eaf7f0; color: #1c7a4d; }
.notice.error { background: #fdecec; color: #b83232; }
.notice.info { background: #eef4fb; color: #35619c; border: 1px solid #d8e6f5; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.stats div { background: #f7f8fa; border-radius: 10px; padding: 13px; text-align: center; }
.stats span { display: block; color: var(--muted); font-size: 11px; }
.stats strong { display: block; font-size: 21px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.login-panel { max-width: 420px; margin: 60px auto; }
.login-panel h1 { font-size: 18px; font-weight: 700; margin: 0 0 18px; }
.id-list { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.id-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12px; border-bottom: 1px solid var(--line); }
.id-row:last-child { border-bottom: 0; }
.id-row code { color: #35619c; background: #eef4fb; padding: 2px 6px; border-radius: 5px; font-size: 11px; cursor: pointer; }
.id-title { color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.via-tag { font-size: 10px; padding: 2px 7px; border-radius: 5px; background: #f0f2f5; color: var(--muted); }
.via-tag.via-manual, .via-tag.via-source, .via-tag.via-parse, .via-tag.via-cps, .via-tag.via-jutuike { background: #eaf7f0; color: #1c7a4d; }
.bind-form { display: flex; gap: 8px; margin-top: 12px; }
.bind-form input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid #dfe2e6; border-radius: 8px; font-size: 12px; outline: none; }
.bind-list { margin-top: 12px; }
.bind-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.bind-row code { color: #35619c; flex: 0 0 auto; }
.bind-url { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   响应式：平板 / 手机
   ============================================================ */
@media (max-width: 1080px) {
  .wrap { padding: 0 20px; }
  .list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .rank-list { grid-template-columns: 1fr; }
  .hero { padding: 30px 30px 26px; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 14px; }
  .header-inner { height: 58px; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
  .brand-name { font-size: 15px; }
  .nav { gap: 0; font-size: 12px; }
  .nav a { padding: 7px 9px; }
  .nav a.active::after { left: 9px; right: 9px; }
  .nav-admin { margin-left: 2px; padding: 6px 10px !important; }
  .main { padding: 18px 0 48px; }
  .hero { padding: 24px 20px 22px; border-radius: 16px; margin-bottom: 14px; }
  .hero h1 { font-size: 20px; }
  .hero-eyebrow { font-size: 10px; }
  .search { margin-top: 18px; }
  .search button { padding: 0 18px; }
  .toolbar { flex-direction: column; align-items: stretch; padding: 8px; }
  .sort-switch { align-self: flex-start; }
  .list { grid-template-columns: 1fr; gap: 14px; }
  .card-img { height: 180px; }
  .card-body { padding: 14px 15px 16px; }
  .tip-banner a { margin-left: 26px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 17px; }
  .bind-form { flex-direction: column; }
}

@media (max-width: 380px) {
  .nav a { padding: 6px 6px; font-size: 11px; }
  .nav a.active::after { left: 6px; right: 6px; }
  .brand-name { font-size: 14px; }
  .hero h1 { font-size: 18px; }
  .card-img { height: 156px; }
}
