/* 双盲交易训练 - 样式（全部作用域在 #at-app 内，避免与主题冲突） */

#at-app{
  --bg:#0b0e14; --panel:#131722; --line:#1e2430; --text:#d1d4dc;
  --dim:#787b86; --up:#f6465d; --down:#0ecb81; --accent:#2962ff; --gold:#f5c542;
  display:flex; flex-direction:column;
  height:min(calc(100vh - 110px), 880px); min-height:540px;
  background:var(--bg); color:var(--text); border-radius:10px; overflow:hidden;
  font-family:-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;
  font-size:14px; line-height:1.4;
  box-sizing:border-box; position:relative;
}
#at-app *,#at-app *::before,#at-app *::after{box-sizing:border-box}
#at-app button{font-family:inherit;cursor:pointer;border:0;background:none}
#at-app p,#at-app h1{margin:0}

/* 顶栏 */
#at-app .at-topbar{
  height:44px;display:flex;align-items:center;gap:12px;padding:0 14px;
  border-bottom:1px solid var(--line);background:var(--panel);flex:0 0 auto;
}
#at-app .at-brand{display:flex;align-items:center;gap:8px;font-size:13px}
#at-app .at-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);flex:0 0 auto}
#at-app .at-badge{background:#2a2f3d;color:#a8b1c1;font-size:11px;padding:2px 7px;border-radius:4px;letter-spacing:.5px}
#at-app .at-mystery{font-weight:600;font-size:14px;letter-spacing:1px}
#at-app .at-spacer{flex:1}
#at-app .at-modes{display:flex;gap:6px;background:#0e1219;padding:3px;border-radius:7px}
#at-app .at-modes button{color:var(--dim);padding:5px 12px;border-radius:5px;font-size:12px}
#at-app .at-modes button.on{background:#1f2633;color:#fff}

/* 周期选择器 */
#at-app .at-period{
  background:#0e1219;color:#c9d1de;border:1px solid #232a38;border-radius:6px;
  padding:5px 24px 5px 9px;font-size:12px;font-family:inherit;cursor:pointer;outline:none;
  appearance:none;-webkit-appearance:none;-moz-appearance:none;line-height:1.5;
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6'%3E%3Cpath d='M0 0l4.5 6 4.5-6z' fill='%23787b86'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 8px center;
}
#at-app .at-period:hover{border-color:#2f3a4d;color:#fff}
#at-app .at-period:focus{border-color:var(--accent)}
#at-app .at-period option{background:#131722;color:#c9d1de}
#at-app .at-pickrow{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:20px}
#at-app .at-pickrow label{font-size:12.5px;color:var(--dim);white-space:nowrap}
#at-app .at-pickrow .at-period{font-size:13px;padding:7px 26px 7px 11px}

#at-app .at-mstats{display:none;gap:14px;font-size:12px;font-variant-numeric:tabular-nums}
#at-app .at-mstats span{display:flex;flex-direction:column;align-items:flex-end;line-height:1.35}
#at-app .at-mstats i{font-style:normal;font-size:9.5px;color:var(--dim);letter-spacing:.4px}
#at-app .at-mstats b{font-weight:600}

/* 主体 */
#at-app .at-main{flex:1;display:flex;min-height:0}
#at-app .at-chartwrap{flex:1;position:relative;min-width:0}
#at-app #at-chart{position:absolute;inset:0}

/* 右侧 */
#at-app .at-side{
  width:196px;flex:0 0 196px;border-left:1px solid var(--line);
  background:var(--panel);display:flex;flex-direction:column;padding:12px 10px;gap:14px;
}
#at-app .at-stat{display:flex;justify-content:space-between;align-items:baseline}
#at-app .at-stat .k{font-size:11px;color:var(--dim);letter-spacing:.5px}
#at-app .at-stat .v{font-size:15px;font-variant-numeric:tabular-nums;font-weight:600}
#at-app .at-posbox{background:#0e1219;border-radius:6px;padding:9px 10px;font-size:12px;line-height:1.9;color:#9aa3b2}
#at-app .at-posbox .row{display:flex;justify-content:space-between}
#at-app .at-posbox b{color:var(--text);font-variant-numeric:tabular-nums}

/* 均线图例（图上角，可点击开关） */
#at-app .at-malegend{
  position:absolute;top:7px;left:12px;z-index:5;display:flex;gap:13px;
  font-size:11.5px;font-variant-numeric:tabular-nums;pointer-events:auto;
}
#at-app .at-ma{cursor:pointer;user-select:none;opacity:.4;transition:opacity .15s;white-space:nowrap}
#at-app .at-ma.on{opacity:1}
#at-app .at-ma[data-ma="5"]{color:#f5c542}
#at-app .at-ma[data-ma="10"]{color:#e07be0}
#at-app .at-ma[data-ma="20"]{color:#4fc3f7}
#at-app .at-ma b{margin-left:4px;font-weight:600}

