/* ============================================================
   布灵西行 — 全局样式系统
   融合赛博水墨徒步风 + 国风布艺UI
   主页面(暗色赛博) / 弹窗面板(亮色国风) 明暗对比
   ============================================================ */

/* ----------------------------
   CSS Variables / Design Tokens
   ---------------------------- */
:root {
  /* === 赛博水墨 暗色系 (主页面背景) === */
  --cyber-bg-deep: #05060f;
  --cyber-bg-mid: #0b1026;
  --cyber-bg-top: #1b2350;

  /* 赛博霓虹色 */
  --cyber-cyan: #5fe3ff;
  --cyber-cyan-dim: rgba(95, 227, 255, 0.35);
  --cyber-cyan-glow: rgba(95, 227, 255, 0.12);
  --cyber-purple: #b98cff;
  --cyber-purple-dim: rgba(185, 140, 255, 0.35);
  --cyber-purple-glow: rgba(185, 140, 255, 0.12);
  --cyber-gold: #ffd479;
  --cyber-gold-dim: rgba(255, 212, 121, 0.35);
  --cyber-gold-glow: rgba(255, 212, 121, 0.12);

  /* 赛博界面色 */
  --cyber-surface: rgba(15, 20, 50, 0.65);
  --cyber-surface-hover: rgba(25, 35, 75, 0.75);
  --cyber-border: rgba(95, 227, 255, 0.18);
  --cyber-border-focus: rgba(95, 227, 255, 0.45);
  --cyber-text: #e0e8ff;
  --cyber-text-dim: #8890b5;
  --cyber-text-muted: #5a6285;

  /* === 国风布艺 亮色系 (弹窗/面板) === */
  --linen-base: #E8E2D9;
  --linen-dark: #D5CFC4;
  --linen-darker: #C0B9AC;
  --linen-text: #2E2A24;
  --linen-text-dim: #6B6560;

  /* 国风深灰青 */
  --slate: #8A999B;
  --slate-light: #A8B5B7;
  --slate-dark: #6A787A;

  /* 国风幽光紫 */
  --aura-purple: #6B3E96;
  --aura-purple-light: #A87FD1;
  --aura-purple-dim: rgba(107, 62, 150, 0.18);
  --aura-purple-glow: rgba(168, 127, 209, 0.25);

  /* 国风点缀 */
  --bronze: #B89658;
  --bronze-light: #D4B87A;
  --bronze-dark: #8A6D3A;
  --bronze-dim: rgba(184, 150, 88, 0.22);
  --ink-blue: #364F6B;
  --ink-blue-light: #4A6B8E;
  --ink-blue-dark: #24364A;

  /* 国风功能色 */
  --mint: #87C8BC;
  --mint-light: #A3DBD1;
  --mint-dark: #5EA89A;
  --flame: #E26A38;
  --flame-light: #F08A5E;
  --flame-dark: #B84A20;

  /* === 通用 === */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-cyber: 0 0 20px var(--cyber-cyan-dim), 0 0 4px var(--cyber-cyan-glow);
  --shadow-cyber-lg: 0 0 40px var(--cyber-purple-dim), 0 0 10px var(--cyber-cyan-glow);
  --shadow-linen: 0 4px 16px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-linen-lg: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);

  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-serif: 'Noto Serif SC', 'SimSun', 'KaiTi', serif;
  --font-display: 'Ma Shan Zheng', 'ZCOOL KuaiLe', var(--font-serif);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* === 短别名（兼容 HTML 直接引用） === */
  --cyan: var(--cyber-cyan);
  --purple: var(--cyber-purple);
  --gold: var(--cyber-gold);
  --ink: var(--cyber-bg-deep);
  --surface: var(--cyber-surface);
  --bronze-short: #B89658;
  --gray-cyan: var(--slate);
  --ink-blue-short: #364F6B;
  --flame-short: #E26A38;
}

/* ----------------------------
   Reset & Base
   ---------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(120% 80% at 50% 0%, var(--cyber-bg-top) 0%, var(--cyber-bg-mid) 55%, var(--cyber-bg-deep) 100%);
  color: var(--cyber-text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* 网格背景层 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(95, 227, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 227, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

a {
  color: var(--cyber-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--cyber-purple); }

img { max-width: 100%; display: block; }

ul, ol { list-style: none; }

/* ----------------------------
   Typography
   ---------------------------- */
