:root{
  --bg:#f5f6f8;
  --card:#ffffff;
  --line:#e6e8ec;
  --line-soft:#f0f1f4;
  --text:#1a1d23;
  --text-2:#5b6270;
  --text-3:#8b93a1;
  --brand:#2b4a8b;
  --brand-soft:#eef2fa;
  --up:#d64545;      /* 中国习惯：涨红 */
  --down:#0f9d58;    /* 跌绿 */
  --radius:14px;
  --shadow:0 1px 2px rgba(16,24,40,.04),0 8px 24px rgba(16,24,40,.05);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;max-width:100%;overflow-x:hidden}
body{
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:14px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{margin:0;font-weight:600;letter-spacing:-.01em}
button{font-family:inherit;cursor:pointer}
input,select{font-family:inherit;font-size:14px}

/* ---------- 顶栏 ---------- */
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  gap:16px;padding:16px 24px;background:var(--card);
  border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30;
}
.brand{display:flex;align-items:center;gap:12px}
.logo{
  display:grid;place-items:center;width:40px;height:40px;border-radius:11px;
  background:linear-gradient(135deg,#2b4a8b,#3f6bc4);color:#fff;
  font-weight:700;font-size:13px;letter-spacing:.02em;
}
.brand-txt h1{font-size:17px}
.brand-txt p{margin:0;font-size:11.5px;color:var(--text-3)}
.topbar-right{display:flex;align-items:center;gap:10px}
.pill{
  font-size:11.5px;padding:4px 10px;border-radius:999px;
  background:var(--brand-soft);color:var(--brand);font-weight:600;
}

/* ---------- 布局 ---------- */
.layout{
  display:grid;grid-template-columns:380px minmax(0,1fr);
  gap:18px;padding:18px 24px 48px;align-items:start;max-width:1560px;margin:0 auto;
}
.panel{
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);
  min-width:0;
}
.panel-config{padding:18px;position:sticky;top:88px}
.panel-result{padding:18px;min-height:520px;min-width:0}
.panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:14px}
.panel-head h2{font-size:15px}
.hint{font-size:11.5px;color:var(--text-3)}

