/*
 * Inkwell Card Showcase 圆环卡片视觉
 * 所有选择器都限定在 .inkwell-stage 作用域内，避免污染主页全局样式。
 * .inkwell-stage 内的所有绝对定位子元素都以 stage 为参照，stage 本身通常是
 * position: sticky（在 index.html 里被 .top-showcase 包裹），或 position: relative
 * （在 card-showcase/index.html 独立页里）。
 */

.inkwell-stage {
  --bg: #ffffff;
  --text: #1e272d;
  --muted: rgba(30, 39, 45, 0.28);
  position: relative;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.inkwell-stage *,
.inkwell-stage *::before,
.inkwell-stage *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.inkwell-stage,
.inkwell-stage * {
  font-weight: 300 !important;
  font-synthesis: none;
}

/* ---------- Cursor（独立页专用；嵌入模式由 JS 隐藏） ---------- */
.inkwell-stage #cursor {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: left, top;
  transition: width 0.25s, height 0.25s, background 0.25s, border 0.25s;
}
.inkwell-stage #cursor.big {
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1.5px solid rgba(30, 39, 45, 0.45);
}
.inkwell-stage #cursor[hidden] {
  display: none;
}

/* ---------- Nav（独立页里可能存在的顶部导航） ---------- */
.inkwell-stage nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  gap: 56px;
  padding: 27px 32px;
}
.inkwell-stage nav a {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s;
}
.inkwell-stage nav a.active {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Scroll Driver（内部滚动源；由父页脚本驱动 scrollTop） ---------- */
.inkwell-stage #scroll-driver {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 1;
  /* 嵌入模式下不希望鼠标滚轮直接作用于此容器（会与主页滚动打架） */
}
.inkwell-stage #scroll-driver::-webkit-scrollbar { display: none; }
.inkwell-stage #scroll-spacer { height: 800vh; }

/* 嵌入模式：屏蔽 scroll-driver 的鼠标事件，避免用户在圆环上直接滚动它 */
.inkwell-stage.is-embedded #scroll-driver {
  pointer-events: none;
}

/* ---------- Scene（圆环 3D 舞台） ---------- */
.inkwell-stage #scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: auto;
  perspective: 1200px;
}

/* ---------- 中心文本 ---------- */
.inkwell-stage #center-text {
  position: absolute;
  text-align: center;
  pointer-events: none;
  z-index: 10;
  user-select: none;
}
.inkwell-stage #center-text .headline {
  font-size: clamp(14px, 1.6vw, 26px);
  font-weight: 300;
  letter-spacing: 0.08px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.5;
  display: none;
}
.inkwell-stage #center-text .scroll-hint {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 分类文本 ---------- */
.inkwell-stage #category-text {
  position: absolute;
  bottom: 9%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  text-wrap: nowrap;
  user-select: none;
  display: none;
}
.inkwell-stage #category-text .sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 3px;
  font-weight: 300;
}
.inkwell-stage #category-text .main {
  font-size: clamp(19px, 2.5vw, 26px);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ---------- Ring & Cards ---------- */
.inkwell-stage #ring {
  position: absolute;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.inkwell-stage .card {
  position: absolute;
  width: 86px;
  height: 112px;
  transform-style: preserve-3d;
  pointer-events: auto;
  will-change: transform, opacity;
}
.inkwell-stage .card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.16s ease-out;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1);
  border-radius: 10px;
  box-shadow: none;
}

.inkwell-stage .card-front,
.inkwell-stage .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
  overflow: hidden;
}
.inkwell-stage .card-front { background: #d0d0ce; }
.inkwell-stage .card-front img,
.inkwell-stage .card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform: translate3d(0, 0, 0.001px) scale(1.001);
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.inkwell-stage .card-back {
  transform: rotateY(180deg);
  background: transparent;
}

/* ---------- 全屏放大层 ---------- */
.inkwell-stage #fullscreen-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 1;
  background: transparent;
}
.inkwell-stage #fullscreen-img {
  display: none;
}
.inkwell-stage #fullscreen-info {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: white;
  opacity: 0;
  transition: opacity 0.6s ease;
  text-wrap: nowrap;
  user-select: none;
  display: none;
}
.inkwell-stage #fullscreen-overlay.show-info #fullscreen-info { opacity: 1; }
.inkwell-stage #fullscreen-info .fs-sub {
  font-size: 13px;
  letter-spacing: 0.6px;
  opacity: 0.6;
  margin-bottom: 6px;
  font-weight: 300;
}
.inkwell-stage #fullscreen-info .fs-title {
  font-size: clamp(24px, 3.5vw, 45px);
  font-weight: 300;
  letter-spacing: -0.5px;
}

