/* ============================================================
   萌鸡农场 —— 样式
   设计基调：对标「元仔」的治愈系马卡龙 UI
     · 奶油白底 + 多彩马卡龙点缀
     · 糖果包边按钮（填充 + 同色系加深描边 + 顶部内高光），几乎不用投影
     · 卡片 1px 浅描边 + 内投影，靠「贴纸感」而非「悬浮感」分层
     · 图钉、拍立得、格纹底等生活化装饰
   ============================================================ */

:root {
  /* ---- 奶油白底系 ---- */
  --cream: #fdf4ef;          /* 页面底色 */
  --cream-2: #fbeae1;        /* 次级底 */
  --paper: #ffffff;          /* 卡片 */
  --line: #f9dfd1;           /* 卡片描边 */
  --inner: #fae5e2;          /* 卡片内投影 */

  /* ---- 马卡龙点缀色 ---- */
  --pink: #fe99a9;
  --pink-d: #e8748a;
  --purple: #9a9eff;
  --purple-d: #7578ea;
  --butter: #fee17b;         /* 主按钮黄 */
  --butter-d: #e2b782;       /* 主按钮描边 */
  --butter-d2: #c99a62;      /* 主按钮厚度底 */
  --cta: #df6667;            /* 主 CTA 红 */
  --cta-d: #c55e4f;
  --mint: #a8e6d4;
  --mint-d: #6fc4a8;
  --sky: #bfe0f5;
  --sky-d: #7cb8dc;

  /* ---- 文字 ---- */
  --ink: #463e5d;            /* 主标题 */
  --ink-2: #7b7391;          /* 次要文字 */
  --ink-3: #a9a2bb;          /* 占位符 */

  /* ---- 行情涨跌（国内习惯：红涨绿跌）---- */
  --rise: #e04f4f;
  --rise-d: #b83a3a;
  --fall: #35a37a;
  --fall-d: #268a63;

  /* ---- 尺寸 ---- */
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --tap: 44px;               /* 最小点击区 */
}

/* ============================================================
   全局重置
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 奶油白底 + 极淡点阵（小程序常见的点纹质感） */
  background-color: var(--cream);
  background-image: radial-gradient(circle, rgba(217, 200, 190, .28) 1px, transparent 1.4px);
  background-size: 16px 16px;
  color: var(--ink);
  height: 100vh;
  height: 100dvh;             /* 跟着地址栏收放，底部按钮不被挡 */
  display: flex;
  align-items: center;         /* 比 9:16 更宽的屏幕：把「手机」居中 */
  justify-content: center;
  overflow: hidden;            /* 外层不滚，避免顶栏被顶出视野 */
  overscroll-behavior: none;   /* 关掉安卓下拉刷新 */
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;  /* 去掉手机点按 300ms 延迟 */
}

/* 小游戏外层与网站其他页面统一为暖奶油背景；农场插画本身保持不变。 */
body.game-page {
  /* 用 background 简写，顺带把基础 body 的 16px 点阵尺寸重置掉，避免渐变被平铺成格子 */
  background:
    radial-gradient(circle at 12% -8%, rgba(255, 196, 92, .22) 0, transparent 36%),
    radial-gradient(circle at 92% 0%, rgba(35, 74, 114, .09) 0, transparent 30%),
    linear-gradient(180deg, #fcfbf8 0%, #f8f6f1 46%, #f2efe8 100%);
  background-color: #f8f6f1;
}

.game-page .phone {
  background: #f8f6f1;
}

@media (min-width: 761px) and (min-height: 601px) {
  .game-page .phone {
    border-color: #e7e1d6;
    box-shadow: 0 22px 50px rgba(31, 47, 69, .16);
  }
}

/* ============================================================
   手机画布
   - 手机上（含横屏、浏览器地址栏把可视区压小的情况）：满屏，不留边
   - 只有大屏（电脑 / 平板）才收成一台 9:16 的手机，居中显示
   页面里所有浮层（面板、弹窗、遮罩）都以它为基准定位，不会溢出
   ============================================================ */
.phone {
  position: relative;
  width: 100%;
  height: 100vh;                /* 老浏览器兜底（不认识 dvh 时用它） */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* clip：连「程序滚动」都不允许。手机浏览器在聚焦输入框时会自动把容器
     滚下去（弹窗里点输入框 → 整块画布被顶出屏幕），用 clip 彻底堵住。
     不认 clip 的老浏览器还有上面的 hidden 兜底。 */
  overflow: clip;
  background: var(--cream);
}

/* 手机一律满屏（浏览器地址栏、键盘把可视区改小了也不留边）。
   只有真正的大屏（电脑、平板横屏）才收成 9:16 的手机并居中。 */
@media (min-width: 761px) and (min-height: 601px) {
  body { padding: 12px; }
  .phone {
    width: min(calc(100vw - 24px), calc((100vh - 24px) * 9 / 16));
    height: calc(100vh - 24px);
    width: min(calc(100vw - 24px), calc((100dvh - 24px) * 9 / 16));
    height: calc(100dvh - 24px);
    border: 2px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 20px 44px rgba(70, 62, 93, .18);
  }
}

/* 电脑端：打开「鸡舍 / 我的 / 纳指溢价 / 估值历史」时临时放宽画布，
   让这些信息页用满屏幕；回到农场首页再收回 9:16 手机框。
   手机上这条规则不生效，依旧满屏。 */
@media (min-width: 761px) and (min-height: 601px) {
  .phone { transition: width .26s ease; }
  .phone.wide { width: min(calc(100vw - 48px), 1180px); }

  .phone.wide .panel { width: min(880px, 92%); max-height: min(88%, 820px); }
  .phone.wide .panel-body { padding: 16px 20px 22px; }
  .phone.wide .hold-card { padding: 12px 16px; }
  .phone.wide .hold-sum { font-size: 12.5px; }

  .phone.wide .scr-head { padding: 12px 20px; }
  .phone.wide .scr-title b { font-size: 16px; }
  .phone.wide .scr-body { padding: 16px 20px 26px; }

  .phone.wide .nana-us { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .phone.wide .nana-val { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .phone.wide .nana-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .phone.wide .nana-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .phone.wide .nana-alt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .phone.wide .nana-table { min-width: 1000px; }
  .phone.wide .nana-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .phone.wide .nana-tools { flex: 1 1 320px; max-width: 460px; }
  .phone.wide .nana-article { max-width: 940px; }
  .phone.wide .nana-chart-card { padding: 12px 14px 6px; }
  .phone.wide .nana-hist-cards { max-width: 720px; }
}

button, input { font-family: inherit; }
button { touch-action: manipulation; cursor: pointer; }

/* 长/短标签切换：桌面显示长文案，手机显示短文案 */
.label-short { display: none; }

.topbar, .adder, .quick, .dock, .panel-head, .modal-head, .farm-tools {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.panel-body::-webkit-scrollbar { width: 5px; }
.panel-body::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}

/* ============================================================
   登录 / 注册
   ============================================================ */
.auth-mask {
  position: absolute;          /* 相对 .phone 定位，不会盖到手机外面 */
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(120% 90% at 50% 0%, #fff6ef 0%, #fde8dd 45%, #f7dcd4 100%);
  overflow-y: auto;
}
.auth-mask.hide { display: none; }

/* 背景漂浮色块，营造治愈氛围 */
.auth-mask::before, .auth-mask::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.auth-mask::before {
  width: 190px; height: 190px; top: -50px; left: -40px;
  background: radial-gradient(circle at 35% 35%, var(--pink), transparent 68%);
  opacity: .38;
}
.auth-mask::after {
  width: 230px; height: 230px; bottom: -70px; right: -60px;
  background: radial-gradient(circle at 60% 40%, var(--sky), transparent 68%);
  opacity: .40;
}

.auth-card {
  position: relative;
  width: 370px;
  max-width: 100%;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: 30px 24px 22px;
  box-shadow: inset 0 -3px 0 var(--inner);
  text-align: center;
}
/* 顶部图钉装饰 */
.auth-card::before {
  content: "";
  position: absolute;
  top: -11px; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff 0%, var(--pink) 45%, var(--pink-d) 100%);
  border: 2px solid var(--paper);
}

.auth-logo { font-size: 42px; line-height: 1; }
.auth-card h2 { font-size: 21px; margin: 10px 0 6px; color: var(--ink); letter-spacing: 1px; }
.auth-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.75; margin-bottom: 18px; }

.auth-tabs {
  display: flex;
  gap: 5px;
  background: var(--cream-2);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: background .18s, color .18s;
}
.auth-tab.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--inner);
}