.title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--cyber-cyan) 0%, var(--cyber-purple) 50%, var(--cyber-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title--lg {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.title--md {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

.subtitle {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--cyber-text-dim);
  letter-spacing: 0.06em;
}

/* 国风面板内标题 */
.linen-panel .title,
.linen-panel .title--lg,
.linen-panel .title--md {
  background: linear-gradient(135deg, var(--aura-purple) 0%, var(--ink-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.linen-panel .subtitle {
  color: var(--linen-text-dim);
}

/* ----------------------------
   Screen / Page System
   ---------------------------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  transform: translateY(12px);
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ----------------------------
   Buttons
   ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.6em 1.5em;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  letter-spacing: 0.03em;
}

/* 主按钮 — 赛博风格 */
.btn--primary {
  background: linear-gradient(135deg, rgba(95, 227, 255, 0.18) 0%, rgba(185, 140, 255, 0.18) 100%);
  color: var(--cyber-cyan);
  border: 1px solid var(--cyber-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-cyber);
}

.btn--primary:hover {
  background: linear-gradient(135deg, rgba(95, 227, 255, 0.28) 0%, rgba(185, 140, 255, 0.28) 100%);
  border-color: var(--cyber-border-focus);
  box-shadow: var(--shadow-cyber-lg);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
}

/* 古铜布艺按钮 */
.btn--bronze {
  background: linear-gradient(180deg, var(--bronze-light) 0%, var(--bronze) 40%, var(--bronze-dark) 100%);
  color: #FFF8ED;
  border: 1px solid var(--bronze-dark);
  border-radius: var(--radius-sm);
  clip-path: polygon(
    4px 0%, calc(100% - 4px) 0%,
    100% 4px, 100% calc(100% - 4px),
    calc(100% - 4px) 100%, 4px 100%,
    0% calc(100% - 4px), 0% 4px
  );
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow:
    0 2px 8px rgba(138, 109, 58, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-family: var(--font-serif);
  letter-spacing: 0.06em;
}

.btn--bronze:hover {
  background: linear-gradient(180deg, var(--bronze) 0%, var(--bronze-dark) 40%, var(--bronze-dark) 100%);
  box-shadow:
    0 4px 14px rgba(138, 109, 58, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn--bronze:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(138, 109, 58, 0.3);
}

/* 薄荷青布艺按钮 */
.btn--teal {
  background: linear-gradient(180deg, var(--mint-light) 0%, var(--mint) 40%, var(--mint-dark) 100%);
  color: #F5FFFD;
  border: 1px solid var(--mint-dark);
  border-radius: var(--radius-sm);
  clip-path: polygon(
    4px 0%, calc(100% - 4px) 0%,
    100% 4px, 100% calc(100% - 4px),
    calc(100% - 4px) 100%, 4px 100%,
    0% calc(100% - 4px), 0% 4px
  );
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow:
    0 2px 8px rgba(94, 168, 154, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-family: var(--font-serif);
  letter-spacing: 0.06em;
}

.btn--teal:hover {
  background: linear-gradient(180deg, var(--mint) 0%, var(--mint-dark) 40%, var(--mint-dark) 100%);
  box-shadow:
    0 4px 14px rgba(94, 168, 154, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn--teal:active {
  transform: translateY(0);
}

/* 暗紫布艺按钮 */
.btn--purple {
  background: linear-gradient(180deg, var(--aura-purple-light) 0%, var(--aura-purple) 40%, #4A2070 100%);
  color: #F8F0FF;
  border: 1px solid #4A2070;
  border-radius: var(--radius-sm);
  clip-path: polygon(
    4px 0%, calc(100% - 4px) 0%,
    100% 4px, 100% calc(100% - 4px),
    calc(100% - 4px) 100%, 4px 100%,
    0% calc(100% - 4px), 0% 4px
  );
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow:
    0 2px 8px rgba(107, 62, 150, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-family: var(--font-serif);
  letter-spacing: 0.06em;
}

.btn--purple:hover {
  background: linear-gradient(180deg, var(--aura-purple) 0%, #4A2070 40%, #3A1858 100%);
  box-shadow:
    0 4px 14px rgba(107, 62, 150, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.btn--purple:active {
  transform: translateY(0);
}

/* 幽灵描边按钮 */
.btn--outline {
  background: transparent;
  color: var(--cyber-cyan);
  border: 1.5px solid var(--cyber-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn--outline:hover {
  border-color: var(--cyber-cyan);
  background: var(--cyber-cyan-glow);
  box-shadow: var(--shadow-cyber);
}

/* 国风面板内的描边按钮 */
.linen-panel .btn--outline {
  color: var(--ink-blue);
  border-color: var(--slate);
}

.linen-panel .btn--outline:hover {
  border-color: var(--ink-blue);
  background: rgba(54, 79, 107, 0.08);
  box-shadow: var(--shadow-linen);
}

/* 按钮尺寸 */
.btn--sm { padding: 0.35em 1em; font-size: 0.8rem; }
.btn--lg { padding: 0.8em 2.2em; font-size: 1.1rem; }

.btn:disabled,
.btn--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* ----------------------------
   Cards
   ---------------------------- */
.card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-normal);
}

/* 赛博卡片 */
.card--cyber {
  background: var(--cyber-surface);
  border: 1px solid var(--cyber-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-cyber);
}

.card--cyber:hover {
  background: var(--cyber-surface-hover);
  border-color: var(--cyber-border-focus);
  box-shadow: var(--shadow-cyber-lg);
  transform: translateY(-2px);
}

/* 国风亚麻布卡片 */
.card--linen {
  background:
    /* 亚麻布纹理 */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(184, 150, 88, 0.03) 2px,
      rgba(184, 150, 88, 0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(184, 150, 88, 0.02) 2px,
      rgba(184, 150, 88, 0.02) 4px
    ),
    linear-gradient(135deg, var(--linen-base) 0%, var(--linen-dark) 100%);
  border: 2px solid var(--linen-darker);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-linen);
  /* 缝线边框效果 */
  outline: 1px dashed var(--bronze-dim);
  outline-offset: -8px;
  color: var(--linen-text);
  position: relative;
}

.card--linen:hover {
  box-shadow: var(--shadow-linen-lg);
  transform: translateY(-2px);
}

/* ----------------------------
   Tags
   ---------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.2em 0.75em;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.tag--gold {
  background: var(--cyber-gold-glow);
  color: var(--cyber-gold);
  border: 1px solid var(--cyber-gold-dim);
}

.linen-panel .tag--gold {
  background: var(--bronze-dim);
  color: var(--bronze-dark);
  border: 1px solid var(--bronze);
}

.tag--ghost {
  background: rgba(95, 227, 255, 0.08);
  color: var(--cyber-text-dim);
  border: 1px solid rgba(95, 227, 255, 0.15);
}

.linen-panel .tag--ghost {
  background: rgba(107, 62, 150, 0.06);
  color: var(--linen-text-dim);
  border: 1px solid var(--aura-purple-dim);
}

/* ----------------------------
   Progress Bar (缠绕丝线进度条)
   ---------------------------- */
.bar {
  width: 100%;
  height: 10px;
  background: var(--cyber-cyan-glow);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--cyber-border);
}

.linen-panel .bar {
  background: var(--linen-darker);
  border: 1px solid var(--slate);
}

.bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  position: relative;
  /* 丝线缠绕纹理 */
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 6px,
      rgba(255, 255, 255, 0.12) 6px,
      rgba(255, 255, 255, 0.12) 8px
    ),
    linear-gradient(90deg, var(--cyber-cyan), var(--cyber-purple));
  animation: barThread 2s linear infinite;
}

.linen-panel .bar__fill {
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 6px,
      rgba(255, 255, 255, 0.15) 6px,
      rgba(255, 255, 255, 0.15) 8px
    ),
    linear-gradient(90deg, var(--aura-purple), var(--mint));
}

/* 进度条装饰端点 */
.bar::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyber-cyan);
  box-shadow: 0 0 8px var(--cyber-cyan);
  z-index: 1;
}

.linen-panel .bar::after {
  background: var(--aura-purple);
  box-shadow: 0 0 8px var(--aura-purple-light);
}

/* ----------------------------
   Decorative Elements
   ---------------------------- */

/* 锦囊 (悬垂布艺挂件) */
.locket {
  width: 64px;
  height: 80px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.locket::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bronze) 0%, var(--bronze-dark) 100%);
  border-radius: 50% 50% 45% 45% / 40% 40% 60% 60%;
  border: 2px solid var(--bronze-dark);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.15), 0 3px 10px rgba(138, 109, 58, 0.35);
}

.locket::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 10px;
  background: var(--bronze-light);
  border-radius: 4px 4px 2px 2px;
  border: 1px solid var(--bronze-dark);
}

/* 线轴 */
.spool {
  width: 48px;
  height: 48px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spool::before {
  content: '';
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bronze-light), var(--bronze));
  border-radius: 50%;
  border: 3px solid var(--bronze-dark);
  box-shadow: inset 0 0 0 4px var(--linen-base), 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 线球 */
.thread-ball {
  width: 36px;
  height: 36px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.thread-ball::before {
  content: '';
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 35% 35%, var(--aura-purple-light), var(--aura-purple));
  border-radius: 50%;
  box-shadow:
    inset -2px -2px 4px rgba(0, 0, 0, 0.2),
    inset 2px 2px 4px rgba(255, 255, 255, 0.2),
    0 2px 8px rgba(107, 62, 150, 0.3);
}

/* 封条 / 胶带 */
.tape {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3em 1em;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: var(--linen-text);
  letter-spacing: 0.1em;
  background: linear-gradient(90deg,
    rgba(184, 150, 88, 0.25) 0%,
    rgba(184, 150, 88, 0.08) 20%,
    rgba(184, 150, 88, 0.02) 50%,
    rgba(184, 150, 88, 0.08) 80%,
    rgba(184, 150, 88, 0.25) 100%
  );
  border-top: 1px solid var(--bronze-dim);
  border-bottom: 1px solid var(--bronze-dim);
  position: relative;
}

.tape::before,
.tape::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bronze);
  transform: translateY(-50%);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.15);
}

.tape::before { left: 3px; }
.tape::after { right: 3px; }

/* 印章装饰 */
.stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--flame);
  border: 2.5px solid var(--flame);
  border-radius: 4px;
  transform: rotate(-8deg);
  opacity: 0.85;
  box-shadow: 2px 2px 0 var(--flame-dark);
  position: relative;
}