/* 交易区（数量输入 + 按钮） */
#at-app .at-trade{display:flex;flex-direction:column;gap:7px;margin-top:auto}
#at-app .at-qtyrow{
  display:flex;align-items:center;gap:6px;background:#0e1219;
  border:1px solid #232a38;border-radius:6px;padding:6px 8px;transition:border-color .15s;
}
#at-app .at-qtyrow:focus-within{border-color:var(--accent)}
#at-app .at-qtylabel{font-size:11px;color:var(--dim);flex:0 0 auto}
#at-app .at-qty{
  flex:1;min-width:0;background:transparent;border:0;outline:none;color:var(--text);
  font-size:14px;font-family:inherit;font-variant-numeric:tabular-nums;text-align:right;
  -moz-appearance:textfield;padding:0;
}
#at-app .at-qty::-webkit-outer-spin-button,
#at-app .at-qty::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
#at-app .at-qtyunit{font-size:11px;color:var(--dim);flex:0 0 auto}
#at-app .at-qtyhint{font-size:10.5px;color:var(--dim);text-align:right;margin-top:-3px}

#at-app .at-btns{display:flex;flex-direction:column;gap:8px;margin-top:auto}
#at-app .at-row2{display:flex;gap:8px}
#at-app .at-btn{border-radius:6px;padding:13px 0;font-size:15px;font-weight:600;letter-spacing:2px;transition:.15s}
#at-app .at-btn:disabled{opacity:.32;cursor:not-allowed}
#at-app .at-buy{background:var(--up);color:#fff}
#at-app .at-buy:hover:not(:disabled){background:#ff5c72}
#at-app .at-sell{background:var(--down);color:#04231a}
#at-app .at-sell:hover:not(:disabled){background:#25d992}
#at-app .at-tp,#at-app .at-sl{
  flex:1;background:transparent;font-size:12.5px;letter-spacing:1px;padding:9px 0;
}
#at-app .at-tp{border:1px solid #2f7a5f;color:#4ecb9b}
#at-app .at-tp:hover:not(:disabled){background:#12301f}
#at-app .at-sl{border:1px solid #7a3030;color:#e07272}
#at-app .at-sl:hover:not(:disabled){background:#2b1414}

/* 底栏 */
#at-app .at-bottombar{
  height:54px;flex:0 0 auto;display:flex;align-items:center;gap:8px;
  padding:0 12px;border-top:1px solid var(--line);background:var(--panel);
}
#at-app .at-nav{
  width:32px;height:32px;flex:0 0 auto;border-radius:6px;background:#0e1219;color:#8b93a3;
  font-size:13px;display:grid;place-items:center;transition:.15s;
}
#at-app .at-nav:hover{background:#1c2331;color:#fff}
#at-app .at-next{
  flex:0 0 auto;height:32px;padding:0 14px;border-radius:6px;background:var(--accent);
  color:#fff;font-size:13px;font-weight:600;letter-spacing:.5px;transition:.15s;
}
#at-app .at-next:hover:not(:disabled){background:#3d74ff}
#at-app .at-next:disabled{opacity:.35;cursor:not-allowed}
#at-app .at-auto{
  flex:0 0 auto;height:32px;padding:0 12px;border-radius:6px;background:#1c2331;
  color:#a8b1c1;font-size:12.5px;transition:.15s;
}
#at-app .at-auto:hover:not(:disabled){background:#252e3e;color:#fff}
#at-app .at-auto.on{background:#3a2a12;color:var(--gold)}
#at-app .at-auto:disabled{opacity:.35;cursor:not-allowed}
#at-app .at-track{flex:1;height:4px;background:#232a38;border-radius:2px;position:relative;cursor:pointer;margin:0 6px}
#at-app .at-fill{position:absolute;left:0;top:0;bottom:0;background:var(--accent);border-radius:2px;width:0}
#at-app .at-knob{position:absolute;top:50%;width:11px;height:11px;border-radius:50%;background:#fff;
  transform:translate(-50%,-50%);left:0;box-shadow:0 0 0 2px var(--accent)}
#at-app .at-counter{font-size:12px;color:var(--dim);font-variant-numeric:tabular-nums;min-width:74px;text-align:right}
#at-app .at-speed{display:flex;gap:4px}
#at-app .at-speed button{background:#0e1219;color:var(--dim);font-size:11px;padding:5px 8px;border-radius:4px}
#at-app .at-speed button.on{background:#1f2633;color:#fff}

