/* ==========================================================================
   会员站首页 · 三栏布局（2026-11-19）
   依赖 style.css（基础色板 / 按钮 / 弹窗），此文件只负责首页骨架与组件
   ========================================================================== */

.hd { padding: 16px 0 18px; margin-bottom: 14px; }
.hd-in { max-width: 1300px; }
.hd h1 { font-size: 20px; }

.layout {
  max-width: 1300px; margin: 0 auto 40px; padding: 0 18px;
  display: grid; grid-template-columns: 186px minmax(0, 1fr);
  gap: 14px; align-items: start; min-width: 0;
}
.layout > .card { margin: 0; }

.main-col {
  display: grid; grid-template-columns: minmax(0, 1fr) 336px;
  gap: 14px; align-items: start; min-width: 0;
}
.col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-main > .card { margin: 0; }
.col-main > .ft { padding: 6px 2px 0; }

/* ---------------- 左：城市栏（窄栏，城市名 + 下方最新期次） ---------------- */
.side { padding: 12px 10px; position: sticky; top: 14px; }
.side h3 { margin: 0 0 2px; font-size: 13.5px; }
.side-tip { color: var(--hint); font-size: 10.5px; margin: 0 0 9px; line-height: 1.5; }
.city-list { display: block; max-height: 560px; overflow-y: auto; margin: 0 -2px; }
.city {
  display: flex; flex-direction: column; align-items: stretch; gap: 1px;
  width: 100%; padding: 6px 8px; margin-bottom: 2px; text-align: left;
  border: 1px solid transparent; border-radius: 8px; background: none;
  font-size: 13px; color: var(--text); cursor: pointer;
  font-family: inherit; line-height: 1.4;
}
.city:hover { background: #fafafb; }
.city.on { background: var(--brand-soft); border-color: #ffd9d2; color: var(--brand-dark); }
.city .c-name {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-weight: 600;
}
.city .c-per {
  font-size: 10.5px; color: var(--hint); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.city.on .c-per { color: #b06a62; }
.city.locked { color: #8f8f9c; }
.city.locked .c-per { color: #bcbcc6; }
.city .lock { font-size: 10px; background: #f0f0f4; color: #8a8a96; border-radius: 5px; padding: 0 5px; }
.side-foot {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--hint); line-height: 1.8;
}
.side-foot b { color: var(--text); }
.side-foot a { color: var(--brand-dark); text-decoration: none; }
.side-foot a:hover { text-decoration: underline; }

/* ---------------- 中：冻结搜索条 ---------------- */
.head-card {
  padding: 10px 12px; min-width: 0;
  position: sticky; top: 0; z-index: 40;
  background: #fff; border-radius: 12px;
  transition: box-shadow .15s ease;
}
.head-card.stuck { box-shadow: 0 6px 18px rgba(24, 20, 20, .10); }
.h-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.h-info { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: nowrap; overflow: hidden; }
.h-title {
  margin: 0; font-size: 15.5px; font-weight: 700; flex: 0 0 auto;
  display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; white-space: nowrap;
}
.h-meta {
  margin: 0; font-size: 11.5px; color: var(--hint); line-height: 1.5; flex: 1 1 auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.h-meta b { color: var(--text); }
.h-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; min-width: 0; }
.h-actions select {
  height: 32px; max-width: 300px; min-width: 0; padding: 0 6px; font-size: 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
.h-actions .btn { height: 32px; padding: 0 10px; font-size: 12px; }

.pill {
  display: inline-block; font-size: 11px; font-weight: 500; line-height: 1.7;
  border-radius: 999px; padding: 1px 9px; vertical-align: 2px;
}
.pill.period { background: var(--brand-soft); color: var(--brand-dark); font-weight: 400; }
.pill.vip    { background: #fff7e6; color: #a5730c; border: 1px solid #ffe0a3; }
.pill.free   { background: #eef7f1; color: #1a7f4b; border: 1px solid #cfe9da; }
.pill.guest  { background: #eef2ff; color: #3a4fa8; border: 1px solid #d8e0ff; }

/* 搜索：一行长条，不换行 */
.filters {
  margin-top: 8px; display: flex; gap: 6px; flex-wrap: nowrap; align-items: center;
}
.filters input, .filters select {
  height: 33px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); font-size: 12.5px; font-family: inherit;
  min-width: 0; max-width: 100%;
}
.filters input[type=search] { flex: 1 1 auto; }
.filters #spec { flex: 0 1 128px; }
.filters select { flex: 0 1 132px; }
.filters .btn { height: 33px; padding: 0 12px; flex: 0 0 auto; }

/* 访客提示条（独立块，不占冻结条高度） */
.guest-banner {
  display: none; margin-top: 10px; padding: 9px 12px; border-radius: 9px;
  background: #fffaf0; border: 1px solid #ffe0a3; color: #8a5a00;
  font-size: 12.5px; line-height: 1.75;
}
.guest-banner b { color: #a5730c; }
.guest-banner a { color: var(--brand-dark); font-weight: 700; text-decoration: none; cursor: pointer; }
.guest-banner a:hover { text-decoration: underline; }
.city-tip + .guest-banner { margin-top: 8px; }

/* ---------------- 中：表格 ---------------- */
/* 用 overflow:clip 而不是 hidden：clip 不产生滚动容器，表头才能 sticky 到页面 */
.table-card { padding: 0; overflow: clip; }
.tbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--hint); flex-wrap: wrap;
}
.tbar b { color: var(--text); }
.tbar-hint { color: #a8a8b4; }
.table-card .table-wrap { overflow-x: auto; }
.table-card table { font-size: 12.5px; width: 100%; }
.table-card th, .table-card td { padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid #f3f3f6; }
.table-card th { font-size: 11.5px; font-weight: 500; }
.table-card tbody tr { cursor: pointer; }
.table-card tbody tr.cur { background: #fffafa; }
.table-card tbody tr:hover { background: #fbfbfc; }
.table-card td.price { text-align: right; font-weight: 700; color: var(--brand-dark); }
.ta-r { text-align: right; }
.name-cell { max-width: 190px; }
.name-cell .nm { font-weight: 600; white-space: normal; }
/* 期次 + 发布周期：两行一格，省宽度但信息不省 */
.pd-main { display: block; font-weight: 600; }
.pd-kind { display: block; font-size: 10.5px; color: var(--hint); margin-top: 1px; }
.src-tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  background: #f5f5f8; color: #6f6f7c; font-size: 10.5px;
}
.table-card .cards { padding: 0 12px 12px; }
.pager { padding: 10px 14px 14px; }

/* 数据说明改成页脚注，避免撑高冻结条 */
.foot-note {
  background: #fafafb; border: 1px solid var(--line); color: var(--hint);
  font-size: 11.5px; line-height: 1.7; margin: 12px 0 0; padding: 8px 12px;
}

/* ---------------- 右：价格波动 ---------------- */
.fluct { padding: 14px 16px; position: sticky; top: 14px; }
.fluct .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fluct h3 { margin: 0; font-size: 14px; }
.mat { margin-top: 10px; font-size: 12px; color: var(--hint); line-height: 1.6; }
.mat b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 2px; }
.big { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 2px; flex-wrap: wrap; }
.big .p { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.big .u { font-size: 12px; color: var(--hint); }
.chg { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px;
  background: #f2f2f5; color: #6b6b76; }
.chg.up { background: #fdecea; color: #c62828; }
.chg.down { background: #e9f6ee; color: #1a7f4b; }

.chart { margin: 12px 0 6px; height: 132px; display: flex; align-items: flex-end;
  gap: 8px; padding: 0 2px; }
.chart .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; gap: 4px; }
.chart .v { font-size: 10px; color: var(--hint); white-space: nowrap; }
.chart .b { width: 100%; border-radius: 6px 6px 2px 2px; min-height: 4px;
  background: linear-gradient(180deg, #ffb3a6, #ff7058); }
.chart .b.dim { background: linear-gradient(180deg, #f3d6d1, #e9c6c0); }
.chart .x { font-size: 10px; color: var(--hint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chart-empty { width: 100%; text-align: center; color: var(--hint); font-size: 12px; }

.rows { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; font-size: 12px; }
.rows div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; color: var(--hint); }
.rows div span:last-child { color: var(--text); font-weight: 600; }
.note { margin-top: 10px; font-size: 11px; color: var(--hint); line-height: 1.65;
  background: #fafafb; border-radius: 8px; padding: 8px 10px; }
.vip-tip { display: none; margin-top: 10px; border: 1px solid #ffe0a3; background: #fffaf0;
  border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #8a5a00; line-height: 1.7; }
.vip-tip b { color: #a5730c; }
.vip-tip a { color: var(--brand-dark); font-weight: 700; text-decoration: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1120px) {
  .main-col { grid-template-columns: minmax(0, 1fr) 300px; }
  .filters #spec { flex: 0 1 110px; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 12px; }
  .side { position: static; padding: 10px 12px; }
  .side h3 { display: inline-block; margin-right: 8px; }
  .side-tip { display: none; }
  .city-list {
    display: flex; gap: 8px; overflow-x: auto; max-height: none;
    margin: 8px -2px 0; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
  .city {
    width: auto; flex: 0 0 auto; margin: 0; white-space: nowrap;
    border: 1px solid var(--line); background: #fff;
    flex-direction: row; align-items: center; gap: 6px; padding: 6px 10px;
  }
  .city .c-per { font-size: 10px; }
  .side-foot { margin-top: 8px; padding-top: 8px; }
  .main-col { grid-template-columns: minmax(0, 1fr); }
  .fluct { position: static; }
  .head-card { position: static; }
}
@media (max-width: 720px) {
  .hd h1 { font-size: 17px; }
  .hd .sub { font-size: 11px; }
  .head-card { padding: 10px 12px; }
  .h-title { font-size: 15px; }
  .h-top { flex-wrap: wrap; }
  .h-info { flex: 1 1 100%; flex-wrap: wrap; overflow: visible; }
  .h-meta { flex: 1 1 100%; white-space: normal; }
  .h-actions { width: 100%; }
  .h-actions select { flex: 1 1 auto; max-width: 100%; }
  .filters { flex-wrap: wrap; }
  .filters input[type=search], .filters #spec, .filters select { flex: 1 1 100%; max-width: 100%; }
  .filters .btn { flex: 1 1 0; }
  .tbar { padding: 9px 13px; font-size: 11.5px; }
  .tbar-hint { display: none; }
  .chart { height: 112px; gap: 6px; }
  .chart .v { font-size: 9px; }
  .big .p { font-size: 23px; }
  .fluct { padding: 12px 13px; }
  .pager { padding: 10px 13px 13px; flex-wrap: wrap; }
}

/* 城市锁提示条（独立块） */
.city-tip { margin-top: 10px; margin-bottom: 0; }

/* 手机端表格：改为卡片，期次 / 来源分类逐行列出 */
@media (max-width: 720px) {
  .name-cell { max-width: none; }
}

/* 手机卡片：期次 / 发布周期 / 来源分类（不省略任何列） */
.mcard .meta2 { color: #8a8a96; font-size: 11px; line-height: 1.6; }

/* ---------------- 桌面：表格定宽 + 表头随冻结条吸附 ----------------
   列宽按百分比分配，长文本换行，避免为了 7 列而横向滚动；
   表头 sticky 的 top 由 JS 写入 --bar-h（冻结条实际高度）。 */
@media (min-width: 961px) {
  .table-card .table-wrap { overflow: visible; }
  .table-card table { table-layout: fixed; width: 100%; }
  .table-card th, .table-card td { padding: 8px 10px; white-space: normal; }
  .table-card td.price { white-space: nowrap; }
  .table-card thead th {
    position: sticky; top: var(--bar-h, 96px); z-index: 20;
    background: #fafafb; border-bottom: 1px solid var(--line);
  }
  .col-name { width: 18%; }
  .col-spec { width: 14%; }
  .col-unit { width: 8%; }
  .table-card th:nth-child(4) { width: 11%; }
  .col-tax { width: 14%; }
  .col-period { width: 17%; }
  .col-src { width: 18%; }
  .name-cell { max-width: none; }
}

/* 最后一列留出卡片内边距，标签不贴边 */
.table-card th:last-child, .table-card td:last-child { padding-right: 14px; }

/* 次级宽度：城市栏/波动栏收窄，给 7 列表格腾地方
   （必须放在上面 min-width:961 的定宽规则之后，否则 padding 会被覆盖回去） */
@media (max-width: 1280px) {
  .layout { grid-template-columns: 172px minmax(0, 1fr); }
  .main-col { grid-template-columns: minmax(0, 1fr) 300px; }
  .table-card th, .table-card td { padding: 8px 8px; }
  .table-card th:last-child, .table-card td:last-child { padding-right: 12px; }
}

/* 城市多时底部淡出，暗示可滚动 */
.city-list { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent); }
@media (max-width: 960px) { .city-list { -webkit-mask-image: none; mask-image: none; } }