.stamp::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(226, 106, 56, 0.3);
  border-radius: 2px;
}

/* ----------------------------
   Animations
   ---------------------------- */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes ring {
  0% { box-shadow: 0 0 0 0 var(--cyber-cyan-dim); }
  70% { box-shadow: 0 0 0 12px rgba(95, 227, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(95, 227, 255, 0); }
}

@keyframes barThread {
  0% { background-position: 0 0; }
  100% { background-position: 14px 0; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 动画工具类 */
.animate-fadeIn { animation: fadeIn var(--transition-normal) ease forwards; }
.animate-fadeOut { animation: fadeOut var(--transition-normal) ease forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-breathe { animation: breathe 3s ease-in-out infinite; }
.animate-ring { animation: ring 2s ease-out infinite; }
.animate-slideUp { animation: slideUp var(--transition-normal) ease forwards; }
.animate-slideDown { animation: slideDown var(--transition-normal) ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* ----------------------------
   Layout Utilities
   ---------------------------- */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* ----------------------------
   Scrollbar
   ---------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--cyber-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyber-border-focus);
}

/* ----------------------------
   Linen Panel Container
   ---------------------------- */
.linen-panel {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(184, 150, 88, 0.03) 3px,
      rgba(184, 150, 88, 0.03) 5px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(184, 150, 88, 0.02) 3px,
      rgba(184, 150, 88, 0.02) 5px
    ),
    linear-gradient(160deg, var(--linen-base) 0%, var(--linen-dark) 70%, var(--linen-darker) 100%);
  border: 2px solid var(--linen-darker);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-linen-lg);
  outline: 1.5px dashed var(--bronze-dim);
  outline-offset: -6px;
  color: var(--linen-text);
  padding: 2rem;
  position: relative;
}

/* 面板四角布艺补丁 */
.linen-panel::before {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1px solid var(--bronze-dim);
  border-radius: calc(var(--radius-md) + 2px);
  pointer-events: none;
  clip-path: polygon(
    0% 0%, 12px 0%, 12px 12px, 0% 12px,
    calc(100% - 12px) 0%, 100% 0%, 100% 12px, calc(100% - 12px) 12px,
    100% calc(100% - 12px), 100% 100%, calc(100% - 12px) 100%, calc(100% - 12px) calc(100% - 12px),
    12px calc(100% - 12px), 12px 100%, 0% 100%, 0% calc(100% - 12px)
  );
}

/* ----------------------------
   Modal / Overlay
   ---------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 6, 15, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-normal) ease;
}

/* ----------------------------
   Responsive Breakpoints
   ---------------------------- */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --radius-lg: 14px;
    --radius-xl: 20px;
  }

  .linen-panel {
    padding: 1.5rem;
  }

  .card {
    padding: 1.25rem;
  }
}

