:root {
  --paper: #f1ede3;
  --paper-deep: #e8e1d4;
  --paper-light: #faf7ef;
  --ink: #242722;
  --muted: #77786f;
  --line: rgba(45, 45, 38, .17);
  --dark: #1d211e;
  --cream: #f7f2e8;
  --green: #3a785e;
  --terracotta: #b96043;
  --slate: #6f7480;
  --shadow: 0 14px 28px rgba(45, 37, 25, .09);
}

* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; }
body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url('/assets/paper-texture.webp');
  background-repeat: repeat;
  background-size: 680px 680px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-wrap: anywhere;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #c77958; outline-offset: 3px; }
button, input { font: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }

.module-bar {
  position: relative;
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  align-items: stretch;
  color: var(--cream);
  background: var(--dark);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.module-brand,
.module-page,
.module-actions { min-width: 0; display: flex; align-items: center; }
.module-brand {
  padding: 0 24px;
  border-right: 1px solid rgba(255, 255, 255, .12);
  font-family: ui-serif, "Songti SC", STSong, serif;
  font-size: 15px;
  font-weight: 620;
}
.module-brand:hover,.module-home:hover { background: rgba(255, 255, 255, .07); }
.module-page { gap: 12px; padding: 0 22px; overflow: hidden; }
.module-current {
  overflow: hidden;
  color: #fffaf0;
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-status {
  flex: 0 0 auto;
  color: rgba(247, 242, 232, .62);
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .08em;
  white-space: nowrap;
}
.module-actions { padding: 0 18px; border-left: 1px solid rgba(255, 255, 255, .1); }
.module-home { min-height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid rgba(255,255,255,.24); color: #fff8ee; font-size: 10px; font-weight: 700; }

.masthead {
  min-height: 158px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 184px;
  align-items: center;
  color: var(--cream);
  background-color: var(--dark);
  background-image: url('/assets/paper-texture.webp');
  background-blend-mode: multiply;
  background-size: 620px 620px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.masthead > div:first-child { padding: 26px clamp(28px, 5vw, 68px); }
.eyebrow, .section-kicker {
  margin: 0 0 9px;
  color: var(--terracotta);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.masthead .eyebrow { color: #e7b091; }
.masthead h1 {
  margin: 0;
  font-family: ui-serif, "Songti SC", STSong, serif;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 540;
  letter-spacing: -.045em;
}
.masthead-note { max-width: 710px; margin: 10px 0 0; color: rgba(247, 242, 232, .54); font-size: 11px; line-height: 1.6; }
.date-block {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 30px;
  border-left: 1px solid rgba(255, 255, 255, .11);
  text-align: right;
}
.date-block strong { color: #e7b091; font: 500 32px/1 ui-serif, Georgia, serif; }
.date-block span { margin-top: 8px; color: rgba(247, 242, 232, .48); font-size: 9px; letter-spacing: .1em; }

main { width: min(100%, 1280px); margin: 0 auto; padding: 28px clamp(24px, 4vw, 58px) 64px; }
.fund-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .72fr);
  align-items: center;
  gap: 28px;
  margin-bottom: 14px;
  padding: 20px 22px;
  border: 1px solid rgba(43, 43, 36, .17);
  border-radius: 8px;
  background: rgba(250, 247, 239, .72);
}
.fund-search-panel h2 { margin: 0; font: 620 22px/1.2 ui-serif, "Songti SC", STSong, serif; letter-spacing: -.03em; }
.fund-search-panel p:last-child { margin: 7px 0 0; color: #71726a; font-size: 10px; line-height: 1.55; }
.fund-search-form { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.fund-search-form label { color: #6c6e66; font-size: 9px; font-weight: 740; white-space: nowrap; }
.fund-search-form input {
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(43, 43, 36, .22);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 253, 247, .9);
  font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}
.fund-search-form input[aria-invalid="true"] { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(185, 96, 67, .1); }
.fund-search-form button, .refresh-fund-button, .error-panel button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #2f634e;
  border-radius: 4px;
  color: #fffaf0;
  background: #356e57;
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
  white-space: nowrap;
}
.fund-search-form button:hover, .refresh-fund-button:hover, .error-panel button:hover { background: #2c5c49; }
.refresh-fund-button:disabled { cursor: wait; opacity: .58; }
.decision-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(390px, .65fr);
  border: 1px solid rgba(43, 43, 36, .17);
  border-top: 3px solid var(--terracotta);
  border-radius: 8px;
  background: rgba(250, 247, 239, .82);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.decision-copy { padding: 22px 24px 20px; }
.decision-copy h2, .section-heading h2, .method-panel h2, .panel h2 {
  margin: 0;
  font-family: ui-serif, "Songti SC", STSong, serif;
  font-weight: 620;
  letter-spacing: -.03em;
}
.decision-copy h2 { font-size: clamp(24px, 2.8vw, 34px); }
.decision-copy > p:last-child { max-width: 680px; margin: 10px 0 0; color: #666860; font-size: 12px; line-height: 1.7; }
.decision-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-left: 1px solid var(--line);
  background: rgba(232, 225, 212, .45);
}
.decision-facts div { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 18px 14px; text-align: center; }
.decision-facts div + div { border-left: 1px solid var(--line); }
.decision-facts dt { color: #8c8b82; font-size: 9px; letter-spacing: .08em; }
.decision-facts dd { margin: 8px 0 0; font: 650 14px/1.2 ui-serif, "Songti SC", STSong, serif; }

.summary-section { margin-top: 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading h2, .method-panel h2 { font-size: 24px; }
.section-note { max-width: 320px; margin: 0; color: #8c8b82; font-size: 9px; line-height: 1.5; text-align: right; letter-spacing: .04em; }
.fund-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.fund-card {
  --accent: var(--slate);
  min-width: 0;
  border: 1px solid rgba(43, 43, 36, .16);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: rgba(250, 247, 239, .78);
  box-shadow: 0 10px 20px rgba(45, 37, 25, .065);
  overflow: hidden;
}
.fund-card.good { --accent: var(--green); }
.fund-card.bad { --accent: var(--terracotta); }
.fund-card.watch { --accent: #9a7438; }
.fund-card-head { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 16px 12px; border-bottom: 1px solid rgba(43, 43, 36, .1); }
.fund-identity { min-width: 0; }
.rank { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.fund-card h3 { margin: 5px 0 2px; font-family: ui-serif, "Songti SC", STSong, serif; font-size: 19px; font-weight: 660; letter-spacing: -.025em; }
.fund-card small { color: #828278; font-size: 9px; }
.status-pill { flex: 0 0 auto; padding: 5px 7px; border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); color: var(--accent); background: rgba(255, 255, 255, .34); font-size: 8px; font-weight: 740; }
.fund-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 13px 16px; }
.fund-metrics div { min-width: 0; }
.fund-metrics div + div { padding-left: 10px; border-left: 1px solid rgba(43, 43, 36, .11); }
.fund-metrics dt { color: #87877e; font-size: 8px; }
.fund-metrics dd { margin: 5px 0 0; font: 620 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.fund-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 13px; border-top: 1px solid rgba(43, 43, 36, .09); }
.fund-card-foot > div { min-width: 0; }
.fund-card-foot strong { display: block; color: var(--accent); font-size: 10px; }
.fund-card-foot span { display: block; margin-top: 3px; color: #88877e; font-size: 8px; white-space: nowrap; }
.fund-card-foot a { min-height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); color: var(--accent); font-size: 9px; font-weight: 720; }
.fund-card-foot a:hover { background: rgba(255, 255, 255, .48); }

.loading-card { min-height: 186px; padding: 24px 18px; border-top-color: rgba(111, 116, 128, .32); }
.loading-line, .loading-block { border-radius: 3px; background: linear-gradient(90deg, rgba(232,225,212,.7), rgba(250,247,239,.9), rgba(232,225,212,.7)); background-size: 220% 100%; animation: loading-sheen 1.4s ease-in-out infinite; }
.loading-line { width: 54%; height: 13px; margin-top: 12px; }
.loading-line.wide { width: 78%; height: 22px; margin-top: 0; }
.loading-block { height: 55px; margin-top: 26px; }
@keyframes loading-sheen { to { background-position: -120% 0; } }
.error-panel { grid-column: 1 / -1; padding: 24px; border: 1px solid rgba(185, 96, 67, .3); border-top: 3px solid var(--terracotta); border-radius: 8px; background: rgba(250, 247, 239, .82); }
.error-panel strong { font: 650 20px/1.2 ui-serif, "Songti SC", STSong, serif; }
.error-panel p { margin: 9px 0 15px; color: #6f7169; font-size: 10px; }
.error-panel button { min-height: 36px; }

.method-panel { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.method-grid article { padding-left: 15px; border-left: 2px solid var(--line); }
.method-grid strong { font-family: ui-serif, "Songti SC", STSong, serif; font-size: 15px; }
.method-grid p { margin: 7px 0 0; color: #707168; font-size: 10px; line-height: 1.65; }

footer { padding: 22px 24px 30px; border-top: 1px solid var(--line); color: #85847b; font-size: 9px; line-height: 1.6; text-align: center; }

.detail-main { padding-top: 24px; }
.detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back-link { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--line); color: #686a62; background: rgba(250, 247, 239, .52); font-size: 10px; font-weight: 700; }
.back-link:hover { background: rgba(250, 247, 239, .92); }
.refresh-fund-button { min-height: 34px; padding: 0 12px; }
.detail-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr); gap: 14px; margin-top: 16px; }
.detail-hero > div { padding: 24px; border: 1px solid rgba(43, 43, 36, .16); border-radius: 8px; background: rgba(250, 247, 239, .78); box-shadow: var(--shadow); }
.detail-hero h1 { margin: 0; font-family: ui-serif, "Songti SC", STSong, serif; font-size: clamp(34px, 5vw, 54px); font-weight: 540; letter-spacing: -.05em; }
.detail-description { margin: 12px 0 0; color: #696b63; font-size: 12px; line-height: 1.7; }
.verdict-card { border-top: 3px solid var(--terracotta) !important; }
.verdict-card.usable { border-top-color: var(--green) !important; }
.verdict-card > span { color: #87877e; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.verdict-card strong { display: block; margin-top: 10px; color: var(--terracotta); font: 650 28px/1.15 ui-serif, "Songti SC", STSong, serif; }
.verdict-card.usable strong { color: var(--green); }
.verdict-card p { margin: 10px 0 0; color: #696b63; font-size: 11px; line-height: 1.65; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.metric-grid article { min-width: 0; padding: 17px 18px; border: 1px solid rgba(43, 43, 36, .16); border-top: 2px solid var(--slate); border-radius: 8px; background: rgba(250, 247, 239, .74); }
.metric-grid span, .metric-grid small { display: block; color: #85857c; font-size: 9px; }
.metric-grid strong { display: block; margin: 9px 0 7px; font: 650 20px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.metric-grid small { min-height: 26px; line-height: 1.45; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); gap: 14px; margin-top: 14px; }
.panel, .method-details { border: 1px solid rgba(43, 43, 36, .16); border-radius: 8px; background: rgba(250, 247, 239, .76); box-shadow: 0 10px 20px rgba(45, 37, 25, .055); }
.panel { min-width: 0; padding: 20px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.panel-heading h2, .meaning-panel h2 { font-size: 22px; }
.panel-heading > span { color: #87877e; font-size: 9px; white-space: nowrap; }
meter { width: 100%; height: 22px; margin-top: 24px; accent-color: var(--green); }
meter::-webkit-meter-bar { background: var(--paper-deep); border: 1px solid rgba(43, 43, 36, .15); border-radius: 0; }
meter::-webkit-meter-optimum-value { background: var(--green); }
.range-labels { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: #7a7b72; font-size: 9px; }
.range-labels strong { color: var(--ink); }
.panel-note, .meaning-panel > p { margin: 18px 0 0; color: #6f7169; font-size: 10px; line-height: 1.65; }
.meaning-panel h2 { margin-top: 0; color: var(--terracotta); }
.meaning-list { margin: 18px 0 0; }
.meaning-list div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(43, 43, 36, .1); }
.meaning-list dt { font-size: 10px; font-weight: 750; }
.meaning-list dd { margin: 0; color: #74756d; font-size: 9px; line-height: 1.5; }
.records-panel { margin-top: 14px; }
.table-wrap { width: 100%; margin-top: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th, td { padding: 10px 12px; border-bottom: 1px solid rgba(43, 43, 36, .11); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: #87877e; font-size: 8px; letter-spacing: .05em; }
.negative { color: var(--terracotta); }
.positive { color: var(--green); }
.table-state { padding: 24px; color: #85857c; text-align: center !important; }
.details-grid a { color: #32674f; text-decoration: underline; text-decoration-color: rgba(50,103,79,.35); text-underline-offset: 2px; }
.method-details { margin-top: 14px; overflow: hidden; }
.method-details summary { padding: 17px 20px; cursor: pointer; color: #5f6159; font-size: 11px; font-weight: 720; }
.details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0 20px 20px; border-top: 1px solid rgba(43, 43, 36, .1); }
.details-grid section { padding-top: 16px; }
.details-grid h2 { margin: 0; font-family: ui-serif, "Songti SC", STSong, serif; font-size: 15px; }
.details-grid p { margin: 8px 0 0; color: #707168; font-size: 9px; line-height: 1.7; }

@media (max-width: 980px) {
  .fund-search-panel { grid-template-columns: 1fr; gap: 16px; }
  .decision-panel { grid-template-columns: 1fr; }
  .decision-facts { border-top: 1px solid var(--line); border-left: 0; }
  .fund-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-panel { grid-template-columns: 1fr; }
  .detail-hero, .detail-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .module-bar { min-height: 52px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .module-brand { padding: 0 14px; font-size: 0; }
  .module-brand::after { content: "LS"; font-size: 13px; letter-spacing: .08em; }
  .module-page { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 0 12px; }
  .module-current { font-size: 11px; }
  .module-status { display: block; max-width: 100%; overflow: hidden; font-size: 7px; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
  .module-actions { padding: 0 10px; }
  .module-home { min-width: 42px; padding: 0 9px; font-size: 0; }
  .module-home::after { content: "首页"; font-size: 10px; }
  .masthead { min-height: 0; grid-template-columns: 1fr; }
  .masthead > div:first-child { padding: 24px 17px 22px; }
  .masthead h1 { font-size: 31px; }
  .date-block { display: none; }
  main { padding: 18px 16px 48px; }
  .fund-search-panel { padding: 17px; }
  .fund-search-form { grid-template-columns: 1fr auto; }
  .fund-search-form label { grid-column: 1 / -1; }
  .decision-copy { padding: 18px 17px 16px; }
  .decision-copy h2 { font-size: 25px; }
  .decision-facts { grid-template-columns: 1fr 1fr; }
  .decision-facts div { padding: 13px 8px; }
  .decision-facts div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
  .section-heading { display: block; }
  .section-note { margin-top: 8px; text-align: left; }
  .fund-grid, .method-grid, .metric-grid, .details-grid { grid-template-columns: 1fr; }
  .summary-section { margin-top: 24px; }
  .fund-card h3 { font-size: 18px; }
  .fund-card-foot span { white-space: normal; }
  .method-panel { gap: 18px; }
  .method-grid article { padding: 0 0 12px; border-left: 0; border-bottom: 1px solid var(--line); }
  .detail-main { padding-top: 16px; }
  .detail-actions { align-items: stretch; }
  .back-link, .refresh-fund-button { justify-content: center; }
  .detail-hero { margin-top: 12px; }
  .detail-hero > div { padding: 20px 17px; }
  .detail-hero h1 { font-size: 38px; }
  .metric-grid { gap: 9px; }
  .metric-grid article { padding: 15px 16px; }
  .panel { padding: 17px; }
  .panel-heading { align-items: flex-start; }
  .range-labels { font-size: 8px; }
  .meaning-list div { grid-template-columns: 72px 1fr; }
  .details-grid { gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
