/* 三页共享的外部样式：只做新增，不覆盖各页原有样式 */
:root {
  --hs-ink: #203a2a;
  --hs-green: #42664c;
  --hs-muted: #6d796f;
  --hs-line: #dce4dc;
}

/* 原版顶部主导航（.heshun-mainbar），与离线包保持一致的深色样式 */
.heshun-mainbar {
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  gap: 18px;
  padding: 10px 18px;
  background: #0c1720;
  border-bottom: 1px solid #294150;
  min-height: 56px;
  font: 16px/normal -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e5eef2;
}
.heshun-mainbrand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.heshun-mainnav {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #537080 transparent;
}
.heshun-mainnav::-webkit-scrollbar { height: 3px; }
.heshun-mainnav::-webkit-scrollbar-thumb { background: #537080; border-radius: 3px; }
.heshun-mainnav a {
  flex: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #a8bdc9;
  padding: 8px 13px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.heshun-mainnav a:hover { color: #fff; background: #1b303b; }
.heshun-mainnav a[aria-current="page"] { color: #f1d99d; border-color: #596352; background: #263036; }
.hs-auth {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.hs-auth-btn {
  padding: 7px 14px;
  border: 1px solid #596352;
  border-radius: 8px;
  background: transparent;
  color: #d7e2db;
  font: 13px/1.2 inherit;
  cursor: pointer;
}
.hs-auth-btn:hover { background: #1b303b; color: #fff; }
.hs-auth-btn--ghost { border-color: #3f5149; color: #a8bdc9; }
.hs-auth-user {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e5eef2;
  font-size: 13px;
}
@media (max-width: 760px) {
  .hs-auth { gap: 6px; }
  .hs-auth-btn { padding: 6px 10px; font-size: 12px; }
  .hs-auth-user { display: none; }
}

/* 登录 / 注册提示弹窗 */
.hs-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0d1a1466;
  backdrop-filter: blur(3px);
}
.hs-modal.is-open { display: flex; }
.hs-modal-card {
  position: relative;
  width: min(400px, 100%);
  padding: 26px;
  border-radius: 16px;
  background: #fff;
  color: #203a2a;
  box-shadow: 0 24px 70px #0d1a1440;
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
}
.hs-modal-card h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.hs-modal-card p { margin: 0; color: #6d796f; font-size: 13px; line-height: 1.75; }
.hs-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f0;
  color: #637666;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.hs-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: #526957;
  font-size: 12px;
  font-weight: 600;
}
.hs-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dfe8df;
  border-radius: 9px;
  background: #f8faf7;
  color: #203a2a;
  font: 14px/1.4 inherit;
}
.hs-field input:focus { outline: 2px solid #aabfac; outline-offset: 1px; }
.hs-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.hs-modal-btn {
  flex: 1;
  padding: 11px 16px;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.hs-modal-btn--primary { background: #203a2a; color: #fff; }
.hs-modal-btn--primary:hover { background: #315d3e; }
.hs-modal-btn--ghost { background: #eef3ed; color: #42664c; }
.hs-modal-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.hs-modal-error {
  display: none;
  margin-top: 12px;
  color: #9a3f38;
  font-size: 12px;
  line-height: 1.6;
}
.hs-modal-error.is-visible { display: block; }

/* 原版两行都固定在顶部：主导航吸顶后，页面原有页头紧随其下 */
body > .header,
body > .topbar {
  top: var(--hs-topbar-h, 56px);
  z-index: 50;
}
@media (max-width: 699px) {
  body > .header,
  body > .topbar { top: var(--hs-topbar-h, 46px); }
}
@media (max-width: 650px) {
  .heshun-mainbar { padding: 8px; gap: 6px; flex-wrap: wrap; }
  .heshun-mainbrand { font-size: 14px; }
  .heshun-mainnav a { font-size: 13px; padding: 6px 8px; }
  .heshun-mainnote { display: none; }
}

/* 轻提示 */
.hs-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 14px);
  z-index: 9999;
  max-width: min(92vw, 460px);
  padding: 11px 18px;
  border-radius: 10px;
  background: rgba(24, 35, 29, 0.94);
  color: #f2f7f2;
  font: 13px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
  box-shadow: 0 8px 28px rgba(18, 30, 22, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.hs-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: reduce) {
  .hs-toast { transition: none; }
}

html {
  scroll-padding-top: calc(var(--hs-topbar-h, 56px) + 68px);
}
.view {
  scroll-margin-top: calc(var(--hs-topbar-h, 56px) + 68px);
}

/* 工作台数据行：列宽与页面原有 .table-head 保持一致 */.hs-row {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 0.8fr 0.8fr;
  gap: 20px;
  padding: 14px 25px;
  border-bottom: 1px solid #edf1ec;
  font-size: 12px;
  color: #526354;
  align-items: center;
}
.hs-row:last-child { border-bottom: 0; }
.hs-row strong {
  display: block;
  font-weight: 650;
  color: #2c4432;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hs-row small {
  display: block;
  color: #8b998d;
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hs-row .hs-amount { font-variant-numeric: tabular-nums; font-weight: 650; color: #2c4432; }

.hs-pill {
  display: inline-block;
  border-radius: 100px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  background: #eef3ed;
  color: #607862;
}
.hs-pill--ok { background: #e7f4ea; color: #2f6b3d; }
.hs-pill--bad { background: #fbeceb; color: #9a3f38; }
.hs-pill--warn { background: #f5f0e6; color: #80663b; }
.hs-pill--info { background: #e9f1f8; color: #2f5f86; }
.hs-pill--muted { background: #f1f1f2; color: #6e6e73; }

.hs-more {
  display: block;
  width: 100%;
  padding: 13px;
  border: 0;
  border-top: 1px solid #edf1ec;
  background: #fafcf9;
  color: #42664c;
  font-size: 12px;
  cursor: pointer;
}
.hs-more:hover { background: #f2f7f2; }

/* 密钥行内的启用 / 停用 / 删除 */
.hs-key-actions {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}
.hs-key-action {
  padding: 0;
  border: 0;
  background: none;
  color: #607862;
  font-size: 11px;
  cursor: pointer;
}
.hs-key-action:hover { text-decoration: underline; }
.hs-key-action:disabled { opacity: 0.5; cursor: not-allowed; text-decoration: none; }
.hs-key-action--danger { color: #9a3f38; }

@media (max-width: 760px) {
  .hs-row {
    grid-template-columns: 1.3fr 0.9fr;
    gap: 6px 12px;
    padding: 12px 14px;
    font-size: 11px;
  }
  .hs-row > :nth-child(3),
  .hs-row > :nth-child(4) { font-size: 10px; }
}

/* 工作台：模拟充值 / 创建密钥弹窗中新增的控件 */
.hs-dialog-select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dfe8df;
  border-radius: 9px;
  background: #f8faf7;
  color: #526957;
  font: inherit;
  font-size: 13px;
}
.hs-dialog-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hs-dialog-msg {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #9a3f38;
}
.hs-dialog-msg[hidden] { display: none; }
.hs-dialog-result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #dfe8df;
  border-radius: 10px;
  background: #f8faf7;
}
.hs-dialog-result p {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #526957;
}
.hs-dialog-result code {
  display: block;
  padding: 10px;
  border: 1px dashed #cfdccf;
  border-radius: 8px;
  background: #fff;
  color: #203a2a;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.hs-dialog-copy {
  margin-top: 10px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: #eef3ed;
  color: #42664c;
  font-size: 11px;
  cursor: pointer;
}
.hs-dialog-copy:hover { background: #e2ece2; }
.hs-dialog-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #9ba89e;
}

/* 演示数据角标：由 workbench-api.js 在读到 X-Data-Mode: demo 时添加 */
/* 公网演示不启用用户登录，隐藏顶部登录/注册入口 */
.hs-auth {
  display: none !important;
}

.hs-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 100px;
  background: #f5f0e6;
  color: #80663b;
  font: 500 10px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  letter-spacing: 0.04em;
  vertical-align: middle;
  white-space: nowrap;
}
