:root {
  --bg: #0a0b0e;
  --bg-soft: #0f1116;
  --panel: #14171e;
  --panel-2: #1a1e27;
  --panel-3: #222732;
  --line: #262c38;
  --line-soft: #1d222c;
  --text: #eceef3;
  --text-2: #b6bdca;
  --dim: #7d8697;
  --accent: #ff5334;
  --accent-soft: #ff7a5e;
  --accent-ghost: rgba(255, 83, 52, 0.12);
  --ok: #35d07f;
  --warn: #ffb224;
  --bad: #ff5f5f;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 60px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -280px, rgba(255, 83, 52, 0.09), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #303747; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 11, 14, 0.78);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

.header-bar {
  max-width: 1240px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 clamp(12px, 3vw, 24px);
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #b32d16);
  display: grid;
  place-items: center;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(255, 83, 52, 0.35);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-text small { display: block; font-size: 10px; color: var(--dim); font-weight: 600; letter-spacing: 2px; }

.nav {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--dim);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.18s, background 0.18s;
}
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.on { color: var(--text); }
.nav a.on::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  animation: navUnderline 0.32s var(--ease);
}
@keyframes navUnderline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.header-right { display: flex; align-items: center; gap: 8px; flex: none; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, #3a4356, #232a37);
  border: 1px solid var(--line);
  flex: none;
}
.avatar.lg { width: 56px; height: 56px; font-size: 22px; border-radius: 18px; }

.badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 70;
  animation: popIn 0.18s var(--ease);
}
.menu a, .menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.menu a:hover, .menu button:hover { background: var(--panel-2); color: var(--text); }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }

main { min-height: calc(100vh - var(--header-h) - 120px); }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px) clamp(12px, 3vw, 24px) 80px;
}
.wrap.narrow { max-width: 760px; }
.wrap.tight { max-width: 480px; }

