/* 玩具批发消息发布平台 - 简洁响应式样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, .10);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.container { width: 100%; max-width: 1020px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 0; padding-bottom: 56px; }

/* ---------- 导航栏 ---------- */
.navbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; gap: 12px;
}
.brand { font-size: 17px; font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 20px; }
.nav-links { display: flex; align-items: center; gap: 14px; font-size: 14px; flex-wrap: wrap; }
.nav-links > a { color: var(--text); text-decoration: none; padding: 5px 2px; border-radius: 6px; transition: color .15s; }
.nav-links > a:hover { color: var(--primary); }
.nav-user { color: var(--text-muted); white-space: nowrap; font-size: 13px; }

/* ---------- Hero（首页大图） ---------- */
.hero {
  position: relative;
  min-height: 300px;
  background: linear-gradient(120deg, rgba(30, 58, 138, .78), rgba(37, 99, 235, .45) 55%, rgba(30, 41, 59, .55)),
              url("../img/hero.jpg") center 42% / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.hero::after {
  /* 盖住图片右下角水印 + 底部过渡 */
  content: ""; position: absolute; inset: auto 0 0 0; height: 70px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}
.hero-overlay { position: relative; z-index: 1; padding: 64px 20px 84px; color: #fff; }
.hero-overlay h1 {
  font-size: 34px; letter-spacing: 2px; font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.hero-overlay p { margin-top: 10px; font-size: 15px; opacity: .94; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }

/* ---------- 搜索栏（浮动卡片） ---------- */
.search-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border);
  padding: 14px; border-radius: 14px;
  margin: -34px auto 20px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 2;
}
.search-bar input[type="search"] {
  flex: 1; min-width: 160px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 14px;
  background: #f8fafc;
}
.search-bar input[type="search"]:focus { background: #fff; outline: none; border-color: var(--primary); }
.search-bar select {
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; background: #fff;
}

/* ---------- 列表头 ---------- */
.list-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 8px 2px 14px;
}
.list-head > span:first-child { font-size: 17px; font-weight: 700; }
.list-count { font-size: 13px; color: var(--text-muted); }

/* ---------- 图文卡片 ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; text-decoration: none;
  color: inherit; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #eef2f7; }
.card-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.card:hover .card-cover img { transform: scale(1.05); }
.card-cover .tag {
  position: absolute; top: 10px; left: 10px;
  backdrop-filter: blur(4px);
}
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.card-title {
  font-size: 15.5px; line-height: 1.45; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-excerpt {
  font-size: 13px; color: var(--text-muted); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted);
  border-top: 1px dashed var(--border); padding-top: 10px;
}
.meta-author { font-weight: 600; color: #475569; }

/* ---------- 分类色标 ---------- */
.tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; line-height: 1.5;
  background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe;
}
.tag[data-c="新品上市"] { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tag[data-c="批发报价"] { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.tag[data-c="促销活动"] { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.tag[data-c="行业动态"] { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.tag[data-c="求购信息"] { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.tag[data-c="通知公告"] { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 9px 18px; border: 1px solid transparent;
  border-radius: 9px; font-size: 14px; cursor: pointer; text-decoration: none;
  text-align: center; background: #fff; color: var(--text); font-weight: 500;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .30); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { border-color: var(--text-muted); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Flash 提示 ---------- */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---------- 表单卡片 ---------- */
.auth-card, .form-card {
  max-width: 440px; margin: 40px auto 32px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow-lg);
}
.form-card { max-width: 640px; }
.auth-card h2, .form-card h2 { font-size: 20px; margin-bottom: 18px; }
.auth-card label, .form-card label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--text-muted); }
.auth-card input, .form-card input, .form-card select, .form-card textarea {
  width: 100%; margin-top: 6px; padding: 10px 13px;
  border: 1px solid var(--border); border-radius: 9px; font-size: 14px;
  font-family: inherit; background: #f8fafc; color: var(--text);
}
.auth-card input:focus, .form-card input:focus,
.form-card select:focus, .form-card textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
}
.auth-hint { margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-hint a { color: var(--primary); }

/* ---------- 注册：分组与协议 ---------- */
.auth-card-wide { max-width: 560px; }
.form-section {
  border: none; margin: 0 0 6px; padding: 0;
}
.form-section legend {
  font-size: 14px; font-weight: 700; color: var(--text);
  padding: 0; margin-bottom: 10px;
}
.form-section .form-hint { font-size: 12px; margin: -4px 0 12px; line-height: 1.6; }
.agree-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 14px 0 18px;
}
.agree-row input { width: 15px; height: 15px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.agree-row a { color: var(--primary); }

/* ---------- 协议 / 隐私政策正文 ---------- */
.legal-page {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 30px 32px; box-shadow: var(--shadow);
  margin: 24px 0;
}
.legal-page h1 { font-size: 22px; margin-bottom: 6px; }
.legal-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.legal-page h2 { font-size: 16px; margin: 22px 0 8px; }
.legal-page p, .legal-page li { font-size: 14px; color: #374151; line-height: 1.9; }
.legal-page ol, .legal-page ul { padding-left: 22px; margin-bottom: 10px; }
.legal-page strong { color: var(--text); }

/* ---------- 详情页 ---------- */
.article {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 28px 28px; margin-top: 24px;
  box-shadow: var(--shadow); overflow: hidden;
}
.article-cover { position: relative; margin: 0 -28px 22px; aspect-ratio: 21 / 8; background: #eef2f7; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-cover .tag { position: absolute; top: 14px; left: 16px; backdrop-filter: blur(4px); }
.article h1 { font-size: 23px; margin-bottom: 12px; line-height: 1.4; }
.article-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted); margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.article-content { font-size: 15px; line-height: 1.95; margin-bottom: 24px; word-break: break-word; }

/* ---------- 状态徽章 / 提示条 ---------- */
.badge {
  display: inline-block; font-size: 12px; padding: 2px 10px;
  border-radius: 999px; white-space: nowrap; line-height: 1.5; font-weight: 600;
}
.badge-approved { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-pending  { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.notice {
  background: #fffbeb; color: #92400e; border: 1px solid #fde68a;
  border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 16px;
}

/* ---------- 页面标题 / 我的发布 / 审核管理 ---------- */
.page-title { font-size: 21px; margin: 24px 0 6px; }
.form-hint { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 16px; box-shadow: var(--shadow);
}
.post-row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.post-row-title {
  font-size: 15px; color: var(--text); text-decoration: none; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-row-title:hover { color: var(--primary); }

.review-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.review-head h3 { font-size: 16px; }
.review-content {
  font-size: 14px; color: var(--text-muted); margin: 10px 0 12px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.review-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- 充值页 ---------- */
.recharge-card { max-width: 520px; }
.balance-box {
  display: flex; align-items: baseline; justify-content: space-between;
  background: linear-gradient(120deg, #2563eb, #3b82f6);
  border-radius: 12px; padding: 18px 20px; margin-bottom: 20px;
  color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 235, .28);
}
.balance-label { font-size: 13px; opacity: .9; }
.balance-value { font-size: 26px; font-weight: 800; }

.amount-pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 18px; }
.amount-pill { position: relative; }
.amount-pill input { position: absolute; opacity: 0; pointer-events: none; }
.amount-pill span {
  display: block; text-align: center; padding: 11px 0;
  border: 1px solid var(--border); border-radius: 10px; font-size: 15px;
  background: #f8fafc; cursor: pointer; transition: all .15s; font-weight: 600;
}
.amount-pill input:checked + span {
  border-color: var(--primary); color: var(--primary);
  background: #eff6ff; box-shadow: 0 0 0 1px var(--primary) inset;
}
.amount-pill span:hover { border-color: var(--primary); }

/* ---------- 我的发布：账号信息条 ---------- */
.account-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(120deg, #eff6ff, #f8fafc);
  border: 1px solid #dbeafe; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.account-name { font-size: 15px; font-weight: 700; margin-right: 8px; }
.account-real { font-size: 12px; color: var(--text-muted); }

.pay-methods { margin-bottom: 18px; }
.pay-method {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; background: #f8fafc;
}
.pay-name { font-size: 14px; font-weight: 600; }

.btn:disabled {
  background: #cbd5e1; border-color: #cbd5e1; color: #fff; cursor: not-allowed;
  box-shadow: none;
}
.pay-tip { margin-top: 12px; font-size: 12px; color: var(--text-muted); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--text-muted); padding: 56px 0; }
.empty h2 { font-size: 32px; margin-bottom: 8px; }
.empty p { margin-bottom: 16px; }

/* ---------- 协议/隐私弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
/* display:flex 会覆盖 hidden 默认样式，必须显式隐藏 */
.modal-mask[hidden] { display: none !important; }
.modal {
  background: #fff; border-radius: 14px;
  width: min(760px, 100%);
  max-height: min(82vh, 720px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .30);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  flex: none;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  border: none; background: #f1f5f9; color: var(--text-muted);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  font-size: 14px; line-height: 1; transition: background .15s;
}
.modal-close:hover { background: #e2e8f0; color: var(--text); }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--border); flex: none;
}
.modal-body .legal-page {
  background: transparent; border: none; box-shadow: none;
  padding: 0; margin: 0;
}
.modal-body .legal-page h1 { font-size: 19px; }
.legal-loading { padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 14px; }
.legal-loading a { color: var(--primary); }

/* ---------- 页脚（备案信息） ---------- */
.footer {
  background: #fff; border-top: 1px solid var(--border);
  padding: 22px 0; text-align: center; font-size: 13px; color: var(--text-muted);
}
.footer p { margin: 3px 0; }
.footer-brand { font-weight: 600; color: #475569; }
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--primary); }

/* ---------- 移动端适配 ---------- */
@media (max-width: 600px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 6px; }
  .brand { font-size: 15px; }
  .nav-links { width: 100%; justify-content: space-between; font-size: 13px; gap: 10px; }
  .hero { min-height: 210px; }
  .hero-overlay { padding: 40px 16px 66px; }
  .hero-overlay h1 { font-size: 23px; letter-spacing: 1px; }
  .hero-overlay p { font-size: 13px; }
  .search-bar { flex-direction: column; margin-top: -30px; }
  .search-bar input[type="search"], .search-bar select { min-width: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .article { padding: 0 16px 20px; margin-top: 16px; }
  .article-cover { margin: 0 -16px 18px; aspect-ratio: 16 / 9; }
  .article, .auth-card, .form-card { padding-left: 16px; padding-right: 16px; }
  .legal-page { padding: 20px 16px 24px; margin: 16px 0; }
  .legal-page h1 { font-size: 19px; }
  .account-bar { flex-direction: column; align-items: flex-start; }
  .auth-card, .form-card { padding-top: 22px; padding-bottom: 22px; margin-top: 24px; }
  .article h1 { font-size: 19px; }
  .post-row { flex-direction: column; align-items: flex-start; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; }
}
