/* ============================================================
   做T 页面样式 · 2026-11 重设计
   设计语言：深青渐变主色 + 白卡浮层 + 柔和投影 + 数字等宽排版
   与 style.css 共用基础变量；ttrade.html 与 ttrade-stock.html 共用本文件
   ============================================================ */

/* 令牌放 :root，固定底栏等 .tt-page 外的组件也能取到 */
:root {
  --tt: #0e9488;
  --tt-deep: #0b7a71;
  --tt-grad: linear-gradient(135deg, #14b8a6, #0891b2);
  --tt-soft: #effcfa;
  --tt-line: #99e6dd;
  --tt-ring: rgba(13, 148, 136, .18);
  --tt-buy: #16a34a;
  --tt-buy-soft: #ecfdf3;
  --tt-sell: #e11d48;
  --tt-sell-soft: #fff1f3;
  --tt-amber: #d97706;
  --tt-radius: 16px;
  --tt-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 28px -14px rgba(15, 23, 42, .12);
}

.tt-page {
  --tt: #0e9488;                              /* 主色：青绿 */
  --tt-deep: #0b7a71;
  --tt-grad: linear-gradient(135deg, #14b8a6, #0891b2);
  --tt-soft: #effcfa;
  --tt-line: #99e6dd;
  --tt-ring: rgba(13, 148, 136, .18);
  --tt-buy: #16a34a;
  --tt-buy-soft: #ecfdf3;
  --tt-sell: #e11d48;
  --tt-sell-soft: #fff1f3;
  --tt-amber: #d97706;
  --tt-radius: 16px;
  --tt-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 28px -14px rgba(15, 23, 42, .12);

  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 34px;
}

/* 页面顶部一点渐变氛围 */
body:has(.tt-page) {
  background:
    radial-gradient(900px 260px at 18% -60px, rgba(20, 184, 166, .10), transparent 70%),
    radial-gradient(700px 220px at 85% -80px, rgba(8, 145, 178, .08), transparent 70%),
    var(--bg);
}

/* 面板入场 */
.tt-page > .panel,
.tt-page > .tt-two {
  animation: tt-rise .38s cubic-bezier(.16, 1, .3, 1) both;
}
.tt-page > .panel:nth-child(2) { animation-delay: .03s; }
.tt-page > .panel:nth-child(3) { animation-delay: .06s; }
.tt-page > .panel:nth-child(4) { animation-delay: .09s; }
.tt-page > .tt-two { animation-delay: .12s; }
.tt-page > .panel:nth-child(6) { animation-delay: .15s; }
@keyframes tt-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ===== 面板 ===== */
.tt-page .panel {
  border-radius: var(--tt-radius);
  border-color: #e7ecf3;
  box-shadow: var(--tt-shadow);
  padding: 18px 20px 16px;
}

.tt-page .panel-title {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f3f8;
  letter-spacing: .2px;
}

.tt-page .panel-title .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--tt-grad);
  box-shadow: 0 4px 10px -3px rgba(13, 148, 136, .5);
  font-size: 15px;
  color: #fff;
  margin-right: 2px;
}

.tt-page .update-time { margin-left: 4px; }

/* ===== 概览统计卡 ===== */
.tt-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.tt-stat {
  position: relative;
  padding: 16px 18px 15px;
  border: 1px solid #e7ecf3;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.tt-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -14px rgba(15, 23, 42, .18);
  border-color: #d7e0ea;
}

.tt-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 999px;
  background: var(--tt-grad);
}

.tt-stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, rgba(20, 184, 166, .18), transparent 68%);
  pointer-events: none;
}

