/* 财富管理系统：个人资产页 + 投资页共用样式（沿用积分页的奶油/棕色调） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', 'PingFang SC', sans-serif; background: #fdf6e3; color: #3d2b1a; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }

.topbar {
  background: #fff8ee; border-bottom: 2px solid #e8d5b0;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 5;
}
.topbar a { color: #8b5e3c; text-decoration: none; font-size: 14px; white-space: nowrap; }
.topbar a:hover { text-decoration: underline; }
.topbar-title { font-size: 18px; font-weight: 700; flex: 1; text-align: center; }

.container { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }

.card {
  background: #fffdf8; border: 1px solid #ecdcbc; border-radius: 16px;
  padding: 18px; margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 700; color: #8b5e3c; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .spacer { flex: 1; }

.hero {
  background: linear-gradient(135deg, #f9a825, #fb8c00); color: #fff;
  border-radius: 18px; padding: 22px 20px; margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(251,140,0,0.28);
}
.hero.invest { background: linear-gradient(135deg, #43a047, #00897b); box-shadow: 0 4px 16px rgba(0,137,123,0.28); }
.hero-label { font-size: 13px; opacity: 0.9; display: flex; align-items: center; gap: 8px; }
.hero-number { font-size: 40px; font-weight: 800; line-height: 1.15; margin-top: 4px; word-break: break-all; }
.hero-sub { font-size: 14px; opacity: 0.92; margin-top: 4px; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 16px; }
.hero-cell { background: rgba(255,255,255,0.16); border-radius: 10px; padding: 8px 10px; }
.hero-cell .k { font-size: 12px; opacity: 0.88; }
.hero-cell .v { font-size: 16px; font-weight: 700; margin-top: 2px; }
.hero .pos, .hero .flat { color: #fff; } .hero .neg { color: #ffe0dc; }

.seg { display: inline-flex; background: #f3e6cc; border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: #8b5e3c; }
.seg button.on { background: #fff; color: #3d2b1a; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.hero .seg { background: rgba(255,255,255,0.22); }
.hero .seg button { color: #fff; }
.hero .seg button.on { background: #fff; color: #e07b00; }

.pos { color: #2e7d32; } .neg { color: #c62828; } .flat { color: #8b7a66; }
.muted { color: #9a8a74; font-size: 12px; }
.note { font-size: 12px; color: #9a8a74; margin-top: 8px; }
.warn { background: #fff3e0; color: #b45309; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }

/* 资产构成横向条 */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row .bar-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; gap: 8px; }
.bar-row .bar-head b { font-weight: 700; }
.bar-track { height: 14px; background: #f3e6cc; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .4s; }

.chart-wrap { width: 100%; }
.line-chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.axis-label { font-size: 12px; fill: #9a8a74; }
.hover-text { font-size: 13px; font-weight: 700; fill: #3d2b1a; }
.chart-empty { text-align: center; color: #b8a88f; padding: 36px 0; font-size: 14px; }

/* 表单 */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: #8b5e3c; margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 9px 10px; border: 1px solid #e3cfa8; border-radius: 10px; background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid #f9a825; border-color: transparent; }
.btn {
  border: none; border-radius: 10px; padding: 10px 18px; font-weight: 700; cursor: pointer;
  background: #2e7d32; color: #fff; transition: background .2s;
}
.btn:hover:not(:disabled) { background: #1b5e20; }
.btn:disabled { background: #bbb; cursor: not-allowed; }
.btn.sell { background: #c62828; } .btn.sell:hover:not(:disabled) { background: #8e1b1b; }
.btn.ghost { background: transparent; color: #8b5e3c; border: 1px solid #e3cfa8; }
.btn.ghost:hover:not(:disabled) { background: #f8ecd4; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.msg { margin-top: 10px; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.msg.ok { background: #e8f5e9; color: #2e7d32; }
.msg.err { background: #fce4ec; color: #c62828; }

/* 列表 */
.list { list-style: none; }
.item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #efe1c4; }
.item:last-child { border-bottom: none; }
.item .main { flex: 1; min-width: 0; }
.item .title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.item .sub { font-size: 12px; color: #9a8a74; margin-top: 2px; }
.item .amt { font-weight: 700; text-align: right; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f3e6cc; color: #8b5e3c; margin-left: 4px; vertical-align: 1px; font-weight: 600; }
.tag.green { background: #e8f5e9; color: #2e7d32; }
.empty { text-align: center; color: #bbb; padding: 22px 0; font-size: 14px; }
.icon-btn { border: none; background: none; color: #c4a882; cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.icon-btn:hover { color: #c62828; background: #fce4ec; }

/* 投资页：搜索 + 报价 */
.search-box { position: relative; }
.search-box input { width: 100%; padding: 12px 14px; border: 1px solid #e3cfa8; border-radius: 12px; background: #fff; font-size: 15px; }
.results { list-style: none; margin-top: 6px; }
.results li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.results li:hover, .results li:focus { background: #f8ecd4; outline: none; }
.results .tk { font-weight: 800; min-width: 56px; }
.results .nm { font-size: 13px; color: #6d5843; flex: 1; }
.quote-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.quote-head .tk { font-size: 22px; font-weight: 800; }
.quote-head .nm { font-size: 13px; color: #6d5843; flex-basis: 100%; }
.quote-price { font-size: 30px; font-weight: 800; }
.range { margin: 14px 0 4px; }
.range-track { position: relative; height: 6px; background: #f3e6cc; border-radius: 999px; margin: 6px 0; }
.range-dot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #e07b00; transform: translate(-50%, -50%); border: 2px solid #fff; }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; color: #9a8a74; }
.estimate { background: #f8f1e2; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 10px; line-height: 1.6; }
.confirm { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }

.pos-card { border-bottom: 1px solid #efe1c4; padding: 12px 0; }
.pos-card:last-child { border-bottom: none; }
.pos-top { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.pos-top .tk { font-weight: 800; font-size: 16px; }
.pos-top .nm { font-size: 12px; color: #9a8a74; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px 12px; margin-top: 8px; font-size: 13px; }
.pos-grid .k { color: #9a8a74; font-size: 11px; }
.pos-grid .v { font-weight: 700; }
.lots { margin-top: 10px; background: #faf3e4; border-radius: 10px; padding: 4px 12px; }
.lot { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #e8d5b0; font-size: 13px; flex-wrap: wrap; }
.lot:last-child { border-bottom: none; }
.lot .main { flex: 1; min-width: 160px; }

@media (max-width: 480px) {
  .hero-number { font-size: 32px; }
  .topbar-title { font-size: 16px; }
}

/* 自选 */
.watch-row { cursor: pointer; border-radius: 8px; }
.watch-row:hover { background: #faf3e4; }
#qWatch { margin-left: auto; }
#qWatch[data-on="1"] { color: #e07b00; border-color: #f6c56b; background: #fff6e0; }
