/* 各页共用的组件（方案/06-界面设计规范.md）。放在 home.css 之后、各页自己的样式之前。 */
:root {
  --red: #b2452f;
  --red-soft: #fbe3dc;
  --green: #2f7a55;
  --green-soft: #e2f3ea;
  --gold: #8a5a12;
  --gold-soft: #fdf0d5;
  --blue: #34558c;
  --blue-soft: #e3ecfa;
  --violet: #4b3a78;
  --violet-soft: #e8def5;
}

button {
  font: inherit;
  color: inherit;
}

/* 顶栏右上角的一个图标按钮 */
.top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #d9d1c3;
  border-radius: 14px;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: transform 150ms ease;
}

.btn.primary {
  width: 100%;
  min-height: 52px;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 17px;
}

.btn.danger {
  border-color: #e8c4ba;
  color: var(--red);
}

.btn.danger.solid {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.btn.small {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn:active:not(:disabled),
.card.tap:active,
.chips button:active {
  transform: scale(0.97);
}

/* 胶囊筛选 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #d9d1c3;
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  cursor: pointer;
}

.chips button.on {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

/* 搜索框 */
.search {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #d9d1c3;
  border-radius: 12px;
  background: var(--paper);
  font: inherit;
  font-size: 16px;
}

/* 卡片 */
.card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.card.tap {
  cursor: pointer;
  transition: transform 150ms ease;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 0 10px;
  font-size: 18px;
}

.section-title a,
.section-title button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

/* 照片格：每行 3 张 */
.grid.album {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.grid.album > * {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 1;
}

/* 年、月卡片 */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cards > * {
  min-width: 0;
}

/* 头像（卡通形象）和标记 */
.avatar {
  display: inline-block;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--soft);
  object-fit: cover;
}

.avatar.stranger {
  background: #d8d2c6;
  filter: grayscale(1) brightness(0.6);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.tag.red { background: var(--red-soft); color: var(--red); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.violet { background: var(--violet-soft); color: var(--violet); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

/* 底部弹层 */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(26, 24, 20, 0.35);
  animation: fade 180ms ease;
}

.sheet-card {
  display: grid;
  gap: 12px;
  width: min(100%, 460px);
  max-height: 92dvh;
  overflow: auto;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #fffdf8;
  animation: rise 220ms ease;
}

.sheet-card::before {
  content: "";
  justify-self: center;
  width: 40px;
  height: 4px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: #ddd5c7;
}

.sheet-card h2 {
  margin: 0;
  font-size: 19px;
}

.sheet-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.sheet-card label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.sheet-card input,
.sheet-card textarea,
.sheet-card select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d9d1c3;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 16px;
}

/* 底部操作条：多选、会议中、直播中 */
.bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: #fff;
}

.bar .btn {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* 顶上提示 */
.toast {
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 90;
  width: min(92%, 400px);
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  transform: translateX(-50%);
  animation: drop 200ms ease;
}

/* 只有自己看得到 */
.lock-mark {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
}

/* 摄像头开着的提示 */
.cam-on {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-size: 13px;
}

.cam-on::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: blink 1.4s ease infinite;
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes drop { from { transform: translate(-50%, -12px); opacity: 0; } }
@keyframes blink { 50% { opacity: 0.25; } }

@media (min-width: 640px) {
  .grid.album { grid-template-columns: repeat(5, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* 筹码：按标准面值分颜色，筹码上只写数字（ADR-0129、ADR-0176） */
.chips {
  --chip: 22px;
  display: inline-flex;
  align-items: flex-start;
  gap: 3px;
  vertical-align: middle;
}

.chip-col {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

/* 正面是 chips/ 里画好的赌场样式筹码；数字写在图里，元素里的字只给读屏用 */
.chip-face {
  position: relative;
  z-index: 1;
  display: block;
  width: var(--chip);
  height: var(--chip);
  overflow: hidden;
  border-radius: 50%;
  background: var(--c) center / cover no-repeat;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  color: transparent;
  font-size: 1px;
}

/* 下面摞着的，看到的是筹码的侧边：底色上一段段色块，和真筹码一样 */
.chip-edge {
  display: block;
  width: var(--chip);
  height: calc(var(--chip) * 0.24);
  margin-top: calc(var(--chip) * -0.1);
  border-radius: 40%;
  background: repeating-linear-gradient(90deg, var(--c) 0 16%, var(--s) 16% 24%);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 1px 1px rgba(0, 0, 0, 0.2);
}

.chip-col.d1 { --c: #efe9dd; --s: #3a66b0; }
.chip-col.d5 { --c: #c8433a; --s: #fbf6ec; }
.chip-col.d25 { --c: #2f8a57; --s: #fbf6ec; }
.chip-col.d100 { --c: #2a2622; --s: #fbf6ec; }
.chip-col.d500 { --c: #6f4aa8; --s: #fbf6ec; }
.chip-col.d1000 { --c: #e8bf2e; --s: #2a2622; }
.chip-col.d5000 { --c: #7a4a2a; --s: #f2dfc0; }
.chip-col.d25000 { --c: #3d8fd6; --s: #fbf6ec; }
.chip-col.d100000 { --c: #e0609a; --s: #fbf6ec; }
.chip-col.d1 .chip-face { background-image: url("chips/chip-1.svg"); }
.chip-col.d5 .chip-face { background-image: url("chips/chip-5.svg"); }
.chip-col.d25 .chip-face { background-image: url("chips/chip-25.svg"); }
.chip-col.d100 .chip-face { background-image: url("chips/chip-100.svg"); }
.chip-col.d500 .chip-face { background-image: url("chips/chip-500.svg"); }
.chip-col.d1000 .chip-face { background-image: url("chips/chip-1000.svg"); }
.chip-col.d5000 .chip-face { background-image: url("chips/chip-5000.svg"); }
.chip-col.d25000 .chip-face { background-image: url("chips/chip-25000.svg"); }
.chip-col.d100000 .chip-face { background-image: url("chips/chip-100000.svg"); }

/* 换零换整的弹层：现在怎么摆 */
.chip-now {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--soft, #ebe4d6);
  font-size: 14px;
  line-height: 1.5;
}

.chip-now .chips { --chip: 30px; flex: none; }

.sheet-card .chip-hint {
  margin: 4px 0 8px;
  font-size: 13px;
}

/* 一排九种面值，给人认 */
.chip-legend {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  max-width: 340px;
  margin: 0 0 14px;
}

.chip-legend figure {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.chip-legend img {
  width: 100%;
  max-width: 40px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* 未满 18 周岁打开游戏 */
.adults-only {
  display: grid;
  gap: 14px;
  padding: 48px 0;
  text-align: center;
}

.adults-only p { color: var(--muted); line-height: 1.6; }


button.link {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* 「下载 APP」那一行用的小图标 */
.app-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

/* 胶囊筛选是 div.chips（里面放按钮），筹码是 span.chips，共用一个类名；胶囊之间要隔 8 */
:where(div).chips {
  display: flex;
  align-items: normal;
  gap: 8px;
}

/* 用哪台拍（ADR-0135） */
.cam-pick {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.cam-pick .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--line, #e4ddd0);
  border-radius: 14px;
  background: var(--paper, #fffcf7);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cam-pick .row.on { border-color: var(--ink, #1a1814); }
.cam-pick .row:disabled { opacity: 0.5; cursor: default; }
.cam-pick .row-name { display: grid; gap: 2px; }
.cam-pick small { color: var(--muted, #6f6a62); font-size: 13px; }


/* 测试版加的：没有卡通形象的人（陌生人）是剪影，好友和自己换成形象 */
.avatar.face-holder {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: var(--soft);
  color: var(--muted);
}

.avatar.face-holder .icon { width: 62%; height: 62%; }
.avatar.face-holder .face-img { width: 100%; height: 100%; object-fit: cover; }
