/* ============================================================
   盾徽编辑器 · 网页版 —— 暗金中世纪主题
   主背景 #1a1a1a · 面板 #2d2d2d · 暗金描边 #c9a84c · 米白文字 #d4c5a0
   ============================================================ */

:root {
  --bg: #1a1a1a;
  --bg-deep: #14120e;
  --panel: #2d2d2d;
  --panel-2: #262626;
  --panel-3: #22211e;
  --border: #3a352c;
  --border-light: #4c4537;
  --gold: #c9a84c;
  --gold-bright: #f0d890;
  --gold-dim: #8a7136;
  --text: #d4c5a0;
  --text-dim: #9b8d6f;
  --text-faint: #6f6652;
  --danger: #b05545;
  --serif: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  display: flex;
  flex-direction: column;
}

button, select, input {
  font-family: var(--sans);
  color: var(--text);
  background: var(--panel-3);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
}
button:hover { background: #3a3427; border-color: var(--gold-dim); color: var(--gold-bright); }
button:active { transform: translateY(1px); }
button.primary { background: #4a3d1d; border-color: var(--gold); color: var(--gold-bright); }
button.primary:hover { background: #5c4c24; }
button:disabled { opacity: .4; cursor: default; }
select:focus, input:focus { border-color: var(--gold); }
input[type="search"] { width: 100%; }

/* ---------------- 顶栏 ---------------- */
#topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-deep);
  border-bottom: 2px solid var(--gold-dim);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.brand-mark {
  font-size: 26px; color: var(--gold-bright);
  border: 1px solid var(--gold-dim); border-radius: 50%;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, #3c3320, #1d1a12);
}
.brand-title {
  font-family: var(--serif); font-size: 18px; color: var(--gold-bright);
  letter-spacing: 2px; display: block;
}
.brand-sub { font-size: 10px; color: var(--text-faint); letter-spacing: 1px; display: block; }
.tool-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tool-group .sep { width: 1px; height: 22px; background: var(--border-light); margin: 0 4px; }
.mini-label { display: flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 12px; }
.mini-label select { padding: 4px 6px; font-size: 12px; }

/* ---------------- 三栏主体 ---------------- */
#main { flex: 1 1 auto; display: flex; min-height: 0; }

#left {
  width: 300px; flex: 0 0 300px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
}
#center {
  flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: #171717;
}
#right {
  width: 320px; flex: 0 0 320px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

/* ---------------- 左侧素材库 ---------------- */
#libTabs { display: flex; border-bottom: 2px solid var(--gold-dim); }
.lib-tab {
  flex: 1; border: none; border-radius: 0; background: var(--panel-2);
  padding: 10px 0; font-family: var(--serif); font-size: 15px; color: var(--text-dim);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.lib-tab.active {
  background: var(--panel-3); color: var(--gold-bright);
  border-bottom-color: var(--gold);
}
.lib-panel { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 8px; gap: 8px; }
.filter-row { display: flex; gap: 6px; flex: 0 0 auto; }
.filter-row select { flex: 1; min-width: 0; }
.panel-tools { flex: 0 0 auto; display: flex; gap: 6px; }
.panel-tools button { flex: 1; }
.crumb {
  flex: 0 0 auto; font-size: 11px; color: var(--gold-bright);
  background: rgba(0,0,0,.28); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 8px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.kind-toggle { display: flex; gap: 4px; flex: 0 0 auto; }
.kind-toggle button { flex: 1; border-radius: 5px; padding: 6px 0; }
.kind-toggle button.active { background: #4a3d1d; border-color: var(--gold); color: var(--gold-bright); }
.panel-hint { color: var(--text-dim); font-size: 12px; line-height: 1.5; }

.thumb-grid {
  flex: 1 1 auto; overflow-y: auto; min-height: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: start;
  padding-right: 2px;
}
.thumb-grid::-webkit-scrollbar { width: 8px; }
.thumb-grid::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.thumb-item {
  position: relative; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px; cursor: pointer; text-align: center;
  transition: border-color .12s, box-shadow .12s;
}
.thumb-item:hover { border-color: var(--gold); box-shadow: 0 0 6px rgba(201,168,76,.35); }
.thumb-item.selected { border-color: var(--gold); box-shadow: 0 0 10px rgba(201,168,76,.65); }
.thumb-item canvas, .thumb-item img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.thumb-item .tname {
  display: block; font-size: 10px; color: var(--text-dim); line-height: 1.25;
  margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thumb-item .tsrc {
  position: absolute; top: 2px; right: 3px; font-size: 8px; color: var(--text-faint);
  background: rgba(0,0,0,.55); border-radius: 3px; padding: 0 3px;
}
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; }
.page-info { color: var(--text-dim); min-width: 60px; text-align: center; }

#layoutGrid { flex: 1 1 auto; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.layout-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; cursor: pointer; text-align: center;
}
.layout-card:hover { border-color: var(--gold); }
.layout-card canvas { display: block; margin: 0 auto; border: 1px solid var(--border); background: var(--bg-deep); }
.layout-card .lname { display: block; margin-top: 5px; color: var(--text-dim); font-size: 12px; }

/* ---------------- 中央画布 ---------------- */
#canvasWrap {
  flex: 1 1 auto; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at center, #232323 0%, #151515 70%, #101010 100%);
  display: flex; align-items: center; justify-content: center;
}
#canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  cursor: grab; box-shadow: 0 0 0 1px var(--border-light), 0 12px 40px rgba(0,0,0,.7);
  background: repeating-conic-gradient(#202020 0% 25%, #1b1b1b 0% 50%) 0 0 / 22px 22px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#canvas.dragging { cursor: grabbing; }
#canvasHint {
  position: absolute; left: 12px; bottom: 10px; font-size: 11px;
  color: var(--text-faint); background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 4px;
  pointer-events: none;
}
#canvasBar {
  flex: 0 0 auto; display: flex; gap: 14px; align-items: center;
  padding: 7px 14px; background: var(--bg-deep); border-top: 1px solid var(--border);
}

/* ---------------- 右侧属性 ---------------- */
.rsec { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.rsec h3 {
  font-family: var(--serif); font-size: 14px; color: var(--gold-bright);
  letter-spacing: 1px; margin-bottom: 8px; border-left: 3px solid var(--gold); padding-left: 8px;
}
.rsec-note { font-size: 10px; color: var(--text-faint); font-family: var(--sans); }

.color-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.color-swatch {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-light);
  flex: 0 0 26px; cursor: pointer; box-shadow: inset 0 0 6px rgba(0,0,0,.45);
}
.color-row .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-size: 12px; }
.color-row .cval { color: var(--text-faint); font-size: 10px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-row .mini-btn { flex: 0 0 auto; }
.mini-btn { font-size: 11px; padding: 3px 7px; border-radius: 4px; }
.mini-btn.danger { color: #e0a090; border-color: #6e3a30; }

.layers { max-height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.layer-item {
  display: flex; align-items: center; gap: 7px; padding: 4px 6px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; cursor: pointer;
}
.layer-item:hover { border-color: var(--border-light); }
.layer-item.selected { border-color: var(--gold); box-shadow: 0 0 7px rgba(201,168,76,.45); }
.layer-item canvas { flex: 0 0 34px; width: 34px; height: 34px; object-fit: contain; }
.layer-item .lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.layer-item .ldepth { color: var(--text-faint); font-size: 10px; }
.layers-empty { color: var(--text-faint); font-size: 12px; text-align: center; padding: 10px 0; }

.prop { display: flex; flex-direction: column; gap: 7px; }
.prop-row { display: flex; align-items: center; gap: 8px; }
.prop-row label { flex: 0 0 62px; color: var(--text-dim); font-size: 12px; }
.prop-row input[type="range"] { flex: 1; accent-color: var(--gold); }
.prop-row .pval { flex: 0 0 44px; text-align: right; color: var(--gold-bright); font-size: 12px; font-family: var(--serif); }
.prop-row input[type="number"] { width: 72px; flex: 0 0 72px; }
.prop-row input[type="checkbox"] { accent-color: var(--gold); width: 15px; height: 15px; }
.prop-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.prop-buttons button { flex: 1; font-size: 12px; padding: 5px 4px; }
.prop-empty { color: var(--text-faint); font-size: 12px; text-align: center; padding: 12px 0; }

/* ---------------- 状态栏 ---------------- */
#statusbar {
  flex: 0 0 auto; display: flex; gap: 20px; padding: 5px 14px;
  background: var(--bg-deep); border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 11px;
}
#statusbar span:last-child { margin-left: auto; }

/* ---------------- 右键菜单 ---------------- */
.ctx-menu {
  position: fixed; z-index: 200; background: var(--panel-3); border: 1px solid var(--gold-dim);
  border-radius: 6px; box-shadow: 0 6px 22px rgba(0,0,0,.7); padding: 4px; min-width: 130px;
}
.ctx-menu button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  border-radius: 4px; padding: 6px 10px; font-size: 12px;
}
.ctx-menu button:hover { background: #3a3427; color: var(--gold-bright); }

/* ---------------- 颜色弹层 ---------------- */
.color-pop {
  position: fixed; z-index: 300; width: 300px; background: var(--panel-3);
  border: 1px solid var(--gold-dim); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.75);
  padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.color-pop-head { display: flex; justify-content: space-between; align-items: center; }
.color-pop-head span { color: var(--gold-bright); font-family: var(--serif); }
.color-grid { height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.color-cell {
  aspect-ratio: 1; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; position: relative;
}
.color-cell:hover { border-color: var(--gold); transform: scale(1.08); }
.color-cell .ctip {
  display: none; position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
  background: #000; color: #ddd; font-size: 10px; padding: 2px 5px; border-radius: 3px; white-space: nowrap; z-index: 2;
}
.color-cell:hover .ctip { display: block; }
.color-pop-foot { display: flex; gap: 6px; align-items: center; }
.color-pop-foot input[type="color"] { width: 44px; height: 26px; padding: 0; border-radius: 4px; }

/* ---------------- 代码弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: min(760px, 90vw); background: var(--panel); border: 1px solid var(--gold-dim);
  border-radius: 10px; box-shadow: 0 16px 60px rgba(0,0,0,.8); padding: 16px;
}
.modal h3 { color: var(--gold-bright); font-family: var(--serif); margin-bottom: 10px; letter-spacing: 1px; }
.modal textarea {
  width: 100%; height: 380px; background: #12100c; color: #d8d0b8;
  border: 1px solid var(--border-light); border-radius: 6px; padding: 10px;
  font-family: Consolas, "Courier New", monospace; font-size: 12px; resize: vertical; white-space: pre;
}
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.modal-foot button.ghost { background: transparent; }

/* ---------------- 全屏素材库 ---------------- */
.lib-modal {
  width: min(1500px, 96vw); height: 92vh;
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 10px;
  box-shadow: 0 16px 60px rgba(0,0,0,.8); display: flex; flex-direction: column;
}
.lib-modal-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.lib-modal-head > span:first-child {
  font-family: var(--serif); font-size: 17px; color: var(--gold-bright); letter-spacing: 1px;
}
.lib-modal-head .crumb { flex: 1; }
.lib-modal-filters {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px;
  border-bottom: 1px solid var(--border); align-items: center;
}
.lib-modal-filters select, .lib-modal-filters input { min-width: 130px; flex: 0 1 180px; }
.lib-modal-filters input[type="search"] { flex: 1 1 260px; }
.lib-modal-body {
  flex: 1 1 auto; overflow-y: auto; position: relative; padding: 6px 10px;
}
.lib-row { position: absolute; left: 8px; right: 8px; display: grid;
  grid-template-columns: repeat(8, 1fr); gap: 6px; }
.lib-cell {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px; cursor: pointer; text-align: center; overflow: hidden; height: 96px;
}
.lib-cell:hover { border-color: var(--gold); }
.lib-cell canvas { display: block; margin: 0 auto; width: 64px; height: 64px; }
.lib-cell .tname {
  display: block; font-size: 10px; color: var(--text-dim); line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px;
}
.lib-modal-foot {
  padding: 8px 14px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px;
}

/* ---------------- 制作者名单 ---------------- */
.credits-mask {
  position: fixed; inset: 0; z-index: 500; background: rgba(10,8,5,.82);
  display: flex; align-items: center; justify-content: center;
}
.credits-card {
  width: 440px; text-align: center; padding: 30px 28px 24px;
  background:
    linear-gradient(160deg, #2a261d 0%, #1c1913 55%, #15120d 100%);
  border: 1px solid var(--gold-dim); border-radius: 14px;
  box-shadow: 0 0 0 3px rgba(201,168,76,.18), 0 24px 80px rgba(0,0,0,.9);
  position: relative;
}
.credits-ornament { font-size: 30px; color: var(--gold); opacity: .75; }
.credits-title {
  font-family: Georgia, "Times New Roman", serif; font-size: 30px; letter-spacing: 3px;
  color: var(--gold-bright); margin: 6px 0 2px; text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.credits-sub { font-size: 14px; color: var(--text-dim); font-weight: normal; letter-spacing: 2px; margin-bottom: 16px; }
.credits-avatar {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--gold); box-shadow: 0 0 22px rgba(201,168,76,.45);
}
.credits-author { margin-top: 14px; font-size: 17px; color: var(--gold-bright); font-family: var(--serif); letter-spacing: 1px; }
.credits-line { margin-top: 6px; font-size: 10px; color: var(--text-faint); }
.credits-count { margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.credits-btn {
  margin-top: 14px; padding: 9px 34px; font-family: var(--serif); font-size: 15px;
  background: #4a3d1d; border: 1px solid var(--gold); color: var(--gold-bright); border-radius: 6px;
}
.credits-btn:hover { background: #5c4c24; }

/* ---------------- 访问密码门禁 ---------------- */
.login-mask {
  position: fixed; inset: 0; z-index: 700; background: rgba(10,8,5,.92);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 360px; text-align: center; padding: 34px 30px 28px;
  background: linear-gradient(160deg, #2a261d 0%, #1c1913 55%, #15120d 100%);
  border: 1px solid var(--gold-dim); border-radius: 14px;
  box-shadow: 0 0 0 3px rgba(201,168,76,.18), 0 24px 80px rgba(0,0,0,.9);
}
.login-ornament { font-size: 30px; color: var(--gold); opacity: .75; }
.login-title {
  font-family: var(--serif); font-size: 26px; letter-spacing: 3px;
  color: var(--gold-bright); margin: 6px 0 2px; text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.login-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 18px; letter-spacing: 1px; }
.login-card input[type="password"] {
  width: 100%; padding: 10px 12px; font-size: 16px; text-align: center; letter-spacing: 2px;
  background: #12100c; color: var(--text); border: 1px solid var(--border-light);
  border-radius: 6px; outline: none;
}
.login-card input[type="password"]:focus { border-color: var(--gold); }
.login-msg { min-height: 18px; margin-top: 8px; font-size: 12px; color: #e0a090; }
.login-btn {
  margin-top: 10px; width: 100%; padding: 10px 0;
  font-family: var(--serif); font-size: 15px; letter-spacing: 2px;
  background: #4a3d1d; border: 1px solid var(--gold); color: var(--gold-bright);
  border-radius: 6px; cursor: pointer;
}
.login-btn:hover { background: #5c4c24; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--panel-3); }
::-webkit-scrollbar-thumb { background: #4a4234; border-radius: 5px; border: 2px solid var(--panel-3); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ============================================================
   响应式适配 · 平板 / 手机
   桌面保持三栏；≤860px 切换为单列 + 底部视图切换栏（素材库/画布/属性）
   ============================================================ */

/* 移动端底部视图切换栏（桌面隐藏） */
#mobileTabs { display: none; }

/* 中等屏：收窄左右栏 */
@media (max-width: 1200px) {
  #left { width: 260px; flex-basis: 260px; }
  #right { width: 280px; flex-basis: 280px; }
}
@media (max-width: 1000px) {
  #left { width: 230px; flex-basis: 230px; }
  #right { width: 250px; flex-basis: 250px; }
}

/* 手机 / 竖屏平板：单列布局 */
@media (max-width: 860px) {
  body { font-size: 14px; }

  /* 顶栏：允许横向滚动，压缩品牌区 */
  #topbar { padding: 6px 8px; gap: 6px; overflow-x: auto; }
  #topbar::-webkit-scrollbar { height: 4px; }
  .brand { flex: 0 0 auto; gap: 7px; }
  .brand-mark { width: 30px; height: 30px; font-size: 19px; }
  .brand-title { font-size: 15px; letter-spacing: 1px; }
  .brand-sub { display: none; }
  .tool-group { flex: 0 0 auto; flex-wrap: nowrap; }
  .tool-group button { white-space: nowrap; padding: 5px 8px; font-size: 12px; }
  .mini-label { font-size: 11px; }
  .mini-label select { padding: 3px 4px; font-size: 11px; }

  /* 主体：单列 + 视图切换 */
  #main { flex-direction: column; }
  #left {
    display: none; width: 100% !important;
    flex: 1 1 auto !important; min-height: 0;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  #center { display: flex; flex: 1 1 auto; min-height: 0; }
  #right {
    display: none; width: 100% !important; flex-basis: auto !important;
    border-left: none; border-top: 1px solid var(--border);
    flex: 1 1 auto; min-height: 0;
  }
  body.mobile-view-lib #left { display: flex; }
  body.mobile-view-lib #center { display: none; }
  body.mobile-view-props #right { display: block; }
  body.mobile-view-props #center { display: none; }

  /* 移动端视图切换栏 */
  #mobileTabs {
    display: flex; flex: 0 0 auto;
    border-top: 1px solid var(--border); background: var(--bg-deep);
  }
  #mobileTabs button {
    flex: 1; border: none; border-radius: 0; background: var(--panel-2);
    padding: 10px 0; font-family: var(--serif); font-size: 14px;
    color: var(--text-dim);
  }
  #mobileTabs button.active {
    background: var(--panel-3); color: var(--gold-bright);
    box-shadow: inset 0 -2px 0 var(--gold);
  }

  #canvasHint {
    left: 8px; right: 8px; bottom: 8px; text-align: center; font-size: 10px;
  }
  #canvasBar { flex-wrap: wrap; gap: 8px; padding: 6px 10px; }
  #statusbar { flex-wrap: wrap; gap: 6px 14px; padding: 5px 10px; }
  #statusbar span:last-child { margin-left: 0; }
  #statusHint { display: none; }

  /* 素材库网格：4 列更适合拇指点按 */
  .thumb-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .thumb-item .tname { font-size: 9px; }
  .color-grid { grid-template-columns: repeat(6, 1fr); height: 220px; }
  .color-pop { width: min(320px, calc(100vw - 24px)); }

  /* 弹窗 */
  .modal { width: 96vw; max-height: 92vh; overflow-y: auto; }
  .modal textarea { height: 52vh; }
  .lib-modal { width: 98vw; height: 96vh; }
  .lib-modal-head { flex-wrap: wrap; gap: 8px; }
  .lib-modal-head .crumb { flex: 1 1 100%; order: 3; }
  .lib-modal-filters select { min-width: 0; flex: 1 1 45%; }
  .lib-modal-filters input[type="search"] { flex: 1 1 100%; }
  .lib-row { grid-template-columns: repeat(4, 1fr); left: 6px; right: 6px; gap: 4px; }
  .lib-cell { height: 84px; padding: 3px; }
  .lib-cell canvas { width: 48px; height: 48px; }

  /* 制作者名单 */
  .credits-card { width: calc(100vw - 28px); padding: 22px 16px 18px; }
  .login-card { width: calc(100vw - 40px); padding: 26px 18px 22px; }
  .credits-title { font-size: 24px; letter-spacing: 2px; }
  .credits-sub { font-size: 12px; }
  .credits-avatar { width: 88px; height: 88px; }

  .layers { max-height: 150px; }
}

/* 超窄屏微调 */
@media (max-width: 420px) {
  .thumb-grid { grid-template-columns: repeat(3, 1fr); }
  .lib-row { grid-template-columns: repeat(3, 1fr); }
  .brand-title { font-size: 13px; }
  .brand-mark { width: 26px; height: 26px; font-size: 16px; }
}