.view { animation: viewIn 0.34s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.view.leaving { animation: viewOut 0.16s var(--ease) both; }
@keyframes viewOut { to { opacity: 0; transform: translateY(-6px); } }

h1 { font-size: clamp(22px, 4vw, 30px); line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.4px; }
h2 { font-size: clamp(17px, 2.4vw, 20px); margin: 0 0 14px; letter-spacing: -0.2px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.sub { color: var(--dim); font-size: 14px; margin: 0 0 20px; }
.muted { color: var(--dim); }
.tiny { font-size: 12px; }
.center { text-align: center; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.segmented {
  display: flex;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
  flex: none;
}
.segmented button {
  border: 0;
  background: none;
  color: var(--dim);
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s;
  min-height: 36px;
}
.segmented button.on {
  color: #fff;
  background: linear-gradient(140deg, var(--accent), #d63d20);
  box-shadow: 0 3px 10px rgba(255, 83, 52, 0.3);
}
.segmented button:not(.on):hover { color: var(--text); }

.search {
  position: relative;
  flex: 1;
  min-width: 190px;
}
.search input { padding-left: 38px; }
.search .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
  font-size: 14px;
}
.search .clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: var(--panel-3);
  color: var(--dim);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  font-size: 13px;
}

input[type=text], input[type=search], input[type=email], input[type=password],
input[type=number], textarea, select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  min-height: 44px;
}
input::placeholder, textarea::placeholder { color: #5d6577; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}
textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

label {
  display: block;
  margin: 16px 0 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
label .req { color: var(--accent); }
.hint { color: var(--dim); font-size: 12.5px; margin-top: 6px; line-height: 1.55; }
.counter { float: right; color: var(--dim); font-size: 12px; font-weight: 400; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  background: linear-gradient(140deg, var(--accent), #d63d20);
  color: #fff;
  padding: 0 18px;
  min-height: 42px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s var(--ease), box-shadow 0.2s, background 0.2s, opacity 0.2s;
  box-shadow: 0 4px 14px rgba(255, 83, 52, 0.28);
  white-space: nowrap;
}
.btn:hover { box-shadow: 0 6px 20px rgba(255, 83, 52, 0.4); }
.btn:active { transform: scale(0.965); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.btn.ghost {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--panel-3); border-color: #303747; }
.btn.quiet { background: none; border-color: transparent; color: var(--dim); box-shadow: none; }
.btn.quiet:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { background: linear-gradient(140deg, #d94040, #a02626); box-shadow: 0 4px 14px rgba(217, 64, 64, 0.28); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { min-height: 50px; padding: 0 26px; font-size: 16px; border-radius: 13px; }
.btn.block { width: 100%; }
.btn.on { background: linear-gradient(140deg, var(--accent), #d63d20); color: #fff; border-color: transparent; }

.card-panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(16px, 3vw, 22px);
  margin-bottom: 16px;
}
.card-panel.flat { background: var(--panel); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.chip:hover { color: var(--text); border-color: #333b4a; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-ghost); }
.chip.static { cursor: default; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--panel-3);
  color: var(--text-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: rgba(53, 208, 127, 0.3); background: rgba(53, 208, 127, 0.1); }
.pill.warn { color: var(--warn); border-color: rgba(255, 178, 36, 0.3); background: rgba(255, 178, 36, 0.1); }
.pill.bad { color: var(--bad); border-color: rgba(255, 95, 95, 0.3); background: rgba(255, 95, 95, 0.1); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: clamp(12px, 2vw, 18px);
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s;
  animation: cardIn 0.42s var(--ease) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }
.card:hover {
  transform: translateY(-4px);
  border-color: #333b4a;
  box-shadow: var(--shadow);
}
.card:active { transform: translateY(-1px); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(140deg, #171b23, #0d1015);
  overflow: hidden;
  display: block;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), opacity 0.4s;
}
.card:hover .thumb img { transform: scale(1.06); }
.thumb .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #2f3644;
  font-size: 30px;
}
.thumb-tags {
  position: absolute;
  left: 9px;
  bottom: 9px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.thumb-tags .pill {
  background: rgba(8, 10, 14, 0.75);
  backdrop-filter: blur(6px);
  border-color: rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-title {
  font-weight: 650;
  font-size: 15.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--dim);
  font-size: 12px;
  align-items: center;
}
.card-meta .who { color: var(--text-2); }
.card-foot {
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
  margin-top: 2px;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
}
.side { position: sticky; top: calc(var(--header-h) + 18px); }

.gallery {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  margin-bottom: 12px;
}
.gallery-main {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0d11;
  cursor: zoom-in;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(10, 12, 16, 0.72);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}
.gallery-nav:hover { background: rgba(255, 83, 52, 0.85); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(10, 12, 16, 0.75);
  font-size: 12px;
  color: var(--text-2);
}
.gallery-strip {
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.gallery-strip button {
  flex: none;
  width: 84px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 2px solid transparent;
  overflow: hidden;
  padding: 0;
  background: #0b0d11;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, border-color 0.2s;
}
.gallery-strip button.on { opacity: 1; border-color: var(--accent); }
.gallery-strip img { width: 100%; height: 100%; object-fit: cover; }

.stat-row { display: flex; gap: 18px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat b { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.stat span { font-size: 12px; color: var(--dim); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; text-align: right; color: var(--text-2); }

.comment {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
  animation: cardIn 0.36s var(--ease) both;
}
.comment.reply { margin-left: 30px; }
.comment-main { flex: 1; min-width: 0; }
.comment-who { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13px; }
.comment-who b { font-size: 14px; }
.comment-text { margin-top: 5px; white-space: pre-wrap; line-height: 1.65; color: var(--text-2); }
.comment-acts { display: flex; gap: 4px; margin-top: 7px; opacity: 0.55; transition: opacity 0.2s; }
.comment:hover .comment-acts { opacity: 1; }

.mail-item {
  display: flex;
  gap: 12px;
  padding: 15px 4px;
  border-top: 1px solid var(--line-soft);
  transition: background 0.2s;
  animation: cardIn 0.36s var(--ease) both;
}
.mail-item.unread { background: linear-gradient(90deg, var(--accent-ghost), transparent 40%); }
.mail-item .body { flex: 1; min-width: 0; }
.mail-item .title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mail-item .text { color: var(--dim); font-size: 13.5px; white-space: pre-wrap; margin-top: 4px; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.22s, background 0.22s, transform 0.22s var(--ease);
  background: var(--bg-soft);
}
.dropzone:hover, .dropzone.hot { border-color: var(--accent); background: var(--accent-ghost); }
.dropzone.hot { transform: scale(1.01); }
.dropzone .big { font-size: 30px; margin-bottom: 8px; opacity: 0.7; }
.dropzone.filled { border-style: solid; border-color: rgba(53, 208, 127, 0.4); background: rgba(53, 208, 127, 0.06); }

.shots-preview { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.shot {
  position: relative;
  width: 118px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  animation: cardIn 0.3s var(--ease) both;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 10, 14, 0.8);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.shot .cover-tag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 83, 52, 0.9);
  font-size: 10px;
  font-weight: 700;
}

.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 14px; padding-bottom: 6px; }
.step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-3);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--dim);
}
.step.done .step-num { background: rgba(53, 208, 127, 0.15); border-color: rgba(53, 208, 127, 0.4); color: var(--ok); }
.step.active .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-body { flex: 1; min-width: 0; padding-bottom: 18px; }
.step-line { width: 1px; background: var(--line); margin: 4px 0 0 13.5px; }

.msg {
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 13.5px;
  margin: 12px 0;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  animation: cardIn 0.3s var(--ease) both;
  line-height: 1.55;
}
.msg.err { background: rgba(255, 95, 95, 0.1); color: #ffb3b3; border: 1px solid rgba(255, 95, 95, 0.25); }
.msg.ok { background: rgba(53, 208, 127, 0.1); color: #a4e8c6; border: 1px solid rgba(53, 208, 127, 0.25); }
.msg.info { background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); }
.msg.warn { background: rgba(255, 178, 36, 0.1); color: #ffd88a; border: 1px solid rgba(255, 178, 36, 0.25); }

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(420px, calc(100vw - 24px));
}
.toast {
  pointer-events: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 13px;
  font-size: 14px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 9px;
  align-items: center;
  animation: toastIn 0.32s var(--ease) both;
  max-width: 100%;
}
.toast.out { animation: toastOut 0.24s var(--ease) both; }
.toast.ok { border-color: rgba(53, 208, 127, 0.4); }
.toast.err { border-color: rgba(255, 95, 95, 0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.97); } }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(5, 6, 9, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: fadeIn 0.22s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } }
.overlay.out { animation: fadeOut 0.18s var(--ease) both; }
@keyframes fadeOut { to { opacity: 0; } }

.dialog {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: dialogIn 0.3s var(--ease) both;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes dialogIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
.dialog h2 { margin-bottom: 8px; }
.dialog-acts { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.lightbox img {
  max-width: min(1200px, 96vw);
  max-height: 88vh;
  border-radius: var(--r);
  animation: dialogIn 0.3s var(--ease) both;
  box-shadow: var(--shadow);
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--panel-2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.skel {
  background: linear-gradient(100deg, var(--panel) 30%, var(--panel-3) 50%, var(--panel) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -60% 0; } }
.skel-card { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.skel-thumb { aspect-ratio: 16 / 9; }
.skel-line { height: 11px; margin: 10px 14px; }
.skel-line.short { width: 45%; }

.empty {
  text-align: center;
  padding: clamp(40px, 9vw, 76px) 20px;
  color: var(--dim);
  animation: viewIn 0.4s var(--ease) both;
}
.empty .big { font-size: 44px; margin-bottom: 12px; opacity: 0.45; }
.empty h3 { color: var(--text-2); font-size: 16px; }

.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 30px; }
.pager .page-of { color: var(--dim); font-size: 13px; min-width: 64px; text-align: center; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--dim); font-weight: 500; font-size: 12.5px; }
.table-scroll { overflow-x: auto; margin: 0 -4px; }

pre {
  background: #080a0d;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  overflow-x: auto;
  font: 12px/1.65 ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}
code { font: 12.5px ui-monospace, Consolas, monospace; background: var(--panel-2); padding: 2px 6px; border-radius: 5px; }

details.fold summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 13px;
  padding: 7px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::before { content: '▸'; transition: transform 0.2s; }
details.fold[open] summary::before { transform: rotate(90deg); }

.body-text { white-space: pre-wrap; line-height: 1.75; color: var(--text-2); }

.progress {
  height: 4px;
  border-radius: 3px;
  background: var(--panel-3);
  overflow: hidden;
  margin-top: 10px;
}
.progress i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  animation: indeterminate 1.1s var(--ease) infinite;
}
@keyframes indeterminate {
  from { transform: translateX(-100%); }
  to { transform: translateX(280%); }
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  z-index: 300;
  transition: width 0.25s var(--ease), opacity 0.3s;
  width: 0;
  opacity: 0;
}
.top-bar.on { opacity: 1; }

.to-top {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
  z-index: 90;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

.site-foot {
  border-top: 1px solid var(--line-soft);
  padding: 26px 20px calc(30px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
}
.site-foot a { color: var(--text-2); }
.site-foot a:hover { color: var(--accent); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .side { position: static; }
}

@media (max-width: 720px) {
  :root { --header-h: 54px; }
  .brand-text { display: none; }
  .nav a { padding: 7px 11px; font-size: 13.5px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 11px; }
  .card-body { padding: 10px 11px 12px; gap: 5px; }
  .card-title { font-size: 14px; }
  .card-desc { font-size: 12px; -webkit-line-clamp: 2; }
  .card-meta { font-size: 11.5px; gap: 8px; }
  .card:hover { transform: none; }
  .comment.reply { margin-left: 14px; }
  .gallery-strip button { width: 66px; }
  .segmented button { padding: 7px 12px; font-size: 13.5px; }
  .shot { width: calc(50% - 5px); }
}

@media (hover: none) {
  .card:hover { transform: none; box-shadow: none; }
  .card:hover .thumb img { transform: none; }
  .comment-acts { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.preview-overlay { padding: 0; }
.preview-shell {
  width: min(1400px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: dialogIn 0.3s var(--ease) both;
}
.preview-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(10px, 2vw, 18px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.preview-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #0b0d11;
  cursor: grab;
}
.preview-stage:active { cursor: grabbing; }
.preview-info {
  flex: none;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 9px clamp(10px, 2vw, 18px) calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel);
}
@media (max-width: 720px) {
  .preview-head { flex-wrap: wrap; }
  .preview-info { gap: 10px; font-size: 11.5px; }
}


.share-box {
  margin-top: 12px;
  padding: 14px 12px;
  border-radius: var(--r);
  background: var(--accent-ghost);
  border: 1px solid rgba(255, 83, 52, 0.3);
  text-align: center;
  animation: cardIn 0.3s var(--ease) both;
}
.share-code {
  margin-top: 8px;
  font: 800 30px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 8px;
  color: var(--accent-soft);
  user-select: all;
  word-break: break-all;
}
@media (max-width: 720px) {
  .share-code { font-size: 26px; letter-spacing: 6px; }
}
