:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --surface: #ffffff;
  --border: #ececf0;
  --text: #1d1d1f;
  --muted: #8a8a91;
  --accent: #ff385c;
  --accent-soft: #fff0f3;
  --accent-dark: #e11d48;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(24, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.container { width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 72px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  width: min(1280px, calc(100% - 40px)); margin: 0 auto;
  height: 66px; display: flex; align-items: center; gap: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ff5e78, #ff2e55);
  color: #fff; font-weight: 800; font-size: 19px; line-height: 1;
}
.brand-text { font-weight: 800; font-size: 18px; letter-spacing: -.4px; }
.main-nav { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.main-nav a {
  color: #5c5c64; font-size: 14px; font-weight: 600; padding: 6px 0;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.search-box {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid transparent; border-radius: 999px;
  padding: 0 14px; height: 38px; width: min(280px, 30vw);
  transition: border-color .2s, background .2s;
}
.search-box:focus-within { background: #fff; border-color: var(--accent); }
.search-box svg { width: 17px; height: 17px; color: var(--muted); }
.search-box input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.text-btn { border: 0; background: none; color: #55555d; font-size: 13px; font-weight: 600; padding: 4px; }
.text-btn:hover { color: var(--accent); }
.user-chip {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.admin-link { color: var(--muted); display: inline-flex; }
.admin-link svg { width: 19px; height: 19px; }
.admin-link:hover { color: var(--accent); }
.nav-toggle { display: none; border: 0; background: none; padding: 6px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }
.mobile-nav { display: none; }

/* ---------- buttons ---------- */
.btn-primary, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 700;
  border: 1px solid transparent; transition: transform .15s, background .2s, border-color .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active, .btn-outline:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- hero ---------- */
.hero {
  margin: 26px 0 20px; min-height: 224px; border-radius: 22px;
  background: linear-gradient(120deg, #fff2f4 0%, #fff8f0 52%, #f3f7ff 100%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 32px 48px; overflow: hidden; position: relative;
}
.hero-copy { position: relative; z-index: 2; max-width: 560px; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,.8); color: var(--accent-dark);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700;
}
.hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.18; margin: 14px 0 10px; letter-spacing: -1px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; color: #6c6c76; font-size: 15px; }
.hero-art { position: relative; width: 300px; height: 180px; flex-shrink: 0; }
.hero-tile { position: absolute; border-radius: 18px; box-shadow: var(--shadow); background: #fff; }
.tile-1 { width: 120px; height: 150px; left: 10px; top: 12px; transform: rotate(-9deg); background: linear-gradient(160deg, #ffd9df, #ff8fa3); }
.tile-2 { width: 116px; height: 138px; left: 112px; top: 30px; transform: rotate(4deg); background: linear-gradient(160deg, #ffe9c9, #ffbd69); }
.tile-3 { width: 110px; height: 128px; left: 190px; top: 2px; transform: rotate(11deg); background: linear-gradient(160deg, #dbe7ff, #8fb4ff); }
.tile-4 { width: 76px; height: 76px; left: 196px; top: 112px; transform: rotate(-7deg); background: linear-gradient(160deg, #d9f5e6, #7bd6a5); }

/* ---------- chips / toolbar ---------- */
.category-strip { display: flex; gap: 9px; overflow-x: auto; padding: 4px 0 18px; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 8px 16px; border-radius: 999px; background: var(--bg-soft);
  color: #55555d; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip:hover { background: var(--accent-soft); color: var(--accent-dark); }
.chip.active { background: var(--accent); color: #fff; }
.feed-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.feed-heading { font-size: 19px; margin: 0; letter-spacing: -.3px; }
.sort-tabs { display: flex; gap: 18px; }
.sort-tabs a { font-size: 13px; color: var(--muted); font-weight: 600; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.sort-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- feed grid ---------- */
.feed-grid { columns: 5; column-gap: 16px; }
.feed-card {
  break-inside: avoid; margin: 0 0 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.feed-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-link { display: block; }
.card-media { position: relative; overflow: hidden; background: var(--bg-soft); }
.card-media.ratio-0 { aspect-ratio: 3 / 4; }
.card-media.ratio-1 { aspect-ratio: 1 / 1; }
.card-media.ratio-2 { aspect-ratio: 4 / 5; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.feed-card:hover .card-media img { transform: scale(1.04); }
.no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b9b9c0; font-size: 13px; }
.card-badge {
  position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.92);
  color: #333; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.card-body { padding: 12px 13px 13px; }
.card-title {
  margin: 0 0 10px; font-size: 14px; line-height: 1.45; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.author-dot {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; flex-shrink: 0;
}
.author-dot.large { width: 36px; height: 36px; font-size: 15px; }
.author-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100px; }
.like-count { margin-left: auto; flex-shrink: 0; }
.load-more-wrap { display: flex; justify-content: center; padding: 34px 0 10px; }
.empty-state, .empty-page { grid-column: 1 / -1; text-align: center; padding: 72px 20px; color: var(--muted); }
.empty-emoji { font-size: 40px; margin-bottom: 10px; }
.empty-state h3, .empty-page h1 { color: var(--text); margin: 6px 0; }
.empty-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-page .btn-primary { margin-top: 18px; }

/* ---------- list hero ---------- */
.list-hero { padding: 30px 0 12px; }
.back-link { color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--accent); }
.list-hero h1 { font-size: 30px; margin: 10px 0 4px; letter-spacing: -.5px; }
.list-hero p { margin: 0; color: var(--muted); }

/* ---------- article ---------- */
.article-page { padding-top: 20px; }
.breadcrumb { display: flex; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 18px; align-items: center; }
.breadcrumb a:hover { color: var(--accent); }
.crumb-current { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 34px; align-items: start; }
.article-main { min-width: 0; }
.article-hero { border-radius: 20px; overflow: hidden; background: var(--bg-soft); }
.article-hero > img { width: 100%; max-height: 620px; object-fit: cover; }
.article-no-image { height: 260px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.thumb { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; background: none; flex-shrink: 0; }
.thumb img { width: 62px; height: 62px; object-fit: cover; }
.thumb.active { border-color: var(--accent); }
.article-header { padding: 26px 0 16px; }
.article-header h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.32; margin: 0 0 16px; letter-spacing: -.6px; }
.article-meta { display: flex; align-items: center; gap: 10px; }
.author-info { display: flex; flex-direction: column; line-height: 1.35; }
.author-info strong { font-size: 13px; }
.author-info span { font-size: 11px; color: var(--muted); }
.like-btn {
  margin-left: auto; border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 8px 16px; font-weight: 700; font-size: 13px; color: var(--muted);
}
.like-btn span:first-child { color: var(--accent); font-size: 16px; }
.like-btn.liked { background: var(--accent-soft); border-color: #ffc9d3; color: var(--accent-dark); }
.article-summary {
  background: var(--bg-soft); border-left: 3px solid var(--accent);
  padding: 14px 18px; border-radius: 0 10px 10px 0; color: #55555d; margin: 0 0 20px;
}
.article-content { font-size: 16px; line-height: 1.9; color: #2d2d32; word-break: break-word; }
.article-content h2, .article-content h3 { margin: 30px 0 12px; line-height: 1.4; }
.article-content img { border-radius: 14px; margin: 18px auto; }
.article-content a { color: var(--accent-dark); text-decoration: underline; }
.article-content blockquote { margin: 18px 0; padding: 10px 18px; background: var(--bg-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }
.article-content table { width: 100%; border-collapse: collapse; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 8px 10px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.tag-pill { background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 600; }
.tag-pill:hover { background: var(--accent); color: #fff; }

/* ---------- comments ---------- */
.comments-section { border-top: 1px solid var(--border); padding-top: 26px; margin-top: 30px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { margin: 0; font-size: 20px; }
.section-hint { font-size: 12px; color: var(--muted); }
.comment-form { background: var(--bg-soft); border-radius: 14px; padding: 16px; margin-bottom: 24px; }
.input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  padding: 11px 13px; outline: none; font-size: 14px; color: var(--text);
}
.input:focus { border-color: var(--accent); }
.comment-form .input { margin-bottom: 10px; }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-hint { color: var(--muted); font-size: 12px; }
.form-error { color: var(--accent-dark); font-size: 13px; min-height: 18px; margin: 6px 0; }
.comment-list { display: flex; flex-direction: column; gap: 18px; }
.comment-item { display: flex; gap: 12px; }
.comment-avatar {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%;
  background: linear-gradient(135deg, #ffe1e7, #ffc2cf); color: var(--accent-dark);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.comment-avatar.small { width: 26px; height: 26px; font-size: 11px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.comment-head strong { font-size: 13px; }
.comment-head time { color: var(--muted); }
.comment-body p { margin: 5px 0; white-space: pre-wrap; word-break: break-word; }
.reply-btn { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 0; }
.reply-btn:hover { color: var(--accent); }
.comment-reply { display: flex; gap: 8px; background: var(--bg-soft); border-radius: 10px; padding: 9px 11px; margin-top: 9px; font-size: 13px; }
.comment-reply p { margin: 2px 0 0; }
.comment-empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* ---------- sidebar ---------- */
.article-sidebar { display: flex; flex-direction: column; gap: 18px; }
.sticky-card { position: sticky; top: 86px; }
.side-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: #fff; }
.side-title { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 7px; margin-bottom: 14px; }
.product-list { display: flex; flex-direction: column; gap: 10px; }
.product-card {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center;
  border: 1px solid var(--border); border-radius: 12px; padding: 9px; transition: border-color .2s, background .2s;
}
.product-card:hover { border-color: var(--accent); background: #fffafb; }
.product-thumb {
  width: 56px; height: 56px; border-radius: 9px; overflow: hidden; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { display: flex; flex-direction: column; min-width: 0; }
.platform { color: var(--accent-dark); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.product-name { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { color: #e8590c; font-weight: 800; font-size: 12px; }
.buy-arrow { color: var(--accent); font-weight: 800; }
.disclaimer { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 14px 0 0; }
.side-empty { color: var(--muted); font-size: 13px; }
.related-list { display: flex; flex-direction: column; gap: 12px; }
.related-item { display: flex; gap: 10px; align-items: center; font-size: 13px; line-height: 1.4; }
.related-item img { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: var(--bg-soft); }
.related-item:hover { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 32px 0 18px; }
.footer-inner { width: min(1280px, calc(100% - 40px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.footer-brand strong { font-size: 15px; }
.footer-links { display: flex; gap: 20px; font-size: 13px; color: #66666e; align-items: center; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  width: min(1280px, calc(100% - 40px)); margin: 24px auto 0; padding-top: 14px;
  border-top: 1px solid var(--border); display: flex; justify-content: space-between;
  gap: 16px; font-size: 11px; color: var(--muted);
}
.analytics-slot { display: none; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--border);
  border-radius: 20px; padding: 34px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 25px; margin: 0 0 4px; letter-spacing: -.4px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.field-label { display: block; font-size: 12px; font-weight: 700; margin: 14px 0 6px; }
.auth-card .btn-primary { margin-top: 8px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.auth-foot a { color: var(--accent); font-weight: 700; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  background: #232329; color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .feed-grid { columns: 4; }
  .main-nav { gap: 12px; }
}
@media (max-width: 980px) {
  .feed-grid { columns: 3; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .sticky-card { position: static; }
  .article-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .search-box { width: min(260px, 40vw); }
  .mobile-nav {
    display: none; flex-wrap: wrap; gap: 6px; padding: 10px 20px 16px;
    border-top: 1px solid var(--border); background: #fff;
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a { background: var(--bg-soft); border-radius: 999px; padding: 6px 13px; font-size: 13px; }
}
@media (max-width: 720px) {
  .container, .header-inner, .footer-inner, .footer-bottom { width: calc(100% - 28px); }
  .header-inner { gap: 10px; height: 58px; }
  .brand-text { font-size: 16px; }
  .search-box { width: auto; flex: 1; padding: 0 10px; }
  .search-box input { font-size: 12px; }
  .header-actions .text-btn { display: none; }
  .hero { padding: 24px; min-height: 190px; }
  .hero-art { display: none; }
  .hero h1 { font-size: 29px; }
  .feed-grid { columns: 2; column-gap: 10px; }
  .feed-card { margin-bottom: 10px; }
  .card-body { padding: 10px; }
  .card-title { font-size: 13px; }
  .author-name { display: none; }
  .article-sidebar { grid-template-columns: 1fr; }
  .footer-inner, .footer-bottom { flex-direction: column; gap: 12px; }
}
@media (max-width: 420px) {
  .feed-grid { columns: 2; column-gap: 8px; }
  .card-badge { font-size: 10px; padding: 2px 6px; }
  .comment-form { padding: 12px; }
}
