/* ==========================================================================
   MONO — 设计系统
   黑白灰 / Liquid Glass / 大厂极简。唯一允许的颜色是稀有度标识色。
   ========================================================================== */

/* ------------------------------------------------------------ 01 变量 */
:root {
  --bg: #000000;
  --bg-1: #0A0A0A;
  --card: #111111;
  --card-2: #161616;
  --hover: #1E1E1E;
  --line: #1A1A1A;
  --line-2: #242424;
  --text: #FFFFFF;
  --text-2: #A0A0A0;
  --text-3: #666666;
  --text-4: #3D3D3D;

  --r-white: #B0B0B0;
  --r-green: #4A9E4A;
  --r-blue: #5B8FD6;
  --r-purple: #8B5FBF;
  --r-gold: #D4A843;
  --r-red: #C0392B;

  --glass: rgba(255, 255, 255, 0.03);
  --glass-2: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-2: rgba(255, 255, 255, 0.14);
  --shadow-top: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.72);
  --blur: blur(20px) saturate(180%);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;

  --dur: 200ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --sidebar-w: 224px;
  --tabbar-h: 58px;
  --header-h: 54px;
  --maxw: 1320px;
}

:root[data-lum="dim"] {
  --bg: #050505;
  --bg-1: #080808;
  --card: #0D0D0D;
  --card-2: #121212;
  --hover: #191919;
  --line: #161616;
  --line-2: #1E1E1E;
  --text: #EDEDED;
  --text-2: #8E8E8E;
}

:root[data-lum="bright"] {
  --bg: #141414;
  --bg-1: #181818;
  --card: #1C1C1C;
  --card-2: #222222;
  --hover: #282828;
  --line: #2A2A2A;
  --line-2: #343434;
  --text: #FFFFFF;
  --text-2: #ABABAB;
  --text-3: #777777;
}

:root[data-motion="off"] {
  --dur: 0ms;
}

/* ------------------------------------------------------------ 02 重置 */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
}

/* 移动端视口：用 dvh 避免浏览器地址栏/手势条造成的「高度算错」；
   老浏览器回退到 100% */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
}

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* 细腻的噪点/暗角，避免大面积纯黑显得平板 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.045), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(255, 255, 255, 0.02), transparent 60%);
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

::selection { background: rgba(255, 255, 255, 0.18); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2E2E2E; }

*:focus-visible { outline: 1px solid rgba(255, 255, 255, 0.35); outline-offset: 2px; }

/* ------------------------------------------------------------ 03 玻璃 */
.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-top);
}

.sheen { position: relative; overflow: hidden; }
.sheen::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.055), transparent);
  transform: skewX(-18deg);
  animation: sheen 2.6s var(--ease-out) 1;
  pointer-events: none;
}
@keyframes sheen {
  from { left: -60%; }
  to { left: 130%; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .appbar, .sidebar, .tabbar, .modal__panel, .sheet { background: var(--card) !important; }
}

/* ------------------------------------------------------------ 04 骨架 */
.app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
  /* 关键：允许横向被压缩，否则子元素会把整行撑破屏幕宽度 */
  min-width: 0;
  overflow: hidden;
}

.appbar__title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}
.appbar__title > span:not(.logo) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar__title small {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.appbar__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}
.appbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* 存档状态徽标：不再自动保存后，靠它提示玩家「还没保存」 */
.saveflag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-4);
  white-space: nowrap;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.saveflag.is-dirty {
  color: var(--text);
  border-style: dashed;
  border-color: var(--stroke-2);
}
.saveflag.is-stale {
  color: var(--text-2);
  border-color: var(--line-2);
}

.logo {
  width: 22px; height: 22px;
  border: 1px solid var(--stroke-2);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--glass);
}

.main {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
}

.sidebar {
  display: none;
  flex-direction: column;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  padding: 14px 10px 18px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid var(--line);
}

