/* mark.nullce.com —— 小工具站。全站不用登录，收藏存本地。 */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --soft: #f7f9fc;
  --soft2: #eef2f8;
  --line: #e3e9f2;
  --line2: #cfd8e6;
  --ink: #141b28;
  --ink2: #3c475c;
  --dim: #67718a;
  --dim2: #8a94a8;
  --blue: #2f6fd0;
  --blue-d: #245aa9;
  --blue-l: #e9f0fa;
  --green: #0f8a63;
  --green-l: #e4f4ec;
  --amber: #a9711b;
  --amber-l: #fdf3e2;
  --red: #bf4a46;
  --red-l: #fceceb;
  --pur: #5b52b0;
  --pur-l: #eeecfb;
  --teal: #17736e;
  --teal-l: #e3f3f2;
  --slate: #4a5568;
  --slate-l: #eef1f6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 27, 40, .05), 0 6px 16px -8px rgba(20, 27, 40, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  will-change: transform;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.logo .mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(140deg, #4a8ae8, #2f6fd0);
  position: relative;
}
.logo .mark::after {
  content: ""; position: absolute; inset: 6px;
  border: 2px solid #fff; border-radius: 50%;
}
.logo b { font-size: 17px; letter-spacing: -.2px; }
.logo span { font-size: 17px; color: var(--dim2); font-weight: 400; }

.hsearch {
  flex: 1 1 auto; max-width: 380px;
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 19px;
  color: var(--dim2);
}
.hsearch svg { flex: 0 0 auto; opacity: .7; }
.hsearch input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 13.5px; color: var(--ink);
}
.hsearch input::placeholder { color: var(--dim2); }

.hnav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 13.5px; color: var(--ink2); }
.hnav a:hover { color: var(--blue); }

