:root {
  --bg: #e9eef3;
  --bg-2: #dfe8f0;
  --ink: #141820;
  --muted: #5c6674;
  --line: #c9d3de;
  --surface: #f7fafc;
  --accent: #0b7a75;
  --accent-2: #134e4a;
  --ad-bg: #e2eaf1;
  --shadow: 0 12px 28px rgba(20, 24, 32, 0.08);
  --font-display: "Avenir Next", "Futura", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-body: "Optima", "PingFang SC", "Hiragino Mincho ProN", "Songti SC", serif;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(900px 420px at 8% -10%, #c9e7e4 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, #cfd9e8 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }

.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(247, 250, 252, 0.86);
  border-bottom: 1px solid rgba(201, 211, 222, 0.9);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  min-width: 0;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #0b7a75, #1f3a5f);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  flex: 0 0 auto;
}
.brand-text { min-width: 0; }
.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand img.logo {
  height: 42px;
  width: auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: flex-end;
  font-family: var(--font-display);
  font-size: 14px;
}
.nav a {
  color: var(--ink);
  opacity: 0.78;
  position: relative;
  padding: 4px 0;
}
.nav a:hover,
.nav a.active {
  opacity: 1;
  color: var(--accent-2);
}
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-display);
  cursor: pointer;
}

/* Ads */
.ad-slot { margin: 16px 0; }
.ad-slot a { display: block; }
.ad-slot img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.sidebar .ad-slot img {
  max-height: 360px;
  object-fit: cover;
}
.ad-placeholder {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(11, 122, 117, 0.06),
      rgba(11, 122, 117, 0.06) 10px,
      rgba(19, 78, 74, 0.04) 10px,
      rgba(19, 78, 74, 0.04) 20px
    ),
    var(--ad-bg);
  border: 1px dashed #9aafc0;
  border-radius: 12px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  text-align: center;
  padding: 22px 16px;
}
.ad-placeholder.tall { min-height: 220px; display: grid; place-items: center; }

/* Hero / page intro */
.page-hero {
  padding: 28px 0 8px;
}
.page-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.page-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--font-display);
  max-width: 52ch;
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
  padding: 8px 0 48px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 16px;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid var(--line);
  background: rgba(247, 250, 252, 0.8);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
}
.chip.active,
.chip:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: #e7f5f3;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.item {
  display: flex;
  flex-direction: column;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.45s ease both;
}
.item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: inherit;
}
.item .thumb {
  aspect-ratio: 3 / 4;
  background: #d5dee8;
  overflow: hidden;
}
.item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.item .body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.item .cat {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: none;
}
.item h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item .date {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted);
}

.sidebar {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.panel h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
}
.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
}
.cat-list a { color: var(--ink); }
.cat-list a:hover { color: var(--accent); }
.cat-list span {
  color: var(--muted);
  float: right;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 28px 0 8px;
  font-family: var(--font-display);
}
.pager a,
.pager span {
  min-width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}
.pager a:hover,
.pager .current {
  border-color: var(--accent);
  background: #e7f5f3;
  color: var(--accent-2);
}

/* Detail */
.detail-wrap {
  width: min(100% - 32px, 880px);
  margin: 0 auto;
  padding: 24px 0 64px;
}
.detail-wrap .back {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-wrap .back a { color: var(--accent); }
.detail-wrap h1 {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  line-height: 1.25;
}
.detail-meta {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  margin-bottom: 18px;
}
.detail-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 8px;
  line-height: 1.8;
  font-size: 1.02rem;
}
.detail-content img { display: none; }
.detail-content p { margin: 0 0 1em; }
.gallery {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.gallery a {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #d5dee8;
  aspect-ratio: 3/4;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.gallery a:hover img { transform: scale(1.04); }
.links-box,
.tags-box {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  font-family: var(--font-display);
}
.links-box h3,
.tags-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.links-box a {
  display: block;
  margin: 6px 0;
  word-break: break-all;
}
.links-locked .locked-links {
  display: none;
}
.links-box.is-unlocked .gate-panel {
  display: none;
}
.links-box.is-unlocked .locked-links {
  display: block;
}
.gate-panel {
  margin-top: 4px;
}
.gate-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.gate-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gate-form input[type="password"] {
  flex: 1 1 160px;
  min-width: 140px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.gate-form input[type="password"]:focus {
  outline: 2px solid rgba(11, 122, 117, 0.25);
  border-color: var(--accent);
}
.gate-form button {
  height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.gate-form button:hover {
  background: var(--accent-2);
}
.gate-get {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #eef4f8;
  white-space: nowrap;
}
.gate-get:hover {
  color: var(--accent-2);
  border-color: var(--accent);
}
.gate-error {
  display: none;
  margin: 10px 0 0;
  color: #b42318;
  font-size: 13px;
}
.gate-error.show {
  display: block;
}
.tags-box { color: var(--muted); font-size: 13px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(247, 250, 252, 0.9);
  padding: 28px 0 36px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  gap: 18px;
}
.friend-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-family: var(--font-display);
  font-size: 14px;
}
.friend-links a { color: var(--ink); opacity: 0.8; }
.friend-links a:hover { opacity: 1; color: var(--accent); }
.footer-copy {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; order: 2; }
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0 4px;
  }
  .nav.open { display: flex; }
  .header-inner { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .item, .gallery img { animation: none; transition: none; }
}