/* 遮罩 */
#at-app .at-overlay{
  position:absolute;inset:0;background:rgba(6,9,14,.94);display:flex;
  align-items:center;justify-content:center;z-index:50;
}
#at-app .at-overlay.at-hide{display:none}
#at-app .at-card{
  background:var(--panel);border:1px solid var(--line);border-radius:12px;
  padding:30px 34px;width:min(420px, 88%);text-align:center;
}
#at-app .at-card h1{font-size:19px;font-weight:600;margin-bottom:8px;color:var(--text)}
#at-app .at-card p{font-size:12.5px;color:var(--dim);line-height:1.85;margin-bottom:22px}
#at-app .at-start-modes{justify-content:center;margin-bottom:20px;display:inline-flex}
#at-app .at-primary{
  width:100%;background:var(--accent);color:#fff;border-radius:7px;
  padding:13px;font-size:14px;font-weight:600;letter-spacing:1px;
}
#at-app .at-primary:hover{background:#3d74ff}
#at-app .at-reveal{display:flex;flex-direction:column;gap:3px;margin-bottom:12px;
  padding-bottom:12px;border-bottom:1px solid var(--line)}
#at-app .at-reveal-label{font-size:11px;color:var(--dim);letter-spacing:1.5px}
#at-app .at-reveal b{font-size:19px;color:var(--gold);letter-spacing:1px;line-height:1.3}
#at-app .at-grade{font-size:52px;font-weight:700;margin:6px 0 4px;letter-spacing:2px}
#at-app .at-settle-rows{margin:18px 0 22px;text-align:left}
#at-app .at-gline{display:flex;justify-content:space-between;font-size:13px;padding:9px 0;border-bottom:1px solid var(--line)}
#at-app .at-gline:last-of-type{border-bottom:0}
#at-app .at-gline .k{color:var(--dim)}
#at-app .at-gline .v{font-variant-numeric:tabular-nums;font-weight:600}
#at-app .at-up-txt{color:var(--up)} #at-app .at-down-txt{color:var(--down)}

/* 提示 */
#at-app .at-toast{
  position:absolute;top:56px;left:50%;transform:translateX(-50%) translateY(-8px);
  background:#1f2633;border:1px solid #2c3547;color:#dfe4ec;font-size:12.5px;
  padding:9px 18px;border-radius:7px;opacity:0;pointer-events:none;transition:.22s;z-index:60;
  white-space:nowrap;
}
#at-app .at-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* 移动端 */
@media (max-width:720px){
  #at-app{height:min(calc(100dvh - 70px), 900px);min-height:480px;border-radius:0;font-size:13px}
  #at-app .at-topbar{height:auto;padding:7px 10px;gap:8px;flex-wrap:wrap}
  #at-app .at-mstats{display:flex}
  #at-app .at-brand{font-size:12px}
  #at-app .at-badge{display:none}
  #at-app .at-modes button{padding:4px 9px;font-size:11px}

  #at-app .at-main{flex-direction:column}
  #at-app .at-side{
    width:100%;flex:0 0 auto;flex-direction:row;align-items:center;
    border-left:0;border-top:1px solid var(--line);
    padding:7px 10px;gap:10px;
  }
  #at-app .at-desk-stats{display:none}
  #at-app .at-posbox{flex:0 0 auto;background:transparent;padding:0;font-size:10.5px;line-height:1.5;color:var(--dim)}
  #at-app .at-posbox .row{gap:4px;white-space:nowrap;justify-content:flex-start}
  #at-app .at-posbox .row:nth-child(4){display:none}   /* 手机上隐藏浮盈行 */
  #at-app .at-posbox b{font-size:11px}
  #at-app .at-btns{flex:1;display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;margin:0}
  #at-app .at-buy,#at-app .at-sell{flex:1 1 calc(50% - 3px);padding:10px 0;font-size:13.5px;letter-spacing:1px}
  #at-app .at-row2{flex:1 1 100%;gap:6px}
  #at-app .at-tp,#at-app .at-sl{padding:7px 0;font-size:12px}

  /* 交易区：手机端数量框单独一行，按钮占满下方两行 */
  #at-app .at-trade{flex:1;display:flex;flex-direction:column;gap:5px;margin:0;min-width:0}
  #at-app .at-qtyrow{flex:0 0 auto;padding:4px 8px;overflow:hidden}
  #at-app .at-qtylabel{display:block;font-size:10px}
  #at-app .at-qty{font-size:13px;text-align:right;width:100%;min-width:0}
  #at-app .at-qtyhint{display:none}
  #at-app .at-malegend{top:5px;left:8px;gap:9px;font-size:10.5px}
  #at-app .at-toast{top:76px;font-size:12px;padding:8px 14px;max-width:88%}

  #at-app .at-bottombar{height:50px;gap:5px;padding:0 7px}
  #at-app .at-nav{width:26px;height:28px;font-size:11px}
  #at-app .at-next{height:28px;padding:0 11px;font-size:0}          /* 只留箭头 */
  #at-app .at-next::before{content:'▶';font-size:13px}
  #at-app .at-auto{height:28px;padding:0 9px;font-size:11px}
  #at-app .at-counter{display:none}
  #at-app .at-track{flex:1;margin:0 4px}
  #at-app .at-speed{display:none}
}
