/*
Theme Name: Dark Lens
Theme URI: https://local/dark-lens
Author: YG
Description: 深色写真站主题 — 瀑布流图墙、衬线标题、沉浸式浏览。为写真/图集站设计。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
License: GPL-2.0-or-later
Text Domain: dark-lens
*/

:root {
  --bg: #0d0b10;
  --bg-soft: #131019;
  --card: #171320;
  --fg: #eae4f0;
  --dim: #968da4;
  --acc: #d4546c;
  --line: rgba(255, 255, 255, .08);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; }

::selection { background: var(--acc); color: #fff; }

/* ---------- 顶部导航 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 11, 16, .72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 36px;
}

.brand {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .22em;
  white-space: nowrap;
}

.brand:hover { color: var(--acc); }

.site-nav { display: flex; gap: 26px; flex: 1; }

.site-nav ul { display: flex; gap: 26px; margin: 0; padding: 0; list-style: none; }
.site-nav li { margin: 0; }

.site-nav a {
  font-size: 13px;
  color: var(--dim);
  letter-spacing: .04em;
  position: relative;
  padding: 4px 0;
  transition: color .25s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--acc);
  transition: width .3s cubic-bezier(.2, .7, .3, 1);
}

.site-nav a:hover { color: var(--fg); }
.site-nav a:hover::after { width: 100%; }

.head-cta {
  font-size: 13px;
  letter-spacing: .08em;
  padding: 7px 18px;
  border: 1px solid rgba(212, 84, 108, .55);
  color: var(--acc);
  border-radius: 999px;
  transition: background .3s, color .3s, border-color .3s;
  white-space: nowrap;
}

.head-cta:hover {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}

/* ---------- 首屏 ---------- */
.hero {
  max-width: 1560px;
  margin: 0 auto;
  padding: 104px 28px 34px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(42px, 7.4vw, 96px);
  line-height: .98;
  letter-spacing: .03em;
  margin: 0;
}

.hero h1 em {
  font-style: normal;
  color: var(--acc);
}

.hero-side {
  max-width: 34ch;
  text-align: right;
  margin-left: auto;
}

.hero-side p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 2;
  color: var(--dim);
}

.hero-rule {
  width: 64px;
  height: 1px;
  background: var(--line);
  margin: 0 0 14px auto;
}

/* ---------- 图墙 ---------- */
.wall {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 28px 90px;
}

.grid {
  columns: 4;
  column-gap: 16px;
}

.card {
  display: block;
  position: relative;
  overflow: hidden;
  break-inside: avoid;
  margin: 0 0 16px;
  background: var(--card);
  border-radius: 2px;
  animation: rise .75s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 26ms);
}

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

.card img {
  display: block;
  width: 100%;
  transition: transform .85s cubic-bezier(.2, .7, .3, 1), filter .5s;
}

.card:hover img { transform: scale(1.045); }

.card .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 16px 14px;
  font-size: 12.5px;
  letter-spacing: .03em;
  line-height: 1.5;
  background: linear-gradient(transparent, rgba(6, 5, 9, .88));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s, transform .35s;
}

.card:hover .cap { opacity: 1; transform: none; }

.card .cap b {
  display: block;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .cap span { color: var(--acc); font-size: 11px; letter-spacing: .12em; }

/* ---------- 空态 ---------- */
.empty {
  padding: 90px 0;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
}

/* ---------- 内容页 ---------- */
.sheet {
  max-width: 760px;
  margin: 0 auto;
  padding: 96px 28px 120px;
}

.sheet > *:first-child { margin-top: 0; }

.sheet h1, .sheet h2, .sheet h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.35;
}

.sheet h1 { font-size: clamp(30px, 4vw, 46px); margin: 0 0 28px; }

.sheet h2 { font-size: 23px; margin: 44px 0 14px; }

.sheet p, .sheet li { color: #cfc7db; }

.sheet a { color: var(--acc); border-bottom: 1px solid rgba(212, 84, 108, .35); }
.sheet a:hover { border-bottom-color: var(--acc); }

.sheet hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* ---------- 表单（会员注册 / 登录） ---------- */
.sheet input[type="text"],
.sheet input[type="email"],
.sheet input[type="password"],
.sheet input[type="search"],
.sheet select,
.sheet textarea {
  width: 100%;
  padding: 12px 14px;
  margin: 6px 0 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  transition: border-color .25s;
}

.sheet input:focus, .sheet select:focus, .sheet textarea:focus {
  outline: none;
  border-color: rgba(212, 84, 108, .6);
}

.sheet label { font-size: 13px; color: var(--dim); }

.sheet button,
.sheet input[type="submit"],
.sheet .swpm-form input[type="submit"] {
  display: inline-block;
  padding: 12px 30px;
  background: var(--acc);
  border: 1px solid var(--acc);
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-size: 14px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .3s, transform .2s;
}

.sheet button:hover, .sheet input[type="submit"]:hover { background: #c04059; }
.sheet button:active, .sheet input[type="submit"]:active { transform: translateY(1px); }

.sheet table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th, .sheet td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.sheet th { color: var(--dim); font-weight: 500; }

/* 会员插件自带的表单容器收窄 */
.swpm-form, form.swpm-form { max-width: 460px; }
.swpm-form br { display: none; }

/* ---------- 页脚 ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 38px 28px 54px;
}

.foot-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--dim);
  letter-spacing: .04em;
}

.foot-inner a:hover { color: var(--acc); }

/* ---------- 灯箱 ---------- */
.lens-box {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 5, 9, .96);
  backdrop-filter: blur(8px);
}

.lens-box.on { display: flex; }

.lens-box img {
  max-width: 94vw;
  max-height: 92vh;
  object-fit: contain;
  animation: rise .4s cubic-bezier(.2, .7, .3, 1) both;
}

.lens-box .close {
  position: absolute;
  top: 22px;
  right: 26px;
  font-size: 26px;
  line-height: 1;
  color: var(--dim);
  cursor: pointer;
}

.lens-box .close:hover { color: #fff; }

/* 原图下线时的降级提示 */
.lens-note {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  margin: 0;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
  letter-spacing: .06em;
  transform: translateY(-50%);
  pointer-events: none;
}

.lens-box:has(img[src]) .lens-note { top: auto; bottom: 28px; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) { .grid { columns: 3; } }

@media (max-width: 820px) {
  .grid { columns: 2; }
  .head-inner { padding: 0 18px; gap: 18px; height: 56px; }
  .site-nav { display: none; }
  .hero { padding: 64px 18px 26px; }
  .hero-side { text-align: left; margin-left: 0; }
  .hero-rule { margin-left: 0; }
  .wall, .sheet { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 520px) {
  .grid { columns: 1; }
  .hero h1 { font-size: 40px; }
}
