/* ============================================================
   影祥视界 · 基础样式（v3 · 2026-10-26）
   依赖 tokens.css。命名约定：
     .hd/.sub/.seg/.wall/.ph   → 站点壳与照片流
     .card/.page/.rule/.hint   → 内容页（表单/后台）沿用旧类名，保证老页面不破
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--t-md); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent); color: #fff; }

/* ---------- 内测条 ---------- */
.notice {
  background: var(--bg-elev-2); color: var(--text-2);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-xs); padding: 7px var(--s-5); text-align: center; letter-spacing: .02em;
}

/* ================= Header ================= */
.hd {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 var(--s-5);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.hd .brand {
  display: flex; align-items: center; gap: 7px; flex: none;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
}
.hd .brand i { color: var(--accent); font-style: normal; }
.hd .brand small {
  font-size: 10px; font-weight: 500; letter-spacing: .16em;
  color: var(--text-3); text-transform: uppercase;
}
.hd nav { display: flex; align-items: center; gap: 2px; }
.hd nav a {
  padding: 6px 9px; border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: 500; color: var(--text-2);
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.hd nav a:hover { color: var(--text); background: var(--bg-elev-2); }
.hd nav a.on { color: var(--text); }

.hd .search {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 360px; height: 34px; padding: 0 14px; margin-left: 18px;
  background: var(--bg-elev); border: 1px solid transparent; border-radius: var(--r-full);
  color: var(--text-3); font-size: var(--t-xs);
  transition: border-color var(--dur-1) var(--ease);
}
.hd .search:hover { border-color: var(--line-strong); color: var(--text-2); }
.hd .search input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text); font: inherit; font-size: var(--t-sm);
}
.hd .search input::placeholder { color: var(--text-3); }
.hd .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hd .right a.txt { font-size: var(--t-sm); color: var(--text-2); padding: 6px 4px; }
.hd .right a.txt:hover { color: var(--text); }

/* ================= 按钮 ================= */
.btn, .btn-dark {
  height: 34px; padding: 0 16px; border: 0; cursor: pointer;
  border-radius: var(--r-full); background: var(--btn-bg); color: var(--btn-ink);
  font: 600 var(--t-sm)/1 var(--font); white-space: nowrap;
  transition: transform var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease);
}
.btn:hover, .btn-dark:hover { opacity: .86; }
.btn:active, .btn-dark:active { transform: scale(.97); }

.btn-ghost {
  height: 34px; padding: 0 15px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  border-radius: var(--r-full); font: 500 var(--t-sm)/1 var(--font);
  transition: border-color var(--dur-1) var(--ease);
}
.btn-ghost:hover { border-color: var(--text-3); }

/* 内容页里的老式主按钮（红底） */
button {
  height: 42px; padding: 0 20px; border: 0; border-radius: var(--r-sm);
  background: var(--accent); color: #fff; font: 600 var(--t-md)/1 var(--font);
  cursor: pointer; transition: opacity var(--dur-1) var(--ease);
}
button:hover { opacity: .88; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }

/* ================= 筛选条 ================= */
.sub {
  position: sticky; top: var(--header-h); z-index: 50;
  height: var(--subbar-h); display: flex; align-items: center; gap: 4px;
  padding: 0 var(--s-5);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.sub::-webkit-scrollbar { display: none; }
.sub .cat {
  padding: 6px 11px; border-radius: var(--r-full); border: 0;
  font-size: var(--t-xs); color: var(--text-3); white-space: nowrap;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.sub .cat:hover { color: var(--text); background: var(--bg-elev-2); }
.sub .cat.on { color: var(--btn-ink); background: var(--btn-bg); font-weight: 600; }

/* 分段控件 */
.seg {
  margin-left: auto; display: flex; gap: 2px; flex: none;
  background: var(--bg-elev); border-radius: var(--r-full); padding: 3px;
}
.seg a { padding: 5px 13px; border-radius: var(--r-full); font-size: var(--t-xs); color: var(--text-3); }
.seg a.on { background: var(--bg-elev-2); color: var(--text); font-weight: 600; }

/* ================= 区块 ================= */
.sec { max-width: var(--page-max); margin: 0 auto; padding: 26px var(--s-5) 0; }
.sec-hd { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.sec-hd h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.sec-hd .meta { font-size: var(--t-xs); color: var(--text-3); }
.sec-hd .more { margin-left: auto; font-size: var(--t-xs); color: var(--text-2); }
.sec-hd .more:hover { color: var(--text); }

/* ================= 精选集合横条 ================= */
.rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1200px) { .rail { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .rail { grid-template-columns: repeat(2, 1fr); } }
.coll .strip { display: flex; gap: 2px; border-radius: var(--r-xs); overflow: hidden; background: var(--bg-elev); }
.coll .strip img {
  width: 100%; height: 132px; object-fit: cover; flex: 1; min-width: 0;
  transition: transform var(--dur-2) var(--ease);
}
.coll:hover .strip img { transform: scale(1.04); }
.coll .t { margin-top: 9px; font-size: var(--t-sm); font-weight: 500; }
.coll .m { margin-top: 2px; font-size: var(--t-xs); color: var(--text-3); }

/* ================= 照片流 ================= */
.wall {
  max-width: var(--page-max); margin: 0 auto;
  padding: 0 var(--s-5) var(--s-6);
  column-count: 5; column-gap: var(--gutter);
}
@media (max-width: 1500px) { .wall { column-count: 4; } }
@media (max-width: 1200px) { .wall { column-count: 3; } }
@media (max-width: 820px)  { .wall { column-count: 2; } }

.ph {
  position: relative; display: block; break-inside: avoid;
  margin-bottom: var(--gutter); border-radius: 2px; overflow: hidden;
  background: var(--bg-elev); cursor: zoom-in;
}
.ph img { width: 100%; height: auto; transition: transform var(--dur-2) var(--ease), filter var(--dur-2) var(--ease); }
.ph:hover img { transform: scale(1.03); filter: brightness(.92); }
.ph .ov {
  position: absolute; inset: auto 0 0 0; padding: 44px 12px 11px;
  background: var(--overlay); display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.ph:hover .ov, .ph.fv .ov { opacity: 1; }
.ph .who { display: flex; align-items: center; gap: 7px; font-size: var(--t-xs); color: #fff; min-width: 0; }
.ph .who .av { width: 20px; height: 20px; border-radius: 50%; flex: none; background: rgba(255,255,255,.24); border: 1px solid rgba(255,255,255,.5); }
.ph .who b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.ph .acts { display: flex; gap: 10px; flex: none; font-size: var(--t-xs); color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.ph .tag {
  position: absolute; top: 9px; left: 9px; padding: 2px 6px; border-radius: 2px;
  font-size: 9.5px; font-weight: 600; letter-spacing: .03em;
  background: var(--brand); color: #fff;
  opacity: 0; transform: translateY(-2px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.ph:hover .tag, .ph.fv .tag { opacity: 1; transform: none; }

/* 图片淡入（ui.js 加 .rdy） */
.ph img { opacity: 0; }
.ph img.rdy { opacity: 1; transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), filter var(--dur-2) var(--ease); }

/* 加载中 */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 44px 0; color: var(--text-3); font-size: var(--t-sm); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--text-2); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ================= 内容页（表单/后台，沿用旧类名） ================= */
.page { flex: 1; width: 100%; max-width: var(--content-w); margin: 0 auto; padding: 44px var(--s-5) 60px; }
.page-wide { max-width: 1080px; }
.page h1 { font-size: 28px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.page h2 { font-size: 19px; font-weight: 600; margin: 26px 0 10px; }
.rule { width: 40px; height: 3px; background: var(--accent); margin: 16px 0 24px; }
p.lead { color: var(--text-2); font-size: var(--t-md); line-height: 1.9; }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 22px; margin-top: 18px;
}
.page label { display: block; font-size: var(--t-xs); color: var(--text-2); margin: 14px 0 6px; }
.page input[type=text], .page input[type=tel], .page input[type=password],
.page input[type=email], .page input[type=file], .page input[type=number], .page select, .page textarea {
  width: 100%; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 0 12px; font-size: var(--t-md); background: var(--bg-elev-2); color: var(--text);
  font-family: var(--font); outline: 0;
}
.page input:focus, .page select:focus, .page textarea:focus { border-color: var(--accent); }
.page textarea { height: auto; min-height: 90px; padding: 10px 12px; }
.hint { font-size: var(--t-xs); color: var(--text-3); line-height: 1.8; margin-top: 10px; }
.err { background: rgba(230,0,18,.08); border: 1px solid rgba(230,0,18,.3); color: var(--brand-ink); border-radius: var(--r-sm); padding: 10px 12px; font-size: var(--t-sm); margin-top: 14px; }
.ok  { background: rgba(31,107,49,.10); border: 1px solid rgba(31,107,49,.30); color: #1F6B31; border-radius: var(--r-sm); padding: 10px 12px; font-size: var(--t-sm); margin-top: 14px; }
[data-theme="dark"] .err { color: #FF8A90; }
[data-theme="dark"] .ok { color: #7BD69A; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.row span:first-child { color: var(--text-3); }
.badge.solid { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
.badge { display: inline-block; border: 1px solid var(--accent); color: var(--accent); border-radius: var(--r-full); font-size: var(--t-2xs); padding: 2px 9px; margin-left: 8px; vertical-align: middle; }
form.inline { display: inline; }

/* 内容页里的按钮（红色主按钮已在全局 button 定义） */
.page .card button { margin-top: 16px; }

/* ================= 页脚 ================= */
.ft {
  margin-top: auto; max-width: var(--page-max);
  padding: 26px var(--s-5) 40px; border-top: 1px solid var(--line);
  display: flex; gap: var(--s-5); flex-wrap: wrap; align-items: center;
  font-size: var(--t-xs); color: var(--text-3);
}
.ft a:hover { color: var(--text-2); }

/* ================= 移动端 ================= */
@media (max-width: 820px) {
  .hd { height: 56px; gap: 12px; padding: 0 14px; }
  .hd nav, .hd .search { display: none; }
  .sub { padding: 0 14px; }
  .sec { padding: 20px 14px 0; }
  .wall { padding: 0 14px 30px; column-gap: 6px; }
  .ph { margin-bottom: 6px; }
  .rail { gap: 10px; }
  .coll .strip img { height: 92px; }
  .page { padding: 28px 16px 48px; }
  .page h1 { font-size: 23px; }
  /* 触摸设备不依赖 hover：常显浮层，但去掉角标（太吵） */
  .ph .ov { opacity: 1; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.6)); padding: 34px 9px 8px; }
  .ph .tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================= 作品卡片弹层（lightbox） ================= */
.lb { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb-bd { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lb-body { position: relative; width: min(1360px, 94vw); max-height: 92vh; }
body.lb-open { overflow: hidden; }

.lbc {
  display: grid; grid-template-columns: minmax(0,1fr) 400px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  max-height: 92vh; box-shadow: var(--card-shadow);
  animation: lbIn var(--dur-2) var(--ease);
}
@keyframes lbIn { from { opacity: 0; transform: translateY(8px) scale(.995); } }

.lbc-media { position: relative; background: var(--bg); display: flex; align-items: center; justify-content: center; min-height: 300px; }
.lbc-media img { max-width: 100%; max-height: 92vh; width: auto; height: auto; object-fit: contain; }
.lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: var(--bg-elev-2); border: 1px solid var(--line-strong);
  color: #fff; font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--dur-1) var(--ease);
}
.lbc-media:hover .lb-arrow { opacity: 1; }
.lb-arrow.l { left: 14px; } .lb-arrow.r { right: 14px; }

.lbc-side { position: relative; background: var(--bg-elev); border-left: 1px solid var(--line);
            display: flex; flex-direction: column; overflow-y: auto; }
.lb-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
            border: 0; background: transparent; color: var(--text-2); font-size: 15px; cursor: pointer; }
.lb-close:hover { background: var(--bg-elev-2); color: var(--text); }

.lbc-author { display: flex; align-items: center; gap: 10px; padding: 22px 22px 0; }
.lbc-av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center;
          justify-content: center; background: linear-gradient(135deg,var(--bg-elev-2),var(--bg));
          border: 1px solid var(--line-strong); color: var(--text-2); font-weight: 600; }
.lbc-nm b { color: var(--text); font-size: var(--t-md); font-weight: 600; }
.lbc-chips { display: flex; gap: 6px; margin-top: 3px; }
.lbc-chip { font-size: 10px; padding: 2px 7px; border-radius: 2px; background: var(--brand); color: #fff; font-weight: 600; }
.lbc-chip.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); font-weight: 500; }
.lbc-follow { margin-left: auto; height: 30px; padding: 0 14px; font-size: var(--t-xs);
              display: inline-flex; align-items: center; border-color: var(--line-strong); color: var(--text); }

.lbc-title { margin: 18px 22px 0; color: var(--text); font-size: var(--t-xl); font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.lbc-desc { margin: 8px 22px 0; color: var(--text-2); font-size: var(--t-sm); line-height: 1.7; }
.lbc-meta { margin: 12px 22px 0; display: flex; gap: 10px; flex-wrap: wrap; color: var(--text-3); font-size: var(--t-xs); }
.lbc-meta span + span::before { content: "·"; margin-right: 8px; }

.lbc-stats { margin: 16px 22px 0; padding: 10px 0; display: flex; gap: 4px;
             border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lbc-stats form { flex: 1; display: flex; min-width: 0; }
.lbc-stats > button { flex: 1; min-width: 0; }
.lbc-stats button { width: 100%; height: auto; background: transparent; border: 0; cursor: pointer;
                    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0;
                    border-radius: var(--r-sm); color: var(--text-2); font-family: var(--font); }
.lbc-stats button:hover { background: var(--bg-elev-2); color: var(--text); }
.lbc-stats button.on { color: var(--accent); }
.lbc-stats span { font-size: 15px; line-height: 1; }
.lbc-stats i { font-style: normal; font-size: var(--t-xs); font-variant-numeric: tabular-nums; }

.lbc-lic { margin: 16px 22px 0; padding: 12px; background: var(--bg-elev-2); border-radius: var(--r-sm);
           display: flex; flex-direction: column; gap: 4px; }
.lbc-lic b { color: var(--text); font-size: var(--t-xs); font-weight: 600; }
.lbc-lic span { color: var(--text-2); font-size: var(--t-xs); }
.lbc-lic code { color: var(--text-2); font-size: var(--t-2xs); font-family: var(--font); margin-top: 4px; word-break: break-all; }

.lbc-foot { margin-top: auto; padding: 16px 22px 20px; display: flex; gap: 10px; }
.lbc-foot .btn, .lbc-foot .btn-ghost { flex: 1; height: 38px; display: flex; align-items: center;
                                       justify-content: center; font-size: var(--t-sm); }
.lbc-foot .btn { background: var(--btn-bg); color: var(--btn-ink); }
.lbc-foot .btn-ghost { border-color: var(--line-strong); color: var(--text); }

@media (max-width: 900px) {
  .lb-body { width: 100vw; max-height: 100vh; }
  .lbc { grid-template-columns: 1fr; max-height: 100vh; border-radius: 0; border: 0; }
  .lbc-media { max-height: 52vh; }
  .lbc-media img { max-height: 52vh; }
  .lb-arrow { opacity: 1; }
  .lbc-side { border-left: 0; border-top: 1px solid var(--line); }
}

.lbc-info { margin: 14px 22px 0; display: flex; flex-direction: column; gap: 7px; }
.lbc-info > div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--t-xs); }
.lbc-info span { color: var(--text-3); }
.lbc-info b { color: var(--text-2); font-weight: 500; }


/* 文件选择框：深色统一 */
.page input[type=file] { padding: 6px 10px; height: auto; line-height: 1.9; }
.page input[type=file]::file-selector-button {
  margin-right: 10px; height: 30px; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--bg-elev-2); color: var(--text);
  font-family: var(--font); font-size: var(--t-xs);
}
.page input[type=file]::file-selector-button:hover { border-color: var(--text-3); }


/* ---- 明暗模式切换按钮（2026-11-03） ---- */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;padding:0;border-radius:50%;cursor:pointer;
  border:1px solid var(--line);background:transparent;color:var(--text);
  transition:background .15s ease,border-color .15s ease;}
.theme-toggle:hover{background:var(--bg-elev-2);border-color:var(--line-2,#3a3a3a)}
.theme-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.theme-toggle .ico-moon{display:none}
[data-theme="light"] .theme-toggle .ico-moon{display:block}
[data-theme="light"] .theme-toggle .ico-sun{display:none}
@media (max-width:820px){.theme-toggle{width:30px;height:30px}}

/* Logo「影祥」品牌红（2026-11-03） */
.brand .brand-cn{color:var(--accent)}

/* Logo：「影祥视界」四字一体（2026-11-03 修字距/对齐，去装饰红点） */
.hd .brand { align-items: baseline; }
.brand .brand-txt { display: inline-flex; align-items: baseline; gap: 0; letter-spacing: -.01em; }
.brand .brand-cn { color: var(--accent); }

/* 链接形式的 btn / btn-ghost 垂直居中（2026-11-03：修作品页「主页」文字偏上） */
a.btn, a.btn-ghost { display: inline-flex; align-items: center; justify-content: center; line-height: 1; text-decoration: none; }
/* 头部「免费注册」主按钮 */
.hd .reg-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 6px;
               background: var(--brand); color: #fff; font-weight: 600; font-size: 13px; text-decoration: none; }
.hd .reg-btn:hover { filter: brightness(1.08); }
/* 关注按钮 */
/* 关注按钮：未关注=实心主色 / 已关注=描边弱化（2026-11-03 强化状态区分） */
.follow-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px;
              height: 30px; padding: 0 14px; font-size: 12.5px; font-weight: 600;
              white-space: nowrap; min-width: 84px; flex: none;
              border-radius: 6px; border: 1px solid var(--brand);
              color: #fff; background: var(--brand);
              cursor: pointer; font-family: var(--font); transition: filter var(--dur-1) var(--ease); }
.follow-btn:hover { filter: brightness(1.08); }
.follow-btn.on { background: transparent; color: var(--text-3); border-color: var(--line-strong);
                 font-weight: 500; }
.follow-btn.on:hover { color: var(--brand); border-color: var(--brand); filter: none; }

/* 作者行防挤压（2026-11-03）：chip 与按钮禁止逐字断行，容器允许换行 */
.chip, .chip.ghost { white-space: nowrap; }
.btn, .btn-ghost { white-space: nowrap; }
.author { flex-wrap: wrap; row-gap: 8px; }
.author .nm { min-width: 0; }
.author .nm b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.author .acts { width: 100%; justify-content: flex-end; margin-left: 0; }
