/*
  功能说明：定义 do.dayrune.com 列表页和作品详情页的静态视觉系统。
  职责边界：只负责列表页框架、卡片展示、页脚和响应式表现，不处理互动场景本体。
*/

:root {
  color-scheme: light;
  --paper: #f6efe4;
  --paper-deep: #eee4d6;
  --ink: #1d221f;
  --ink-soft: rgba(29, 34, 31, 0.68);
  --ink-muted: rgba(29, 34, 31, 0.46);
  --line: rgba(29, 34, 31, 0.12);
  --surface: #fffdf8;
  --accent: #9b6a32;
  --accent-deep: #6e4321;
  --shadow: 0 22px 56px rgba(31, 28, 23, 0.08);
  --shadow-deep: 0 28px 64px rgba(31, 28, 23, 0.11);
  --ambient-bg: url("../assets/interaction-bg.jpg");
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background: var(--ambient-bg) center center / cover no-repeat;
  filter: saturate(1.1) contrast(1.05);
  transform: scale(1.015);
  transform-origin: center;
}

/* 背景图始终铺满窗口，同时用轻遮罩保证标题、筛选和作品卡片可读。 */
body::after {
  background:
    linear-gradient(90deg, rgba(246, 239, 228, 0.82) 0%, rgba(246, 239, 228, 0.52) 48%, rgba(246, 239, 228, 0.14) 100%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.18) 0%, rgba(238, 228, 214, 0.64) 100%);
}

body > * {
  position: relative;
  z-index: 1;
}

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

button {
  font: inherit;
}

canvas {
  display: block;
}

.do-shell {
  width: min(1180px, calc(100vw - 40px));
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  padding: clamp(36px, 7vw, 92px) 0;
}

.eyebrow,
.scene-kicker {
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 720;
  color: var(--accent);
}

.catalog-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(29, 34, 31, 0.08);
}

.catalog-bar h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.18;
  font-weight: 620;
}

.catalog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.sort-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(29, 34, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.62);
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(29, 34, 31, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 680;
  line-height: 1;
}

.home-link:hover,
.home-link:focus-visible {
  border-color: rgba(29, 34, 31, 0.2);
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  outline: none;
}

.sort-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 680;
  line-height: 1;
  cursor: pointer;
}

.sort-tab.is-active {
  background: #27342e;
  color: #fffaf3;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 360px));
  gap: clamp(16px, 2.5vw, 24px);
  align-items: start;
  justify-content: start;
  margin-top: 22px;
}

.scene-card {
  position: relative;
  display: grid;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(29, 34, 31, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 244, 238, 0.84)),
    var(--surface);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.scene-card:hover,
.scene-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(29, 34, 31, 0.2);
  box-shadow: var(--shadow-deep);
  outline: none;
}

.preview-panel {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(29, 34, 31, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 241, 232, 0.88)),
    #f7f2e8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 18px 42px rgba(31, 28, 23, 0.08);
}

.preview-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 6px;
  background: #020100;
  box-shadow: 0 14px 34px rgba(2, 1, 0, 0.18);
}

.preview-canvas {
  width: 100%;
  height: 100%;
}

.scene-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 2px 4px 4px;
}

.scene-title {
  display: block;
  font-size: clamp(1.52rem, 3vw, 2.25rem);
  line-height: 1.1;
  font-weight: 620;
}

.scene-desc {
  display: block;
  min-height: 3.4em;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.72;
}

.do-footer {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 0 0 34px;
}

.do-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid rgba(29, 34, 31, 0.1);
}

.do-footer-inner,
.do-records a {
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.do-records {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: flex-end;
}

.police-record {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.police-record img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.do-hero-shell {
  width: min(1180px, calc(100vw - 40px));
  min-height: 100vh;
  margin: 0 auto;
}

.do-work-stage {
  position: relative;
  inset: 0;
  overflow: hidden;
  min-height: 100vh;
  background: #050505;
}

.do-work-stage canvas {
  width: 100vw;
  height: 100vh;
}

.do-work-return {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(8px);
}

@media (max-width: 760px) {
  .do-shell,
  .do-footer {
    width: min(100% - 28px, 560px);
  }

  .catalog-bar {
    align-items: start;
    flex-direction: column;
  }

  .catalog-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .sort-tabs {
    width: 100%;
  }

  .home-link {
    width: 100%;
  }

  .sort-tab {
    flex: 1;
  }

  .scene-grid {
    grid-template-columns: 1fr;
  }

  .do-footer-inner {
    align-items: start;
    flex-direction: column;
  }

  .do-records {
    justify-content: flex-start;
  }

  body::before {
    background-position: 58% center;
  }

  body::after {
    background:
      linear-gradient(180deg, rgba(246, 239, 228, 0.68) 0%, rgba(238, 228, 214, 0.82) 100%);
  }
}