/* ---------- 表单 ---------- */
.field{margin-bottom:12px}
.field label{display:block;font-size:12px;color:var(--text-2);margin-bottom:5px;font-weight:500}
input[type=text],input[type=number],input[type=date],input[type=email],input[type=password],select{
  width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:9px;
  background:#fff;color:var(--text);outline:none;transition:.15s;
}
input:focus,select:focus{border-color:#9db3e0;box-shadow:0 0 0 3px rgba(43,74,139,.08)}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* 投资方式切换 */
.seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:#f2f4f8;border-radius:10px;border:1px solid var(--line)}
.seg-btn{
  border:0;background:transparent;cursor:pointer;font-family:inherit;
  font-size:12.5px;font-weight:600;color:var(--text-2);
  padding:7px 4px;border-radius:7px;transition:.16s;
}
.seg-btn.is-on{background:var(--card);color:var(--brand);box-shadow:0 1px 3px rgba(16,24,40,.12)}
.block{margin:14px 0}
.block-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.block-head label{font-size:12px;color:var(--text-2);font-weight:500}
.small{font-size:11.5px;color:var(--text-3)}
.tiny{font-size:11px;color:var(--text-3)}

/* ---------- 搜索 ---------- */
.search-wrap{position:relative;margin-bottom:10px}
.search-results{
  position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:40;
  background:#fff;border:1px solid var(--line);border-radius:10px;
  box-shadow:0 10px 30px rgba(16,24,40,.12);max-height:290px;overflow:auto;
}
.sr-item{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:9px 12px;cursor:pointer;border-bottom:1px solid var(--line-soft)}
.sr-item:last-child{border-bottom:0}
.sr-item:hover,.sr-item.active{background:var(--brand-soft)}
.sr-name{font-size:13px;font-weight:500}
.sr-meta{font-size:11px;color:var(--text-3);display:flex;gap:6px;align-items:center}
.sr-tag{background:#f2f3f6;border-radius:5px;padding:1px 6px;font-size:10.5px;color:var(--text-2)}

/* ---------- 标的行 ---------- */
.items{display:flex;flex-direction:column;gap:8px}
.item-row{
  padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:#fcfcfd;
}
.item-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.item-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:4px}
.item-name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.item-code{display:flex;align-items:center;gap:5px;font-size:11px;color:var(--text-3);min-width:0;overflow:hidden}
.item-amt{display:flex;align-items:center;gap:3px;flex:none}
.item-amt input{width:76px;padding:5px 7px;font-size:12.5px;text-align:right;border-radius:7px}
.item-amt span{font-size:11px;color:var(--text-3)}
.div-wrap{display:inline-flex;align-items:center;gap:2px;font-size:10.5px;color:var(--text-3);white-space:nowrap}
.div-in{width:40px;padding:1px 4px;font-size:10.5px;border-radius:5px;border:1px solid var(--line);text-align:right}
.item-del{
  width:24px;height:24px;flex:none;border:0;background:transparent;color:var(--text-3);
  border-radius:6px;font-size:16px;line-height:1;
}
.item-del:hover{background:#fdecec;color:var(--up)}
.add-row{margin-top:9px}

/* ---------- 按钮 ---------- */
button.primary,button.ghost{
  padding:9px 16px;border-radius:9px;font-size:13px;font-weight:600;border:1px solid transparent;transition:.15s;
}
button.primary{background:var(--brand);color:#fff}
button.primary:hover{background:#233c72}
button.ghost{background:#fff;border-color:var(--line);color:var(--text-2)}
button.ghost:hover{border-color:#c9d3e6;color:var(--brand)}
button.primary:disabled,button.ghost:disabled{opacity:.55;cursor:not-allowed}
.small-btn{padding:6px 11px;font-size:12px}
.actions{display:flex;gap:8px;margin-top:16px}
.actions .primary{flex:1}
.msg{margin-top:10px;font-size:12px;min-height:16px}
.msg.err{color:var(--up)}
.msg.ok{color:var(--down)}

/* ---------- 结果 ---------- */
.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;height:480px;color:var(--text-3)}
.empty-icon{font-size:34px;margin-bottom:6px;opacity:.85}
.empty h3{font-size:15px;color:var(--text-2);margin-bottom:4px}
.empty p{margin:2px 0;font-size:12.5px}

.kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:10px}
.kpi{
  background:#fbfbfc;border:1px solid var(--line-soft);border-radius:11px;padding:11px 12px;
}
.kpi span{display:block;font-size:11px;color:var(--text-3);margin-bottom:2px}
.kpi strong{font-size:17px;font-weight:650;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.kpi strong.up{color:var(--up)}
.kpi strong.down{color:var(--down)}

.chart-card,.table-card{border:1px solid var(--line-soft);border-radius:12px;padding:13px;margin-bottom:14px}
.chart-head,.table-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
.chart-head h3,.table-head h3{font-size:13px}
.legend{display:flex;gap:12px;font-size:11px;color:var(--text-3)}
.legend i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:4px}
.dot-value{background:#2b4a8b}
.dot-cost{background:#b9c0cc}
.chart{width:100%;height:260px}

.table-scroll{overflow:auto;max-height:330px}
.table-scroll.tall{max-height:420px}
table{width:100%;border-collapse:collapse;font-size:12.5px}
th,td{padding:7px 9px;text-align:right;white-space:nowrap;border-bottom:1px solid var(--line-soft)}
th{font-weight:600;color:var(--text-3);font-size:11.5px;position:sticky;top:0;background:#fff;z-index:2}
th:first-child,td:first-child{text-align:left}
th:nth-child(2),td:nth-child(2){text-align:left}
tbody tr:hover{background:#fafbfc}
.up{color:var(--up)}
.down{color:var(--down)}
.mono{font-variant-numeric:tabular-nums}
.tag{font-size:10.5px;background:#f2f3f6;color:var(--text-2);border-radius:5px;padding:1px 6px}

/* ---------- 弹窗 ---------- */
.modal{position:fixed;inset:0;background:rgba(16,24,40,.42);display:grid;place-items:center;z-index:100;padding:20px}
.modal-box{background:#fff;border-radius:16px;padding:22px;width:100%;max-width:400px;position:relative;
  box-shadow:0 20px 60px rgba(16,24,40,.2)}
.modal-close{position:absolute;top:12px;right:14px;border:0;background:transparent;font-size:22px;color:var(--text-3);line-height:1}
.auth-actions{display:flex;gap:8px;margin-top:12px}
.auth-actions button{flex:1}
.plans-list{display:flex;flex-direction:column;gap:8px;margin-top:12px;max-height:400px;overflow:auto}
.plan-row{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.plan-row:hover{border-color:#c9d3e6}
.plan-name{font-size:13px;font-weight:600}
.plan-meta{font-size:11px;color:var(--text-3)}
.plan-acts{display:flex;gap:6px}

.hidden{display:none!important}

/* ---------- 响应式 ---------- */
@media (max-width:1100px){
  .layout{grid-template-columns:minmax(0,1fr)}
  .panel-config{position:static}
  .kpis{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:640px){
  .topbar{padding:12px 14px;gap:8px}
  .brand-txt p{display:none}
  .brand-txt h1{font-size:15px}
  .logo{width:34px;height:34px;font-size:12px;border-radius:9px}
  #btnAccount{padding:7px 10px;font-size:12px}
  .layout{padding:12px 12px 40px;gap:12px}
  .panel-config,.panel-result{padding:14px}
  .kpis{grid-template-columns:repeat(2,1fr);gap:8px}
  .kpi{padding:9px 10px}
  .kpi strong{font-size:15px}
  .grid2{grid-template-columns:1fr}
  .chart{height:210px}
  .pill{display:none}
  .chart-card,.table-card{padding:11px}
}

/* ---------- 2026-10-18：组合 / 计划 / 分享 ---------- */
textarea{
  width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:9px;
  background:#fff;color:var(--text);outline:none;transition:.15s;
  font-family:inherit;font-size:13.5px;line-height:1.5;resize:vertical;min-height:44px;
}
textarea:focus{border-color:#9db3e0;box-shadow:0 0 0 3px rgba(43,74,139,.08)}
.seg-lg{margin-bottom:14px}
.seg-lg .seg-btn{padding:9px 4px;font-size:13px}
.divider{display:flex;align-items:center;gap:10px;margin:18px 0 12px;color:var(--text-3);font-size:11.5px}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line)}
.muted-tip{color:var(--text-3);font-size:11px;margin:8px 0 0;line-height:1.5}
.modal-wide{max-width:560px}

/* 组合成员行 */
.member-row{padding:10px 11px;border:1px solid var(--line);border-radius:10px;background:#fcfcfd}
.member-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.member-name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.member-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:4px}
.member-sub{font-size:11px;color:var(--text-3);display:flex;gap:6px;align-items:center;min-width:0;overflow:hidden}
.member-amt{display:flex;align-items:center;gap:3px;flex:none}
.member-amt input{width:82px;padding:5px 7px;font-size:12.5px;text-align:right;border-radius:7px}
.member-amt span{font-size:11px;color:var(--text-3)}

/* 结果元信息行 */
.result-meta{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:11.5px;color:var(--text-3);margin:-4px 0 14px}
.result-meta span{position:relative}
.result-meta span+span::before{content:"·";position:absolute;left:-9px;color:var(--line)}

/* 分享卡片 */
.share-card{border:1px solid var(--brand-soft);background:var(--brand-soft);border-radius:12px;padding:14px}
.share-card h3{font-size:13px;margin-bottom:4px}
.share-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:2px}
.share-card .small{color:var(--text-2)}
.share-actions{display:flex;gap:8px;margin-top:11px;flex-wrap:wrap}
.share-actions input{flex:1;min-width:150px;font-size:12px;padding:7px 10px}
.switch{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--text-2);cursor:pointer;user-select:none}
.switch input{width:15px;height:15px;accent-color:var(--brand);margin:0;cursor:pointer}

/* 计划汇总表 */
.sum-row td{font-variant-numeric:tabular-nums}
@media (max-width:640px){
  .kpi strong{font-size:15px}
  .share-actions input{min-width:0;width:100%}
}
