/* 顶栏 */
#top-card .card {
  padding: 11px 13px;
  background: #fff;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}
.topbar::before {
  content: "盘后数据";
  margin-right: 4px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -.15px;
}
.topbar .date {
  color: #526174;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.data-availability {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}
.data-availability i { width: 6px; height: 6px; border-radius: 50%; background: #99a6b4; }
.data-availability.is-complete { color: var(--down); border-color: #b9d9d1; background: var(--down-bg); }
.data-availability.is-complete i { background: var(--down); }
.data-availability.is-unarchived { color: var(--warn); border-color: #ead0a8; background: var(--warn-bg); }
.data-availability.is-unarchived i { background: var(--warn); }
.data-availability.is-partial { color: var(--up); border-color: #edc2c5; background: var(--up-bg); }
.data-availability.is-partial i { background: var(--up); }
.top-stock-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 360px;
  flex: 1;
}
.top-stock-search > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.top-stock-combobox {
  position: relative;
  min-width: 160px;
  flex: 1;
}
.top-stock-combobox input { width: 100%; }
.top-stock-options {
  position: absolute;
  z-index: 60;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  overflow-y: auto;
  max-height: 286px;
  padding: 4px;
  border: 1px solid #bacbd7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(24, 45, 66, .14);
}
.top-stock-option {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 5px;
  background: #fff;
  color: var(--ink2);
  text-align: left;
}
.top-stock-option:hover,
.top-stock-option.is-active {
  border: 0;
  background: #eef5f6;
  color: var(--teal);
}
.top-stock-option span {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
}
.top-stock-option b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-stock-option small {
  color: var(--muted);
  letter-spacing: .04em;
}
.top-stock-option em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
}
.top-stock-option-state {
  padding: 12px 9px;
  color: var(--muted);
  font-size: 12px;
}
.status { margin-top: 7px; color: var(--muted); font-size: 11px; }
.status i { margin-right: 9px; font-style: normal; }

/* 控件 */
button, .btn {
  min-height: 28px;
  padding: 5px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease,
    box-shadow .16s ease, transform .16s ease;
}
button:hover, .btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
button.ghost, .btn.ghost {
  background: #fff;
  color: #526174;
  border-color: var(--line);
}
button.ghost:hover, .btn.ghost:hover {
  color: var(--accent);
  border-color: #aab8c5;
  background: var(--surface);
}
button.mini, .btn.mini {
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11.5px;
}
button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.stock-link:focus-visible {
  outline: 2px solid #6d879f;
  outline-offset: 2px;
}
input, select, textarea {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:hover, select:hover, textarea:hover { border-color: #bcc8d3; }
input:focus, select:focus, textarea:focus {
  border-color: #8ea1b3;
  box-shadow: 0 0 0 3px rgba(78, 103, 128, .08);
}
textarea { width: 100%; resize: vertical; }

/* 表格 */
.tablebox { overflow-x: auto; overscroll-behavior-inline: contain; }
.tallbox {
  max-height: 590px;
  overflow: auto;
  overscroll-behavior: contain;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  color: #66778a;
  font-size: 11px;
  font-weight: 650;
}
tr:last-child td { border-bottom-color: transparent; }
tr:hover td { background: #f7f9fb; }
td:first-child, th:first-child { padding-left: 10px; }
td:last-child, th:last-child { padding-right: 10px; }

/* 标签、提示与状态 */
.qmark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex: none;
  margin-left: 5px;
  border-radius: 50%;
  background: #edf1f5;
  color: #748396;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}
.qmark.warn { color: var(--warn); background: var(--warn-bg); }
.qmark.err { color: var(--up); background: var(--up-bg); }
.qmark[data-tip]:hover::after,
.qmark[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: 21px;
  z-index: 130;
  width: max-content;
  max-width: 360px;
  padding: 7px 10px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(24, 38, 56, .2);
  color: #fff;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  white-space: pre-line;
  pointer-events: none;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 1px 3px 1px 0;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--teal-bg);
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.45;
  vertical-align: middle;
}
.pill.warn { color: var(--warn); border-color: #eccb9f; background: var(--warn-bg); }
.pill.ok { color: #197a67; border-color: #b8ddd4; background: var(--down-bg); }
.pill.gray { color: #526274; border-color: #cdd8e2; background: #e9eef3; }
.pill.red { color: #c84f55; border-color: #f0c4c7; background: var(--up-bg); }
.pill.teal { color: var(--teal); border-color: #b6dcdf; background: var(--teal-bg); }
.pill.blue { color: #3f6297; border-color: #c8d5e8; background: #e5edf8; }
.theme-exposure {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.pill.theme-exposed.is-primary {
  border-color: #abd5d8;
  box-shadow: inset 2px 0 0 var(--teal);
}
.pill.theme-exposed.secondary {
  border-color: #d3dde6;
  background: #f0f4f7;
  color: #526579;
}
button.theme-pick-trigger {
  min-height: 20px;
  padding: 1px 6px;
  border-color: #cdd8e2;
  border-radius: 4px;
  background: #fff;
  color: #607185;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
  white-space: nowrap;
}
button.theme-pick-trigger:hover {
  border-color: #91a8ba;
  background: #eef3f6;
  color: #263d54;
}
button.theme-exposed-edit {
  min-height: 20px;
  margin: 1px 3px 1px 0;
  padding: 1px 7px;
  background: var(--teal-bg);
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.45;
}
button.theme-exposed-edit.secondary {
  border-color: #d3dde6;
  background: #f0f4f7;
  color: #526579;
}
button.theme-exposed-edit:hover,
.lstk2 button.theme-t:hover {
  border-color: #91a8ba;
  background: #e6eff3;
  color: #263d54;
}
button.theme-exposed-edit:focus-visible,
.lstk2 button.theme-t:focus-visible {
  outline: 2px solid #6d879f;
  outline-offset: 1px;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 1px 2px;
  padding: 1px 6px;
  border: 1px solid #bedfe1;
  border-radius: 4px;
  background: var(--teal-bg);
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 650;
}
.tag.tag-off { opacity: .5; text-decoration: line-through; }
.corrected { color: var(--teal); }
.corrected::after { content: "✍"; margin-left: 2px; font-size: 9px; }


/* 市场周期固定条(顶栏卡片第二行,人为标注 启动/主升/轮动/退潮) */
.cycle-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  min-width: 0;
  flex-wrap: wrap;
}
.cycle-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.cycle-opt {
  min-height: 24px;
  padding: 2px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.cycle-opt:hover { border-color: #9fb0c0; color: #526174; }
/* A股语境:主升=红(up),退潮=绿(down),启动=暖黄(warn),轮动=蓝(accent) */
.cycle-opt.is-active[data-cycle="启动"] { color: var(--warn); border-color: #ead0a8; background: var(--warn-bg); }
.cycle-opt.is-active[data-cycle="主升"] { color: var(--up); border-color: #edc2c5; background: var(--up-bg); }
.cycle-opt.is-active[data-cycle="轮动"] { color: var(--accent); border-color: #b9cbe8; background: var(--accent-bg); }
.cycle-opt.is-active[data-cycle="退潮"] { color: var(--down); border-color: #b9d9d1; background: var(--down-bg); }
.cycle-opt.is-active { font-weight: 760; }
.cycle-note { color: var(--muted); font-size: 10.5px; }