/* ---------- 进度点 ---------- */
.inkwell-stage #progress-bar {
  position: absolute;
  right: calc(320px + 20px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 100;
  transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.inkwell-stage.settings-collapsed #progress-bar {
  right: 20px;
}
.inkwell-stage .prog-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s, transform 0.3s;
  flex-shrink: 0;
}
.inkwell-stage .prog-dot.active {
  background: var(--text);
  transform: scale(1.6);
}

/* ---------- 设置面板（内嵌模式下强制隐藏） ---------- */
.inkwell-stage #controls-dock {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}
.inkwell-stage #controls-dock.collapsed #controls-panel {
  transform: translateX(100%);
}
.inkwell-stage #controls-toggle {
  position: absolute;
  top: 50%;
  right: 320px;
  z-index: 301;
  transform: translateY(-50%);
  width: 34px;
  height: 52px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.05);
  color: #0a0a0a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s, box-shadow 0.2s;
}
.inkwell-stage #controls-toggle:hover {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.07);
}
.inkwell-stage #controls-dock.collapsed #controls-toggle {
  right: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}
.inkwell-stage #controls-toggle .toggle-chevron {
  display: block;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.inkwell-stage #controls-dock.collapsed #controls-toggle .toggle-chevron {
  transform: rotate(180deg);
}

.inkwell-stage #controls-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 320px;
  transform: translateX(0);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  padding: 40px 24px 32px;
  background: rgba(255, 255, 255, 0.0);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: #0a0a0a;
  -webkit-font-smoothing: antialiased;
}
.inkwell-stage #controls-panel .panel-brand {
  margin-bottom: 4px;
}
.inkwell-stage #controls-panel .panel-brand-title {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.6px;
  line-height: 1.15;
  color: #0a0a0a;
}
.inkwell-stage #controls-panel .panel-brand-title .bold {
  font-weight: 700;
}
.inkwell-stage #controls-panel .panel-brand-sub {
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.42);
}
.inkwell-stage #controls-panel .panel-divider {
  padding-top: 18px;
  margin-top: 2px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.inkwell-stage #controls-panel .panel-divider-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.38);
  margin-bottom: 14px;
}
.inkwell-stage #controls-panel .control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inkwell-stage #controls-panel .control-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
}
.inkwell-stage #controls-panel .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.inkwell-stage #controls-panel label.control-text {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: none;
  color: #111;
}
.inkwell-stage #controls-panel input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.12);
  cursor: pointer;
}
.inkwell-stage #controls-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0a0a0a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}
.inkwell-stage #controls-panel input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #0a0a0a;
}
.inkwell-stage #controls-panel input[type="range"]::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.12);
}
.inkwell-stage #controls-panel .value {
  font-size: 10px;
  min-width: 44px;
  text-align: right;
  color: rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}
.inkwell-stage #controls-panel .file-block label.control-text {
  display: block;
  margin-bottom: 8px;
}
.inkwell-stage #controls-panel input[type="file"] {
  width: 100%;
  font-size: 10px;
  padding: 14px 12px;
  border: 1px dashed rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: #111;
}
.inkwell-stage #controls-panel input[type="file"]:hover {
  border-color: rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.04);
}
.inkwell-stage #controls-panel select {
  width: 100%;
  font-size: 11px;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: #0a0a0a;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.inkwell-stage #controls-panel select:hover,
.inkwell-stage #controls-panel select:focus {
  border-color: rgba(0, 0, 0, 0.28);
  background: #fff;
  outline: none;
}
.inkwell-stage #controls-panel .checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.inkwell-stage #controls-panel .checkbox-row:last-of-type {
  border-bottom: none;
}
.inkwell-stage #controls-panel input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0a0a0a;
  cursor: pointer;
}
.inkwell-stage #controls-panel .checkbox-row-end {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inkwell-stage #controls-panel .checkbox-row-end .value {
  min-width: auto;
}
.inkwell-stage #controls-panel .file-block {
  margin-bottom: 14px;
}
.inkwell-stage #controls-panel .file-block:last-child {
  margin-bottom: 0;
}
.inkwell-stage #controls-panel .panel-divider.continued {
  padding-top: 18px;
  margin-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.inkwell-stage #controls-panel .reset-defaults-btn {
  width: 100%;
  margin-top: 2px;
  padding: 11px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
  color: #111;
  transition: background 0.2s, border-color 0.2s;
}
.inkwell-stage #controls-panel .reset-defaults-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.22);
}

@media screen and (max-width: 768px) {
  .inkwell-stage #cursor {
    /* 移动端保留默认，可按需隐藏 */
  }
}