.auth-body { text-align: left; }
.auth-field { display: block; margin-bottom: 12px; }
.auth-field span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 16px;              /* ≥16px，iOS 聚焦不会放大整页 */
  font-family: inherit;
  color: var(--ink);
  outline: none;
  background: #fff;
  transition: border-color .18s;
}
.auth-field input::placeholder { color: var(--ink-3); }
.auth-field input:focus { border-color: var(--purple); }

.auth-msg { min-height: 18px; font-size: 12px; color: var(--cta-d); margin-bottom: 8px; font-weight: 600; }
.auth-msg.good { color: var(--fall-d); }

/* 糖果包边主按钮 */
.auth-submit {
  width: 100%;
  padding: 13px;
  border: 3px solid var(--butter-d);
  border-radius: 16px;
  background: var(--butter);
  color: #7a5200;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .62), 0 4px 0 var(--butter-d2);
  transition: transform .12s, box-shadow .12s, background .16s;
}
.auth-submit:hover { background: #ffea94; }
.auth-submit:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,.62), 0 1px 0 var(--butter-d2); }
.auth-submit:disabled { opacity: .6; cursor: default; transform: none; }

.auth-tip { font-size: 11px; color: var(--ink-3); line-height: 1.75; margin-top: 14px; }
.auth-tip code { background: var(--cream-2); padding: 1px 6px; border-radius: 6px; font-size: 10.5px; color: var(--ink-2); }

/* ============================================================
   顶部栏
   ============================================================ */