.sidebar__brand {
  padding: 6px 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.sidebar__brand b { font-weight: 600; letter-spacing: 0.14em; font-size: 13px; }
.sidebar__brand span { font-size: 11px; color: var(--text-3); }

.sidebar__group { margin-bottom: 14px; }
.sidebar__group > i {
  display: block;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 0 10px 6px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  border: 1px solid transparent;
}
.sidebar__item svg { flex: 0 0 auto; opacity: 0.75; }
.sidebar__item:hover { background: var(--hover); color: var(--text); }
.sidebar__item.is-active {
  background: var(--glass-2);
  border-color: var(--stroke);
  color: var(--text);
  box-shadow: var(--shadow-top);
}
.sidebar__item.is-active svg { opacity: 1; }
.sidebar__item .kbd { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text-4); }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8, 8, 8, 0.86);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--line);
}
.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 10px;
  cursor: pointer;
  position: relative;
  transition: color var(--dur) var(--ease);
}
.tabbar__item svg { opacity: 0.8; }
.tabbar__item.is-active { color: var(--text); }
.tabbar__item.is-active svg { opacity: 1; }
.tabbar__item.is-active::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.tabbar__item .dot-badge {
  position: absolute;
  top: 8px; right: 50%;
  margin-right: -16px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text);
}

.view {
  display: none;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--tabbar-h) + 24px);
}
.view.is-active { display: block; animation: viewIn var(--dur) var(--ease-out) both; }
.content { max-width: var(--maxw); margin: 0 auto; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ 05 排版 */
.view__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.view__title { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.view__sub {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
  margin-top: 2px;
  /* 手机上这行信息密度很高（单抽价 / 折扣 / 格数），必须允许折行，
     否则一个中文字 1em，375px 下必然撑破容器 */
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.sect { margin-bottom: 20px; }
.sect__title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.sect__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sect__actions { margin-left: auto; display: flex; gap: 6px; }

.hint { font-size: 11px; color: var(--text-4); line-height: 1.6; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.up { color: var(--text); }
.dn { color: var(--text-3); }
.muted { color: var(--text-3); }
.dim { color: var(--text-4); }
.pos { color: var(--text); }
.neg { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------ 06 网格 */
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack--tight { gap: 6px; }
.stack--loose { gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--end { align-items: flex-end; }
.col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.grid { display: grid; gap: 10px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scroll-x {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-y { overflow-y: auto; }

/* ------------------------------------------------------------ 07 卡片 */
.card {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-top);
}
.card--pad { padding: 14px; }
.card--flat { background: var(--card); border-color: var(--line); box-shadow: none; }

.panel {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.panel__body { padding: 14px; }
.panel__body--flush { padding: 0; }

.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  /* 小屏（320px）上这类标签会很长，必须允许折行 */
  overflow-wrap: anywhere;
}
.stat__value { font-size: 20px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.stat__value--sm { font-size: 15px; }
.stat__delta { font-size: 11px; font-family: var(--mono); color: var(--text-3); }

.kpi {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-top);
  min-width: 0;
}
.kpi__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tile {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  box-shadow: var(--shadow-top);
  min-width: 0;
}
.tile:hover { background: var(--hover); border-color: var(--stroke-2); }
.tile:active { transform: scale(0.99); }
.tile.is-active { border-color: var(--stroke-2); background: var(--glass-2); }

/* ------------------------------------------------------------ 08 物品 */
.item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px 11px 14px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  overflow: hidden;
  box-shadow: var(--shadow-top);
  min-width: 0;
}
.item:hover { background: var(--hover); border-color: var(--stroke-2); }
.item__bit {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--rc, var(--r-white));
  opacity: 0.85;
}
.item__name {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item__sub {
  font-size: 11px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item__price {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}
.item__meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-4);
  text-align: right;
  white-space: nowrap;
}
.item__tag {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 0 4px;
  white-space: nowrap;
}

.iview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.iview--list { grid-template-columns: 1fr; gap: 6px; }
.iview--list .item { padding-top: 9px; padding-bottom: 9px; }

.item--grid {
  flex-direction: column;
  align-items: stretch;
  padding: 12px 12px 11px 14px;
  gap: 6px;
}
.item--grid .item__name { white-space: normal; line-height: 1.35; height: 2.7em; overflow: hidden; }
.item--grid .item__price { text-align: left; font-size: 14px; }
.item--grid .item__meta { text-align: left; }

.rarity {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: var(--mono);
}
.rarity::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--rc, var(--r-white));
}
.rarity--white { --rc: var(--r-white); }
.rarity--green { --rc: var(--r-green); }
.rarity--blue { --rc: var(--r-blue); }
.rarity--purple { --rc: var(--r-purple); }
.rarity--gold { --rc: var(--r-gold); }
.rarity--red { --rc: var(--r-red); }

.floatbar {
  position: relative;
  height: 2px;
  background: var(--line-2);
  border-radius: 2px;
  overflow: hidden;
}
.floatbar__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--rc, var(--text-2)); }
.wear { font-family: var(--mono); font-size: 10px; color: var(--text-3); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--stroke);
  background: var(--glass);
  border-radius: 999px;
  padding: 2px 8px;
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); display: inline-block; }
.dot--dim { background: var(--text-4); }

