/* ============================================================
   我的世界 · 个人网站 全局样式
   纯 CSS 像素风主题，无任何外部依赖
   ============================================================ */

:root {
  --bg: #0c1114;
  --bg-soft: #131b1f;
  --panel: #182226;
  --panel-2: #1e2a2f;
  --line: #2c3b40;
  --text: #e8efe9;
  --text-dim: #93a39c;
  --grass: #5ac54f;
  --grass-dark: #2f7d2a;
  --diamond: #4aedd9;
  --gold: #f8b800;
  --redstone: #d64541;
  --lapis: #4a7bf7;
  --amethyst: #a878f0;
  --font-mono: "Consolas", "Courier New", "Sarasa Mono SC", "Microsoft YaHei", monospace;
  --font-ui: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.7;
  overflow-x: hidden;
}

/* 背景网格纹理（像素感） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(90, 197, 79, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 197, 79, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--diamond); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

.wrap { width: min(1180px, 92%); margin: 0 auto; position: relative; z-index: 1; }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12, 17, 20, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid #000;
  box-shadow: 0 3px 0 rgba(90, 197, 79, 0.25);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-family: var(--font-mono); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-cube {
  width: 34px; height: 34px; flex: none;
  image-rendering: pixelated;
}
.brand-name { font-size: 15px; letter-spacing: 1px; }
.brand-name small { display: block; color: var(--text-dim); font-size: 11px; font-weight: 400; letter-spacing: 0; }

.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-dim);
  padding: 8px 14px;
  border: 2px solid transparent;
  transition: all .15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; border-color: var(--line); }
.nav-links a.active { color: var(--grass); border-color: var(--grass); background: rgba(90, 197, 79, 0.08); }

/* ---------------- 背景音乐开关 ---------------- */
.music-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  padding: 7px 11px;
  background: transparent;
  color: var(--text-dim);
  border: 2px solid var(--line);
  cursor: pointer;
  transition: all .15s;
}
.music-btn:hover { color: var(--text); border-color: var(--text-dim); }
.music-btn .music-ico { display: inline-block; }
.music-btn.on { color: var(--grass); border-color: var(--grass); background: rgba(90,197,79,.08); }
.music-btn.on .music-ico { animation: musicBounce 1.5s ease-in-out infinite; }
.music-btn.hint { animation: musicHint 1.6s ease-in-out infinite; }
@keyframes musicBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes musicHint {
  0%,100% { box-shadow: 0 0 0 0 rgba(90,197,79,0); }
  50% { box-shadow: 0 0 0 4px rgba(90,197,79,.2); }
}