.topbar {
  flex-shrink: 0;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  padding: 9px 18px 10px;
  padding-top: calc(9px + env(safe-area-inset-top, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand-emoji {
  font-size: 29px;
  filter: drop-shadow(0 2px 4px rgba(254, 153, 169, .5));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16.5px; color: var(--ink); letter-spacing: .5px; }
.brand-text small { font-size: 10.5px; color: var(--ink-3); }

/* 用户胶囊（模仿小程序右上角胶囊） */
.user-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 5px 4px 11px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 99px;
}
.user-box.hide { display: none; }
.user-name {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-out {
  padding: 5px 11px;
  font-size: 11px;
  font-family: inherit;
  color: #fff;
  background: var(--cta);
  border: 2px solid var(--cta-d);
  border-radius: 99px;
  font-weight: 700;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35);
  transition: background .16s;
}
.user-out:hover { background: var(--cta-d); }

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: inset 0 -2px 0 var(--inner);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}
.stat label { font-size: 10.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.stat b {
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 金币卡单独用黄，视觉上像元仔的「金币」元素 */
.stat.gold { background: #fff8e2; border-color: #f3e0b4; }
.stat.gold b { color: #b8862f; }

/* ============================================================
   添加鸡（弹窗表单：点农场右上角的 ➕ 打开）
   ============================================================ */
.add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* 弹窗里代码框独占一行，不要继承外面那套横向 flex 规则 */
.add-form #codeInput,
.add-form #accountInput { flex: none; width: 100%; }
.add-row { display: flex; gap: 8px; }
.add-row #qtyInput,
.add-row #costInput { flex: 1 1 0; width: auto; min-width: 0; }
.add-form #addBtn { width: 100%; padding: 12px 20px; font-size: 15px; }
.add-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

#codeInput,
#accountInput {
  flex: 1;
  min-width: 0;
  padding: 11px 15px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: border-color .18s;
}
#codeInput::placeholder,
#accountInput::placeholder { color: var(--ink-3); }
#codeInput:focus,
#accountInput:focus { border-color: var(--pink); }

/* 计价币种切换（自动 / 人民币 / 美元） */
.cur-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cur-row > span {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
}
.cur-toggle {
  flex: 1;
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 99px;
  background: var(--cream-2);
  box-shadow: inset 0 1px 2px rgba(70, 62, 93, .08);
}
.cur-toggle button {
  flex: 1;
  padding: 6px 4px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.cur-toggle button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--inner);
}

/* 添加鸡时的可选「持仓数量 / 成本价」 */
#qtyInput,
#costInput {
  flex: 0 0 auto;
  width: 92px;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  font-size: 16px;
  font-family: ui-monospace, monospace;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: border-color .18s;
}
#qtyInput::placeholder,
#costInput::placeholder { color: var(--ink-3); }
#qtyInput:focus,
#costInput:focus { border-color: var(--pink); }

.btn-primary {
  padding: 11px 20px;
  border: 3px solid var(--butter-d);
  border-radius: 15px;
  background: var(--butter);
  color: #7a5200;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), 0 4px 0 var(--butter-d2);
  transition: transform .12s, box-shadow .12s, background .16s;
}
.btn-primary:hover { background: #ffea94; }
.btn-primary:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,.6), 0 1px 0 var(--butter-d2); }

.btn-ghost {
  padding: 11px 15px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: background .16s, transform .12s;
}
.btn-ghost:hover { background: var(--cream-2); }
.btn-ghost:active { transform: translateY(2px); }

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.toggle input { width: 17px; height: 17px; accent-color: var(--pink); cursor: pointer; }

/* ============================================================
   快捷标签
   ============================================================ */
.quick {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 18px 9px;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.quick-label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

/* 马卡龙小圆片 */
.chip {
  padding: 6px 12px;
  border: 2px solid transparent;
  border-radius: 99px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: transform .12s;
}
.chip:hover { transform: translateY(-1px); }
.chip:active { transform: translateY(1px); }
.chip:nth-of-type(6n+1) { border-color: #ffd9e0; }
.chip:nth-of-type(6n+2) { border-color: #dcd9ff; }
.chip:nth-of-type(6n+3) { border-color: #cdeaf8; }
.chip:nth-of-type(6n+4) { border-color: #d5f2e6; }
.chip:nth-of-type(6n+5) { border-color: #ffeec4; }
.chip:nth-of-type(6n+6) { border-color: #f2e0ff; }

/* 快捷代码：一行放不下就换行 */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* 输入代码时的市场提示（沪深 / 美股） */
.add-hint {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-3);
  margin-top: -4px;
  padding: 0 2px;
}
.add-hint.us { color: #2f6fa8; }
.add-hint.bad { color: #c4566a; }
/* 持仓面板里的汇率说明 */
.hold-fx {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 6px 2px 2px;
}

.sync-status { font-size: 11px; color: var(--ink-3); margin-left: auto; font-weight: 600; }
.sync-status.live { color: var(--fall-d); }
.sync-status.err { color: var(--cta-d); }

/* ============================================================
   农场画布
   ============================================================ */
.farm-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  margin: 0 12px;
  /* 顶栏撤掉后农场顶到屏幕最上面，这里给状态栏/刘海留出安全距离 */
  margin-top: calc(8px + env(safe-area-inset-top, 0px));
  margin-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #eaf5e4;
  /* 拍立得：内白边 + 浅描边 + 内投影 */
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--line), inset 0 -3px 0 var(--inner);
}

#farm {
  display: block;
  width: 100%;
  height: 100%;
  /* 不再做降饱和 / 提亮处理：底图按原色显示，之前的滤镜会把画面调得灰蒙蒙 */
  filter: none;
}

/* 原来的奶油色柔光罩已去掉：那层半透明罩子会让农场看起来像蒙了一层灰 */

.farm-tools {
  position: absolute;
  top: 14px; right: 14px;
  display: flex;
  gap: 7px;
  z-index: 5;
}
.farm-tool {
  width: 38px; height: 38px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .94);
  font-size: 17px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: transform .12s;
}
.farm-tool:active { transform: translateY(2px); }
.farm-tool.off { opacity: .42; background: rgba(255, 255, 255, .6); }
/* ➕ 添加基金：主操作，用暖黄色让它一眼能看见 */
.farm-tool.primary {
  background: var(--butter);
  border-color: var(--butter-d);
  color: #7a5200;
  font-size: 20px;
  font-weight: 800;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08), 0 3px 0 var(--butter-d2);
}

/* ---- 右上角 ☰ 菜单：收着「鸡舍 / 持仓 / 我的」 ---- */
.fab-menu {
  position: absolute;
  top: 60px;                     /* 贴在工具按钮那一行下面 */
  right: 14px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  opacity: 0;
  transform: translateY(-6px) scale(.96);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.fab-menu.open { opacity: 1; transform: none; pointer-events: auto; }

.fab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;              /* 手指点得准 */
  padding: 9px 14px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 var(--inner), 0 2px 6px rgba(70, 62, 93, .12);
  transition: transform .12s;
}
.fab-item:active { transform: translateY(1px); }
.fab-item b {
  min-width: 19px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--pink);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* ---- 喂食：农场右下角的悬浮按钮（纯好玩，不影响数据） ---- */
.feed-fab {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 15px 0 8px;
  border: 2px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, .95);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--ink-2);
  box-shadow: inset 0 -2px 0 var(--inner), 0 6px 16px rgba(70, 62, 93, .14);
  transition: transform .12s, box-shadow .12s;
}
.ff-emoji {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffdf4 0%, #fff2cf 55%, #ffe3a8 100%);
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(180, 130, 60, .22);
  font-size: 17px;
  line-height: 1;
}
.feed-fab:hover {
  box-shadow: inset 0 -2px 0 var(--inner), 0 9px 22px rgba(70, 62, 93, .18);
}
.feed-fab:active {
  transform: translateY(2px) scale(.98);
  box-shadow: inset 0 -2px 0 var(--inner), 0 3px 8px rgba(70, 62, 93, .14);
}

/* 农场左上角：鸡蛋数（数量 = 持仓浮盈的元数）+ 下面一行同步状态 */
.farm-topleft {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  pointer-events: none;          /* 别挡住点鸡 */
}
.egg-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 10px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  box-shadow: inset 0 -2px 0 var(--inner);
  pointer-events: auto;          /* 保留 hover 提示 */
}
.egg-badge span { font-size: 18px; line-height: 1; }
.egg-badge b {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
/* 亏损时：鸡蛋变成「欠的饲料」，数字是负的，整块换成暖木色 */
.egg-badge.debt {
  border-color: #e8d3ae;
  background: rgba(255, 249, 236, .96);
  box-shadow: inset 0 -2px 0 #f0e3cd;
}
.egg-badge.debt b { color: #b47a35; }

/* 同步状态：贴在鸡蛋下面 */
#syncStatus {
  margin: 0;
  padding: 6px 12px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .94);
  box-shadow: inset 0 -2px 0 var(--inner);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
#syncStatus.live { color: var(--mint-d); }
#syncStatus.err { color: var(--cta-d); }

/* 气泡提示 */
.toast {
  position: absolute;
  left: 50%;
  bottom: 76px;                  /* 抬到喂食按钮上面，免得盖住它 */
  transform: translateX(-50%) translateY(14px);
  padding: 11px 20px;
  background: var(--pink);
  color: #fff;
  border: 2px solid var(--pink-d);
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s, transform .24s;
  max-width: 84%;
  text-align: center;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.good { background: var(--mint-d); border-color: #4fa88a; }
.toast.bad { background: var(--cta); border-color: var(--cta-d); }
.toast.gold { background: var(--butter); border-color: var(--butter-d); color: #7a5200; }

/* ============================================================
   底部 dock —— 仿小程序 tabBar
   ============================================================ */
.dock {
  flex-shrink: 0;
  display: flex;
  gap: 7px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  background: var(--paper);
  border-top: 2px solid var(--line);
}

.dock-btn {
  flex: 1;
  min-height: var(--tap);
  padding: 8px 6px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: transform .12s;
}
.dock-btn:active { transform: translateY(2px); }
.dock-btn b {
  display: inline-block;
  min-width: 19px;
  padding: 0 5px;
  margin-left: 3px;
  border-radius: 99px;
  background: var(--pink);
  color: #fff;
  font-size: 11px;
  line-height: 19px;
  vertical-align: 1px;
}
.dock-btn.danger { color: var(--cta-d); border-color: #f3d4cf; background: #fff6f4; }

/* ---- 「我的」面板：账号信息 + 农场动态 ---- */
.me-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: inset 0 -2px 0 var(--inner);
}
.me-avatar {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: 14px;
  background: var(--cream-2);
}
.me-info { min-width: 0; flex: 1; }
.me-info strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-info small { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-3); line-height: 1.4; }
.me-title {
  margin: 2px 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}

/* 改密码表单 */
.pw-form { display: flex; flex-direction: column; gap: 8px; }
.pw-form input {
  width: 100%;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;               /* 16px 以上手机浏览器才不会自动放大 */
  outline: none;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: border-color .18s;
}
.pw-form input::placeholder { color: var(--ink-3); }
.pw-form input:focus { border-color: var(--pink); }
.pw-form .btn-primary { width: 100%; padding: 12px 20px; font-size: 15px; }
.pw-msg {
  min-height: 17px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cta-d);
  text-align: center;
}
.pw-msg.good { color: var(--fall-d); }

/* ============================================================
   侧边面板
   ============================================================ */
.panel-mask {
  position: absolute;
  inset: 0;
  background: rgba(70, 62, 93, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .26s;
  z-index: 200;
}
.panel-mask.open { opacity: 1; pointer-events: auto; }

.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92%, 520px);
  max-height: min(86%, 760px);
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 24px;
  box-shadow: inset 0 -3px 0 var(--inner), 0 18px 40px rgba(70, 62, 93, .22);
  transform: translate(-50%, -50%) scale(.94);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.34, 1.4, .5, 1), opacity .2s;
  z-index: 201;
  display: flex;
  flex-direction: column;
  overflow: hidden;              /* 圆角把头和内容裁进去 */
}
.panel.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }

.panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 13px;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
}
.panel-head h3 { font-size: 16px; color: var(--ink); letter-spacing: .5px; }

.panel-close {
  width: 30px; height: 30px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 14px;
  display: grid;
  place-items: center;
  font-family: inherit;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: transform .12s, background .16s;
}
.panel-close:hover { background: var(--cream-2); }
.panel-close:active { transform: scale(.92); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 13px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.chicken-card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: inset 0 -2px 0 var(--inner);
  padding: 12px 13px;
  cursor: pointer;
  transition: transform .14s;
}
.chicken-card:active { transform: translateY(2px); }
.chicken-card.loss { border-color: #f6d4d4; background: #fffafa; }

.cc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cc-name { font-size: 14px; font-weight: 800; color: var(--ink); }
.cc-code { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.cc-price { text-align: right; flex-shrink: 0; }
.cc-price b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.cc-price span { font-size: 11px; font-weight: 700; }

.cc-meta {
  display: flex;
  gap: 11px;
  margin-top: 9px;
  font-size: 11px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.cc-meta em { font-style: normal; color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }

.cc-bar {
  height: 8px;
  margin-top: 10px;
  background: var(--cream-2);
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(70, 62, 93, .08);
}
.cc-bar i { display: block; height: 100%; border-radius: 99px; transition: width .4s; }

/* 涨跌配色：红涨绿跌 */
.up { color: var(--rise); }
.down { color: var(--fall); }

.ach-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  border: 2px solid transparent;
  background: rgba(255, 255, 255, .55);
}
.ach-item.unlocked {
  background: var(--paper);
  border-color: #ffe1a8;
  box-shadow: inset 0 -2px 0 #fdefd6;
}
.ach-item.locked { opacity: .5; }
.ach-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: var(--cream-2);
  border-radius: 13px;
}
.ach-item.unlocked .ach-icon { background: #fff6e2; }
.ach-item strong { display: block; font-size: 13px; color: var(--ink); }
.ach-item small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* ---- 持仓页：一行一只基金 ---- */
.hold-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  padding: 10px 13px;
  margin-bottom: 10px;
  border-radius: var(--r-md);
  background: var(--cream-2);
  font-size: 11.5px;
  color: var(--ink-3);
}
.hold-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }

.hold-card {
  padding: 11px 13px;
  margin-bottom: 8px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: inset 0 -2px 0 var(--inner);
  cursor: pointer;
}
.hold-card:active { transform: translateY(1px); }
.hold-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.hold-name { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.hold-name small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.hold-pnl {
  flex-shrink: 0;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hold-pnl small { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; }
.hold-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-3);
}
.hold-meta em { font-style: normal; color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }

.log-item {
  padding: 10px 13px;
  border-radius: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.log-item time {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.log-item.buy { border-left: 4px solid var(--rise); }
.log-item.sell { border-left: 4px solid var(--fall); }
.log-item.egg { border-left: 4px solid var(--butter); }

.empty-tip {
  text-align: center;
  padding: 46px 20px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 2;
}

/* ============================================================
   交易弹窗
   ============================================================ */
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(70, 62, 93, .32);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .26s;
  z-index: 300;
}
.modal-mask.open { opacity: 1; pointer-events: auto; }

.modal {
  width: 420px;
  max-width: 100%;
  max-height: 88%;
  overflow-y: auto;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: inset 0 -3px 0 var(--inner);
  padding: 20px 18px 18px;
  transform: scale(.94) translateY(10px);
  transition: transform .28s cubic-bezier(.34, 1.4, .5, 1);
}
.modal-mask.open .modal { transform: scale(1) translateY(0); }

.sheet-grab { display: none; }

/* 手指拖动抽屉时关掉过渡，让面板跟手 */
.modal.dragging { transition: none; }
.modal.dragging .sheet-grab i { background: var(--ink-3); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-head h3 { font-size: 17px; color: var(--ink); }
.modal-head small { font-size: 11.5px; color: var(--ink-3); display: block; margin-top: 3px; }

.trade-quote {
  background: var(--cream-2);
  border-radius: var(--r-md);
  padding: 13px;
  margin-bottom: 15px;
}
.tq-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 4px 0;
  color: var(--ink-2);
}
.tq-item b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }

.trade-actions { display: flex; flex-direction: column; gap: 10px; }

/* 编辑弹窗：数字框改完就自动保存的说明 */
.trade-save-hint {
  margin-top: -3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: center;
}

.btn-row { display: flex; gap: 7px; }
.btn-row.main { flex-direction: row; flex-wrap: wrap; }
/*买卖按钮不允许被压成竖排文字 */
.btn-row.main .btn-buy, .btn-row.main .btn-sell {
  min-width: 104px;
  white-space: nowrap;
}
.btn-soft {
  flex: 1;
  min-height: 38px;
  padding: 8px 4px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: inset 0 -2px 0 var(--inner);
  transition: transform .12s, background .16s;
}
.btn-soft:active { transform: translateY(2px); }
.btn-soft:hover { background: var(--cream-2); }

