/* ==========================================================================
   身入帛中 · INTO THE SILK — 统一漆帛美学设计规范 (Shared Theme Tokens)
   四境共用视觉语言：深漆墨底、素帛象牙、鎏金细线、汉印朱砂
   ========================================================================== */

:root {
  color-scheme: dark;
  --silk-bg: #080706;
  --silk-surface: rgba(14, 12, 10, 0.80);
  --silk-surface-strong: rgba(11, 9, 8, 0.93);
  --silk-ink: #efe6d4;
  --silk-muted: #a29682;
  --silk-dim: #736858;
  --silk-gold: #d8be8c;
  --silk-gold-bright: #f3dba7;
  --silk-cinnabar: #b83b28;
  --silk-cinnabar-bright: #d44d38;
  --silk-cinnabar-glow: rgba(184, 59, 40, 0.34);
  --silk-line: rgba(216, 190, 140, 0.24);
  --silk-line-strong: rgba(216, 190, 140, 0.52);
  --silk-jade: #8db8a2;
  --silk-radius: 3px;
  --silk-topbar-safe: 74px;
  --silk-side-safe: 24px;
  --silk-cam-width: 196px;
  --silk-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --silk-sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --silk-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 统一按钮基础样式 */
.silk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--silk-sans);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--silk-ink);
  background: rgba(18, 15, 12, 0.78);
  border: 1px solid var(--silk-line);
  border-radius: var(--silk-radius);
  padding: 10px 22px;
  cursor: pointer;
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.silk-btn:hover {
  border-color: var(--silk-line-strong);
  background: rgba(34, 27, 20, 0.88);
  color: var(--silk-gold-bright);
}

.silk-btn:focus-visible {
  outline: 1px solid var(--silk-gold-bright);
  outline-offset: 3px;
}

.silk-btn:disabled {
  opacity: 0.45;
  cursor: wait;
}

.silk-btn-primary {
  background: linear-gradient(180deg, rgba(178, 56, 36, 0.92), rgba(132, 35, 22, 0.96));
  border-color: rgba(232, 178, 112, 0.65);
  color: #fdf5e6;
  box-shadow: 0 8px 26px rgba(152, 42, 24, 0.32), inset 0 1px 0 rgba(255, 228, 178, 0.22);
}

.silk-btn-primary:hover {
  background: linear-gradient(180deg, rgba(198, 64, 42, 0.96), rgba(148, 40, 25, 0.98));
  border-color: rgba(246, 204, 138, 0.88);
  color: #fffaf0;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(176, 48, 28, 0.44), inset 0 1px 0 rgba(255, 232, 186, 0.3);
}

.silk-btn-ghost {
  background: rgba(14, 12, 10, 0.46);
  border-color: rgba(216, 190, 140, 0.18);
  color: var(--silk-muted);
}

.silk-btn-ghost:hover {
  background: rgba(216, 190, 140, 0.1);
  border-color: var(--silk-line-strong);
  color: var(--silk-ink);
}

/* 统一朱砂方印与卡片语言 */
.silk-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--silk-serif);
  font-size: 11px;
  letter-spacing: 0.32em;
  color: #e4735e;
  border: 1px solid rgba(196, 72, 54, 0.72);
  background: rgba(184, 59, 40, 0.1);
  padding: 4px 12px 4px 15px;
  border-radius: 2px;
}

.silk-card {
  position: relative;
  background: linear-gradient(168deg, rgba(20, 16, 13, 0.90), rgba(9, 8, 7, 0.95));
  border: 1px solid var(--silk-line);
  border-radius: var(--silk-radius);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.76), inset 0 1px 0 rgba(243, 219, 167, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.silk-card::before,
.silk-card::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  border-color: rgba(216, 190, 140, 0.52);
  border-style: solid;
}

.silk-card::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.silk-card::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1px 1px 0;
}

/* 统一摄像头右上角停靠窗 */
.silk-cam-dock {
  position: fixed;
  top: var(--silk-topbar-safe);
  right: var(--silk-side-safe);
  width: var(--silk-cam-width);
  z-index: 35;
  background: var(--silk-surface);
  border: 1px solid var(--silk-line);
  border-radius: var(--silk-radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: opacity 0.35s ease, transform 0.35s var(--silk-ease);
}

.silk-cam-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-bottom: 1px solid rgba(216, 190, 140, 0.14);
  font-family: var(--silk-sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--silk-gold);
}

.silk-cam-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--silk-dim);
  flex-shrink: 0;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.silk-cam-dot.live {
  background: var(--silk-jade);
  box-shadow: 0 0 8px rgba(141, 184, 162, 0.85);
}

.silk-cam-dot.warn {
  background: #e29d66;
}

.silk-cam-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0b0a09;
  overflow: hidden;
}

.silk-cam-foot {
  padding: 6px 9px 7px;
  font-family: var(--silk-sans);
  font-size: 10px;
  line-height: 1.45;
  color: var(--silk-muted);
}

/* 统一纯净展陈模式（按 H 隐藏非核心 UI 浮层） */
body.silk-pure-mode .silk-hide-in-pure {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.35s ease;
}

/* 细金滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(12, 10, 9, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(216, 190, 140, 0.28);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(216, 190, 140, 0.5);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

@media (max-width: 760px) {
  :root {
    --silk-topbar-safe: 62px;
    --silk-side-safe: 14px;
    --silk-cam-width: 144px;
  }
}
