/* 甲子芽 · 铁疙瘩：旧网页「打字机 + 数码屏机器人」全套样式，原样搬来后加作用域前缀。
   改样式请改本文件；日签文案请改 qian.js；逻辑请改 iron-gadget.js。 */
  /* ================= 复古桌面区 ================= */
  
.iron-stage .retro-section {
    width: 100%;
    max-width: 1180px;
    margin: -40px auto 3rem;   /* ★ 桌子＋打字机＋机器人整体上移 40px，卷轴随之同步上移 */
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
  }

  
.iron-stage .scene-scaler {
    width: 100%;
    max-width: 900px;
    height: 760px;   /* 加高，容纳放大 2× 后的机器人（显示全） */
    position: relative;
    overflow: hidden;
  }

  
.iron-stage .scene {
    position: absolute;
    top: 0; left: 50%;
    width: 860px;
    height: 760px;   /* 加高，容纳放大 2× 后的机器人（显示全） */
    transform: translateX(-50%) scale(1);
    transform-origin: top center;
    transition: transform .2s ease;
  }

  
.iron-stage .desk {
    position:absolute; bottom: 94px; left:-60px; right:-60px; height: 200px;  /* 上移 30px（64→94） */
    background:
      repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 3px, transparent 3px 90px,
                rgba(255,255,255,.03) 90px 93px, transparent 93px 180px),
      linear-gradient(178deg, #8a5c34, #6b4423);
    /* 四个角都圆：跟手机端「桌子变显示屏」那块弹出屏的 16px 圆角对齐。
       --desk-round 由 iron-gadget.js 按场景缩放比例算好，保证屏幕上看着正好 16px */
    border-radius: var(--desk-round, 16px);
    box-shadow: 0 -4px 10px rgba(0,0,0,.3), inset 0 4px 6px rgba(255,255,255,.15);
    overflow: hidden;
  }
  
.iron-stage .desk::before {
    content:""; position:absolute; top:-14px; left:0; right:0; height:16px;
    background: linear-gradient(#6b4423, #8a5c34);
    border-radius: var(--desk-round, 16px) var(--desk-round, 16px) 0 0;
    box-shadow: inset 0 2px 3px rgba(255,255,255,.2), 0 -3px 6px rgba(0,0,0,.25);
    z-index: 2;
  }

  
.iron-stage .desk-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    pointer-events: none;
    user-select: none;
    width: 80%;
  }

  
.iron-stage .desk-title h2 {
    font-size: clamp(1.2rem, 3.2vw, 2rem);
    font-weight: 600;
    letter-spacing: 10px;
    line-height: 1.3;
    color: #bfa46f;
    text-shadow:
      0 1px 0 rgba(255,235,200,.5),
      0 -1px 0 rgba(30,14,2,.7),
      0 2px 3px rgba(0,0,0,.5);
    margin-bottom: 0.2rem;
  }

  
.iron-stage .desk-title p {
    font-size: clamp(0.62rem, 1.1vw, 0.85rem);
    letter-spacing: 5px;
    color: #c38743;
    text-shadow:
      0 1px 0 rgba(255,235,200,.4),
      0 -1px 0 rgba(30,14,2,.6),
      0 1px 2px rgba(0,0,0,.4);
    font-family: "Georgia", serif;
  }

  /* 打字机 */
  
.iron-stage .typewriter {
    position: absolute; left: 45px; bottom: 290px;  /* 整体上移 30px（260→290） */
    width: 470px; height: 330px;
    cursor: pointer; z-index: 5;
    /* 整体缩到 0.723 倍 → 视觉宽 340px，与机器人(340px)严格等宽；
       以左下角为轴，保持贴桌面且左移后的位置不跑偏 */
    transform: scale(0.723);
    transform-origin: bottom left;
  }

  
