:root { color-scheme: light; --ink: #183b3b; --muted: #647777; --accent: #18786e; --line: #dfe9e5; }
* { box-sizing: border-box; }
html { background: #f3f6f3; }
body { max-width: 1120px; margin: 36px auto; padding: 0 24px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink); line-height: 1.65; }
.hero { padding: 30px 36px; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 20px; background: #eaf3ed; }
.eyebrow { margin: 0 0 12px; font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--accent); }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.3; letter-spacing: -1px; margin: 0 0 14px; }
.desc { color: #365c58; font-size: 17px; margin-bottom: 10px; }
.hero-note { color: var(--muted); font-size: 14px; max-width: 760px; margin: 0; }
.method-link { display: inline-block; margin-top: 14px; color: var(--accent); font-size: 13px; text-decoration: none; }
.method-link:hover { text-decoration: underline; }
.panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 28px; margin-bottom: 22px; box-shadow: 0 4px 20px #183b3b03; }
.section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.step-number { flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; background: #edf5f0; color: var(--accent); border-radius: 11px; font-size: 13px; font-weight: 700; }
.panel h2 { font-size: 19px; margin: 0; }
.section-heading p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.section-note { margin: -4px 0 20px; padding: 12px 16px; background: #f5f8f5; border-radius: 10px; color: var(--muted); font-size: 13px; }
.parameter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.form-row { margin: 0; }
label { color: #365551; font-size: 13px; }
input, textarea { padding: 11px 12px; border-color: #d7e2dc; border-radius: 8px; color: var(--ink); font-family: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #18786e15; }
button { background: var(--accent); font-family: inherit; font-weight: 600; border-radius: 8px; padding: 11px 17px; transition: filter .15s; }
button:hover { filter: brightness(.94); }
button:focus-visible { outline: 3px solid #66b3a6; outline-offset: 3px; }
.btn-secondary { color: #286357; background: #eaf3ed; }
.btn-danger { color: #a55048; background: #fbefed; font-weight: 400; }
.mini-btn { padding: 9px 12px; font-size: 12px; }
.group-card { padding: 20px; background: #fbfcfa; border-color: var(--line); border-radius: 12px; margin: 0; min-width: 0; }
#riskGroupContainer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.group-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.group-title { color: var(--accent); font-size: 13px; margin-bottom: 16px; }
.row-inline { align-items: end; gap: 10px; margin-bottom: 14px; }
.row-inline > div { min-width: 0; }
.fund-name-preview { display: block; min-height: 20px; overflow-wrap: anywhere; }
.row-inline:has(.fund-name-preview) { align-items: flex-start; }
.row-inline:has(.fund-name-preview) > button { margin-top: 28px; }
.hint { color: var(--muted); line-height: 1.7; margin: 6px 0 0; }
.budget-summary { display: inline-block; padding: 7px 12px; background: #f0f6f1; color: #386258; border-radius: 8px; margin: 16px 0 4px; font-size: 12px; }
.calculate-actions { align-items: center; justify-content: space-between; padding: 8px 4px 20px; }
#calcBtn { min-width: 200px; padding: 14px 24px; box-shadow: 0 4px 12px #18786e18; }
#result { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.empty-state { text-align: center; padding: 28px 12px; }
.empty-state h2 { font-size: 20px; margin: 12px 0 8px; }
.empty-state p { color: var(--muted); font-size: 13px; margin: 0; }
.result-title { font-size: 22px; }
.result-date { color: var(--muted); font-size: 13px; }
.weight-table { font-size: 13px; }
.weight-table th { background: #f0f6f1; font-weight: 600; color: #365551; }
.weight-table th, .weight-table td { border-color: var(--line); padding: 12px; }
.weight-table th.text-right, .weight-table td.text-right { text-align: right; font-variant-numeric: tabular-nums; }
.metric-card { background: #f0f6f1; border-radius: 12px; }
.backtest-details { border-color: var(--line); border-radius: 12px; }
.site-footer { margin-top: 32px; line-height: 1.6; }
.site-footer-inner { flex-wrap: wrap; justify-content: center; row-gap: 12px; }
@media (max-width: 760px) {
  body { margin: 16px auto; padding: 0 14px; }
  .hero { padding: 24px; border-radius: 18px; }
  .panel, #result { padding: 20px; }
  #riskGroupContainer { grid-template-columns: 1fr; }
  .group-card { padding: 16px; }
  .calculate-actions { gap: 16px; }
  #calcBtn { width: 100%; }
}
@media (max-width: 440px) {
  .parameter-grid { grid-template-columns: 1fr; gap: 18px; }
  .group-card > .row-inline, #lowRiskContainer > .row-inline { flex-wrap: wrap; }
  .group-card > .row-inline > div, #lowRiskContainer > .row-inline > div { flex: 1 1 38%; }
  .group-card > .row-inline > button, #lowRiskContainer > .row-inline > button { margin-left: auto; }
  .hero { padding: 22px; }
  .section-heading { gap: 10px; }
}
