/* ==========================================================================
   吃瓜网 · 前台样式
   ========================================================================== */

:root {
  --brand: #ff4e6a;
  --brand-2: #ff8e53;
  --brand-grad: linear-gradient(120deg, #ff4e6a 0%, #ff8e53 100%);
  --brand-soft: #fff1f3;
  --purple: #6c5ce7;
  --purple-soft: #f0eeff;
  --green: #12b76a;
  --ink: #171a23;
  --ink-2: #4a5164;
  --ink-3: #8b93a7;
  --line: #eceef4;
  --bg: #f6f7fb;
  --card: #ffffff;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 2px 10px rgba(23, 26, 35, .05);
  --shadow: 0 12px 36px rgba(23, 26, 35, .08);
  --shadow-lg: 0 28px 80px rgba(23, 26, 35, .16);
  --header-h: 66px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
ul, ol { list-style: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 18px; }
.container-sm { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 18px; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(23, 26, 35, .06);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; letter-spacing: -.4px; flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px; background: var(--brand-grad);
  display: grid; place-items: center; font-size: 18px; box-shadow: 0 6px 16px rgba(255, 78, 106, .32);
}
.logo-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.nav-link {
  padding: 8px 14px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  transition: .18s; white-space: nowrap;
}
.nav-link:hover { background: var(--brand-soft); color: var(--brand); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); }

.header-search { margin-left: auto; position: relative; }
.header-search.mobile { display: none; margin-left: 0; }
.header-search input {
  width: 210px; padding: 9px 14px 9px 36px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #f8f9fc; outline: none; transition: .2s; font-size: 14px;
}
.header-search input:focus { width: 250px; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(255, 78, 106, .1); }
.header-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 14px; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.user-menu { position: relative; }
.user-menu .trigger { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; transition: .2s; }
.user-menu .trigger:hover { background: #f4f5f9; }
.user-menu .dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); width: 194px; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 7px; opacity: 0; visibility: hidden;
  transform: translateY(-6px); transition: .2s;
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.dropdown a:hover { background: var(--brand-soft); color: var(--brand); }
.dropdown .sep { height: 1px; background: var(--line); margin: 5px 8px; }

.nav-toggle { display: none; width: 38px; height: 38px; border-radius: 11px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 17px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: 12px; border: 0; font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: .18s; white-space: nowrap; line-height: 1.2;
}
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px rgba(255, 78, 106, .26); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(255, 78, 106, .34); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { filter: brightness(1.2); }
.btn-ghost { background: var(--brand-soft); color: var(--brand); }
.btn-ghost:hover { background: #ffe3e8; }
.btn-outline { background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-green { background: #e8fbf1; color: var(--green); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------------- 通用卡片 ---------------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid rgba(23, 26, 35, .04); }
.card-pad { padding: 22px; }
.section { padding: 40px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.section-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 10px; }
.section-title .dot { width: 6px; height: 22px; border-radius: 6px; background: var(--brand-grad); }
.section-sub { color: var(--ink-3); font-size: 13.5px; margin-top: 5px; }
.section-more { font-size: 14px; color: var(--ink-3); font-weight: 600; flex-shrink: 0; }
.section-more:hover { color: var(--brand); }

/* ---------------- 首页 Hero ---------------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #fff0f3 0%, #f7f8ff 55%, #eef4ff 100%); padding: 56px 0 48px; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.hero::before { width: 380px; height: 380px; background: #ffc9d3; top: -160px; right: -80px; }
.hero::after { width: 320px; height: 320px; background: #cfd8ff; bottom: -180px; left: -90px; }
.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .8); border: 1px solid #fff;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--brand); box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: 40px; line-height: 1.25; font-weight: 900; letter-spacing: -1.4px; margin: 18px 0 12px; }
.hero h1 em { font-style: normal; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--ink-2); font-size: 16px; margin-bottom: 26px; }
.hero-search { display: flex; gap: 10px; max-width: 540px; margin: 0 auto; }
.hero-search input {
  flex: 1; padding: 15px 20px; border-radius: 15px; border: 1.5px solid #fff; outline: none;
  box-shadow: var(--shadow); font-size: 15px;
}
.hero-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 78, 106, .12); }
.hero-stats { display: flex; justify-content: center; gap: 44px; margin-top: 32px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.6px; }
.hero-stat span { font-size: 13px; color: var(--ink-3); }

/* ---------------- 栏目 chips ---------------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); transition: .18s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.chip.active { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(255, 78, 106, .26); }

/* ---------------- 文章卡片 ---------------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.post-card {
  background: #fff; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid rgba(23, 26, 35, .05); box-shadow: var(--shadow-sm); transition: .22s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--brand-grad); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.post-card:hover .post-cover img { transform: scale(1.06); }
.post-cover .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 42px; opacity: .92; }
.cover-tag {
  position: absolute; top: 12px; left: 12px; padding: 5px 11px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px);
}
.cover-price {
  position: absolute; top: 12px; right: 12px; padding: 5px 11px; border-radius: 999px;
  background: var(--brand-grad); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 6px 14px rgba(255, 78, 106, .35);
}
.cover-free { position: absolute; top: 12px; right: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(18, 183, 106, .92); color: #fff; font-size: 12px; font-weight: 700; }
.post-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.post-title { font-size: 16.5px; font-weight: 700; line-height: 1.5; letter-spacing: -.2px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card:hover .post-title { color: var(--brand); }
.post-summary { font-size: 13.5px; color: var(--ink-3); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
.post-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-3); margin-top: auto; }
.post-meta .tag { background: #f4f5f9; padding: 3px 9px; border-radius: 7px; color: var(--ink-2); font-weight: 600; }

/* 列表横向卡片 */
.post-row { display: flex; gap: 16px; background: #fff; border-radius: var(--radius); padding: 14px; border: 1px solid rgba(23, 26, 35, .05); box-shadow: var(--shadow-sm); transition: .2s; }
.post-row:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-row .thumb { width: 168px; aspect-ratio: 16/10; border-radius: 13px; overflow: hidden; flex-shrink: 0; background: var(--brand-grad); }
.post-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-row .thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 34px; }
.post-row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 头条大卡 */
.hero-post { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 340px; display: flex; align-items: flex-end; background: var(--brand-grad); box-shadow: var(--shadow); }
.hero-post img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-post .mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.78) 100%); }
.hero-post .content { position: relative; z-index: 2; padding: 28px; color: #fff; }
.hero-post .content h3 { font-size: 25px; font-weight: 800; line-height: 1.4; letter-spacing: -.6px; margin: 10px 0; }
.hero-post .content p { font-size: 14px; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.badge-hot { display: inline-flex; align-items: center; gap: 5px; background: var(--brand-grad); color: #fff; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* ---------------- 详情页 ---------------- */
.article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.article-main { background: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); border: 1px solid rgba(23,26,35,.04); }
.breadcrumb { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--brand); }
.article-title { font-size: 29px; font-weight: 800; line-height: 1.4; letter-spacing: -.8px; margin-bottom: 14px; }
.article-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.article-meta .m { display: inline-flex; align-items: center; gap: 5px; }
.article-cover { border-radius: 15px; overflow: hidden; margin-bottom: 24px; }

.article-content { font-size: 16.5px; line-height: 2; color: #2a2f3d; word-break: break-word; }
.article-content p { margin: 0 0 18px; }
.article-content h2 { font-size: 21px; font-weight: 800; margin: 30px 0 14px; padding-left: 13px; border-left: 4px solid var(--brand); line-height: 1.5; }
.article-content h3 { font-size: 18px; font-weight: 700; margin: 24px 0 12px; }
.article-content img { border-radius: 12px; margin: 14px auto; }
.article-content ul, .article-content ol { margin: 0 0 18px 22px; }
.article-content ul li { list-style: disc; margin-bottom: 8px; }
.article-content ol li { list-style: decimal; margin-bottom: 8px; }
.article-content blockquote { background: #f8f9fc; border-left: 4px solid var(--purple); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 0 0 18px; color: var(--ink-2); font-size: 15px; }
.article-content a { color: var(--brand); text-decoration: underline; }
.article-content table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 14.5px; }
.article-content th, .article-content td { border: 1px solid var(--line); padding: 10px 12px; }
.article-content th { background: #f8f9fc; }
.article-content code { background: #f4f5f9; padding: 2px 7px; border-radius: 6px; font-size: 14px; font-family: Consolas, Monaco, monospace; }

/* 付费遮罩 */
.paywall { position: relative; margin-top: -60px; padding-top: 90px; }
.paywall-fade { position: absolute; top: 0; left: 0; right: 0; height: 130px; background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 78%); }
.paywall-box {
  position: relative; z-index: 2; border-radius: var(--radius); padding: 28px; text-align: center;
  background: linear-gradient(140deg, #fff5f7 0%, #f3f5ff 100%); border: 1px dashed #ffc9d3;
}
.paywall-box .lock-icon { font-size: 36px; }
.paywall-box h3 { font-size: 20px; font-weight: 800; margin: 10px 0 6px; letter-spacing: -.4px; }
.paywall-box p { color: var(--ink-2); font-size: 14px; margin-bottom: 18px; }
.paywall-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.paywall-tip { font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }

/* 解锁成功 */
.unlocked-bar {
  display: flex; align-items: center; gap: 9px; background: #ecfdf3; color: #027a48; border-radius: 12px;
  padding: 11px 15px; font-size: 13.5px; font-weight: 600; margin-bottom: 20px;
}

/* ---------------- 侧栏 ---------------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + 20px); }
.widget { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid rgba(23,26,35,.04); }
.widget-title { font-size: 15.5px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.rank-item { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.rank-item:last-child { border-bottom: 0; }
.rank-no { width: 21px; height: 21px; border-radius: 7px; background: #f4f5f9; color: var(--ink-3); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; margin-top: 3px; }
.rank-item:nth-child(1) .rank-no { background: var(--brand-grad); color: #fff; }
.rank-item:nth-child(2) .rank-no { background: #ffe0e5; color: var(--brand); }
.rank-item:nth-child(3) .rank-no { background: #fff0d9; color: #d97706; }
.rank-title { font-size: 13.5px; font-weight: 600; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank-item:hover .rank-title { color: var(--brand); }

/* ---------------- 邀请中心 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid rgba(23,26,35,.04); }
.stat-card .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; margin-bottom: 12px; }
.stat-card b { font-size: 26px; font-weight: 800; letter-spacing: -.8px; display: block; }
.stat-card span { font-size: 13px; color: var(--ink-3); }

.progress-bar { height: 12px; border-radius: 999px; background: #f0f1f6; overflow: hidden; }
.progress-bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand-grad); transition: width .5s; }

.invite-link-box { display: flex; gap: 10px; }
.invite-link-box input { flex: 1; padding: 13px 15px; border-radius: 12px; border: 1.5px solid var(--line); background: #f8f9fc; outline: none; font-size: 13.5px; color: var(--ink-2); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { background: #fff; border-radius: var(--radius); padding: 20px; border: 1px solid rgba(23,26,35,.04); box-shadow: var(--shadow-sm); }
.step .n { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; margin-bottom: 11px; }
.step h4 { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.step p { font-size: 13.5px; color: var(--ink-3); line-height: 1.65; }

/* ---------------- 个人中心 ---------------- */
.user-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.user-side { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid rgba(23,26,35,.04); position: sticky; top: calc(var(--header-h) + 20px); }
.user-side .me { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.user-side .me .avatar { width: 60px; height: 60px; font-size: 23px; margin: 0 auto 10px; }
.user-side .me b { display: block; font-size: 15.5px; }
.user-side .me span { font-size: 12.5px; color: var(--ink-3); }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 11px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 3px; }
.side-nav a:hover { background: #f6f7fb; }
.side-nav a.active { background: var(--brand-soft); color: var(--brand); }

.list-item { display: flex; gap: 14px; padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: #fff; margin-bottom: 12px; transition: .2s; align-items: center; }
.list-item:hover { border-color: #ffd7de; box-shadow: var(--shadow-sm); }
.list-item .thumb { width: 92px; aspect-ratio: 16/11; border-radius: 11px; overflow: hidden; flex-shrink: 0; background: var(--brand-grad); }
.list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-item .thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 24px; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .body h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.list-item .body h4:hover { color: var(--brand); }
.list-item .body .sub { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 12px; flex-wrap: wrap; }

.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-green { background: #e8fbf1; color: #027a48; }
.pill-orange { background: #fff4e5; color: #b45309; }
.pill-gray { background: #f2f3f7; color: #6b7280; }
.pill-red { background: #fef2f2; color: #b42318; }
.pill-purple { background: var(--purple-soft); color: var(--purple); }

/* ---------------- 表单 / 登录注册 ---------------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 18px; background: linear-gradient(135deg, #fff0f3 0%, #f7f8ff 50%, #eef4ff 100%); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 24px; padding: 34px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.6px; margin-bottom: 6px; }
.auth-card .desc { color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1.5px solid var(--line); background: #fafbfd;
  outline: none; transition: .2s; font-size: 14.5px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(255, 78, 106, .1); }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--ink-3); margin-top: 20px; }
.auth-foot a { color: var(--brand); font-weight: 700; }

.alert { border-radius: 13px; padding: 12px 16px; font-size: 14px; margin-bottom: 16px; display: flex; gap: 9px; align-items: flex-start; }
.alert-error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.alert-success { background: #ecfdf3; color: #027a48; border: 1px solid #a6f4c5; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* ---------------- 支付弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 20, 28, .55); z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 18px; backdrop-filter: blur(3px);
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 22px; width: 100%; max-width: 430px; padding: 26px; box-shadow: var(--shadow-lg); animation: pop .22s ease; max-height: 92vh; overflow: auto; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-close { width: 32px; height: 32px; border-radius: 10px; border: 0; background: #f4f5f9; cursor: pointer; font-size: 16px; color: var(--ink-2); }
.modal-close:hover { background: #ffe3e8; color: var(--brand); }
.pay-amount { text-align: center; padding: 18px 0 22px; }
.pay-amount .num { font-size: 36px; font-weight: 900; letter-spacing: -1.4px; color: var(--brand); }
.pay-amount .num small { font-size: 19px; font-weight: 700; }
.pay-amount .lbl { font-size: 13px; color: var(--ink-3); }
.pay-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 18px; }
.pay-tab {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 15px 12px; cursor: pointer; text-align: center;
  transition: .18s; background: #fff; font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.pay-tab .ic { font-size: 22px; display: block; margin-bottom: 5px; }
.pay-tab:hover { border-color: #ffc9d3; }
.pay-tab.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.qr-box { text-align: center; padding: 18px; background: #f8f9fc; border-radius: 16px; margin-bottom: 14px; }
.qr-box #qrcode { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-sm); }
.qr-box .tip { font-size: 13px; color: var(--ink-2); margin-top: 12px; font-weight: 600; }
.qr-box .sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.pay-status { text-align: center; font-size: 13.5px; color: var(--ink-3); padding-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border: 2px solid #e6e8ee; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 分页 ---------------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 7px; padding: 34px 0 10px; flex-wrap: wrap; }
.pager-btn { min-width: 38px; height: 38px; padding: 0 12px; border-radius: 11px; background: #fff; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: .18s; }
.pager-btn:hover { border-color: var(--brand); color: var(--brand); }
.pager-btn.active { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(255, 78, 106, .28); }
.pager-gap { color: var(--ink-3); padding: 0 2px; }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .ic { font-size: 46px; margin-bottom: 12px; opacity: .8; }
.empty p { font-size: 14.5px; }

/* ---------------- 页脚 ---------------- */
.site-footer { margin-top: 56px; background: #fff; border-top: 1px solid var(--line); padding: 40px 0 26px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-bottom: 28px; }
.footer-grid h4 { font-size: 14.5px; font-weight: 800; margin-bottom: 13px; }
.footer-grid a, .footer-grid li { display: block; font-size: 13.5px; color: var(--ink-3); margin-bottom: 9px; }
.footer-grid a:hover { color: var(--brand); }
.footer-desc { font-size: 13.5px; color: var(--ink-3); line-height: 1.8; margin-top: 12px; max-width: 320px; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }

/* ---------------- 公告条 ---------------- */
.notice-bar { background: linear-gradient(90deg, #fff5f7, #f4f2ff); border-radius: 13px; padding: 11px 16px; font-size: 13.5px; color: var(--ink-2); display: flex; gap: 9px; align-items: center; margin-top: 18px; }
.notice-bar .lb { background: var(--brand-grad); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 7px; flex-shrink: 0; }

/* ---------------- Toast ---------------- */
#toast-wrap { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast { background: rgba(23, 26, 35, .93); color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: fadein .25s; }
.toast.ok { background: rgba(18, 183, 106, .95); }
.toast.err { background: rgba(240, 68, 56, .95); }
@keyframes fadein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .article-wrap { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .user-layout { grid-template-columns: minmax(0, 1fr); }
  .user-side { position: static; }
  .side-nav { display: flex; gap: 6px; overflow-x: auto; min-width: 0; }
  .side-nav a { white-space: nowrap; margin-bottom: 0; }

  /* 网格/弹性子项允许收缩，避免 min-content 撑破布局 */
  .user-layout > *, .article-wrap > *, .home-top > *, .home-top .side > *,
  .steps > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .footer-grid > *,
  .stat-grid > *, .author-stats > *, .user-side > * { min-width: 0; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; background: #fff; flex-direction: column;
    align-items: stretch; padding: 12px; gap: 4px; box-shadow: var(--shadow); display: none; border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .header-search { display: none; }
  .header-inner { position: relative; }
  .header-search.mobile { display: block !important; margin: 8px 0 0; width: 100%; }
  .header-search.mobile input { width: 100%; padding-left: 38px; }
  .header-search.mobile input:focus { width: 100%; }
  .hero { padding: 34px 0 32px; }
  .hero h1 { font-size: 27px; letter-spacing: -1px; }
  .hero p { font-size: 14.5px; }
  .hero-search { flex-direction: column; }
  .hero-stats { gap: 26px; }
  .hero-stat b { font-size: 20px; }
  .section { padding: 28px 0 4px; }
  .section-title { font-size: 18.5px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-3.mobile-2, .grid-2.mobile-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 15px; }
  .stat-card b { font-size: 21px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .post-row { flex-direction: column; }
  .post-row .thumb { width: 100%; aspect-ratio: 16/9; }
  .article-main { padding: 20px 17px; border-radius: 16px; }
  .article-title { font-size: 22px; }
  .article-content { font-size: 16px; line-height: 1.95; }
  .hero-post { min-height: 250px; }
  .hero-post .content { padding: 20px; }
  .hero-post .content h3 { font-size: 19px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pay-tabs { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; }
  .paywall-actions { flex-direction: column; }
  .paywall-actions .btn { width: 100%; }
}

/* ---------------- 首页头条区 ---------------- */
.home-top { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: stretch; }
.home-top .side { display: flex; flex-direction: column; gap: 14px; }
.home-top .side .post-row { flex: 1; }
.home-top .side .post-row .thumb { width: 120px; }
.home-top .side .post-summary { display: none; }
@media (max-width: 900px) {
  .home-top { grid-template-columns: minmax(0, 1fr); }
  .home-top .side .post-row .thumb { width: 128px; }
}

/* ---------------- 邀请/推广 Banner ---------------- */
.cta-banner {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(120deg, #ff4e6a 0%, #ff7a59 55%, #ff9f43 100%);
  padding: 34px 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  box-shadow: 0 22px 55px rgba(255, 78, 106, .3);
}
.cta-banner::after { content: "🍉"; position: absolute; right: -10px; bottom: -30px; font-size: 150px; opacity: .13; }
.cta-banner h3 { font-size: 24px; font-weight: 800; letter-spacing: -.8px; margin-bottom: 9px; }
.cta-banner p { font-size: 14px; opacity: .94; max-width: 560px; line-height: 1.7; }
.cta-banner .btn { background: #fff; color: #ff4e6a; box-shadow: 0 10px 24px rgba(0, 0, 0, .14); position: relative; z-index: 2; }
.cta-banner .btn:hover { transform: translateY(-2px); }
@media (max-width: 768px) {
  .cta-banner { flex-direction: column; align-items: flex-start; padding: 24px; }
  .cta-banner h3 { font-size: 19px; }
  .cta-banner .btn { width: 100%; }
}

/* 热门标签 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.tag-cloud a { padding: 7px 14px; border-radius: 999px; background: #f4f5f9; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tag-cloud a:hover { background: var(--brand-soft); color: var(--brand); }

/* ---------------- 钱包 ---------------- */
.wallet-hero {
  border-radius: var(--radius-lg); padding: 30px 32px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #ff4e6a 0%, #ff7a59 55%, #ff9f43 100%);
  box-shadow: 0 22px 55px rgba(255, 78, 106, .28);
}
.wallet-hero::after { content: "💰"; position: absolute; right: 18px; bottom: -26px; font-size: 130px; opacity: .14; }
.wallet-hero .label { font-size: 13.5px; opacity: .9; }
.wallet-hero .amount { font-size: 44px; font-weight: 900; letter-spacing: -1.6px; line-height: 1.2; margin: 6px 0 4px; }
.wallet-hero .amount small { font-size: 22px; font-weight: 700; }
.wallet-hero .sub { font-size: 13px; opacity: .9; }
.wallet-hero .mini-stats { display: flex; gap: 30px; margin-top: 20px; flex-wrap: wrap; }
.wallet-hero .mini-stats b { display: block; font-size: 19px; font-weight: 800; }
.wallet-hero .mini-stats span { font-size: 12.5px; opacity: .88; }
.wallet-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; position: relative; z-index: 2; }
.wallet-actions .btn { background: rgba(255,255,255,.95); color: #ff4e6a; }
.wallet-actions .btn.outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.7); }

.amount-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.amount-chip {
  padding: 11px 20px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: .18s; color: var(--ink-2);
}
.amount-chip:hover { border-color: #ffc9d3; }
.amount-chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.wallet-log { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.wallet-log:last-child { border-bottom: 0; }
.wallet-log .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; background: #f4f5f9; }
.wallet-log .info { flex: 1; min-width: 0; }
.wallet-log .info b { display: block; font-size: 14.5px; font-weight: 700; }
.wallet-log .info span { font-size: 12.5px; color: var(--ink-3); }
.wallet-log .num { font-size: 16px; font-weight: 800; flex-shrink: 0; }
.wallet-log .num.plus { color: #12b76a; }
.wallet-log .num.minus { color: #f04438; }

/* ---------------- 创作中心 ---------------- */
.author-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.work-item { display: flex; gap: 14px; padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: #fff; margin-bottom: 12px; align-items: center; transition: .2s; }
.work-item:hover { border-color: #ffd7de; box-shadow: var(--shadow-sm); }
.work-item .thumb { width: 96px; aspect-ratio: 16/11; border-radius: 11px; overflow: hidden; flex-shrink: 0; background: var(--brand-grad); }
.work-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-item .thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 26px; }
.work-item .body { flex: 1; min-width: 0; }
.work-item .body h4 { font-size: 15.5px; font-weight: 700; margin-bottom: 7px; }
.work-item .body h4:hover { color: var(--brand); }
.work-item .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-3); }

@media (max-width: 768px) {
  .author-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .wallet-hero { padding: 22px; }
  .wallet-hero .amount { font-size: 34px; }
  .wallet-hero .mini-stats { gap: 20px; }
  .work-item .thumb { width: 76px; }
}

.pill-blue { background: #eff6ff; color: #1d4ed8; }

/* ==========================================================================
   移动端深度适配
   ========================================================================== */

.input-with-btn { display: flex; gap: 10px; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn .btn { flex-shrink: 0; }

@media (max-width: 768px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .container, .container-sm { padding: 0 14px; }

  /* 区块标题改为纵向 */
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
  .section { padding: 26px 0 4px; }
  .section-sub { font-size: 13px; }

  /* 标签横向滚动，省纵向空间 */
  .chips {
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }

  /* 创作中心作品卡片纵向排列 */
  .work-item { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .work-item .thumb { width: 100%; aspect-ratio: 16 / 9; }
  .work-item .row-actions { flex-direction: row !important; flex-wrap: wrap; }
  .work-item .row-actions .btn,
  .work-item .row-actions form { flex: 1 1 46%; }
  .work-item .row-actions form .btn { width: 100%; }

  /* 列表项：操作区换行占满 */
  .list-item { flex-wrap: wrap; gap: 12px; padding: 13px; }
  .list-item .thumb { width: 76px; }
  .list-item .body { flex: 1 1 calc(100% - 90px); }
  .list-item > .btn { flex: 0 0 100%; }
  .order-amount { flex: 0 0 100%; text-align: left !important; display: flex; align-items: center; gap: 10px; }

  /* 邀请链接框纵向 */
  .invite-link-box { flex-direction: column; }
  .invite-link-box .btn { width: 100%; }

  /* 钱包 */
  .wallet-actions { gap: 10px; }
  .wallet-actions .btn { flex: 1 1 100%; }
  .wallet-log { gap: 11px; }
  .wallet-log .ic { width: 34px; height: 34px; font-size: 15px; }
  .wallet-log .num { font-size: 15px; }
  .amount-chips { gap: 8px; }
  .amount-chip { flex: 1 1 calc(33.333% - 6px); text-align: center; padding: 10px 6px; font-size: 14px; }

  /* 正文表格可横向滚动 */
  .article-content table { display: block; overflow-x: auto; white-space: nowrap; }
  .article-content blockquote { padding: 12px 14px; font-size: 14.5px; }
  .article-content h2 { font-size: 18.5px; }
  .breadcrumb { font-size: 12.5px; }
  .unlocked-bar { font-size: 13px; }

  /* 支付弹窗改为底部抽屉 */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; border-radius: 22px 22px 0 0;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
    animation: sheetup .26s ease;
  }
  .pay-amount { padding: 8px 0 16px; }
  .pay-amount .num { font-size: 30px; }

  .notice-bar { align-items: flex-start; line-height: 1.7; }
  .notice-bar .lb { margin-top: 2px; }
  .footer-bottom { flex-direction: column; gap: 6px; align-items: flex-start; }
  .pager-btn { min-width: 34px; height: 34px; font-size: 13px; }
  .post-meta { gap: 10px; }
  .hero-post .content h3 { font-size: 18px; }
}

@keyframes sheetup { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (max-width: 400px) {
  .hero h1 { font-size: 22px; letter-spacing: -.8px; }
  .article-title { font-size: 20px; }
  .post-title { font-size: 15.5px; }
  .amount-chip { flex: 1 1 calc(50% - 5px); }
  .stat-card b { font-size: 19px; }
  .header-actions .btn { padding: 8px 12px; font-size: 13px; }
  .logo { font-size: 18px; }
  .logo-mark { width: 30px; height: 30px; font-size: 16px; }
  .section-title { font-size: 17.5px; }
  .pay-tab { padding: 12px 10px; font-size: 13.5px; }
}

/* ==========================================================================
   首页 = 作者分享落地页
   ========================================================================== */
.landing-author {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid rgba(23, 26, 35, .04);
}
.landing-author .ava {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-grad); color: #fff; display: grid; place-items: center;
  font-size: 21px; font-weight: 800; box-shadow: 0 8px 20px rgba(255, 78, 106, .28);
}
.landing-author .info { flex: 1; min-width: 0; }
.landing-author .name { font-size: 17px; font-weight: 800; letter-spacing: -.3px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.landing-author .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

.landing-tip {
  margin-top: 14px; padding: 11px 16px; border-radius: 13px; font-size: 13.5px; color: var(--ink-2);
  background: linear-gradient(90deg, #fff5f7, #f4f2ff);
}

.landing-post {
  margin-top: 18px; background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(23, 26, 35, .05);
}
.landing-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--brand-grad); }
.landing-cover img { width: 100%; height: 100%; object-fit: cover; }
.landing-body { padding: 28px 32px 32px; }
.landing-meta-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.landing-title { font-size: 27px; font-weight: 800; line-height: 1.42; letter-spacing: -.9px; margin-bottom: 12px; }
.landing-summary {
  font-size: 14.5px; color: var(--ink-3); line-height: 1.85; padding: 13px 16px;
  background: #f8f9fc; border-radius: 12px; border-left: 3px solid var(--brand);
}

@media (max-width: 768px) {
  .landing-author { padding: 15px; gap: 12px; flex-wrap: wrap; }
  .landing-author .ava { width: 44px; height: 44px; font-size: 18px; }
  .landing-author .name { font-size: 15.5px; }
  .landing-author > .btn { width: 100%; }
  .landing-body { padding: 20px 17px 24px; }
  .landing-title { font-size: 21px; letter-spacing: -.6px; }
  .landing-summary { font-size: 13.5px; padding: 11px 13px; }
  .landing-tip { font-size: 13px; padding: 10px 13px; line-height: 1.7; }
}