.tt-stat.is-main { background: linear-gradient(150deg, var(--tt-soft), #fff 62%); border-color: var(--tt-line); }
.tt-stat.is-up { background: linear-gradient(150deg, #fff5f5, #fff 62%); border-color: #fcd0d0; }
.tt-stat.is-up::before { background: linear-gradient(180deg, #f87171, #dc2626); }
.tt-stat.is-up::after { background: radial-gradient(circle at 32% 32%, rgba(224, 46, 46, .14), transparent 68%); }
.tt-stat.is-down { background: linear-gradient(150deg, #f2fbf5, #fff 62%); border-color: #bce8cd; }
.tt-stat.is-down::before { background: linear-gradient(180deg, #34d399, #059669); }
.tt-stat.is-down::after { background: radial-gradient(circle at 32% 32%, rgba(22, 163, 74, .14), transparent 68%); }
.tt-stat.is-gold { background: linear-gradient(150deg, #fff8e6, #fff 62%); border-color: #f7dd94; }
.tt-stat.is-gold::before { background: linear-gradient(180deg, #fbbf24, #d97706); }
.tt-stat.is-gold::after { background: radial-gradient(circle at 32% 32%, rgba(217, 119, 6, .14), transparent 68%); }

.tt-stat .k {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
  letter-spacing: .4px;
}

.tt-stat .v {
  margin-top: 7px;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
  color: var(--text);
}

.tt-stat .v small { font-size: 13px; font-weight: 600; color: var(--text-sub); margin-left: 3px; letter-spacing: 0; }
.tt-stat .s { margin-top: 7px; font-size: 12px; color: var(--text-sub); }
.tt-stat .s b { color: var(--tt-deep); font-weight: 700; }
.tt-stat .v.up { color: var(--up); }
.tt-stat .v.down { color: var(--down); }

/* ===== 表单 ===== */
.tt-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.tt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sub);
  min-width: 132px;
}

.tt-field .ipt,
.tt-field .tt-sel { height: 36px; }

.tt-field .ipt {
  border-radius: 10px;
  border-color: #dde4ee;
  transition: border-color .15s, box-shadow .15s;
}
.tt-field .ipt:focus,
.tt-sel:focus-within {
  border-color: var(--tt);
  box-shadow: 0 0 0 3px var(--tt-ring);
}

.tt-sel {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #dde4ee;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.tt-sel:focus { outline: none; border-color: var(--tt); box-shadow: 0 0 0 3px var(--tt-ring); }

.tt-w-code { min-width: 190px; }
.tt-w-sm { min-width: 124px; }
.tt-w-price { width: 96px; }
.tt-w-qty { width: 96px; }
.tt-w-chk { min-width: 136px; }

.tt-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
  height: 34px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.tt-chk input { accent-color: var(--tt); width: 15px; height: 15px; }

.tt-add { height: 36px; }

.tt-hint {
  margin-top: 12px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.75;
  background: #f7fafc;
  border-radius: 10px;
  border: 1px dashed #e2e9f2;
}

.tt-note {
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.75;
}
.tt-note b { color: var(--text); }

/* ===== 按钮 ===== */
.tt-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #dde4ee;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s, transform .12s, opacity .15s;
  white-space: nowrap;
}

.tt-btn:hover {
  border-color: var(--tt);
  color: var(--tt-deep);
  background: var(--tt-soft);
}
.tt-btn:active { transform: translateY(1px); }

.tt-btn.primary {
  background: var(--tt-grad);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 5px 14px -5px rgba(13, 148, 136, .55);
}
.tt-btn.primary:hover {
  color: #fff;
  filter: brightness(1.05);
  box-shadow: 0 7px 18px -5px rgba(13, 148, 136, .65);
}

.tt-btn.sm { height: 28px; padding: 0 11px; font-size: 12px; border-radius: 8px; }

.tt-btn.danger { color: #b91c1c; border-color: #fbd5d5; background: #fff7f7; }
.tt-btn.danger:hover { background: #feeaea; color: #991b1b; border-color: #f5b5b5; }

.tt-btn.buy { color: var(--tt-buy); border-color: #bce8cd; background: var(--tt-buy-soft); }
.tt-btn.buy:hover { background: #dcfce7; color: #15803d; border-color: #8fdcae; }
.tt-btn.sell { color: var(--tt-sell); border-color: #fbd0da; background: var(--tt-sell-soft); }
.tt-btn.sell:hover { background: #ffe4ea; color: #be123c; border-color: #f8a8bc; }

.tt-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.tt-btn.primary + .tt-btn { margin-left: 8px; }
.panel-title-btn .tt-btn + .tt-btn { margin-left: 8px; }

/* ===== 状态胶囊 ===== */
.tt-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  letter-spacing: .2px;
  background: #eef2f7;
  color: #526274;
}
.tt-pill.buy { background: var(--tt-buy-soft); color: #15803d; }
.tt-pill.sell { background: var(--tt-sell-soft); color: #be123c; }
.tt-pill.hit { background: #fff7e0; color: #b45309; box-shadow: inset 0 0 0 1px #f9e2a8; }
.tt-pill.done { background: #e8f1fe; color: #1d4ed8; }
.tt-pill.pending { background: #eef2f7; color: #526274; }
.tt-pill.warn { background: #fff1f1; color: #b91c1c; box-shadow: inset 0 0 0 1px #fbd5d5; }
.tt-pill.plan { background: #f3efff; color: #6d28d9; }

/* ===== 加载 / 空态 ===== */
.tt-loading {
  padding: 26px 0;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
}

.tt-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 2;
  border: 1.5px dashed #d8e2ee;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #f7fafd);
}

/* ===== 工具条 / 标签页 ===== */
.tt-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tt-spacer { flex: 1; }

.tt-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #e4eaf2;
  border-radius: 999px;
  background: #f1f5f9;
  gap: 2px;
}

.tt-tabs button {
  border: none;
  background: transparent;
  padding: 6px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}

.tt-tabs button:hover { color: var(--tt-deep); }

.tt-tabs button.active {
  background: var(--tt-grad);
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(13, 148, 136, .6);
}

.tt-manual { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tt-manual .ipt { height: 32px; border-radius: 9px; }
.tt-manual .tt-sel { height: 32px; border-radius: 9px; }

/* ===== 表格（T 段 / 标的共用） ===== */
.tt-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #e7ecf3;
  background: #fff;
}

.tt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1000px;
}

.tt-table th {
  background: linear-gradient(180deg, #f8fafc, #f2f6fa);
  color: #64748b;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: .3px;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid #e7ecf3;
  white-space: nowrap;
}

.tt-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.tt-table tbody tr { transition: background .12s; }
.tt-table tbody tr:hover { background: #f6fcfb; }
.tt-table tbody tr:last-child td { border-bottom: none; }

.tt-table tr.is-hit {
  background: linear-gradient(90deg, #fffcf2, #fffefb 42%);
  box-shadow: inset 3px 0 0 var(--tt-amber);
}
.tt-table tr.is-done { color: #64748b; }
.tt-table tr.is-done .nm b { color: #64748b; }

.tt-table .nm { display: flex; flex-direction: column; gap: 2px; }
.tt-table .nm b { font-size: 13.5px; }
.tt-table .nm span { font-size: 11.5px; color: var(--text-sub); }

.tt-dir { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.tt-dir::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tt-dir.buy { color: var(--tt-buy); }
.tt-dir.sell { color: var(--tt-sell); }

.tt-muted { color: var(--text-sub); }
.tt-num { font-variant-numeric: tabular-nums; }
.tt-num.up { color: var(--up); font-weight: 600; }
.tt-num.down { color: var(--down); font-weight: 600; }

.tt-time { font-size: 11.5px; color: var(--text-sub); line-height: 1.6; }

.tt-ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 标的列表（表格形态） ===== */
.tt-stocks { display: block; }
.tt-stocks .tt-wrap { overflow-x: auto; }
.tt-stock-table { min-width: 1370px; }

.tt-stock-table .st-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-stock-table .st-name b { font-size: 14px; letter-spacing: .2px; }
.tt-stock-table .st-name a { color: var(--text); text-decoration: none; transition: color .12s; }
.tt-stock-table .st-name a:hover { color: var(--tt-deep); text-decoration: underline; }
.tt-stock-table .st-name span { font-size: 11.5px; color: var(--text-sub); }

.tt-stock-table .st-px { font-size: 16px; font-weight: 750; letter-spacing: -.2px; }
.tt-stock-table .st-px.up { color: var(--up); }
.tt-stock-table .st-px.down { color: var(--down); }
.tt-stock-table .st-sub { font-size: 11.5px; color: var(--text-sub); line-height: 1.55; }

.tt-stock-table .st-pills { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 5px; }
.tt-stock-table .st-next { font-size: 11.5px; color: var(--text-sub); line-height: 1.65; }

.tt-stock-table .st-exec {
  border: 1px solid #dde4ee;
  background: #f1f5f9;
  color: #526274;
  border-radius: 999px;
  padding: 4.5px 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: all .15s;
}
.tt-stock-table .st-exec:hover { border-color: var(--tt); color: var(--tt-deep); }
.tt-stock-table .st-exec.is-auto {
  background: var(--tt-buy-soft);
  border-color: #8fdcae;
  color: #15803d;
  box-shadow: 0 3px 8px -4px rgba(22, 163, 74, .5);
}

.tt-stock-table td { vertical-align: middle; }
.tt-stock-table .st-ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 方案 / 券商列表 ===== */
.tt-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.tt-list { display: flex; flex-direction: column; gap: 9px; }

.tt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid #e7ecf3;
  border-radius: 12px;
  background: #fff;
  flex-wrap: wrap;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.tt-item:hover {
  border-color: var(--tt-line);
  box-shadow: 0 8px 20px -12px rgba(13, 148, 136, .35);
}

.tt-item-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.tt-item-main b { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.tt-item-main span { font-size: 12px; color: var(--text-sub); line-height: 1.6; }
.tt-item-ops { display: flex; gap: 6px; }

.tt-mini-tag {
  font-size: 10.5px;
  font-weight: 650;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: var(--tt-soft);
  color: var(--tt-deep);
  border: 1px solid var(--tt-line);
  letter-spacing: .3px;
}

/* ===== 学习总结 ===== */
.tt-learn-ai {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--tt-line);
  background: linear-gradient(150deg, var(--tt-soft), #fff 72%);
  font-size: 13.5px;
  line-height: 1.95;
  white-space: pre-wrap;
  color: var(--text);
  box-shadow: 0 8px 22px -14px rgba(13, 148, 136, .4);
}

.tt-learn-ai .ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tt-deep);
  margin-bottom: 6px;
}

.tt-adaptive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.tt-adapt {
  border: 1px solid #e7ecf3;
  border-left: 4px solid var(--tt);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
}
.tt-adapt:hover { box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .2); transform: translateY(-1px); }

.tt-adapt b { display: block; font-size: 13.5px; margin-bottom: 6px; }
.tt-adapt p { font-size: 12.5px; color: var(--text-sub); line-height: 1.8; }

.tt-adapt.k-fee { border-left-color: #0891b2; }
.tt-adapt.k-plan { border-left-color: #7c3aed; }
.tt-adapt.k-risk, .tt-adapt.k-near { border-left-color: #dc2626; background: linear-gradient(150deg, #fffafa, #fff 70%); }
.tt-adapt.k-hit { border-left-color: #d97706; background: linear-gradient(150deg, #fffdf5, #fff 70%); }
.tt-adapt.k-hold, .tt-adapt.k-cost, .tt-adapt.k-empty { border-left-color: #94a3b8; }

.tt-tips { margin-top: 18px; }
.tt-tips-head {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tt-tips-head::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: var(--tt-grad);
}

.tt-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.tt-tip {
  border: 1px solid #e7ecf3;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fbfdff, #f8fbfe);
  transition: border-color .15s, box-shadow .15s;
}
.tt-tip:hover { border-color: var(--tt-line); box-shadow: 0 8px 22px -14px rgba(13, 148, 136, .4); }
.tt-tip b { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.tt-tip b::before { content: "💡 "; }
.tt-tip p { font-size: 12.5px; color: var(--text-sub); line-height: 1.8; }

/* ===== 弹窗 ===== */
.tt-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.tt-mask[hidden] { display: none; }

.tt-dialog {
  width: min(560px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 32px 80px -20px rgba(15, 23, 42, .4);
  overflow: hidden;
  animation: tt-pop .28s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes tt-pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.tt-dialog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid #eef2f7;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(150deg, var(--tt-soft), #fff 80%);
}

.tt-dialog-head .tt-x {
  margin-left: auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tt-dialog-head .tt-x:hover { background: #eef2f7; color: var(--text); }

.tt-dialog-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.tt-dialog-foot {
  padding: 13px 18px;
  border-top: 1px solid #eef2f7;
  background: #fafbfd;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.tt-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.tt-dialog-msg {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.85;
  white-space: pre-wrap;
}

.tt-dialog-fields {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.tt-gen-preview {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f6f9fc;
  border: 1px solid #e9eef5;
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.95;
  min-height: 44px;
}
.tt-gen-preview b { color: var(--text); }
.tt-gen-preview .g-buy { color: var(--tt-buy); font-weight: 650; }
.tt-gen-preview .g-sell { color: var(--tt-sell); font-weight: 650; }

/* ===== Toast ===== */
.tt-toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 120;
  max-width: min(560px, calc(100vw - 40px));
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .93);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  line-height: 1.7;
  box-shadow: 0 16px 40px -10px rgba(15, 23, 42, .5);
  white-space: pre-wrap;
  animation: tt-rise .25s ease both;
}
.tt-toast[hidden] { display: none; }
.tt-toast.err { background: rgba(153, 27, 27, .95); }
.tt-toast.ok { background: rgba(6, 95, 70, .95); }

.tt-auto-tip { font-size: 12px; color: var(--text-sub); font-weight: 400; }

a.tt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* ===== 做T个股详情页 ===== */
.ts-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ts-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; line-height: 1.65; }

.ts-period {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #e4eaf2;
  border-radius: 999px;
  background: #f1f5f9;
  gap: 2px;
}
.ts-period button {
  border: none;
  background: transparent;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.ts-period button:hover { color: var(--tt-deep); }
.ts-period button.active {
  background: var(--tt-grad);
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(13, 148, 136, .6);
}

.ts-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-sub);
  margin: 2px 0 10px;
}
.ts-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ts-legend .dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; display: inline-block; }
.ts-legend .dot.buy { background: #0ea5e9; }
.ts-legend .dot.sell { background: #f43f5e; }
.ts-legend .dot.cost { background: #d97706; }
.ts-legend .dot.now { background: #64748b; }

.ts-chart {
  position: relative;
  height: 440px;
  border: 1px solid #e7ecf3;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--tt-shadow);
}
.ts-chart:is(.is-loading, .is-error)::after {
  content: attr(data-tip);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-sub);
  background: rgba(255, 255, 255, .84);
  border-radius: 14px;
}

.ts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ts-tier-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 9px;
  padding-left: 10px;
  border-left: 4px solid #e2e8f0;
  border-radius: 2px;
  color: var(--text);
}
.ts-tier-head.buy { color: var(--tt-buy); border-left-color: var(--tt-buy); }
.ts-tier-head.sell { color: var(--tt-sell); border-left-color: var(--tt-sell); }
.ts-tier-head small { font-weight: 400; font-size: 11.5px; color: var(--text-sub); }

.ts-ladder { display: flex; flex-direction: column; gap: 8px; }

.ts-ladder-item {
  border: 1px solid #e7ecf3;
  border-left: 4px solid var(--tt-buy);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  transition: box-shadow .15s;
}
.ts-ladder-item:hover { box-shadow: 0 8px 20px -14px rgba(15, 23, 42, .25); }
.ts-ladder-item.is-sell { border-left-color: var(--tt-sell); }
.ts-ladder-item.is-ok { background: #fafdff; }
.ts-ladder-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-sub);
}
.ts-ladder-sub {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.65;
}

.ts-cycle-box {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid #e7ecf3;
  background: #f8fafc;
}
.ts-cycle-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 9px;
}
.ts-cycle-table { min-width: 860px; }
.ts-cycle-table b { font-variant-numeric: tabular-nums; }

.ts-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 11px;
}
.ts-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #e7ecf3;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff, #f8fbfe);
  position: relative;
  overflow: hidden;
}
.ts-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--tt-grad);
  opacity: .8;
}
.ts-stat .k { font-size: 11.5px; color: var(--text-sub); font-weight: 600; }
.ts-stat .v { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.ts-stat .v.up { color: var(--up); }
.ts-stat .v.down { color: var(--down); }
.ts-stat .s { font-size: 11.5px; color: var(--text-sub); line-height: 1.5; }

.ts-config { display: flex; flex-direction: column; }
.ts-config-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #eef2f7;
  font-size: 12.5px;
}
.ts-config-row:last-child { border-bottom: none; }
.ts-config-row .k { color: var(--text-sub); }
.ts-config-row .v { color: var(--text); line-height: 1.7; word-break: break-word; }

.ts-advice-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.ts-advice-item b { font-size: 13px; }
.ts-advice-item.is-bad { border-color: #fbd5d5; background: #fff7f7; }
.ts-advice-item.is-warn { border-color: #f9e2a8; background: #fffdf5; }
.ts-advice-item.is-ok { border-color: #bce8cd; background: #f4fdf8; }
.ts-advice-text { font-size: 12.5px; color: var(--text-sub); line-height: 1.8; }

.ts-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.ts-seg-table { min-width: 1060px; }
.ts-deal-table { min-width: 900px; }

/* ===== 大白话解读 ===== */
.ts-explain { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.ts-explain-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #e7ecf3;
  border-left: 4px solid var(--tt);
  border-radius: 12px;
  padding: 11px 13px;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
}
.ts-explain-item:hover { box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .2); transform: translateY(-1px); }
.ts-explain-item .t {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.ts-explain-item .t .ico { font-size: 15px; font-style: normal; }
.ts-explain-item .x { font-size: 12.5px; line-height: 1.85; color: var(--text-sub); }
.ts-explain-item:nth-child(3n + 1) { border-left-color: #0ea5e9; }
.ts-explain-item:nth-child(3n + 2) { border-left-color: #d97706; }
.ts-explain-item:nth-child(3n) { border-left-color: var(--tt); }

#ts-exec.is-auto { background: #ecfdf5; border-color: #10b981; color: #047857; }

.ts-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.ts-mask[hidden] { display: none; }

.ts-dialog {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 32px 80px -20px rgba(15, 23, 42, .4);
  overflow: hidden;
  animation: tt-pop .28s cubic-bezier(.16, 1, .3, 1) both;
}
.ts-dialog-title {
  padding: 15px 18px;
  font-size: 14.5px;
  font-weight: 700;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(150deg, var(--tt-soft), #fff 80%);
}
.ts-dialog-body {
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.ts-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 18px;
  background: #fafbfd;
  border-top: 1px solid #eef2f7;
}

/* ===== AI 创建方案 ===== */
.tt-btn.ai {
  color: #6d28d9;
  border-color: #ddd6fe;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  box-shadow: none;
}
.tt-btn.ai:hover { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.tt-btn.ai:disabled { opacity: .6; cursor: not-allowed; }

.tt-ai-stocks {
  max-height: 172px;
  overflow-y: auto;
  border: 1px solid #e7ecf3;
  border-radius: 12px;
  background: #fafbfd;
}
.tt-ai-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 1px dashed #eef2f7;
  transition: background .12s;
}
.tt-ai-stock:last-child { border-bottom: 0; }
.tt-ai-stock:hover { background: #f1fbf9; }
.tt-ai-stock input { accent-color: var(--tt); }
.tt-ai-stock b { color: var(--text); }
.tt-ai-stock span { color: var(--text-sub); font-size: 11.5px; }

.tt-ai-result {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #ddd6fe;
  border-radius: 12px;
  background: linear-gradient(160deg, #faf8ff, #f5f3ff);
  font-size: 12.5px;
  line-height: 1.75;
  box-shadow: 0 8px 22px -16px rgba(109, 40, 217, .5);
}
.tt-ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.tt-ai-head b { font-size: 13.5px; color: #5b21b6; }
.tt-ai-params { color: var(--text); font-weight: 650; margin-bottom: 4px; }
.tt-ai-hint { color: #b45309; font-size: 11.5px; margin-bottom: 4px; }
.tt-ai-reason { color: var(--text-sub); white-space: pre-wrap; }
.tt-ai-ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 4px;
}
.tt-ai-ladder span {
  padding: 3.5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ddd6fe;
  color: #5b21b6;
  font-size: 11.5px;
  font-weight: 550;
}
.tt-ai-ladder b { font-weight: 750; }

.tt-ai-done { margin-top: 7px; color: #15803d; font-size: 12px; font-weight: 600; }

/* ===== 响应式 ===== */
@media (max-width: 1280px) {
  .tt-two { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .ts-grid { grid-template-columns: 1fr; }
  .ts-chart { height: 372px; }
  .ts-stats { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
  .ts-explain { grid-template-columns: 1fr; }
}

/* ===== 手机端固定操作栏（桌面隐藏） ===== */
.tt-mobile-bar { display: none; }

@media (max-width: 767px) {
  .tt-page { gap: 12px; padding-bottom: 104px; }
  .tt-page .panel { padding: 14px 13px 13px; border-radius: 14px; }
  .tt-page .panel-title { font-size: 14.5px; margin-bottom: 12px; padding-bottom: 10px; }
  .tt-page .panel-title .ico { width: 27px; height: 27px; font-size: 14px; border-radius: 8px; }

  /* 概览：两列小卡 */
  .tt-hero { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tt-stat { padding: 12px 13px 11px; border-radius: 12px; }
  .tt-stat .v { font-size: 21px; }
  .tt-stat .s { font-size: 11px; line-height: 1.55; }
  .tt-stat::before { top: 10px; bottom: 10px; width: 3px; }

  /* 主操作下沉到固定底栏，概览区不再重复放主按钮 */
  #tt-gen-all { display: none; }

  /* 触控尺寸 + 防 iOS 聚焦缩放 */
  .tt-btn { height: 38px; font-size: 13.5px; }
  .tt-btn.sm { height: 32px; font-size: 12.5px; }
  .tt-field .ipt,
  .tt-field .tt-sel,
  .tt-sel,
  .tt-add,
  .tt-manual .ipt,
  .tt-manual .tt-sel { height: 40px; font-size: 16px; }
  .tt-form { flex-direction: column; align-items: stretch; gap: 10px; }
  .tt-field { min-width: 0; }
  .tt-add { width: 100%; border-radius: 11px; }
  .tt-grid2 { grid-template-columns: 1fr; }
  .tt-manual { width: 100%; }
  .tt-manual .ipt { flex: 1; min-width: 0; }
  .panel-title-btn { margin-left: 0; width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .panel-title-btn .tt-btn + .tt-btn { margin-left: 0; }
  .panel-title-btn .tt-btn { flex: 1; }
  .tt-bar { gap: 8px; margin-bottom: 10px; }
  .tt-tabs button { padding: 6px 12px; }
  .tt-empty { padding: 22px 14px; }

  /* ---- 宽表格 → 卡片化（标的 / T 段 / 详情页表格通用） ---- */
  .tt-wrap { overflow-x: visible; border: none; background: transparent; border-radius: 0; }
  .tt-table { min-width: 0 !important; display: block; }
  .tt-table thead { display: none; }
  .tt-table tbody { display: block; }
  .tt-table tr {
    display: block;
    margin-bottom: 10px;
    padding: 3px 0;
    border: 1px solid #e7ecf3;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--tt-shadow);
  }
  .tt-table tr.is-hit { box-shadow: inset 3px 0 0 var(--tt-amber), var(--tt-shadow); }
  .tt-table td {
    display: block;
    padding: 7px 13px;
    border-bottom: 1px dashed #eef2f7;
  }
  .tt-table td:last-child { border-bottom: none; padding-bottom: 10px; }
  .tt-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: .4px;
    margin-bottom: 3px;
  }

  /* 标的表列标签 */
  .tt-stock-table td:nth-child(2)::before { content: "现价"; }
  .tt-stock-table td:nth-child(3)::before { content: "持股 / 成本"; }
  .tt-stock-table td:nth-child(4)::before { content: "浮动盈亏"; }
  .tt-stock-table td:nth-child(5)::before { content: "已实现做T"; }
  .tt-stock-table td:nth-child(6)::before { content: "T 段"; }
  .tt-stock-table td:nth-child(7)::before { content: "保本价差"; }
  .tt-stock-table td:nth-child(8)::before { content: "执行"; }
  .tt-stock-table td:nth-child(9)::before { content: "操作"; }

  /* T 段表列标签 */
  .tt-seg-table td:nth-child(2)::before { content: "方向"; }
  .tt-seg-table td:nth-child(3)::before { content: "挂单价"; }
  .tt-seg-table td:nth-child(4)::before { content: "股数"; }
  .tt-seg-table td:nth-child(5)::before { content: "成交额"; }
  .tt-seg-table td:nth-child(6)::before { content: "手续费"; }
  .tt-seg-table td:nth-child(7)::before { content: "距现价"; }
  .tt-seg-table td:nth-child(8)::before { content: "状态"; }
  .tt-seg-table td:nth-child(9)::before { content: "触达 / 成交"; }
  .tt-seg-table td:nth-child(10)::before { content: "操作"; }

  .tt-stock-table .st-ops .tt-btn,
  .tt-ops .tt-btn { flex: 1 0 auto; }

  /* ---- 手机端固定操作栏 ---- */
  .tt-mobile-bar {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #e7ecf3;
    box-shadow: 0 -10px 30px -14px rgba(15, 23, 42, .22);
  }
  .tt-mobile-bar .tt-btn {
    flex: 1;
    height: 46px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 13px;
  }
  .tt-mobile-bar .tt-btn.primary {
    flex: 1.7;
    font-size: 15.5px;
    font-weight: 700;
    height: 46px;
  }

  .tt-toast { bottom: 88px; max-width: calc(100vw - 28px); }

  /* 弹窗手机化 */
  .tt-mask { padding: 12px; }
  .tt-dialog { width: 100%; border-radius: 16px; }
  .tt-dialog-body { padding: 14px; gap: 11px; }

  .ts-bar { gap: 8px; }
  .ts-chart { height: 320px; }
  .ts-config-row { grid-template-columns: 1fr; gap: 3px; }
  .ts-legend { gap: 10px; }
  .ts-explain-item { padding: 10px 11px; }

  /* 人工填写方案：手机端档位行两行排 */
  .tt-m-row { grid-template-columns: 40px 1fr 1fr; grid-auto-rows: auto; }
  .tt-m-row .tt-m-qty { grid-column: 2; }
  .tt-m-row .tt-m-del { grid-column: 3; justify-self: start; }
  .tt-m-row .tt-m-hint { grid-column: 1 / -1; }
}

/* ===== 人工填写方案（档位价 + 实时预览） ===== */
.tt-m-vol {
  padding: 10px 13px;
  border: 1px dashed #c7d2fe;
  border-radius: 11px;
  background: #f5f7ff;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.75;
}
.tt-m-vol b { color: #4338ca; font-size: 14px; }

.tt-m-rows { display: flex; flex-direction: column; gap: 7px; }
.tt-m-row {
  display: grid;
  grid-template-columns: 44px 1fr 1fr 84px minmax(150px, 1.4fr) auto;
  gap: 6px;
  align-items: center;
}
.tt-m-row .ipt { height: 36px; font-size: 13px; padding: 0 9px; min-width: 0; }
.tt-m-no {
  font-size: 12px;
  font-weight: 700;
  color: #6366f1;
  background: #eef2ff;
  border-radius: 8px;
  text-align: center;
  padding: 7px 0;
}
.tt-m-hint { font-size: 11.5px; color: #15803d; font-weight: 600; line-height: 1.5; }
.tt-m-hint.is-bad { color: #dc2626; }

.tt-m-sum {
  padding: 11px 13px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 13px;
  line-height: 1.8;
}
.tt-m-sum b { font-size: 15.5px; color: #15803d; }

@media (max-width: 767px) {
  .tt-m-vol { font-size: 12px; }
  .tt-m-row .ipt { height: 40px; font-size: 16px; }
}