/* ---------------- MC 风格按钮 ---------------- */
.mc-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: #fff; text-shadow: 1px 1px 0 #222;
  background: linear-gradient(#7a7a7a, #5f5f5f 45%, #4c4c4c);
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.35), inset -3px -3px 0 rgba(0,0,0,.45);
  padding: 12px 26px;
  cursor: pointer;
  transition: filter .12s;
  text-decoration: none !important;
  image-rendering: pixelated;
}
.mc-btn:hover { filter: brightness(1.15); }
.mc-btn:active { filter: brightness(0.9); }
.mc-btn.green { background: linear-gradient(#6fce63, #4ea844 45%, #3c8a34); }
.mc-btn.dark { background: linear-gradient(#3d4a50, #2c373c 45%, #222b2f); }
.mc-btn.big { font-size: 17px; padding: 16px 36px; }

/* ---------------- Hero 区 ---------------- */
.hero { position: relative; overflow: hidden; border-bottom: 3px solid #000; }
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-scene svg { width: 100%; height: 100%; image-rendering: pixelated; }
.hero-inner {
  position: relative; z-index: 1;
  padding: 96px 0 120px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 22px;
}
.hero-tag {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px;
  color: var(--grass); background: rgba(12, 17, 20, .78);
  border: 2px solid var(--grass); padding: 6px 14px;
}
.hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(30px, 5.4vw, 58px);
  line-height: 1.25; letter-spacing: 2px;
  text-shadow: 3px 3px 0 rgba(0,0,0,.8);
  max-width: 18em;
  background: rgba(12, 17, 20, .62);
  padding: 10px 18px;
}
.hero h1 .accent { color: var(--grass); }
.hero p.sub {
  font-size: clamp(14px, 1.6vw, 17px); color: var(--text);
  background: rgba(12, 17, 20, .78); padding: 10px 18px;
  border-left: 4px solid var(--grass); max-width: 46em;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------- 通用区块 ---------------- */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-soft); border-top: 3px solid #000; border-bottom: 3px solid #000; }
.section-head { margin-bottom: 40px; }
.section-head .kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 3px;
  color: var(--grass); display: block; margin-bottom: 8px;
}
.section-head h2 { font-family: var(--font-mono); font-size: clamp(22px, 3vw, 32px); letter-spacing: 1px; }
.section-head p.desc { color: var(--text-dim); margin-top: 10px; max-width: 60em; }
.name-hl { color: var(--grass); }

/* ---------------- 卡片 ---------------- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--panel);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.5), 0 6px 0 rgba(0,0,0,.35);
  padding: 22px;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.5), 0 10px 0 rgba(0,0,0,.35); }
.card h3 { font-family: var(--font-mono); font-size: 16px; margin-bottom: 10px; letter-spacing: 1px; }
.card p { color: var(--text-dim); font-size: 14px; }
.card .icon { font-size: 30px; margin-bottom: 12px; image-rendering: pixelated; }

/* 带像素图标方块的卡片头 */
.card .pix {
  width: 40px; height: 40px; margin-bottom: 14px;
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.3), inset -3px -3px 0 rgba(0,0,0,.4);
}

/* 喜欢的方块展示 */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.fav-item {
  background: var(--panel); border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), 0 5px 0 rgba(0,0,0,.35);
  padding: 14px; text-align: center; transition: transform .15s;
}
.fav-item:hover { transform: translateY(-3px); }
.fav-swatch {
  width: 56px; height: 56px; margin: 0 auto 10px;
  border: 3px solid #000;
  box-shadow: inset 4px 4px 0 rgba(255,255,255,.28), inset -4px -4px 0 rgba(0,0,0,.38);
  image-rendering: pixelated;
}
.fav-item b { font-family: var(--font-mono); font-size: 13px; display: block; }
.fav-item span { font-size: 12px; color: var(--text-dim); }

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-block; font-family: var(--font-mono); font-size: 11px;
  padding: 3px 9px; border: 2px solid #000; letter-spacing: 1px;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.25);
  white-space: nowrap;
}
.badge.java     { background: #b96a2b; color: #fff; }
.badge.bedrock  { background: var(--grass-dark); color: #fff; }
.badge.pe       { background: var(--lapis); color: #fff; }
.badge.console  { background: var(--amethyst); color: #fff; }
.badge.edu      { background: #2a9d8f; color: #fff; }
.badge.other    { background: #5c6b70; color: #fff; }
.badge.stage    { background: #333f44; color: var(--text); }
.badge.name     { background: var(--gold); color: #221a00; }
.badge.size-s   { background: var(--grass-dark); color: #fff; }
.badge.size-m   { background: #8a6d1d; color: #fff; }
.badge.size-l   { background: #8a3b2e; color: #fff; }

/* ---------------- 版本页 ---------------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--panel); border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), 0 5px 0 rgba(0,0,0,.35);
  padding: 14px;
  position: sticky; top: 66px; z-index: 50;
  margin-bottom: 30px;
}
.search-input {
  font-family: var(--font-mono); font-size: 14px;
  background: #0c1114; color: var(--text);
  border: 2px solid var(--line); padding: 10px 14px;
  min-width: 240px; flex: 1 1 240px; outline: none;
}
.search-input:focus { border-color: var(--grass); }
.chip {
  font-family: var(--font-mono); font-size: 12px; cursor: pointer;
  background: #0c1114; color: var(--text-dim);
  border: 2px solid var(--line); padding: 8px 14px;
  transition: all .12s;
}
.chip:hover { color: var(--text); border-color: var(--text-dim); }
.chip.on { color: #fff; border-color: var(--grass); background: var(--grass-dark); }

.stats-line { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }
.stats-line b { color: var(--grass); }

/* 时间轴 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 4px; background: var(--line);
}
.era-head {
  position: relative; margin: 34px 0 18px;
  font-family: var(--font-mono); letter-spacing: 2px;
  font-size: 15px; color: var(--grass);
  display: flex; align-items: center; gap: 12px;
}
.era-head::before {
  content: ""; position: absolute; left: -26px;
  width: 20px; height: 20px;
  background: var(--grass); border: 3px solid #000;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.35), inset -3px -3px 0 rgba(0,0,0,.4);
}
.era-head .era-count { color: var(--text-dim); font-size: 12px; }
.era-head .era-date { color: var(--text-dim); font-size: 12px; font-weight: 400; }
.era-group { margin-bottom: 8px; }

.ver-card {
  position: relative;
  background: var(--panel); border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.5), 0 5px 0 rgba(0,0,0,.35);
  padding: 16px 18px; margin-bottom: 14px;
  display: grid; grid-template-columns: 190px 1fr; gap: 6px 20px;
  transition: transform .12s;
}
.ver-card::before {
  content: ""; position: absolute; left: -25px; top: 22px;
  width: 10px; height: 10px; background: var(--panel-2);
  border: 3px solid #000;
}
.ver-card:hover { transform: translateX(4px); }
.ver-card .v-head { display: flex; flex-direction: column; gap: 8px; }
.ver-card .v-num { font-family: var(--font-mono); font-weight: 700; font-size: 17px; color: var(--text); }
.ver-card .v-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.ver-card .v-body { min-width: 0; }
.ver-card .v-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ver-card .v-highlight { font-size: 14px; color: var(--text); }
.ver-card .v-note { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }

.empty-tip {
  text-align: center; padding: 60px 0; color: var(--text-dim);
  font-family: var(--font-mono);
}
.empty-tip .big { font-size: 40px; margin-bottom: 14px; }

/* ---------------- 游戏页 ---------------- */
.play-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }

.client-list { display: flex; flex-direction: column; gap: 12px; max-height: 78vh; overflow-y: auto; padding-right: 4px; }
.client-group { margin-bottom: 6px; }
.client-group-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: var(--grass);
  border-left: 4px solid var(--grass); padding: 4px 10px;
  background: rgba(90, 197, 79, 0.07); margin-bottom: 4px;
}
.client-group-head span { color: var(--text-dim); font-weight: 400; font-size: 11px; }
.client-group-tip { font-size: 12px; color: var(--text-dim); margin: 0 0 10px 10px; }
.client-group .client-item { margin-bottom: 10px; }
.client-item {
  background: var(--panel); border: 3px solid #000; cursor: pointer;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), 0 5px 0 rgba(0,0,0,.35);
  padding: 14px; transition: all .12s;
}
.client-item:hover { background: var(--panel-2); }
.client-item.on { border-color: var(--grass); box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), 0 0 0 1px var(--grass), 0 5px 0 rgba(0,0,0,.35); }
.client-item .c-title { font-family: var(--font-mono); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.client-item .c-title .ver { color: var(--grass); }
.client-item .c-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.client-item .c-desc { font-size: 12.5px; color: var(--text-dim); }

.player-shell { background: var(--panel); border: 3px solid #000; box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), 0 6px 0 rgba(0,0,0,.35); }
.player-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 3px solid #000; background: var(--panel-2);
  flex-wrap: wrap;
}
.player-top .p-title { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.player-top .p-title span { color: var(--grass); }
.player-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 线路选择行 */
.line-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 16px; border-bottom: 3px solid #000; background: #0f1518;
}
.line-btn {
  font-family: var(--font-mono); font-size: 12px; cursor: pointer;
  background: #1d272c; color: var(--text-dim);
  border: 2px solid var(--line); padding: 5px 12px;
  transition: all .12s;
}
.line-btn:hover { color: var(--text); border-color: var(--text-dim); }
.line-btn.on { color: #fff; border-color: var(--grass); background: rgba(90, 197, 79, 0.14); }
.mini-btn {
  font-family: var(--font-mono); font-size: 12px; cursor: pointer;
  background: linear-gradient(#3d4a50, #2c373c); color: var(--text);
  border: 2px solid #000; padding: 7px 12px;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.12);
}
.mini-btn:hover { filter: brightness(1.2); }
.mini-btn.go { background: linear-gradient(#6fce63, #3c8a34); color: #fff; }

.screen {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  background: #05080a;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.screen iframe { width: 100%; height: 100%; border: 0; background: #05080a; }
.screen .placeholder { text-align: center; color: var(--text-dim); padding: 30px; }
.screen .placeholder .big { font-size: 52px; margin-bottom: 16px; }
.screen .placeholder h3 { font-family: var(--font-mono); color: var(--text); margin-bottom: 10px; font-size: 17px; }
.screen-loading {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #05080a; z-index: 5; color: var(--text-dim); font-family: var(--font-mono); font-size: 13px;
}
.screen-loading.show { display: flex; }
.loader-bar { width: min(420px, 70%); height: 22px; border: 3px solid #000; background: #0c1114; box-shadow: inset 2px 2px 0 rgba(0,0,0,.6); }
.loader-fill { height: 100%; width: 20%; background: repeating-linear-gradient(90deg, var(--grass) 0 14px, var(--grass-dark) 14px 20px); animation: fillmove 2.4s steps(20) infinite; }
@keyframes fillmove { 0% { width: 8%; } 55% { width: 78%; } 100% { width: 96%; } }

.keys-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.keys-table th, .keys-table td { text-align: left; padding: 9px 12px; border-bottom: 2px solid var(--line); }
.keys-table th { font-family: var(--font-mono); color: var(--grass); font-weight: 700; }
.keys-table td:first-child { font-family: var(--font-mono); color: var(--gold); white-space: nowrap; }

.notice {
  border-left: 4px solid var(--gold); background: rgba(248, 184, 0, 0.07);
  padding: 12px 16px; font-size: 13px; color: var(--text-dim);
}
.notice b { color: var(--gold); }

/* ---------------- 页脚 ---------------- */
.footer { border-top: 3px solid #000; background: #080c0e; padding: 40px 0 30px; margin-top: 60px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer p, .footer a { font-size: 13px; color: var(--text-dim); }
.footer .disclaimer { max-width: 62em; font-size: 12px; line-height: 1.8; }

/* ---------------- 动画 ---------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; }
.reveal.in { opacity: 1; transform: none; }

.type-cursor { color: var(--grass); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .play-layout { grid-template-columns: 1fr; }
  .client-list { max-height: none; flex-direction: row; overflow-x: auto; }
  .client-item { min-width: 260px; }
  .filter-bar { position: static; }
}
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .ver-card { grid-template-columns: 1fr; }
  .hero-inner { padding: 64px 0 84px; }
  .nav-inner { flex-direction: column; align-items: flex-start; }
  .timeline { padding-left: 18px; }
  .ver-card::before { left: -19px; }
  .era-head::before { left: -18px; }
}

/* ---------------- 全站悬浮对话窗（js/chat.js 注入） ---------------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 58px; height: 58px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.14), inset -2px -2px 0 rgba(0,0,0,.5), 0 6px 0 rgba(0,0,0,.4);
  cursor: pointer;
  transition: transform .12s, filter .12s;
  image-rendering: pixelated;
}
.chat-fab:hover { transform: translateY(-3px); filter: brightness(1.15); }
.chat-fab svg { width: 30px; height: 30px; display: block; }
.chat-fab.on { border-color: var(--grass); }

/* 按钮左侧的像素小标签 */
.chat-fab-tip {
  position: absolute; right: calc(100% + 10px); top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px;
  color: var(--grass); background: var(--panel);
  border: 2px solid #000; padding: 5px 10px;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.08), 0 3px 0 rgba(0,0,0,.4);
  white-space: nowrap; pointer-events: none;
}

.chat-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 200;
  width: min(360px, calc(100vw - 32px));
  height: min(540px, calc(100vh - 130px));
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), 0 10px 0 rgba(0,0,0,.4);
  animation: chatIn .16s ease-out both;
}
.chat-panel[hidden] { display: none; }
@keyframes chatIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2); border-bottom: 3px solid #000;
}
.chat-ava {
  width: 36px; height: 36px; flex: none;
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.25), inset -3px -3px 0 rgba(0,0,0,.4);
}
.chat-ava svg { width: 100%; height: 100%; image-rendering: pixelated; }
.chat-id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.chat-id b { font-family: var(--font-mono); font-size: 13px; letter-spacing: 1px; }
.chat-id i { font-style: normal; font-size: 11px; color: var(--grass); }

.chat-clear {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 11px;
  background: transparent; color: var(--text-dim);
  border: 2px solid var(--line); padding: 4px 8px;
  cursor: pointer; transition: all .12s;
}
.chat-clear:hover { color: var(--text); border-color: var(--text-dim); }
.chat-close {
  width: 26px; height: 26px; flex: none;
  font-size: 16px; line-height: 1;
  background: transparent; color: var(--text-dim);
  border: 2px solid transparent; cursor: pointer; transition: all .12s;
}
.chat-close:hover { color: #fff; border-color: var(--redstone); background: rgba(214,69,65,.15); }

.chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg);
}
.chat-msgs::-webkit-scrollbar { width: 8px; }
.chat-msgs::-webkit-scrollbar-track { background: var(--bg); }
.chat-msgs::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid var(--bg); }

.chat-msg { display: flex; gap: 8px; align-items: flex-end; }
.chat-msg .mini-ava {
  width: 22px; height: 22px; flex: none;
  border: 2px solid #000;
  background: linear-gradient(#5ac54f 0 30%, #795539 30% 100%);
}
.chat-msg .bubble {
  max-width: 78%;
  font-size: 13.5px; line-height: 1.6;
  padding: 8px 12px;
  border: 2px solid #000;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06);
}
.chat-msg.bot .bubble { background: var(--panel-2); color: var(--text); }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg.user .bubble { background: var(--grass-dark); color: #fff; }
.chat-msg .bubble.err {
  background: rgba(214,69,65,.12); border-color: var(--redstone);
  color: var(--text-dim);
}

/* 正在输入：三块闪烁的小草方块 */
.chat-typing { display: flex; gap: 4px; align-items: center; padding: 11px 12px; }
.chat-typing i { width: 7px; height: 7px; background: var(--grass); animation: chatBlink 1s steps(2) infinite; }
.chat-typing i:nth-child(2) { animation-delay: .2s; }
.chat-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes chatBlink { 50% { opacity: .15; } }

.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; background: var(--bg); }
.chat-chips button {
  font-family: var(--font-mono); font-size: 11.5px; cursor: pointer;
  background: #0c1114; color: var(--text-dim);
  border: 2px solid var(--line); padding: 5px 10px;
  transition: all .12s;
}
.chat-chips button:hover { color: var(--text); border-color: var(--grass); }

.chat-inputrow {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 12px;
  background: var(--panel-2); border-top: 3px solid #000;
}
.chat-inputrow textarea {
  flex: 1; resize: none;
  font-family: var(--font-ui); font-size: 13.5px; line-height: 1.5;
  background: #0c1114; color: var(--text);
  border: 2px solid var(--line);
  padding: 8px 10px; min-height: 38px; max-height: 96px;
  outline: none;
}
.chat-inputrow textarea:focus { border-color: var(--grass); }
.chat-inputrow .mc-btn { padding: 9px 16px; font-size: 13px; flex: none; }
.chat-send:disabled { filter: grayscale(.6) brightness(.8); cursor: default; }

@media (max-width: 640px) {
  .chat-fab { right: 14px; bottom: 14px; width: 52px; height: 52px; }
  .chat-fab-tip { display: none; }
  .chat-panel { left: 10px; right: 10px; width: auto; bottom: 78px; height: min(72vh, 540px); }
}