.input-row { position: relative; display: flex; align-items: center; }
.input-row input {
  width: 100%;
  padding: 12px 46px 12px 15px;
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  background: #fff;
}
.input-row input:focus { border-color: var(--purple); }
.input-row .unit {
  position: absolute;
  right: 14px;
  font-size: 12px;
  color: var(--ink-3);
  pointer-events: none;
}

.btn-buy, .btn-sell {
  flex: 1;
  min-height: var(--tap);
  border-radius: 15px;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  transition: transform .12s, box-shadow .12s, background .16s;
}
.btn-buy {
  border: 3px solid var(--cta-d);
  background: var(--cta);
  color: #fff;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .32), 0 4px 0 #a94b3d;
}
.btn-buy:hover { background: #e57272; }
.btn-buy:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,.32), 0 1px 0 #a94b3d; }

.btn-sell {
  border: 3px solid var(--sky-d);
  background: var(--sky);
  color: #2c5d78;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5), 0 4px 0 #5d9ec4;
}
.btn-sell:hover { background: #d3e9f9; }
.btn-sell:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,.5), 0 1px 0 #5d9ec4; }

.btn-feed {
  min-height: var(--tap);
  padding: 12px;
  border: 3px solid var(--butter-d);
  border-radius: 15px;
  background: var(--butter);
  color: #7a5200;
  font-size: 13.5px;
  font-weight: 800;
  font-family: inherit;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), 0 4px 0 var(--butter-d2);
  transition: transform .12s, box-shadow .12s, background .16s;
}
.btn-feed:hover { background: #ffea94; }
.btn-feed:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,.6), 0 1px 0 var(--butter-d2); }

.btn-del {
  min-height: 40px;
  padding: 10px;
  border: 2px solid #f2d6d2;
  border-radius: 14px;
  background: #fff7f6;
  color: var(--cta-d);
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  transition: background .16s, transform .12s;
}
.btn-del:hover { background: #ffeceb; }
.btn-del:active { transform: translateY(2px); }

.trade-hint {
  margin-top: 13px;
  padding: 11px 13px;
  background: var(--cream-2);
  border-radius: 13px;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.75;
  min-height: 20px;
}
.trade-hint:empty { display: none; }

/* ============================================================
   响应式
   ============================================================ */

/* 手机 */
@media (max-width: 700px) {
  .label-wide { display: none; }
  .label-short { display: inline; }

  /* 顶栏：只剩品牌 + 账号，一行放得下（统计那排已经撤掉） */
  .topbar {
    display: flex;
    align-items: center;
    padding: calc(8px + env(safe-area-inset-top, 0px))
             max(11px, env(safe-area-inset-left, 0px)) 8px;
    gap: 10px;
  }
  .brand { padding: 0 2px; gap: 8px; }
  .brand-emoji { font-size: 24px; }
  .brand-text strong { font-size: 15px; }
  .brand-text small { display: none; }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .stat { padding: 6px 8px; }
  .stat label { font-size: 10px; }
  .stat b { font-size: 13px; }

  /* 添加弹窗：两个数字框并排、各自占一半宽 */
  #qtyInput,
  #costInput { width: 74px; padding: 10px 8px; }
  /* 手机上「显示行情标签」用画布右上角的 🏷️ 按钮代替，弹窗里就不重复放了 */
  .add-form .toggle { display: none; }
  /* 快捷标签：横滑一行，不换行挤掉画布 */
  .quick {
    padding: 0 13px 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .quick::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .sync-status { flex-shrink: 0; }
  /* 窄屏隐藏「快速添加」文字标签，给标签腾地方 */
  .quick-label { display: none; }
  #codeInput { padding: 10px 13px; }
  .btn-primary { padding: 10px 15px; font-size: 13px; }
  .btn-ghost { padding: 10px 12px; font-size: 12px; }

  .farm-wrap {
    margin: 0 8px;
    margin-top: calc(6px + env(safe-area-inset-top, 0px));
    margin-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--r-md);
  }

  .dock { padding: 7px 9px calc(7px + env(safe-area-inset-bottom, 0px)); gap: 5px; }
  .dock-btn { font-size: 12px; border-radius: 13px; padding: 8px 3px; }

  /* 面板：手机上也保持在屏幕正中 */
  .panel {
    width: min(92%, 460px);
    max-height: min(80%, 640px);
  }

  /* 交易弹窗：贴底抽屉 */
  .modal-mask { place-items: end center; padding: 0; }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 86%;
    border-radius: 26px 26px 0 0;
    border-bottom: none;
    padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
  }
  .modal-mask.open .modal { transform: translateY(0); }

  .sheet-grab {
    display: flex;
    justify-content: center;
    padding: 6px 0 10px;
  }
  .sheet-grab i {
    width: 42px;
    height: 5px;
    border-radius: 99px;
    background: var(--line);
  }

  /* 买入独占一行，两个卖出并排一行 */
  .btn-buy { flex: 1 1 100%; }
  .btn-sell { flex: 1 1 0; }
}