.iron-stage .tw-paper {
    position:absolute; top:-6px; left:50%;
    width: 210px; height: 140px;
    background: linear-gradient(180deg, #f8f4e8, #efe9d8);
    transform: translateX(-50%) translateY(105%);
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    border-radius: 2px; z-index: 0; overflow: hidden;
    transition: transform .55s cubic-bezier(.3,1.4,.5,1);
  }
  
.iron-stage .typewriter.printed .tw-paper { transform: translateX(-50%) translateY(-42%); }
  
.iron-stage .tw-paper .plines {
    padding: 46px 16px 0;
    font-size: 10.5px; color:#4a4136; line-height:1.75;
    font-family:"Courier New",monospace;
    white-space: pre-wrap; text-align:center;
  }
  
.iron-stage .tw-paper .plines::after {
    content:"↳ 点击取出";
    display:block; text-align:center; margin-top:8px;
    color:#a08a5c; font-size:10px; letter-spacing:1px;
    animation: pulse 1.6s infinite;
  }
  @keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }

  
.iron-stage .tw-backplate {
    position:absolute; top: 34px; left: 70px; right: 70px; height: 78px;
    background: linear-gradient(175deg, #4e6152, #37473b 70%, #2c392f);
    border-radius: 8px 8px 4px 4px;
    box-shadow: inset 0 2px 3px rgba(255,255,255,.15), 0 4px 8px rgba(0,0,0,.3);
  }
  
.iron-stage .tw-backplate::before {
    content:""; position:absolute; top:8px; left:26px; right:26px; height:7px;
    background:#141a16; border-radius:4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.08);
  }
  
.iron-stage .tw-backplate::after {
    content:"QI MA No.5";
    position:absolute; bottom:8px; left:0; right:0; text-align:center;
    font-size:9px; letter-spacing:3px; color:rgba(230,222,200,.55);
    font-family:"Georgia",serif;
  }

  
.iron-stage .tw-roller {
    position:absolute; top: 100px; left: 30px; right: 30px; height: 44px;
    background: linear-gradient(#5b6e5e, #39483c 60%, #2b372e);
    border-radius: 22px;
    box-shadow: inset 0 3px 4px rgba(255,255,255,.2), 0 5px 10px rgba(0,0,0,.4);
    z-index: 2;
  }
  
.iron-stage .tw-roller::before, .iron-stage .tw-roller::after {
    content:""; position:absolute; top: 7px;
    width: 30px; height: 30px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #6d7d6e, #39483c 60%, #232c25);
    box-shadow: 0 3px 5px rgba(0,0,0,.45);
  }
  
.iron-stage .tw-roller::before { left: -15px; }
  
.iron-stage .tw-roller::after { right: -15px; }
  
.iron-stage .tw-roller .slot {
    position:absolute; top: 19px; left: 34px; right: 34px; height: 6px;
    background: #10150f; border-radius: 3px;
    box-shadow: inset 0 2px 3px rgba(0,0,0,.8);
  }

  
.iron-stage .tw-typebars {
    position:absolute; top: 124px; left: 50%; transform: translateX(-50%);
    display:flex; gap: 8px; z-index: 3;
  }
  
.iron-stage .tw-typebars i {
    width: 4px; height: 30px;
    background: linear-gradient(#9a9484, #5f584a);
    border-radius: 2px;
    transform-origin: bottom center;
    transform: rotate(calc((var(--i) - 4.5) * 8deg));
  }
  
.iron-stage .typing .tw-typebars i { animation: strike .4s infinite; }
  
.iron-stage .typing .tw-typebars i:nth-child(2n) { animation-delay:.15s; }
  
.iron-stage .typing .tw-typebars i:nth-child(3n) { animation-delay:.3s; }
  @keyframes strike {
    0%,100% { transform: rotate(calc((var(--i) - 4.5) * 8deg)); }
    50% { transform: rotate(calc((var(--i) - 4.5) * 1.5deg)) scaleY(1.06); }
  }

  
.iron-stage .tw-body {
    position:absolute; top: 138px; left: 0; right: 0; bottom: 26px;
    background:
      repeating-linear-gradient(93deg, rgba(255,255,255,.025) 0 2px, transparent 2px 9px),
      linear-gradient(172deg, #465a4c, #33443a 55%, #27342b);
    border-radius: 16px 16px 26px 26px;
    box-shadow: inset 0 3px 4px rgba(255,255,255,.16), inset 0 -6px 10px rgba(0,0,0,.45),
                0 16px 30px rgba(0,0,0,.42);
  }
  
.iron-stage .tw-lever {
    position:absolute; left: -26px; top: 176px;
    width: 56px; height: 10px; border-radius: 6px;
    background: linear-gradient(#8a8270, #4d463a);
    transform: rotate(-16deg);
    box-shadow: 0 3px 6px rgba(0,0,0,.4);
    z-index: 4; transition: transform .35s;
  }
  
.iron-stage .typing .tw-lever { animation: leverPull .9s ease-in-out infinite; }
  @keyframes leverPull {
    0%,100% { transform: rotate(-16deg); }
    40%,60% { transform: rotate(14deg); }
  }
  
.iron-stage .tw-spools {
    position:absolute; top: 126px; left: 50%; transform: translateX(-50%);
    display:flex; gap: 130px; z-index: 4;
  }
  
.iron-stage .tw-spools i {
    width: 18px; height: 18px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #b08a5c, #4a3a28 55%, #2a2016);
    box-shadow: 0 2px 4px rgba(0,0,0,.45);
  }
  
.iron-stage .typing .tw-spools i { animation: spin .5s linear infinite; }
  
.iron-stage .typing .tw-spools i:last-child { animation-direction: reverse; }
  @keyframes spin { to { transform: rotate(360deg); } }

  
.iron-stage .tw-keyboard {
    position:absolute; bottom: 42px; left: 48px; right: 48px;
    display:flex; flex-direction:column; gap: 5px;
    align-items: center; z-index: 3;
  }
  
.iron-stage .krow { display:flex; gap: 5px; }
  
.iron-stage .key {
    width: 26px; height: 24px;
    display:flex; align-items:center; justify-content:center;
    font-family:"Courier New",monospace;
    font-size: 10px; font-weight:bold; color:#4a4335;
    background: linear-gradient(#f2ecdc, #cec6b0 70%, #b5ac93);
    border-radius: 5px;
    box-shadow: 0 4px 0 #8a8270, 0 6px 8px rgba(0,0,0,.35),
                inset 0 1px 1px rgba(255,255,255,.85);
    transition: transform .07s, box-shadow .07s;
  }
  
.iron-stage .key.dark { background: linear-gradient(#d9d0ba, #b0a78d 70%, #988e74); color:#5a5342; }
  
.iron-stage .key.space { width: 190px; border-radius: 12px; }
  
.iron-stage .krow.offset1 { margin-left: 14px; }
  
.iron-stage .krow.offset2 { margin-left: 28px; }
  
.iron-stage .krow.offset3 { margin-left: 42px; }
  
.iron-stage .typing .key { animation: keytap .42s infinite; }
  @keyframes keytap {
    0%,100% { transform: translateY(0);
      box-shadow: 0 4px 0 #8a8270, 0 6px 8px rgba(0,0,0,.35), inset 0 1px 1px rgba(255,255,255,.85); }
    50% { transform: translateY(4px);
      box-shadow: 0 0px 0 #8a8270, 0 2px 3px rgba(0,0,0,.3), inset 0 1px 1px rgba(255,255,255,.85); }
  }

  
.iron-stage .tw-base {
    position:absolute; bottom: 12px; left: 34px; right: 34px; height: 22px;
    background: linear-gradient(#2b342c, #171d17);
    border-radius: 10px;
    box-shadow: 0 10px 18px rgba(0,0,0,.5), inset 0 1px 2px rgba(255,255,255,.12);
  }

  /* ══════════════════════════════════════════
     提示气泡：整条（小手 + 文字）一起上下浮动
     严格在打字机横向居中
  ══════════════════════════════════════════ */
  
.iron-stage .tw-hint {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0d7377;
    font-size: 22px;
    letter-spacing: 2px;
    white-space: nowrap;
    opacity: 1;
    pointer-events: none;
    transition: opacity .3s;
    /* 整条一起上下浮动 */
    animation: hintBob 1.1s ease-in-out infinite;
  }
  
.iron-stage .tw-hint .hand {
    font-size: 22px;
    display: inline-block;
    /* 小手不再单独动画，跟整条一起浮 */
  }

  @keyframes hintBob {
    0%,100% { transform: translateX(-50%) translateY(0); }
    45%     { transform: translateX(-50%) translateY(-5px); }
    60%     { transform: translateX(-50%) translateY(1px); }
  }

  /* 隐藏：只淡出，不再改 transform（避免与浮动动画冲突） */
  
.iron-stage .typewriter.typing .tw-hint, .iron-stage .tw-hint.hide {
    opacity: 0;
  }

  /* 成功提示：整条一起浮动，颜色/字号不同 */
  
.iron-stage .tw-hint.success {
    color: #2e7d4f;
    font-size: 18px;
    visibility: hidden;     /* ← 默认彻底不显示 */
    opacity: 0;
    animation: hintBob 1.1s ease-in-out infinite, top: -6px;
  }
  
.iron-stage .tw-hint.success.show {
    visibility: visible; 
    opacity: 1;
  }
 
  
.iron-stage .tw-hint.success .hand {
    font-size: 18px;
    display: inline-block;
    animation: successPop .7s ease-in-out infinite;
  }
  @keyframes successPop {
    0%,100% { transform: scale(1) rotate(-8deg); }
    50%     { transform: scale(1.2) rotate(8deg); }
  }

  
.iron-stage .carriage { transition: transform .1s; }
  
.iron-stage .typing .carriage { animation: slide .5s ease-in-out infinite alternate; }
  @keyframes slide { from { transform: translateX(-7px); } to { transform: translateX(7px); } }

  /* 朱印 */
  
.ir-mini-seal {
    position: relative;
    display: inline-flex;
    background: #a02c21;
    border-radius: 3px;
    box-shadow: inset 0 0 6px rgba(60,8,4,.55);
    flex: none;
  }
  
.ir-mini-seal b {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100%; width: 100%;
    color: #fdf6ec;
    font-family: "SimSun","宋体","Songti SC","Noto Serif SC",serif;
    font-weight: 900;
    line-height: 1;
    z-index: 5;
  }
  
.ir-mini-seal b i { font-style: normal; display: block; }
  
.ir-mini-seal::before {
    content:""; position:absolute; inset:0; pointer-events:none; z-index: 3;
    background-image:
      radial-gradient(circle 1.1px at 20% 15%, rgba(160,44,33,.35) 40%, transparent 60%),
      radial-gradient(circle 0.9px at 70% 30%, rgba(160,44,33,.3) 40%, transparent 60%),
      radial-gradient(circle 1.2px at 45% 60%, rgba(160,44,33,.35) 40%, transparent 60%),
      radial-gradient(circle 0.9px at 85% 80%, rgba(160,44,33,.28) 40%, transparent 60%),
      radial-gradient(circle 1.1px at 30% 90%, rgba(160,44,33,.32) 40%, transparent 60%),
      radial-gradient(circle 0.9px at 60% 8%,  rgba(160,44,33,.3) 40%, transparent 60%);
  }
  
.ir-mini-seal::after {
    content:""; position:absolute; inset:0; pointer-events:none; z-index: 4;
    background:
      radial-gradient(circle 2.5px at 0% 0%, transparent 55%, #a02c21 60%) 0 0 / 6px 6px no-repeat,
      radial-gradient(circle 2px at 100% 0%, transparent 55%, #a02c21 60%) 100% 0 / 6px 6px no-repeat,
      radial-gradient(circle 2.2px at 0% 100%, transparent 55%, #a02c21 60%) 0 100% / 6px 6px no-repeat,
      radial-gradient(circle 2.8px at 100% 100%, transparent 55%, #a02c21 60%) 100% 100% / 6px 6px no-repeat;
  }
  
.ir-mini-seal.tb {
    width: 15px; height: 20px;
    transform: rotate(-2deg);
    overflow: hidden;
  }
  
.ir-mini-seal.tb b i { font-size: 5px; }
  
.ir-mini-seal.tb b { gap: 1px; }
  
.ir-mini-seal.paper {
    width: 45px; height: 60px;
    position: absolute; right: 26px; bottom: 22px;
    transform: rotate(-3deg);
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
    box-shadow: inset 0 0 6px rgba(60,8,4,.55), 0 1px 3px rgba(0,0,0,.2);
  }
  
.ir-mini-seal.paper b { gap: 1px; }
  
.ir-mini-seal.paper b i { font-size: 13px; }

  /* 弹窗 */
  
.ir-modal-mask {
    position: fixed; inset: 0;
    background: rgba(20,16,10,.45);
    display:flex; align-items:center; justify-content:center;
    opacity:0; pointer-events:none;
    transition: opacity .3s; z-index: 100;
  }
  
.ir-modal-mask.show { opacity:1; pointer-events:auto; }
  
.ir-retro-window {
    width: 520px; max-width: 94vw;
    background: #c3c3c3;
    border: 2px solid;
    border-color: #fff #4a4a4a #4a4a4a #fff;
    box-shadow: 4px 4px 0 rgba(0,0,0,.35), inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
    font-family: "Tahoma","SimSun","Noto Serif SC",sans-serif;
    transform: translateY(26px) scale(.96);
    transition: transform .35s cubic-bezier(.25,.8,.25,1);
    display: flex; flex-direction: column;
  }
  
.ir-modal-mask.show .ir-retro-window { transform: translateY(0) scale(1); }

  
.ir-retro-window.maximized {
    width: 96vw; max-width: 96vw;
    height: 88vh;
    transform: none !important;
    transition: all .25s;
  }
  
.ir-retro-window.maximized .ir-rw-paper { flex: 1; height: auto; }

  
.ir-retro-window.minimized .ir-rw-menubar, .ir-retro-window.minimized .ir-rw-toolbar, .ir-retro-window.minimized .ir-rw-body, .ir-retro-window.minimized .ir-rw-statusbar, .ir-retro-window.minimized .ir-rw-actions { display: none; }
  
.ir-retro-window.minimized { box-shadow: 4px 4px 0 rgba(0,0,0,.35); }

  
.ir-rw-titlebar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #fff;
    padding: 5px 6px 5px 10px;
    display:flex; align-items:center; gap: 8px;
    font-size: 13px; font-weight: bold; letter-spacing: 1px;
    user-select: none;
    cursor: default;
  }
  
.ir-rw-titlebar .ir-rw-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  
.ir-rw-titlebar .ir-rw-btns { margin-left:auto; display:flex; gap: 3px; }
  
.ir-rw-titlebar button {
    width: 20px; height: 18px;
    background: #c3c3c3;
    border: 1px solid;
    border-color: #fff #4a4a4a #4a4a4a #fff;
    font-size: 11px; font-weight: bold; color:#000;
    cursor: pointer; line-height: 1;
    display:flex; align-items:center; justify-content:center;
    font-family: "Tahoma",monospace;
  }
  
.ir-rw-titlebar button:active { border-color: #4a4a4a #fff #fff #4a4a4a; }

  
.ir-rw-menubar {
    display:flex; gap: 2px; padding: 3px 6px;
    font-size: 12px; color:#111;
    border-bottom: 1px solid #808080;
    box-shadow: 0 1px 0 #fff;
    background: #c3c3c3;
  }
  
.ir-rw-menubar span { padding: 2px 8px; cursor: default; }
  
.ir-rw-menubar span:hover { background: #000080; color: #fff; }

  
.ir-rw-toolbar {
    display:flex; gap: 4px; padding: 5px 8px;
    background: #c3c3c3;
    border-bottom: 1px solid #808080; box-shadow: 0 1px 0 #fff;
  }
  
.ir-rw-toolbar .tbtn {
    font-size: 11px; padding: 3px 10px;
    background: #c3c3c3;
    border: 1px solid; border-color:#fff #4a4a4a #4a4a4a #fff;
    color:#222; cursor:pointer;
    font-family: inherit;
  }
  
.ir-rw-toolbar .tbtn:active { border-color:#4a4a4a #fff #fff #4a4a4a; }

  
.ir-rw-body { padding: 10px; background: #c3c3c3; flex: 1; display: flex; }
  
.ir-rw-paper {
    background: #fdfdf8;
    border: 2px solid;
    border-color: #4a4a4a #fff #fff #4a4a4a;
    padding: 18px 22px;
    height: 320px; overflow-y: auto;
    font-family: "Courier New","Noto Serif SC",monospace;
    font-size: 14px; line-height: 26px; color: #222;
    flex: 1;
    position: relative;
  }
  
.ir-rw-paper .txt { outline:none; user-select:text; white-space:pre-wrap; min-height: 200px; }
  
.ir-rw-paper .caret {
    display:inline-block; width:8px; height:16px;
    background:#222; vertical-align:-2px;
    animation: caretblink .8s steps(1) infinite;
  }
  @keyframes caretblink { 50% { opacity:0; } }
  
.ir-rw-paper .dateline {
    color:#7a4a2a; font-weight: bold;
    border-bottom: 1px dashed #b09a78;
    padding-bottom: 6px; margin-bottom: 10px;
    display:block;
  }

  
.ir-rw-statusbar {
    display:flex; gap: 4px; padding: 4px 6px 6px;
    background: #c3c3c3; font-size: 11px; color:#222;
  }
  
.ir-rw-statusbar .cell {
    flex:1; padding: 2px 8px;
    border: 1px solid;
    border-color:#4a4a4a #fff #fff #4a4a4a;
    box-shadow: inset 1px 1px 0 #808080;
    overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
  }

  
.ir-rw-actions {
    display:flex; justify-content:center; gap: 10px;
    padding: 6px 10px 14px; background:#c3c3c3;
  }
  
.ir-rw-actions button {
    min-width: 96px; padding: 6px 14px;
    font-family: "Tahoma","Noto Serif SC",sans-serif;
    font-size: 13px;
    background: #c3c3c3; color:#000;
    border: 2px solid;
    border-color:#fff #4a4a4a #4a4a4a #fff;
    box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
    cursor:pointer;
  }
  
.ir-rw-actions button:active {
    border-color:#4a4a4a #fff #fff #4a4a4a;
    transform: translate(1px,1px);
  }
  
.ir-rw-actions button:focus { outline: 1px dotted #000; outline-offset: -5px; }

  
.ir-toast {
    position: fixed; top:30px; left:50%;
    transform: translateX(-50%) translateY(-16px);
    background: rgba(40,35,28,.92); color:#e8dfc9;
    padding:10px 24px; border-radius:26px;
    font-size:13px; letter-spacing:2px;
    opacity:0; transition: all .4s; z-index:200; pointer-events:none;
  }
  
.ir-toast.show { opacity:1; transform: translateX(-50%) translateY(0); }

  /* ═══════════ 数码屏机器人（原木桩年轮位）· 移植自 机器人.html ═══════════ */
  
.iron-stage .qb-wrap {
    position: absolute;
    right: 60px;
    bottom: 226px;   /* 补偿 viewBox 底部留白，使履带随桌子一起上移后落在桌面接触线 */
    z-index: 6;
    transform: scale(2);             /* ★ 机器人放大两倍（含顶部数码屏，同步放大） */
    transform-origin: bottom right;  /* 以右下角为支点放大：履带仍踩桌面、右侧不出界 */
  }

  
.iron-stage .qb-unit {
    position: relative;
    display: block;
    width: 200px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .3s ease;
  }
  
.iron-stage .qb-unit:hover { transform: translateY(-4px); }
  
.iron-stage .qb-unit svg.qb-svg {
    width: 100%; height: auto; display: block;
    filter: drop-shadow(0 12px 16px rgba(40,20,5,.34));
  }

  /* —— 眼球常态游移 —— */
  
.iron-stage .qb-eyeball { transform-origin: center; animation: qb-look 6s ease-in-out infinite; }
  @keyframes qb-look {
    0%,100% { transform: translate(0,0); }
    25%     { transform: translate(6px,-4px); }
    50%     { transform: translate(-5px,3px); }
    75%     { transform: translate(3px,5px); }
  }

  /* —— 点击：眼神乱瞟 + 目镜辉光 —— */
  
.iron-stage .qb-eyeball.qb-dart { animation: qb-dart 1.1s ease, qb-eyeglow 1.1s ease; }
  @keyframes qb-dart {
    0%   { transform: translate(0,0) rotate(0); }
    12%  { transform: translate(9px,-2px) rotate(8deg); }
    26%  { transform: translate(-9px,2px) rotate(-8deg); }
    40%  { transform: translate(9px,3px) rotate(8deg); }
    54%  { transform: translate(-9px,-3px) rotate(-8deg); }
    68%  { transform: translate(7px,1px) rotate(6deg); }
    84%  { transform: translate(-4px,0) rotate(-4deg); }
    100% { transform: translate(0,0) rotate(0); }
  }
  @keyframes qb-eyeglow {
    0%,100% { filter: drop-shadow(0 0 0 rgba(255,220,120,0)); }
    25%,65% { filter: drop-shadow(0 0 12px rgba(255,220,120,1)); }
    45%     { filter: drop-shadow(0 0 6px rgba(255,220,120,.5)); }
  }

  /* —— 点击：机身弹跳 —— */
  
.iron-stage .qb-unit svg.qb-react { animation: qb-reactA 1.1s ease !important; }
  @keyframes qb-reactA {
    0%   { transform: translateY(0) rotate(0); }
    18%  { transform: translateY(-12px) rotate(-3deg); }
    34%  { transform: translateY(-8px) rotate(3deg); }
    50%  { transform: translateY(-10px) rotate(-2deg); }
    66%  { transform: translateY(-4px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0); }
  }

  /* —— 数码屏文字 —— */
  
.iron-stage .qb-digital-text {
    font-family: "Courier New","Lucida Console",monospace;
    font-weight: bold;
    fill: #aaffaa;
    text-anchor: middle;
    dominant-baseline: middle;
    filter: drop-shadow(0 0 3px #00ff88);
    letter-spacing: 2px;
  }

  /* —— 数码屏浮动（以底座连接点为轴） —— */
  /* 摸头时由 JS 直接改 holder 的 SVG transform 属性，让整块屏跳到脑袋正上方 */
.iron-stage #ir-qb-screen-group {
    animation: qb-floatScreen 2.8s ease-in-out infinite;
    transform-origin: 110px -42px;
  }
  @keyframes qb-floatScreen {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-5px); }
  }

  @media (max-width:520px) { 
.iron-stage .qb-unit { width: 170px; } }
/* ══════════════════════════════════════════════════════════════
   铁疙瘩 · 装载台（把旧网页的 860×760 场景等比塞进书页）
   场景真正的缩放由 iron-gadget.js 按可用宽度实时算，CSS 只给兜底。
   ══════════════════════════════════════════════════════════════ */
.iron-stage{width:100%;margin:8px 0 0;position:relative}
.iron-stage .retro-section{margin:0 auto;padding:0;max-width:900px;width:100%;display:block}
.iron-stage .scene-scaler{height:700px;max-width:900px}
.iron-stage .scene{transition:none}
.iron-stage .typewriter,.iron-stage .qb-unit{-webkit-tap-highlight-color:transparent}
.iron-stage .tw-paper{cursor:pointer}
/* 弹窗挂在 body 上：脱离书页的层叠上下文，手机底栏也压不住它 */
.ir-modal-mask{z-index:400}
.ir-toast{z-index:410}
.ir-retro-window{max-height:92vh}
.ir-rw-paper{max-height:60vh}
@media(max-width:820px){
  .iron-stage{margin-left:-10px;margin-right:-10px;width:calc(100% + 20px)}
  .ir-retro-window{width:94vw}
  .ir-rw-paper{padding:14px 16px;font-size:13px;line-height:24px;height:260px}
  .ir-rw-menubar{display:none}
}
@media(prefers-reduced-motion:reduce){
  .iron-stage *,.iron-stage *::before,.iron-stage *::after{animation-duration:.001ms!important;animation-iteration-count:1!important}
}

/* ══════════════════════════════════════════════════════════════
   姐姐 2026-11-09：复古弹窗加大、文字加大、四周留白防出框
   全部写在文件末尾做覆盖，上面原有样式一行没删，随时能整段撤掉
   ══════════════════════════════════════════════════════════════ */
.ir-modal-mask{ padding:16px; box-sizing:border-box; }
.ir-retro-window{
  width:660px; max-width:min(94vw,660px); box-sizing:border-box;
  max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px);
  overflow-y:auto;
}
.ir-retro-window.maximized{
  width:min(96vw,calc(100vw - 32px)); max-width:min(96vw,calc(100vw - 32px));
  height:min(88vh,calc(100dvh - 32px));
}
.ir-rw-titlebar{ font-size:15px; }
.ir-rw-titlebar button{ width:24px; height:21px; font-size:13px; }
.ir-rw-menubar{ font-size:14px; }
.ir-rw-toolbar .tbtn{ font-size:13px; padding:5px 12px; }
.ir-rw-paper{ padding:22px 28px; height:380px; max-height:60vh; font-size:17px; line-height:30px; }
.ir-rw-paper .caret{ width:9px; height:19px; }
.ir-rw-statusbar{ font-size:13px; }
.ir-rw-actions button{ font-size:16px; min-width:120px; padding:9px 20px; }
@media(max-width:820px){
  .ir-retro-window{ width:min(94vw,660px); }
  .ir-rw-paper{ padding:16px 18px; height:clamp(220px,46vh,360px); font-size:17px; line-height:29px; }
  .ir-rw-titlebar{ font-size:14px; }
  .ir-rw-actions button{ font-size:15px; min-width:110px; }
}

/* ══════════════════════════════════════════════════════════════
   摸头台词 2026-11-09 三改（按姐姐要求）：
   · 电脑端：不弹单独屏幕，只把机器人头顶那块原数码屏放大 10%
   · 手机端：弹出屏 = 桌子本人 —— 大小、位置完全盖住「可交互的天机小器」
     那张桌子（坐标由 JS 实时取桌子的 rect），边框用拟物金属框，
     感觉桌子突然变成了电子显示屏
   ══════════════════════════════════════════════════════════════ */
/* 电脑端：拆掉单独弹窗，原屏放大 10%（scale 独立属性不干扰浮动动画） */
@media (min-width:821px){
  .ir-qb-pop{ display:none !important; }
  .iron-stage #ir-qb-screen-group{ scale:1.1; }
}
/* 手机端：弹出屏盖住桌子（left/top/width/height 由 JS 按桌子实时钉） */
@media (max-width:820px){
  .ir-qb-pop{
    position:fixed; left:0; top:0; width:100%; height:auto; z-index:420;
    display:flex; align-items:stretch; justify-content:stretch;
    padding:0; box-sizing:border-box;
    pointer-events:none; opacity:0; transition:opacity .25s ease;
  }
  .ir-qb-pop.show{ opacity:1; }
  .ir-qb-pop-card{
    flex:1; width:auto; max-width:none; min-height:0; box-sizing:border-box;
    display:flex; align-items:center; justify-content:center;
    text-align:center; padding:8px 14px;
    border:4px solid transparent; border-radius:16px;
    background:
      linear-gradient(150deg,#13271b 0%,#08150e 100%) padding-box,
      linear-gradient(160deg,#f5e6ae 0%,#cfa642 24%,#8a6a2a 50%,#f2dc9c 74%,#6e4c14 100%) border-box;
    box-shadow:0 10px 28px rgba(0,0,0,.45), inset 0 0 22px rgba(90,255,150,.14);
    overflow:hidden;
  }
  .ir-qb-pop-card p{
    margin:0; color:#aaffaa;
    /* 跟机器人头顶那块数码屏用同一套字体：英文等宽数码体，
       中文回退到黑体类（不落到宋体），再叠三层绿色荧光 */
    font-family:"Courier New","Lucida Console","Microsoft YaHei UI","Microsoft YaHei",
                "PingFang SC","Heiti SC","Noto Sans CJK SC",sans-serif;
    font-weight:700;
    font-size:clamp(15px,4.4vw,21px); line-height:1.55; letter-spacing:2px;
    text-shadow:0 0 3px #00ff88, 0 0 10px rgba(0,255,136,.65), 0 0 20px rgba(0,255,136,.35);
    word-break:break-word;
  }
}