/* ------------------------------------------------------------ 09 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform 90ms var(--ease), opacity var(--dur) var(--ease);
  box-shadow: var(--shadow-top);
  user-select: none;
}
.btn:hover { background: var(--hover); border-color: var(--stroke-2); }
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.is-disabled { opacity: 0.35; pointer-events: none; }
.btn--primary { background: var(--text); color: #000; border-color: transparent; font-weight: 500; }
.btn--primary:hover { background: #EDEDED; }
.btn--ghost { background: transparent; border-color: var(--stroke); box-shadow: none; }
.btn--quiet { background: transparent; border-color: transparent; color: var(--text-3); box-shadow: none; }
.btn--quiet:hover { color: var(--text); background: var(--hover); }
.btn--danger { border-style: dashed; border-color: var(--line-2); color: var(--text-2); }
.btn--danger:hover { color: var(--text); border-color: var(--stroke-2); }
.btn--sm { height: 27px; padding: 0 9px; font-size: 11.5px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn--block { width: 100%; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

.iconbtn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.iconbtn:hover { background: var(--hover); color: var(--text); }
.iconbtn.is-active { color: var(--text); background: var(--glass-2); }

/* ------------------------------------------------------------ 10 表单 */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
}
.input, .select {
  height: 34px;
  padding: 0 10px;
  background: var(--bg-1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  width: 100%;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input:focus, .select:focus { outline: none; border-color: var(--stroke-2); background: var(--card); }
.input--mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.select {
  appearance: none;
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 11px;
  background: var(--bg-1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  flex: 1;
  min-width: 0;
}
.searchbar input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 13px;
  color: var(--text);
}
.searchbar input::placeholder { color: var(--text-4); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 27px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--text-3);
  font-size: 11.5px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--stroke-2); }
.chip.is-active { background: var(--glass-2); color: var(--text); border-color: var(--stroke-2); }
.chip i { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--text-4); }

.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--bg-1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
}
.segmented__item {
  padding: 4px 11px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.segmented__item:hover { color: var(--text); }
.segmented__item.is-active { background: var(--glass-2); color: var(--text); box-shadow: var(--shadow-top); }

.switch {
  position: relative;
  width: 38px; height: 21px;
  border-radius: 999px;
  background: var(--line-2);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
  flex: 0 0 auto;
}
.switch__track {
  position: absolute;
  top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform var(--dur) var(--ease-out), background var(--dur) var(--ease);
}
.switch.is-on { background: rgba(255, 255, 255, 0.18); }
.switch.is-on .switch__track { transform: translateX(17px); background: var(--text); }

.slider { width: 100%; accent-color: #ffffff; }

/* ------------------------------------------------------------ 11 数据 */
.table { width: 100%; font-size: 12.5px; }
.table th {
  text-align: left;
  font-weight: 400;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  white-space: nowrap;
}
/* 手机上表格列多、单元格 nowrap 必然超出屏宽：
   允许横向滚动（比强行折行更可读），并给容器留出滚动提示 */
@media (max-width: 560px) {
  .table td, .table th { white-space: normal; word-break: break-word; padding: 8px 7px; }
  .table td.num, .table th.num { white-space: nowrap; }
  .table--compact td, .table--compact th { font-size: 11px; padding: 6px 5px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kv-grid { grid-template-columns: 1fr; }
  .kv { flex-direction: column; align-items: flex-start; gap: 0; }
  .kv__k { font-size: 10px; }
  .kv__v { font-size: 12px; text-align: left; white-space: normal; }
}
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.table tbody tr:last-child td { border-bottom: 0; }
.table--compact td { padding: 6px 8px; font-size: 11.5px; }
.table td.num, .table th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.chart { width: 100%; display: block; }
.chartbox {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.chartbox canvas { display: block; width: 100%; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--text-4); font-family: var(--mono); }
.legend i { display: inline-block; width: 8px; height: 2px; background: var(--text-2); vertical-align: middle; margin-right: 5px; }

.depth { display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 11px; }
.depth__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 7px;
  border-radius: 3px;
  overflow: hidden;
  color: var(--text-2);
}
.depth__bar {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.055);
  pointer-events: none;
}
.depth__row--ask .depth__bar { background: rgba(255, 255, 255, 0.035); }
.depth__row span { position: relative; }

.rank { display: flex; flex-direction: column; gap: 1px; }
.rank__no {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-4);
  width: 18px;
  text-align: right;
  flex: 0 0 18px;
}

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12px; }
.kv__k { color: var(--text-4); font-size: 11px; }
.kv__v {
  font-family: var(--mono);
  color: var(--text-2);
  text-align: right;
  /* 手机上 kv 值是长句（公式说明等），必须允许折行 */
  overflow-wrap: anywhere;
  min-width: 0;
}
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }

