:root {
  --ink: #101820;
  --ink-2: #1c2934;
  --paper: #f4f2eb;
  --card: #fffef9;
  --line: #d8d5cb;
  --muted: #6b746f;
  --signal: #c8f135;
  --blue: #1d5eff;
  --danger: #d23c3c;
  --green: #1a9e6b;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(16,24,32,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,24,32,.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}
.rank-app { max-width: 1240px; margin: 0 auto; padding: 24px 30px 56px; }

/* topbar */
.topbar { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; min-height: 150px; padding: 30px 38px; overflow: hidden; color: #fff; background: var(--ink); border: 1px solid #263642; border-radius: 4px; box-shadow: 0 18px 45px rgba(16,24,32,.16); }
.topbar::after { content: ""; position: absolute; right: -58px; bottom: -158px; width: 300px; height: 300px; border: 50px solid var(--signal); border-radius: 50%; pointer-events: none; }
.hero-copy,.hero-actions { position: relative; z-index: 1; }
.eyebrow { color: var(--signal); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.topbar h1 { margin: 10px 0 8px; font-family: "Songti SC","STSong",serif; font-size: clamp(30px,4vw,46px); line-height: 1.05; letter-spacing: -.04em; }
.topbar p { max-width: 620px; margin: 0; color: #b8c2c8; font-size: 13px; line-height: 1.8; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.search-entry { display: inline-flex; gap: 14px; align-items: center; padding: 10px 15px; color: var(--ink); background: var(--signal); border-radius: 99px; font-size: 12px; font-weight: 800; text-decoration: none; }
.search-entry.alt { background: var(--blue); color: #fff; }
.search-entry span { font-size: 16px; line-height: 1; }
.status { display: inline-flex; align-items: center; gap: 8px; color: #dce3e6; font-size: 12px; }
.status::before { content: ""; width: 7px; height: 7px; background: var(--signal); border-radius: 50%; box-shadow: 0 0 0 4px rgba(200,241,53,.12); }
.status.subtle { color: var(--muted); }
.status.subtle::before { background: var(--blue); box-shadow: 0 0 0 4px rgba(29,94,255,.1); }
.status.ok::before { background: var(--green); box-shadow: 0 0 0 4px rgba(26,158,107,.12); }
.status.bad::before { background: var(--danger); box-shadow: 0 0 0 4px rgba(210,60,60,.12); }

/* cards */
.card { padding: 24px; margin-bottom: 16px; background: rgba(255,254,249,.97); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 8px 28px rgba(16,24,32,.06); }
.cfg-card { border-top: 4px solid var(--blue); }
.search-card { border-top: 4px solid var(--signal); }
.calc-card { border-top: 4px solid var(--green); }
.section-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.section-kicker { color: var(--signal); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.section-title h2 { margin: 6px 0 6px; font-size: 19px; }
.section-title p { margin: 0; max-width: 720px; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* form bits */
.prompt-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
textarea, input { font-family: inherit; font-size: 13px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 9px 11px; }
textarea { width: 100%; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid rgba(29,94,255,.25); border-color: var(--blue); }
.grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid.two { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid label, .grid.two label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; color: var(--muted); }
.grid.two input { width: 100%; }
.grid .inline { flex-direction: row; align-items: center; gap: 7px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar input { min-width: 180px; }
.toolbar input#bindPid { min-width: 200px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
button { font-family: inherit; font-size: 12px; font-weight: 800; color: var(--ink); background: #ece9e0; border: 1px solid var(--line); border-radius: 3px; padding: 10px 16px; cursor: pointer; }
button.primary { background: var(--signal); border-color: transparent; }
button.signal { background: var(--green); color: #fff; border-color: transparent; }
button:hover { filter: brightness(1.04); }
.adv { margin-top: 14px; }
.adv summary { cursor: pointer; font-size: 12px; font-weight: 800; color: var(--blue); }

/* offer list */
.offer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.offer { padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.offer .title { font-size: 13px; font-weight: 800; margin-bottom: 6px; min-height: 34px; }
.offer .meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.offer .price { color: var(--danger); font-weight: 800; }
.offer .price.none { color: var(--muted); font-weight: 500; }
.offer a { color: var(--blue); font-size: 11px; text-decoration: none; word-break: break-all; }
.offer .row { display: flex; gap: 8px; margin-top: 8px; }
.offer .row input { flex: 1; min-width: 0; }
.offer .row button { padding: 7px 10px; }

/* profit result */
.profit-result { margin-top: 16px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.kpi .k { font-size: 11px; color: var(--muted); font-weight: 700; }
.kpi .v { font-size: 22px; font-weight: 800; margin-top: 4px; }
.kpi.good .v { color: var(--green); }
.kpi.bad .v { color: var(--danger); }
.breakdown { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.9; }
.breakdown b { color: var(--ink); }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
