/* networth-page.css - 内置版「每日净资产」页面样式（嵌入主应用 SPA）
 * 仅保留卡片/按钮/图表/记录视觉，不含独立页的 body 滚动解锁（主应用 .page 自带内部滚动）。
 */

/* 页面容器：参照 journal.css 已验证模式，PC 端 .main(overflow:hidden + 固定高度) 内必须显式声明 height + overflow-y:auto */
#pageNetworth {
  position: relative;
  display: block;
  width: 100%;
  height: calc(100dvh - 72px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.nw-main { max-width: 680px; margin: 0 auto; padding: 16px 16px 32px; }

/* 手动同步今日净资产（主操作按钮） */
.nw-sync-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  margin-bottom: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.34);
  transition: transform .12s ease, box-shadow .12s ease;
  text-align: left;
}
.nw-sync-btn:active { transform: translateY(1px) scale(.992); box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3); }
.nw-sync-ico { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.nw-sync-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nw-sync-txt { font-size: 15px; font-weight: 800; letter-spacing: .3px; }
.nw-sync-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.82); line-height: 1.4; }

.nw-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.nw-card-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: #0f172a; }

.nw-threshold-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #475569;
}
.nw-input {
  width: 90px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  text-align: right;
  font-family: inherit;
}
.nw-btn {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.28);
  font-family: inherit;
}
.nw-hint { font-size: 11px; color: #94a3b8; margin-top: 10px; line-height: 1.5; }

.nw-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nw-sum-item { background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(99, 102, 241, 0.1); border-radius: 14px; padding: 12px; }
.nw-sum-label { font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.nw-sum-val { font-size: 18px; font-weight: 800; color: #0f172a; line-height: 1.3; }
.nw-sum-val.up { color: #f43f5e; }   /* 涨红 */
.nw-sum-val.down { color: #10b981; } /* 跌绿 */
.nw-sum-sub { font-size: 10px; color: #94a3b8; margin-top: 4px; }

.nw-chart { width: 100%; }
.nw-svg { width: 100%; height: auto; display: block; }

.nw-records { display: flex; flex-direction: column; gap: 10px; }
.nw-rec {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
}
.nw-rec.danger { border: 1px solid rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.06); }
.nw-rec-date { font-size: 13px; color: #475569; font-weight: 600; }
.nw-rec-amount { font-size: 15px; font-weight: 800; color: #0f172a; margin-top: 2px; }
.nw-rec-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.nw-rec-delta { font-size: 14px; font-weight: 700; }
.nw-rec-delta.up { color: #f43f5e; }
.nw-rec-delta.down { color: #10b981; }
.nw-warn-tag { font-size: 10px; color: #f43f5e; background: rgba(244, 63, 94, 0.1); padding: 2px 6px; border-radius: 6px; }
.nw-ack-btn {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.06);
  color: #6366f1;
  cursor: pointer;
  font-family: inherit;
}
.nw-empty { font-size: 13px; color: #94a3b8; text-align: center; padding: 20px 0; line-height: 1.6; }

.nw-toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}
.nw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 桌面端（≥1024px）：主应用 .page 全宽，净值内容用双列仪表盘更紧凑 */
@media (min-width: 1024px) {
  .nw-main {
    max-width: none;
    margin: 0;
    padding: 28px 48px 56px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-areas:
      "sync      sync"
      "summary   summary"
      "chart     records"
      "threshold records";
    gap: 20px;
    align-content: start;
  }
  .nw-sync-btn { grid-area: sync; width: auto; align-self: start; }
  .nw-summary { grid-area: summary; grid-template-columns: repeat(4, 1fr); }
  .nw-chart-card { grid-area: chart; }
  .nw-records-card { grid-area: records; }
  .nw-threshold { grid-area: threshold; }
  .nw-records { max-height: 560px; overflow-y: auto; }
}
