:root {
  --bg: #f2e7d8;
  --card: #ffffff;
  --gold: #b08c3a;
  --gold-dark: #9a7a2f;
  --text: #333;
  --muted: #666;
  --border: #d8c9b3;
  --shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: var(--bg);
  padding: 12px 0 0;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
}
.logo-block img {
  max-height: 52px;
  width: auto;
  display: block;
}
.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.brand-name { font-weight: 700; }
.brand-desc { color: var(--muted); }

.nav-bar {
  background: linear-gradient(180deg, #c6a970, #b19057);
  color: #fff;
  padding: 12px 0;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0;
  font-weight: 600;
}
.nav-link {
  padding: 6px 26px;
  border-left: 1px solid rgba(255,255,255,0.3);
}
.nav-link:first-child { border-left: none; }

.hero {
  background: url("https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?auto=format&fit=crop&w=1400&q=60") center/cover no-repeat;
  height: 260px;
  position: relative;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(242,231,216,0.9));
  display: grid;
  place-items: center;
}
.search {
  width: min(620px, 90vw);
  display: flex;
  box-shadow: var(--shadow);
}
.search input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  outline: none;
  font-size: 16px;
  background: #fff;
}
.search button {
  width: 60px;
  border: none;
  background: var(--gold);
  color: #fff;
  font-size: 18px;
}
.search button:hover { background: var(--gold-dark); }

.page {
  max-width: 1100px;
  margin: 18px auto 60px;
  padding: 0 16px;
}
.main-grid {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr;
  gap: 18px;
}

.content {
  background: var(--card);
  padding: 18px 18px 24px;
  box-shadow: var(--shadow);
}
.content-title {
  margin: 0 0 10px;
  font-size: 22px;
}
.cta {
  width: 100%;
  background: var(--gold);
  color: #fff;
  padding: 12px;
  border: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 12px;
}
.cta-title { pointer-events: none; }
.cta-toggle {
  position: absolute;
  right: 18px;
  font-size: 18px;
}

.first-visit-panel {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  line-height: 1.6;
  display: none;
  flex-direction: column;
  gap: 12px;
}
.first-visit-panel[hidden] { display: none !important; }
.first-visit-panel.is-open { display: flex; }
.first-visit-panel h3 { margin: 0; font-size: 18px; }
.grid-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.grid-box.wide {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid-box span {
  display: block;
  padding: 12px;
  border: 1px solid #dcd3c4;
  text-align: center;
  font-size: 14px;
  background: #faf7f2;
}
.grid-box small { color: var(--muted); }

.post-meta {
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin: 4px 0;
}
.post-title {
  text-align: center;
  margin: 6px 0 8px;
  font-size: 18px;
}
.under-line { text-decoration: underline; }

.admin-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
  font-size: 14px;
  color: var(--muted);
}
.admin-tools input { margin-right: 6px; }
.admin-hint { font-size: 13px; }

.mgs-grid,
.fanza-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.mgs-card {
  background: #fff;
  border: 1px solid #e6d9c6;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 12px 12px;
}
.card-cover {
  position: relative;
  display: block;
  height: 165px;
  background: url("https://placehold.co/600x360/9aa8a5/ffffff?text=MGS") center/cover no-repeat;
}
.card-cover-2 { background: url("https://placehold.co/600x360/8b6a5c/ffffff?text=NTR") center/cover no-repeat; }
.card-cover-3 { background: url("https://placehold.co/600x360/b7a69d/ffffff?text=S-Cute") center/cover no-repeat; }
.cover-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(255,255,255,0.95);
  color: var(--gold-dark);
  padding: 6px 10px;
  border: 1px solid #d7c6a5;
  font-weight: 700;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 6px 10px;
}
.card-date {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.card-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: #3b3b3b;
}
.meta-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
  justify-content: center;
}
.meta-icon { color: #c6a970; font-size: 12px; }
.meta-text { color: #444; text-align: center; }
.meta-text.site { font-weight: 600; }
.meta-text.code { color: #666; }
.card-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.btn-ghost {
  border: 1px solid #dcd3c4;
  background: #fff;
  padding: 6px 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}
.btn-ghost.small { font-size: 13px; }
.btn-ghost:hover { background: #f7f0e3; }
.card-foot {
  border-top: 1px solid #e6d9c6;
  padding: 8px 6px 6px;
  text-align: center;
  color: #8a7f72;
  font-weight: 700;
  font-size: 12px;
}

.mgs-grid.admin-enabled .card-cover {
  cursor: pointer;
}
.mgs-grid.admin-enabled .card-cover::after {
  content: "上传封面";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
}
.mgs-grid.admin-enabled .card-cover:hover::after {
  opacity: 1;
}

.mgs-card {
  background: #fff;
  border: 1px solid #e6d9c6;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.mgs-card .card-cover {
  height: 170px;
}
.mgs-card .card-body {
  padding: 10px 8px 10px;
  background: #fff;
}
.mgs-card .card-title {
  font-size: 14px;
  font-weight: 700;
}
.mgs-card .btn-ghost {
  padding: 6px 10px;
  font-size: 12px;
}
.mgs-card .card-foot {
  padding: 8px 8px 6px;
  color: #8a7f72;
}

.fanza-card {
  background: #fff;
  border: 1px solid #e6d9c6;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 10px 12px;
}
.fanza-card .card-body {
  background: #fff;
}
.fanza-card .btn-ghost {
  padding: 6px 12px;
}
.fanza-card .card-foot {
  padding: 10px 8px 6px;
  color: #a09382;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ad-card, .comments-card {
  background: #fff;
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.ad-img {
  width: 100%;
  height: 180px;
  background: url("https://placehold.co/400x240/ccb07a/ffffff?text=AD") center/cover no-repeat;
  margin-bottom: 8px;
}
.comments-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.comments-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comments-card li {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eee3d3;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5dba7;
  display: grid;
  place-items: center;
}
.comment-author {
  margin: 0;
  font-weight: 700;
}
.comment-date {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.comment-text {
  margin: 4px 0 0;
  font-size: 14px;
}

@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .nav-inner {
    gap: 16px;
    padding: 0 12px;
  }
  .post-card {
    flex-direction: column;
  }
  .thumb, .thumb-2 {
    width: 100%;
    height: 180px;
  }
  .header-brand { flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .search {
    width: 92vw;
  }
  .nav-inner {
    flex-wrap: wrap;
  }
}