/* 横屏矮屏 */
@media (orientation: landscape) and (max-height: 520px) {
  .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .quick { display: none; }
  .stat { padding: 4px 7px; }
  .stat b { font-size: 12.5px; }
  .farm-wrap { margin: 0 8px; }
  .topbar { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
  .adder { padding-top: 6px; padding-bottom: 5px; }
  .panel { width: min(90%, 460px); max-height: 92%; }
}

/* 超窄屏 */
@media (max-width: 380px) {
  .brand-text small { display: none; }
  .stat b { font-size: 12.5px; }
  .chip { padding: 5px 10px; font-size: 11.5px; }
  .toggle { display: none; }
}

/* 桌面：内容居中限宽 */
@media (min-width: 701px) {
  .topbar, .adder, .quick {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  .farm-wrap {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 24px);
  }
  .dock {
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
}

/* 触屏：去掉 hover 残留 */
@media (hover: none) {
  .chip:hover, .btn-ghost:hover, .btn-soft:hover, .panel-close:hover { background: var(--paper); }
  .btn-primary:hover, .btn-feed:hover { background: var(--butter); }
  .btn-buy:hover, .user-out:hover { background: var(--cta); }
  .btn-sell:hover { background: var(--sky); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
   百万纳指：溢价看板 / 估值历史（全屏页）
   ============================================================ */
.screen {
  /* 浅色（默认）：跟农场一套奶油色；深色在 [data-nana-theme="dark"] 里覆盖 */
  --nana-bg: var(--cream);
  --nana-card: var(--paper);
  --nana-line: var(--line);
  --nana-ink: var(--ink);
  --nana-ink2: var(--ink-2);
  --nana-ink3: var(--ink-3);
  --nana-soft: var(--cream-2);
  --nana-shadow: inset 0 -2px 0 var(--inner);
  --nana-rise: var(--rise);
  --nana-fall: var(--fall);

  position: absolute;
  inset: 0;
  z-index: 260;
  display: flex;
  flex-direction: column;
  background: var(--nana-bg);
  color: var(--nana-ink);
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.32, .72, .35, 1), opacity .2s;
}
#nanaHistScreen { z-index: 270; }
.screen.open { transform: none; opacity: 1; pointer-events: auto; }
.screen[data-nana-theme="dark"] {
  --nana-bg: #12141c;
  --nana-card: #1b1e29;
  --nana-line: #2b3040;
  --nana-ink: #eaeef8;
  --nana-ink2: #b6bfd3;
  --nana-ink3: #7f899f;
  --nana-soft: #222634;
  --nana-shadow: none;
  --nana-rise: #ff6b6b;
  --nana-fall: #3ecf9a;
}

.scr-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(9px + env(safe-area-inset-top, 0px)) 12px 9px;
  background: var(--nana-card);
  border-bottom: 2px solid var(--nana-line);
}
.scr-back {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--nana-line);
  border-radius: 12px;
  background: var(--nana-soft);
  color: var(--nana-ink);
  font-size: 16px;
  font-family: inherit;
  line-height: 1;
}
.scr-title { flex: 1; min-width: 0; }
.scr-title b { display: block; font-size: 15px; letter-spacing: .4px; }
.scr-title small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--nana-ink3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scr-act {
  flex-shrink: 0;
  padding: 7px 11px;
  border: 2px solid var(--nana-line);
  border-radius: 12px;
  background: var(--nana-soft);
  color: var(--nana-ink2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}
.scr-act:active, .scr-back:active { transform: translateY(1px); }

.scr-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 12px calc(20px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 美股指数 ---------- */
.nana-us {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));   /* 4 个指数一行排开 */
  gap: 6px;
  margin-bottom: 12px;
}
.us-card {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  padding: 7px 7px 6px;
  border: 2px solid var(--nana-line);
  border-radius: 12px;
  background: var(--nana-card);
  box-shadow: var(--nana-shadow);
}
.us-head { display: flex; justify-content: space-between; gap: 3px; font-size: 8.5px; line-height: 1.15; color: var(--nana-ink3); }
.us-head .un { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-head .ut { flex-shrink: 0; font-weight: 800; color: var(--nana-ink2); }
.us-main { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; margin-top: 3px; }
.us-price { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.us-chg { font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.us-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 4px; margin-top: 3px; font-size: 8px; color: var(--nana-ink3); }
.us-cls { display: flex; align-items: center; gap: 4px; }
.us-cls i { width: 6px; height: 6px; border-radius: 50%; background: var(--nana-ink3); }
.us-cls.reg i { background: var(--nana-fall); }
.us-cls.pre i { background: #f0b45a; }
.us-cls.post i { background: #8fa3ff; }
.us-cls.closed i { background: #b9b3c8; }

/* ---------- 估值温度 ---------- */
.nana-verdict {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 13px;
  margin-bottom: 9px;
  border-radius: 14px;
  border: 2px solid var(--nana-line);
  background: var(--nana-card);
  font-size: 11.5px;
  color: var(--nana-ink2);
}
.nana-verdict b { font-size: 13px; color: var(--nana-ink); }
.nana-verdict.low { border-color: #9fd7b9; background: rgba(74, 190, 132, .10); }
.nana-verdict.mid { border-color: #f0d79a; background: rgba(240, 200, 90, .12); }
.nana-verdict.high { border-color: #f0a7a0; background: rgba(240, 120, 110, .10); }

.nana-val {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));   /* 5 个估值卡一行 */
  gap: 4px;
}
.val-card {
  padding: 6px 6px 5px;
  border: 2px solid var(--nana-line);
  border-radius: 11px;
  background: var(--nana-card);
  box-shadow: var(--nana-shadow);
  min-width: 0;
}
.val-card.link { cursor: pointer; }
.val-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 5px; }
.val-k { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 8px; color: var(--nana-ink3); font-weight: 700; white-space: nowrap; }
.val-ext { margin-left: 2px; color: var(--nana-ink3); }
.val-badge {
  flex-shrink: 0;
  padding: 1px 4px;
  border-radius: 99px;
  font-size: 7.5px;
  font-weight: 800;
  background: var(--nana-soft);
  color: var(--nana-ink3);
}
.val-badge.low { background: rgba(74, 190, 132, .16); color: #2f9d68; }
.val-badge.mid { background: rgba(233, 186, 70, .18); color: #a8811f; }
.val-badge.high { background: rgba(236, 110, 100, .16); color: #c9524a; }
.val-v {
  margin-top: 3px;
  font-size: 13.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.val-v small { margin-left: 1px; font-size: 8px; font-weight: 700; color: var(--nana-ink3); }
.val-v.low { color: #2f9d68; }
.val-v.mid { color: #c9962a; }
.val-v.high { color: #d9584f; }
.val-meter { height: 4px; margin-top: 4px; border-radius: 99px; background: var(--nana-soft); overflow: hidden; }
.val-meter i { display: block; height: 100%; border-radius: 99px; }
.val-meter .bg-low { background: #4abe84; }
.val-meter .bg-mid { background: #e9ba46; }
.val-meter .bg-high { background: #ec6e64; }
.val-sub { margin-top: 3px; font-size: 7px; color: var(--nana-ink3); line-height: 1.35; }
.nana-src { margin: 8px 2px 14px; font-size: 10px; color: var(--nana-ink3); line-height: 1.5; }
.nana-src b { color: var(--nana-ink2); }
.val-stale { color: #c08a2f; }

/* ---------- 区块标题 ---------- */
.nana-sec-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 16px 2px 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--nana-ink);
}
.nana-sec-title small { font-size: 10px; font-weight: 600; color: var(--nana-ink3); }

/* ---------- 统计卡 ---------- */
.nana-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.nana-stat {
  padding: 7px 6px;
  border: 2px solid var(--nana-line);
  border-radius: 11px;
  background: var(--nana-card);
  box-shadow: var(--nana-shadow);
}
.nana-stat .k { font-size: 8px; color: var(--nana-ink3); font-weight: 700; }
.nana-stat .v { margin-top: 2px; font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.nana-stat .v small { font-size: 8px; color: var(--nana-ink3); font-weight: 700; }
.nana-stat .v.hot { color: #d9584f; }
.nana-stat .sub { margin-top: 2px; font-size: 7px; color: var(--nana-ink3); line-height: 1.3; }

/* ---------- 工具条 ---------- */
.nana-toolbar { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.nana-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.nana-tab {
  padding: 5px 9px;
  border: 2px solid var(--nana-line);
  border-radius: 99px;
  background: var(--nana-card);
  color: var(--nana-ink2);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
}
.nana-tab.on { background: var(--butter); border-color: var(--butter-d); color: #7a5200; }
.nana-tools { display: flex; gap: 7px; align-items: center; }
.nana-search {
  flex: 1;
  min-width: 0;
  padding: 8px 11px;
  border: 2px solid var(--nana-line);
  border-radius: 12px;
  background: var(--nana-card);
  color: var(--nana-ink);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}
.nana-search::placeholder { color: var(--nana-ink3); }
.nana-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 2px solid var(--nana-line);
  border-radius: 12px;
  background: var(--nana-card);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--nana-ink3);
  white-space: nowrap;
}
.nana-chip.on { border-color: var(--pink-d); color: var(--pink-d); background: rgba(255, 153, 169, .12); }
.nana-chip input { accent-color: var(--pink-d); }

/* ---------- 表格 ---------- */
.nana-table-wrap {
  margin-top: 9px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 2px solid var(--nana-line);
  border-radius: 14px;
  background: var(--nana-card);
}
.nana-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 660px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.nana-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 7px;
  text-align: right;
  white-space: nowrap;
  background: var(--nana-soft);
  color: var(--nana-ink3);
  font-weight: 800;
  font-size: 10px;
  cursor: pointer;
  border-bottom: 2px solid var(--nana-line);
}
.nana-table th:nth-child(1), .nana-table th:nth-child(2), .nana-table th:nth-child(3) { text-align: left; }
.nana-table th.on { color: var(--nana-ink); }
.nana-table td {
  padding: 8px 7px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--nana-line);
  color: var(--nana-ink2);
}
.nana-table tr:last-child td { border-bottom: none; }
.nana-table td:nth-child(1), .nana-table td:nth-child(2), .nana-table td:nth-child(3) { text-align: left; }
.nana-table td.code { font-weight: 800; color: var(--nana-ink); }
.nana-table .nm { font-size: 11px; font-weight: 700; color: var(--nana-ink); white-space: normal; max-width: 130px; line-height: 1.35; }
.nana-table .meta { margin-top: 2px; font-size: 9.5px; color: var(--nana-ink3); }
.nana-table .ex { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 4px; font-size: 8.5px; font-weight: 800; }
.nana-table .ex.sh { background: rgba(236, 110, 100, .16); color: #c9524a; }
.nana-table .ex.sz { background: rgba(90, 150, 240, .16); color: #3d74c9; }
.nana-table .lk { margin-left: 5px; color: var(--nana-ink3); }
.nana-table .lk.held {
  display: inline-block; margin-left: 5px; padding: 1px 6px;
  border-radius: 6px; font-size: 9px; font-weight: 800;
  background: rgba(216, 164, 62, .15); color: #a07c24;
  vertical-align: 1px;
}
.nana-table .idx { display: inline-block; padding: 1px 5px; border-radius: 5px; font-size: 9px; font-weight: 800; }
.nana-table .idx.nas { background: rgba(140, 120, 255, .14); color: #6b5bd6; }
.nana-table .idx.sp { background: rgba(70, 160, 200, .14); color: #2f7f9e; }
.nana-table .muted { color: var(--nana-ink3); }
.nana-table .pos { color: var(--nana-rise); font-weight: 700; }
.nana-table .neg { color: var(--nana-fall); font-weight: 700; }
.nana-table .flat { color: var(--nana-ink3); }
.nana-table .unit { font-size: 9px; color: var(--nana-ink3); }
.prem-cell { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.prem-bar { width: 46px; height: 6px; border-radius: 99px; background: var(--nana-soft); overflow: hidden; }
.prem-bar i { display: block; height: 100%; border-radius: 99px; }
.prem-val { font-weight: 800; min-width: 46px; text-align: right; }
.lvl-high { color: #d9584f; }
.lvl-mid { color: #c9962a; }
.lvl-low { color: #2f9d68; }
.bg-high { background: #ec6e64; }
.bg-mid { background: #e9ba46; }
.bg-low { background: #4abe84; }
.fee { color: var(--nana-ink2); }
.fee.best { color: #2f9d68; font-weight: 800; }
.nana-empty { padding: 20px 0; text-align: center; color: var(--nana-ink3); font-size: 11.5px; }

.nana-count { margin: 7px 2px 0; font-size: 10.5px; color: var(--nana-ink3); }
.nana-count b { color: var(--nana-ink); }
.nana-legend { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 7px 2px 0; font-size: 8.5px; color: var(--nana-ink3); }
.nana-legend .dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; }
.nana-legend .dot.high { background: #ec6e64; }
.nana-legend .dot.mid { background: #e9ba46; }
.nana-legend .dot.low { background: #4abe84; }
.nana-note { margin: 7px 2px; font-size: 9.5px; line-height: 1.55; color: var(--nana-ink3); }

/* ---------- 溢价排行 ---------- */
.nana-chart { display: flex; flex-direction: column; gap: 5px; }
.prow { display: grid; grid-template-columns: 118px 1fr 48px; align-items: center; gap: 7px; font-size: 10px; }
.prow .pl { color: var(--nana-ink2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.prow .pl b { margin-right: 4px; color: var(--nana-ink); }
.prow .ptrack { height: 7px; border-radius: 99px; background: var(--nana-soft); overflow: hidden; }
.prow .pfill { display: block; height: 100%; border-radius: 99px; }
.prow .pv { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- 长文说明 ---------- */
.nana-article { margin-top: 18px; }
.nana-article h3 { margin: 16px 0 6px; font-size: 13.5px; color: var(--nana-ink); }
.nana-article p { margin: 5px 0; font-size: 11.5px; line-height: 1.7; color: var(--nana-ink2); }
.nana-article p b { color: var(--nana-ink); }
.nana-article ol { margin: 6px 0 0 16px; font-size: 11.5px; line-height: 1.75; color: var(--nana-ink2); }
.nana-article ol b { color: var(--nana-ink); }
.nana-formula {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--nana-soft);
  font-weight: 800;
  color: var(--nana-ink) !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nana-picks { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.pick {
  padding: 9px 11px;
  border: 2px solid var(--nana-line);
  border-radius: 13px;
  background: var(--nana-card);
  font-size: 11px;
  color: var(--nana-ink2);
  line-height: 1.6;
}
.pick .pk { display: block; font-size: 9.5px; color: var(--nana-ink3); font-weight: 700; }
.pick b { display: inline-block; margin: 2px 0; font-size: 12.5px; color: var(--nana-ink); }
.pick small { display: block; font-size: 10.5px; line-height: 1.6; color: var(--nana-ink3); }
.nana-alt { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.nana-alt > div {
  padding: 9px 11px;
  border-radius: 13px;
  background: var(--nana-soft);
  font-size: 11px;
  line-height: 1.65;
  color: var(--nana-ink2);
}
.nana-alt b { color: var(--nana-ink); }
.nana-alt small { display: block; margin-top: 3px; font-size: 9.5px; color: var(--nana-ink3); font-weight: 700; }
.nana-disclaimer {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px dashed var(--nana-line);
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--nana-ink3);
}
.nana-disclaimer b { color: var(--nana-ink2); }

/* ---------- 估值历史 ---------- */
.nana-hist-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nana-hcard {
  padding: 10px 12px;
  border: 2px solid var(--nana-line);
  border-radius: 15px;
  background: var(--nana-card);
  box-shadow: var(--nana-shadow);
}
.nana-hcard .k { font-size: 10.5px; color: var(--nana-ink3); font-weight: 700; }
.nana-hcard .v { margin-top: 3px; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.nana-hcard .v small { margin-left: 2px; font-size: 11px; color: var(--nana-ink3); }
.nana-hcard .v.low { color: #2f9d68; }
.nana-hcard .v.mid { color: #c9962a; }
.nana-hcard .v.high { color: #d9584f; }
.nana-hcard .sub { margin-top: 4px; font-size: 10px; color: var(--nana-ink3); }
.nana-hcard .sub b { color: var(--nana-ink2); }

.nana-ranges { display: flex; gap: 6px; margin: 12px 0 10px; }
.nana-range {
  flex: 1;
  padding: 7px 4px;
  border: 2px solid var(--nana-line);
  border-radius: 11px;
  background: var(--nana-card);
  color: var(--nana-ink2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
}
.nana-range.on { background: var(--butter); border-color: var(--butter-d); color: #7a5200; }

.nana-chart-card {
  padding: 10px 10px 4px;
  margin-bottom: 10px;
  border: 2px solid var(--nana-line);
  border-radius: 15px;
  background: var(--nana-card);
  box-shadow: var(--nana-shadow);
}
.ncc-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 6px; }
.ncc-k { font-size: 12px; font-weight: 800; }
.ncc-k.pe { color: #5b8cff; }
.ncc-k.pb { color: #b07cf0; }
.ncc-now { font-size: 10.5px; color: var(--nana-ink3); font-variant-numeric: tabular-nums; }
.nana-canvas { display: block; width: 100%; height: 190px; }

/* ============================================================
   全站导航（首页「百万纳指」和农场共用）
   ============================================================ */
.nav-mask {
  position: absolute;
  inset: 0;
  z-index: 280;
  background: rgba(70, 62, 93, .34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}
.nav-mask.open { opacity: 1; pointer-events: auto; }

.nav-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 281;
  width: min(92%, 380px);
  max-height: min(88%, 640px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: inset 0 -3px 0 var(--inner), 0 18px 40px rgba(70, 62, 93, .24);
  transform: translate(-50%, -46%) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: transform .24s cubic-bezier(.34, 1.4, .5, 1), opacity .18s;
}
.nav-sheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }

.nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 6px;
}
.nav-head b { font-size: 15px; color: var(--ink); letter-spacing: .5px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: var(--cream-2);
  font-family: inherit;
  text-align: left;
  transition: transform .1s, background .14s;
}
.nav-item:active { transform: translateY(1px); }
.nav-item:hover { background: #fff6ea; }

.ni-emoji {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: inset 0 -2px 0 var(--inner);
  font-size: 19px;
}
.ni-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ni-text b { font-size: 13.5px; color: var(--ink); }
.ni-text small { font-size: 10.5px; color: var(--ink-3); }

/* ---------------- 定投计划（添加弹窗 / 持仓抽屉共用） ---------------- */
.dca-box {
  border: 2px dashed var(--line);
  border-radius: var(--r-md, 16px);
  background: var(--cream-2);
  padding: 11px 12px 12px;
  margin-top: 2px;
}
.dca-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dca-head b { font-size: 13px; color: var(--ink); }
.dca-head span {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 700;
  text-align: right;
  line-height: 1.5;
}
.dca-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.dca-row select,
.dca-row input {
  min-height: 36px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 9px;
  box-sizing: border-box;
  box-shadow: inset 0 -2px 0 var(--inner);
}
.dca-row select { flex: 0 0 auto; }
.dca-row input { flex: 1 1 auto; min-width: 0; }
.dca-row .unit { flex: none; font-size: 12px; color: var(--ink-3); font-weight: 700; }
.dca-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.dca-actions .btn-soft { min-height: 34px; font-size: 11.5px; padding: 6px 6px; }
.dca-actions .btn-soft:disabled { opacity: .45; }
.dca-hint {
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* 小游戏右上角：鸡舍 / 我的 两个直达按钮（不弹窗） */
.farm-links {
  position: absolute;
  top: 59px;
  right: 14px;
  display: flex;
  gap: 7px;
  z-index: 5;
}
.farm-link {
  height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 2px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--inner);
  cursor: pointer;
  transition: transform .12s, background .16s;
}
.farm-link:hover { background: var(--cream-2); }
.farm-link:active { transform: translateY(2px); }


/* 纳指ETF：超窄屏（<340px）时估值卡 / 统计卡退回多行，保证可读 */
@media (max-width: 340px) {
  .nana-val { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nana-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 电脑端：卡片放得开，字号恢复舒展（手机上才用紧凑排版） */
@media (min-width: 701px) {
  .val-card { padding: 9px 11px; border-radius: 14px; }
  .val-k { font-size: 10.5px; }
  .val-badge { padding: 1px 6px; font-size: 9.5px; }
  .val-v { margin-top: 4px; font-size: 19px; }
  .val-v small { font-size: 10.5px; }
  .val-meter { height: 5px; margin-top: 6px; }
  .val-sub { font-size: 9.5px; margin-top: 4px; }
  .nana-stat { padding: 9px 11px; border-radius: 14px; }
  .nana-stat .k { font-size: 10.5px; }
  .nana-stat .v { margin-top: 3px; font-size: 17px; }
  .nana-stat .v small { font-size: 10px; }
  .nana-stat .sub { margin-top: 3px; font-size: 9.5px; }
}
/* 估值历史页：顶部指数 K 线卡 */
.ncc-k.idx { color: #3f8f6f; }
.ncc-note { margin-left: 4px; font-size: 9px; font-weight: 600; color: var(--nana-ink3); }
/* 估值历史：时间标签多了 1/3/6 个月，允许自动换行，按钮不挤压 */
.nana-ranges { flex-wrap: wrap; }
.nana-range { flex: 1 1 0; min-width: 44px; padding: 6px 4px; font-size: 10.5px; white-space: nowrap; }
/* ---- 添加动物（牛 / 马） ---- */
.animal-picks { display: flex; flex-direction: column; gap: 10px; }
.animal-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--cream-2);
  font-family: inherit;
  text-align: left;
  transition: transform .1s, background .14s;
}
.animal-pick:active { transform: translateY(1px); }
.animal-pick:hover { background: #fff6ea; }
.ap-emoji { width: 44px; flex-shrink: 0; font-size: 30px; line-height: 1; text-align: center; }
.animal-pick b { display: block; font-size: 14px; color: var(--ink); }
.animal-pick small { display: block; margin-top: 2px; font-size: 11px; line-height: 1.45; color: var(--ink-3); }
