/* PulsearSpec Data Workshop (tool.html / tool-cn.html). Same palette as styles/theme.css. */
:root {
    --ink: #1d1d1f; --sub: #6e6e73; --bg: #ffffff; --alt: #f5f5f7; --line: #d2d2d7;
    --accent: #0071e3; --accent-hover: #0077ed; --radius: 16px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Inter, Arial,
            "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--alt); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.tbar { position: sticky; top: 0; z-index: 20; height: 52px; display: flex; align-items: center; gap: 16px; padding: 0 20px;
    background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,.08); }
.tbar .brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 16px; }
.tbar .brand img { height: 28px; width: auto; }
.tbar nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.tbar nav a { color: var(--ink); opacity: .8; }
.tbar nav a:hover { opacity: 1; text-decoration: none; }

main { max-width: 1320px; margin: 0 auto; padding: 24px 20px 40px; }
.intro h1 { font-size: 32px; line-height: 1.15; margin: 8px 0 6px; letter-spacing: -.01em; }
.intro p { margin: 0 0 18px; color: var(--sub); font-size: 16px; max-width: 820px; }

.card { background: var(--bg); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 14px 16px; }

/* toolbar */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.row .label { font-size: 13px; font-weight: 600; color: var(--sub); min-width: 74px; }
.file-meta { font-size: 13px; color: var(--sub); }
.file-meta b { color: var(--ink); font-weight: 600; }
.ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.ctl input[type=number] { width: 78px; }
input[type=number], select { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

.btn { font: inherit; font-size: 13px; line-height: 1.2; cursor: pointer; border-radius: 980px; padding: 7px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #a1a1a6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn .material-symbols-outlined { font-size: 16px; vertical-align: -3px; margin-right: 2px; }

/* plots */
.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.side { display: flex; flex-direction: column; gap: 16px; }
.plot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.plot-head .spacer { flex: 1; }
.plot-head .hint { font-size: 12px; color: var(--sub); }
#mapPlot { height: 600px; }
#specPlot, #kinPlot { height: 300px; }
.sel { font-size: 13px; font-weight: 600; }

/* help */
.help { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.help h2 { font-size: 17px; margin: 2px 0 8px; }
.help p, .help li { font-size: 14px; color: #424245; margin: 0 0 8px; }
.help ul { padding-left: 18px; margin: 0; }
.help code, .help pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.help pre { background: var(--alt); border-radius: 8px; padding: 8px 10px; overflow-x: auto; margin: 0 0 8px; }
.cite { background: var(--alt); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; word-break: break-word; }
.cta { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cta p { margin: 0; font-size: 15px; }

footer { text-align: center; font-size: 12px; color: var(--sub); padding: 24px 20px 32px; }
footer p { margin: 4px 0; }

/* toast + drag overlay */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    background: #1d1d1f; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; transition: all .25s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #c9302c; }
.drop-overlay { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(0,113,227,.12); border: 3px dashed var(--accent);
    align-items: center; justify-content: center; font-size: 22px; font-weight: 600; color: var(--accent); pointer-events: none; }
body.dragging .drop-overlay { display: flex; }

@media (max-width: 1000px) {
    .grid { grid-template-columns: minmax(0, 1fr); }
    .help { grid-template-columns: minmax(0, 1fr); }
    #mapPlot { height: 460px; }
}
@media (max-width: 600px) {
    .tbar { padding: 0 16px; gap: 10px; }
    .tbar .brand span { display: none; }
    .tbar nav { gap: 14px; font-size: 13px; }
    main { padding: 16px 16px 32px; }
    .intro h1 { font-size: 24px; }
    .intro p { font-size: 14px; }
    .card { padding: 12px; }
    .row .label { min-width: 0; width: 100%; }
    #mapPlot { height: 380px; }
    #specPlot, #kinPlot { height: 280px; }
}
