:root {
  --bg: #0a0d11;
  --panel: rgba(18, 21, 27, 0.92);
  --panel-soft: rgba(25, 31, 39, 0.92);
  --line: rgba(214, 184, 120, 0.16);
  --line-strong: rgba(214, 184, 120, 0.32);
  --gold: #d6b878;
  --gold-bright: #f1d89c;
  --ink: #f6f0df;
  --muted: #a9acaa;
  --green: #7dbf87;
  --amber: #d8a24c;
  --red: #bb544c;
  --blue: #6f8fb5;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius: 12px;
}
* { box-sizing: border-box; }
body.tp-page {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(214, 184, 120, 0.09), transparent 24%),
    radial-gradient(circle at left 20%, rgba(125, 191, 135, 0.06), transparent 18%),
    linear-gradient(180deg, #0f1318 0%, #090b0e 100%);
}
a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.tp-wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 56px; }
.tp-intro { padding: 6px 2px 16px; }
.tp-intro h1 { margin: 0 0 8px; font-size: 25px; letter-spacing: 0.5px; color: var(--gold-bright); }
.tp-intro p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 880px; }
.tp-data-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(214, 184, 120, 0.06);
  color: var(--gold); font-size: 12.5px;
}

.tp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
.tp-layout > .tp-panel { min-width: 0; }
@media (max-width: 960px) { .tp-layout { grid-template-columns: 1fr; } }

.tp-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tp-panel h2 { margin: 0 0 12px; font-size: 16px; color: var(--gold-bright); font-weight: 600; }
.tp-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; min-width: 0; }
.tp-search { flex: 1 1 200px; min-width: 0; max-width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(10,13,17,.85); color: var(--ink); font-size: 14px; font-family: inherit; outline: none; }
.tp-search:focus { border-color: var(--gold); }
.tp-select { min-width: 0; max-width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(10,13,17,.85); color: var(--ink); font-size: 13.5px; font-family: inherit; outline: none; }
.tp-select option { background: #11161d; }

.tp-list { max-height: 560px; overflow-y: auto; }
.tp-task-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid rgba(214,184,120,.07); font-size: 13.5px; }
.tp-task-row input[type="checkbox"] { accent-color: #8a6a35; width: 16px; height: 16px; flex: none; }
.tp-task-row .nm { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.tp-task-row .nm b { color: var(--ink); font-weight: 600; }
.tp-task-row .meta { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tp-task-row .badge { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tp-task-row .badge.kappa { color: var(--gold-bright); border-color: rgba(214,184,120,.5); }
.tp-task-row .badge.has-items { color: var(--green); border-color: rgba(125,191,135,.4); }
.tp-count { padding: 10px 4px 0; font-size: 12.5px; color: var(--muted); }

.tp-result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tp-clear { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; font-family: inherit; }
.tp-clear:hover { color: var(--red); border-color: var(--red); }

.tp-selected-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; min-height: 30px; }
.tp-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(214,184,120,.08); font-size: 13px; }
.tp-chip button { border: 0; background: rgba(255,255,255,.08); color: var(--muted); width: 19px; height: 19px; border-radius: 50%; cursor: pointer; font-size: 11px; padding: 0; }
.tp-chip button:hover { background: var(--red); color: #fff; }
.tp-chips-empty { color: var(--muted); font-size: 13px; align-self: center; }

.tp-sec { margin-top: 4px; }
.tp-sec h3 { margin: 14px 0 8px; font-size: 14px; color: var(--gold-bright); font-weight: 600; }
.tp-sec h3 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.tp-item-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-top: 1px solid rgba(214,184,120,.07); font-size: 13.5px; }
.tp-item-row img { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: rgba(0,0,0,.3); object-fit: contain; flex: none; }
.tp-item-row .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-item-row .ct { flex: none; color: var(--gold-bright); font-variant-numeric: tabular-nums; font-weight: 600; }
.tp-item-row .ts { flex: none; font-size: 11.5px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-empty { color: var(--muted); font-size: 13.5px; padding: 10px 4px; }

.tp-map-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tp-map-list span { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--ink); background: rgba(255,255,255,.02); }

.tp-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tp-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(214,184,120,.1); color: var(--gold-bright); font-size: 13.5px; cursor: pointer; font-family: inherit; }
.tp-btn:hover { background: rgba(214,184,120,.18); }

.tp-panel :is(button, input, select):focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.tp-panel button:disabled, .tp-panel button[aria-disabled="true"] {
  opacity: .6;
  cursor: wait;
}

.tp-note { margin-top: 18px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18,21,27,.65); color: var(--muted); font-size: 13.5px; line-height: 1.9; }
.tp-note summary { cursor: pointer; color: var(--gold-bright); font-size: 15px; font-weight: 600; padding: 2px 0 8px; }
.tp-note ul { margin: 8px 0 0; padding-left: 22px; }
.tp-note li { margin-bottom: 6px; }

.tp-copy { margin-top: 18px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18,21,27,.65); color: var(--muted); font-size: 13.5px; line-height: 1.9; }
.tp-copy h2 { color: var(--ink); font-size: 15px; margin: 0 0 8px; }
.tp-copy p { margin: 0 0 8px; }

.tp-footer { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; }

@media print {
  .tp-controls, .tp-clear, .tp-actions, .tp-note, .tp-copy, .tp-footer, .tp-data-badge, .site-header, .takefu-shell-header { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .tp-panel { border-color: #ccc; background: #fff; box-shadow: none; }
  .tp-item-row, .tp-task-row { border-color: #eee; }
}