/* ---------------------------------------------------------------- hero */
.hero {
  margin-top: 24px;
  padding: 34px 40px 30px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 160% at 88% -30%, #e6effc 0%, rgba(230,239,252,0) 62%),
    linear-gradient(180deg, #fbfdff, #f4f8fe);
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0 0 6px;
  font-size: 34px; line-height: 1.25; letter-spacing: -.8px; font-weight: 700;
}
.hero .sub { margin: 0 0 22px; color: var(--dim); font-size: 14.5px; }
.hero .row { display: flex; gap: 12px; align-items: stretch; }
.hero .inputbox {
  flex: 1 1 auto; display: flex; align-items: center;
  height: 56px; padding: 0 20px;
  background: #fff; border: 1px solid #c9d8ee; border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.hero .inputbox:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 208, .12); }
.hero .inputbox input {
  flex: 1 1 auto; border: 0; outline: 0; background: transparent;
  font-size: 15px; color: var(--ink);
}
.hero .inputbox input::placeholder { color: var(--dim2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line2); background: #fff; color: var(--ink2);
  height: 44px; padding: 0 20px; border-radius: 12px;
  font-size: 14.5px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600;
}
.btn.primary:hover { background: var(--blue-d); border-color: var(--blue-d); color: #fff; }
.btn.big { height: 56px; padding: 0 32px; font-size: 16px; border-radius: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.hero .stat { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; padding-left: 8px; }
.hero .stat .n { font-size: 26px; font-weight: 700; color: var(--blue); line-height: 1.1; }
.hero .stat .l { font-size: 11.5px; color: var(--dim2); }

/* ---------------------------------------------------------------- 工具墙 */
.sec-head { display: flex; align-items: center; gap: 10px; margin: 34px 0 16px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.sec-head .hint { font-size: 12.5px; color: var(--dim2); }
.chips { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 28px; padding: 0 13px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  font-size: 11.5px; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--line2); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 16px;
}
.card {
  display: flex; flex-direction: column;
  padding: 18px; min-height: 168px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.card:hover { transform: translateY(-2px); border-color: #cfdcef; box-shadow: 0 2px 4px rgba(20,27,40,.05), 0 14px 28px -14px rgba(47,111,208,.35); }
.card .ico {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.card p { margin: 0; font-size: 12.5px; color: var(--dim); line-height: 1.55; flex: 1 1 auto; }
.card .foot { display: flex; align-items: center; margin-top: 12px; font-size: 10.5px; font-weight: 600; }
.card .foot .arw { margin-left: auto; color: var(--dim2); font-size: 13px; font-weight: 400; }
.card .star {
  margin-left: auto; margin-right: 6px;
  border: 0; background: transparent; cursor: pointer;
  font-size: 14px; color: var(--line2); padding: 0 2px;
}
.card .star.on { color: #e8b33d; }

/* ---------------------------------------------------------------- 工具页 */
.crumb { display: flex; align-items: center; gap: 8px; padding: 18px 0 0; font-size: 13px; color: var(--dim2); }
.crumb a:hover { color: var(--blue); }

.tool-head { display: flex; align-items: flex-start; gap: 16px; margin: 14px 0 20px; }
.tool-head .ico { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 27px; flex: 0 0 auto; }
.tool-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.5px; }
.tool-head p { margin: 0; color: var(--dim); font-size: 13.5px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.panel + .panel { margin-top: 16px; }
.panel h4 { margin: 0 0 14px; font-size: 13px; color: var(--dim2); font-weight: 600; letter-spacing: .3px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink2); margin-bottom: 6px; font-weight: 500; }
.field label .opt { color: var(--dim2); font-weight: 400; }
.field input[type=text], .field input[type=number], .field textarea, .field select {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line2); border-radius: 11px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff;
  outline: 0; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 208, .12);
}
.field .tip { font-size: 11.5px; color: var(--dim2); margin-top: 6px; }
.field.err input, .field.err textarea { border-color: var(--red); }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.actions .msg { font-size: 12.5px; color: var(--dim); }
.actions .msg.bad { color: var(--red); }

/* 结果 */
#result { display: none; }
#result.on { display: block; }
.spinner {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.errbox {
  padding: 16px 18px; border-radius: 12px;
  background: var(--red-l); border: 1px solid #f3d3d1; color: #8f3733; font-size: 13.5px;
}
.errbox b { display: block; margin-bottom: 4px; }

.player { display: flex; gap: 16px; flex-wrap: wrap; }
.player .cover {
  width: 200px; height: 126px; flex: 0 0 auto; border-radius: 12px; object-fit: cover;
  background: var(--soft2);
}
.player .meta { flex: 1 1 220px; min-width: 0; }
.player .meta h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.4; }
.player .meta .by { font-size: 12.5px; color: var(--dim); }

.dl-list { display: grid; gap: 8px; margin-top: 18px; }
.dl-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft);
}
.dl-row .q { font-weight: 600; font-size: 13.5px; min-width: 64px; }
.dl-row .s { font-size: 11.5px; color: var(--dim2); }
.dl-row a, .dl-row button {
  margin-left: auto; height: 34px; padding: 0 16px; border-radius: 9px;
  background: var(--blue); color: #fff; border: 0; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; cursor: pointer;
}
.dl-row a:hover, .dl-row button:hover { background: var(--blue-d); }

.note-body { font-size: 14px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.imgs img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; background: var(--soft2); }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 14px 0 0; }
.kv .cell { padding: 12px 14px; background: var(--soft); border-radius: 11px; border: 1px solid var(--line); }
.kv .cell .k { font-size: 11px; color: var(--dim2); }
.kv .cell .v { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }

.rank { display: grid; gap: 2px; }
.rank .it { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.rank .it:last-child { border-bottom: 0; }
.rank .n { width: 26px; text-align: center; font-size: 12px; color: var(--dim2); font-weight: 600; }
.rank .n.top { color: var(--blue); font-size: 14px; }
.rank .cov { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--soft2); flex: 0 0 auto; }
.rank .tt { min-width: 0; }
.rank .tt b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .tt span { font-size: 11.5px; color: var(--dim2); }

.store { display: grid; gap: 10px; }
.store .it { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.store .it img { width: 68px; height: 68px; border-radius: 10px; object-fit: cover; background: var(--soft2); flex: 0 0 auto; }
.store .it .m { min-width: 0; }
.store .it b { font-size: 14px; }
.store .it .sub { font-size: 12px; color: var(--dim2); margin-top: 2px; }

.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 62px 1fr 44px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-row .t { width: 100%; height: 9px; background: var(--soft2); border-radius: 5px; overflow: hidden; }
.bar-row .t i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #6fa4e8, #2f6fd0); }
.bar-row .v { text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 11.5px; padding: 3px 10px; border-radius: 9px; background: var(--soft2); color: var(--ink2); }
.tag.blue { background: var(--blue-l); color: var(--blue); }
.tag.green { background: var(--green-l); color: var(--green); }
.tag.amber { background: var(--amber-l); color: var(--amber); }
.tag.red { background: var(--red-l); color: var(--red); }

.empty { padding: 26px 8px; text-align: center; color: var(--dim2); font-size: 13px; }

/* 侧栏 */
.side .panel { padding: 18px; }
.side .panel h4 { margin-bottom: 12px; }
.rec { display: grid; gap: 8px; }
.rec a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13px; }
.rec a:hover { background: var(--soft); }
.rec a .e { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex: 0 0 auto; }
.hist { display: grid; gap: 6px; font-size: 12.5px; }
.hist a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist a:hover { background: var(--soft); color: var(--blue); }
.hist .muted { color: var(--dim2); padding: 6px 10px; }

/* ---------------------------------------------------------------- footer */
.site-foot {
  margin-top: 52px; padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--dim2);
}
.site-foot .r { margin-left: auto; display: flex; gap: 18px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  padding: 11px 20px; border-radius: 11px;
  background: #1b2433; color: #fff; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 90; max-width: 80vw;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .side { order: 2; }
  .hero { padding: 26px 22px 24px; }
  .hero h1 { font-size: 27px; }
  .hsearch { max-width: 220px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .site-header .bar { height: 58px; gap: 12px; }
  .hsearch { display: none; }
  .hnav { gap: 16px; font-size: 13px; }
  .hero { margin-top: 14px; border-radius: 16px; padding: 22px 18px 20px; }
  .hero h1 { font-size: 23px; letter-spacing: -.4px; }
  .hero .sub { font-size: 13px; margin-bottom: 16px; }
  .hero .row { gap: 8px; }
  .hero .inputbox { height: 48px; padding: 0 14px; border-radius: 12px; }
  .hero .stat { display: none; }
  .btn.big { height: 48px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { padding: 14px; min-height: 152px; border-radius: 14px; }
  .card .ico { width: 40px; height: 40px; font-size: 19px; border-radius: 11px; margin-bottom: 11px; }
  .card h3 { font-size: 14px; }
  .card p { font-size: 11.5px; }
  .chips { margin-left: 0; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .tool-head h1 { font-size: 21px; }
  .panel { padding: 16px; }
  .player .cover { width: 100%; height: 180px; }
  .site-foot .r { margin-left: 0; }
}