.prob { display: flex; align-items: center; gap: 9px; font-size: 11.5px; }
.prob__bar { position: relative; flex: 1; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.prob__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--rc, var(--text-2)); }

.bar-stack { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.bar-stack > i { display: block; height: 100%; }

.heat { display: flex; gap: 2px; }
.heat__cell { width: 100%; height: 22px; border-radius: 2px; background: #101010; }
.heat__cell:nth-child(1) { background: #0A0A0A; }
.heat__cell:nth-child(2) { background: #111111; }
.heat__cell:nth-child(3) { background: #181818; }
.heat__cell:nth-child(4) { background: #1F1F1F; }
.heat__cell:nth-child(5) { background: #262626; }
.heat__cell:nth-child(6) { background: #2E2E2E; }
.heat__cell:nth-child(7) { background: #3A3A3A; }
.heat__cell:nth-child(8) { background: #4A4A4A; }
.heat__cell:nth-child(9) { background: #5E5E5E; }
.heat__cell:nth-child(10) { background: #777777; }
.heat__cell:nth-child(11) { background: #9A9A9A; }
.heat__cell:nth-child(12) { background: #CFCFCF; }

.mood {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}
.mood__mrk { position: relative; width: 92px; height: 3px; background: var(--line); border-radius: 3px; }
.mood__mrk i {
  position: absolute;
  top: -3px;
  width: 2px; height: 9px;
  background: var(--text);
  border-radius: 2px;
  transition: left var(--dur) var(--ease-out);
}

/* ------------------------------------------------------------ 12 抽奖 */
.draw { display: flex; flex-direction: column; gap: 14px; }
.draw__stage {
  position: relative;
  min-height: 240px;
  display: grid;
  /* 关键：列必须拉伸。place-items:center 会让子元素按内容宽度收缩，
     轮盘卡带（内联固定宽的卡）会把容器撑到上千像素，
     导致轮盘不是居中滚动而是偏移滚动 —— 手机上尤其明显。
     需要居中的只有单张翻卡，用 align-content 处理即可。 */
  justify-items: stretch;
  align-content: center;
  padding: 18px;
  perspective: 1200px;
}
/* 单张翻卡专用：真正居中 */
.draw__stage--center { justify-items: center; }
/* 轮盘容器：占满可用宽度并与视口边框对齐（负外边距抵消 stage 内边距） */
.draw__slot--reel {
  width: 100%;
  min-width: 0;
  margin: 0 -18px;
  width: calc(100% + 36px);
}
.draw__card {
  width: 168px;
  height: 232px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
  transform: rotateY(0deg);
}
.draw__card.is-flipped { transform: rotateY(180deg); }
.draw__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  background: linear-gradient(160deg, #131313, #0A0A0A);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-top), 0 20px 40px rgba(0, 0, 0, 0.6);
}
.draw__face--back { transform: rotateY(180deg); }
.draw__face--front {
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  letter-spacing: 0.3em;
  font-size: 11px;
}
.draw__glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.10), transparent 72%);
  opacity: 0;
  transition: opacity 420ms var(--ease);
  pointer-events: none;
}
.draw__card.is-flipped .draw__glow { opacity: 1; }
.draw__reveal { position: relative; }
.draw__reveal[data-rarity="gold"] .draw__face--back,
.draw__reveal[data-rarity="red"] .draw__face--back {
  animation: revealPulse 1800ms var(--ease-out) infinite;
  border-color: var(--rc);
}
@keyframes revealPulse {
  0%, 100% { box-shadow: var(--shadow-top), 0 20px 40px rgba(0, 0, 0, 0.6); }
  50% { box-shadow: var(--shadow-top), 0 0 0 1px var(--rc), 0 24px 60px rgba(0, 0, 0, 0.75); }
}
.draw__thumb {
  flex: 1;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 9px);
  position: relative;
}
.draw__thumb b {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text-2);
}
.draw__info { padding: 10px 11px; }
.draw__info .item__name { white-space: normal; line-height: 1.3; height: 2.6em; }
.draw__result { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.draw__bag { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.draw__pool { display: flex; flex-direction: column; gap: 7px; }

.floatup {
  position: absolute;
  right: 12px;
  top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  pointer-events: none;
  animation: floatUp 1050ms var(--ease-out) forwards;
}
.floatup.is-dn { color: var(--text-3); }
@keyframes floatUp {
  from { opacity: 0; transform: translateY(6px); }
  25% { opacity: 1; }
  to { opacity: 0; transform: translateY(-22px); }
}

.spin { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------- 12b 开箱轮盘（CS 开箱风格） */
.reel {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.014), transparent 40%, rgba(255, 255, 255, 0.014));
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.reel__strip { will-change: transform; }
.reel__track {
  display: flex;
  gap: 8px;
  align-items: stretch;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
.reel__card {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, #131313, #0A0A0A);
  overflow: hidden;
  box-shadow: var(--shadow-top);
  transition: border-color 220ms var(--ease), opacity 220ms var(--ease), transform 220ms var(--ease);
}
.reel__card.is-dim { opacity: 0.82; }
.reel__band { height: 3px; background: var(--rc, var(--r-white)); opacity: 0.92; }
.reel__img {
  height: 76px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 9px);
}
.reel__img b {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text-3);
}
.reel__meta { padding: 7px 8px 9px; }
.reel__name {
  font-size: 11px;
  line-height: 1.3;
  height: 2.6em;
  overflow: hidden;
  color: var(--text-2);
  word-break: break-all;
}
.reel__sub {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reel__card.is-hit {
  border-color: var(--rc);
  opacity: 1;
  animation: reelHit 620ms var(--ease-out) 1 both;
}
@keyframes reelHit {
  0% { transform: scale(1); }
  35% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.reel__marker {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
  background: var(--text);
  z-index: 3;
  pointer-events: none;
}
.reel__marker i {
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
.reel__marker i:first-child { top: 0; border-top: 7px solid var(--text); }
.reel__marker i:last-child { bottom: 0; border-bottom: 7px solid var(--text); }
.reel__fade { position: absolute; top: 0; bottom: 0; width: 56px; pointer-events: none; z-index: 2; }
.reel__fade--l { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.reel__fade--r { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }

.reel__fast {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding-top: 12px;
}
.reel__card.is-pop { flex: 0 0 auto; animation: popIn 260ms var(--ease-out) both; }
@keyframes popIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.is-up { animation: flashUp 560ms var(--ease-out); }
.is-dn { animation: flashDn 560ms var(--ease-out); }
@keyframes flashUp { 0% { color: #fff; text-shadow: 0 0 12px rgba(255, 255, 255, 0.35); } 100% { color: inherit; } }
@keyframes flashDn { 0% { opacity: 0.45; } 100% { opacity: 1; } }

/* ------------------------------------------------------------ 13 反馈 */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 16px);
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(18, 18, 18, 0.9);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-pop);
  font-size: 12.5px;
  color: var(--text-2);
  animation: toastIn 260ms var(--ease-out) both;
  pointer-events: auto;
}
.toast.is-out { animation: toastOut 220ms var(--ease) both; }
.toast b { color: var(--text); font-weight: 500; }
.toast--good { border-color: rgba(255, 255, 255, 0.2); }
.toast--bad { border-style: dashed; }
.toast--info { color: var(--text-3); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 200ms var(--ease) both;
}
.modal__panel {
  width: min(560px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: rgba(14, 14, 14, 0.94);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop), var(--shadow-top);
  overflow: hidden;
  animation: modalIn 260ms var(--ease-out) both;
}
.modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
}
.modal__body { padding: 16px; overflow-y: auto; }
.modal__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.99); } to { opacity: 1; transform: none; } }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: rgba(14, 14, 14, 0.96);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--stroke);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-pop);
  animation: sheetIn 280ms var(--ease-out) both;
}
.sheet::before {
  content: "";
  display: block;
  width: 34px; height: 3px;
  border-radius: 3px;
  background: var(--line-2);
  margin: 4px auto 12px;
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 42px 20px;
  color: var(--text-4);
  text-align: center;
  font-size: 12px;
}
.empty svg { opacity: 0.4; }
.alert {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--glass);
  font-size: 12px;
  color: var(--text-2);
}
.skeleton {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #151515, #1D1D1D, #151515);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--text-2); transition: width var(--dur) var(--ease-out); }
.spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  border-top-color: var(--text-2);
  animation: spin 800ms linear infinite;
}
.tooltip {
  position: absolute;
  z-index: 95;
  padding: 7px 9px;
  background: rgba(24, 24, 24, 0.96);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-2);
  pointer-events: none;
  box-shadow: var(--shadow-pop);
  font-family: var(--mono);
  white-space: nowrap;
}

/* ------------------------------------------------------------ 14 其它 */
.locked { opacity: 0.45; border-style: dashed !important; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.settings-row__text b { font-weight: 400; font-size: 13px; }
.settings-row__text span { font-size: 11px; color: var(--text-4); }

.save-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--glass);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.save-slot:hover { background: var(--hover); }
.save-slot.is-active { border-color: var(--stroke-2); }

.pullind {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -40px);
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 160ms var(--ease);
  pointer-events: none;
  z-index: 30;
}
.pullind span {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  border-top-color: var(--text-2);
}
.pullind.is-on { opacity: 1; }
.pullind.is-busy span { animation: spin 700ms linear infinite; }

.scrollpad { height: 8px; }
.tabular { font-variant-numeric: tabular-nums; }
.text-r { text-align: right; }
.text-c { text-align: center; }
.w-100 { width: 100%; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ 15 响应式 */
@media (min-width: 560px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .iview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .draw__bag { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  body { font-size: 14px; }
  .sidebar { display: flex; }
  .tabbar { display: none; }
  .view { padding: 22px 26px 42px; }
  .appbar { padding: 0 26px; }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .iview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toasts { left: auto; right: 24px; transform: none; bottom: 24px; align-items: flex-end; }
  .view__title { font-size: 24px; }
}

@media (min-width: 1100px) {
  .iview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .draw__bag { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1400px) {
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .iview { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  /* 顶部这一行在手机上放不下「品牌 + 指数情绪 + 5 档倍速 + 2 个按钮」，
     实测需要约 610px。因此：隐藏指数/情绪，收窄速度档与图标按钮。 */
  .appbar__meta { display: none; }
  .appbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .appbar__actions { gap: 4px; }
  .segmented__item { padding: 4px 7px; font-size: 11px; }
  .iconbtn { width: 30px; height: 30px; }
  /* 手机上顶栏太挤：存档徽标只在「未保存」时显示 */
  .saveflag { display: none; }
  .saveflag.is-dirty { display: inline-block; font-size: 9.5px; padding: 1px 5px; }

  /* 抽奖页在手机上「过于拉伸」：240px 最小高度 + 18px 内边距在窄屏显得空荡，
     卡片之间也被撑得很散。这里整体收紧。 */
  .draw { gap: 10px; }
  .draw__stage { min-height: 0; padding: 10px; }
  .draw__slot--reel { margin: 0 -10px; width: calc(100% + 20px); }
  .draw__card { width: 138px; height: 190px; }
  .draw__thumb b { font-size: 24px; }
  .draw__info { padding: 8px 9px; }
  .reel { padding: 10px 0; }
  .reel__card { width: 92px; }
  .reel__img { height: 62px; }
  .reel__img b { font-size: 13px; }
  .reel__meta { padding: 6px 7px 7px; }
  .reel__name { font-size: 10px; height: 2.6em; }
  .reel__fade { width: 34px; }
}

@media (max-width: 460px) {
  /* 更窄时连日期也收掉，只留品牌与操作区 */
  .appbar__title small { display: none; }
  .appbar__title { font-size: 14px; }
  .segmented__item { padding: 4px 5px; font-size: 10.5px; }
}

@media (max-width: 360px) {
  /* 超窄屏（280~360px）：进一步收窄，隐藏 logo 方块，只留文字品牌 */
  .appbar .logo { display: none; }
  .segmented__item { padding: 4px 4px; font-size: 10px; }
  .iconbtn { width: 28px; height: 28px; }
  .view { padding-left: 10px; padding-right: 10px; }
  .reel__card { width: 84px !important; }
  .reel__img { height: 56px; }
  .reel__fade { width: 26px; }
  .draw__card { width: 124px; height: 172px; }
}

@media (max-width: 400px) {
  .iview { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
  .view { padding-left: 12px; padding-right: 12px; }
  .view__title { font-size: 19px; }
}

@media (max-width: 560px) {
  .reel__card { width: 92px !important; }
  .reel__img { height: 62px; }
  .reel__name { font-size: 10px; }
  .reel__fade { width: 36px; }
}

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