/* Mobile Landscape */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .btn { padding: 0.5em 1.2em; font-size: 0.9rem; }
  .btn--lg { padding: 0.7em 1.8em; font-size: 1rem; }

  .screen {
    padding: 1rem;
  }

  .linen-panel {
    padding: 1.25rem;
    margin: 0.5rem;
  }

  .title--lg {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }

  .title--md {
    font-size: clamp(1.2rem, 6vw, 1.6rem);
  }

  .tag { font-size: 0.72rem; padding: 0.15em 0.6em; }

  .locket { width: 52px; height: 66px; }
  .spool { width: 40px; height: 40px; }
  .thread-ball { width: 30px; height: 30px; }
  .stamp { width: 48px; height: 48px; font-size: 1rem; }
}

/* Mobile Portrait */
@media (max-width: 480px) {
  html { font-size: 14px; }

  .card { padding: 1rem; }
  .linen-panel { padding: 1rem; }

  .btn--lg { padding: 0.65em 1.6em; font-size: 0.95rem; }

  .flex-col-mobile { flex-direction: column; }

  .gap-lg { gap: 1rem; }
  .gap-xl { gap: 1.25rem; }
}

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

/* High Contrast */
@media (prefers-contrast: high) {
  :root {
    --cyber-text: #ffffff;
    --cyber-text-dim: #c0c8e0;
    --cyber-border: rgba(95, 227, 255, 0.35);
  }
}
