* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8; color: #1f2329; font-size: 13px;
}
.topbar {
  display: flex; align-items: center; gap: 24px;
  height: 54px; padding: 0 20px; background: #fff;
  border-bottom: 1px solid #e5e6eb; position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 16px; font-weight: 600; white-space: nowrap; }
.search { position: relative; flex: 0 0 320px; }
.search input {
  width: 100%; height: 34px; padding: 0 12px; border: 1px solid #d0d3d9;
  border-radius: 6px; font-size: 13px; outline: none;
}
.search input:focus { border-color: #3370ff; }
.suggest {
  position: absolute; top: 38px; left: 0; right: 0; background: #fff;
  border: 1px solid #e5e6eb; border-radius: 6px; list-style: none;
  max-height: 320px; overflow: auto; z-index: 20; box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.suggest li { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; }
.suggest li:hover { background: #f2f3f5; }
.suggest .code { color: #8a8f99; }
.conn { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.conn label { color: #8a8f99; }
.conn input { height: 30px; width: 200px; padding: 0 8px; border: 1px solid #d0d3d9; border-radius: 6px; }
.conn button { height: 30px; padding: 0 12px; border: none; background: #3370ff; color: #fff; border-radius: 6px; cursor: pointer; }

.layout { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }
.side { flex: 0 0 320px; display: flex; flex-direction: column; gap: 14px; }
.charts { flex: 1 1 auto; min-width: 0; }
.card { background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 14px; }
.card h3 { font-size: 13px; margin-bottom: 10px; color: #4e5969; font-weight: 600; }
.info-body { line-height: 1.9; }
.info-body .row { display: flex; gap: 8px; }
.info-body .k { color: #8a8f99; flex: 0 0 84px; }
.info-body .v { color: #1f2329; flex: 1; word-break: break-all; }
.info-body .name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.fin-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fin-body th, .fin-body td { border: 1px solid #eef0f3; padding: 4px 6px; text-align: right; }
.fin-body th { background: #f7f8fa; color: #4e5969; }
.fin-body td:first-child, .fin-body th:first-child { text-align: left; }

.chart-card { padding: 12px 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#chartTitle { font-weight: 600; }
.range .rbtn { border: 1px solid #d0d3d9; background: #fff; padding: 4px 10px; margin-left: 6px; border-radius: 6px; cursor: pointer; }
.range .rbtn.active { background: #3370ff; color: #fff; border-color: #3370ff; }
.chart { width: 100%; height: 520px; }
.chart.sm { height: 130px; margin-top: 4px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px;
  opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: .92; }

/* ---- 行情/财务 Tab ---- */
.tabs { display: flex; gap: 4px; }
.tab { border: none; background: transparent; padding: 6px 14px; font-size: 14px; color: #4e5969; cursor: pointer; border-radius: 6px 6px 0 0; border-bottom: 2px solid transparent; }
.tab:hover { color: #1f2329; }
.tab.active { color: #3370ff; font-weight: 600; border-bottom-color: #3370ff; }

/* ---- 行情信息条（同花顺风格） ---- */
.quote-bar { display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px; padding: 2px 2px 10px; }
.quote-bar .qdate { font-size: 13px; color: #8a8f99; align-self: center; font-variant-numeric: tabular-nums; }
.quote-bar .last { font-size: 26px; font-weight: 700; line-height: 1; }
.quote-bar .chg { font-size: 14px; font-weight: 600; }
.quote-bar .ma { display: flex; gap: 12px; font-size: 12px; color: #4e5969; margin-left: auto; }
.quote-bar .ma b { font-weight: 600; }
.quote-bar .up { color: #ef232a; }
.quote-bar .down { color: #14b143; }

/* ---- 财务视图 ---- */
.fin-view { display: none; }
.fin-toolbar { display: flex; align-items: baseline; gap: 12px; padding: 2px 2px 8px; }
.fin-title { font-size: 15px; font-weight: 600; }
.fin-hint { font-size: 12px; color: #8a8f99; }
.chart.fin { height: 520px; }

/* ---- 复权切换 ---- */
.adj-toggle { margin-left: 10px; display: inline-flex; border: 1px solid #d0d3d9; border-radius: 6px; overflow: hidden; vertical-align: middle; }
.adjbtn { border: none; background: #fff; padding: 4px 10px; font-size: 12px; color: #4e5969; cursor: pointer; }
.adjbtn + .adjbtn { border-left: 1px solid #d0d3d9; }
.adjbtn.active { background: #3370ff; color: #fff; }

/* ---- 周期切换（日/周/月） ---- */
.period-toggle { display: inline-flex; border: 1px solid #d0d3d9; border-radius: 6px; overflow: hidden; vertical-align: middle; margin-right: 4px; }
.pbtn { border: none; background: #fff; padding: 4px 10px; font-size: 12px; color: #4e5969; cursor: pointer; }
.pbtn + .pbtn { border-left: 1px solid #d0d3d9; }
.pbtn.active { background: #3370ff; color: #fff; }

/* ---- 数据同步 ---- */
.sync { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.sync-btn { border: 1px solid #3370ff; background: #3370ff; color: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.sync-btn:hover { background: #2860e0; }
.sync-btn:disabled { background: #c9cdd4; border-color: #c9cdd4; cursor: not-allowed; }
.sync-status { font-size: 12px; color: #4e5969; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
