* { box-sizing: border-box; }
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #7a879a;
  --line: #e6eaf0;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.app { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }
.top { text-align: center; margin: 8px 0 18px; }
.top h1 { font-size: 22px; margin: 0 0 4px; }
.top .sub { color: var(--muted); font-size: 14px; margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}

.step { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.badge {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.step-title { font-weight: 600; }
.step-desc { color: var(--muted); font-size: 13px; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  border: 1px solid transparent; border-radius: 14px; padding: 16px 22px;
  font-size: 18px; font-weight: 700; cursor: pointer; transition: .15s;
  font-family: inherit; min-height: 56px; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--primary-d); }
.btn-secondary { background: #eef2ff; color: var(--primary-d); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.wide { flex: 1; }
.btn.small { padding: 10px 16px; font-size: 15px; min-height: 44px; font-weight: 600; }
#pasteBtn { flex: 1; min-width: 200px; font-size: 20px; min-height: 62px; }
#mergeBtn { font-size: 20px; min-height: 62px; }

.manual { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.manual textarea {
  width: 100%; min-height: 120px; resize: vertical; padding: 10px;
  border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 14px;
}
.hidden { display: none; }

.hint { margin-top: 10px; font-size: 13px; min-height: 18px; }
.hint.ok { color: var(--green); }
.hint.err { color: var(--red); }

.list-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-size: 14px; font-weight: 600;
}
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
  background: #fbfcfe;
}
.li-idx {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; background: #eef2ff;
  color: var(--primary-d); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.li-main { flex: 1; min-width: 0; }
.li-title { font-size: 14px; font-weight: 600; }
.li-desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-tag { font-size: 11px; color: var(--primary-d); background:#eef2ff; padding:1px 6px; border-radius: 6px; margin-left:6px;}
.li-btns { display: flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  width: 42px; height: 42px; cursor: pointer; font-size: 18px; color: var(--muted);
}
.icon-btn:hover { background: #f1f5f9; }
.icon-btn.del:hover { color: var(--red); border-color: #f3c2c2; }

.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 8px; }

.result {
  white-space: pre-wrap; word-break: break-word; background: #0f172a; color: #e2e8f0;
  padding: 14px; border-radius: 10px; font-size: 13px; margin: 10px 0 0;
  max-height: 460px; overflow: auto;
}
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ===== 手机端适配 ===== */
@media (max-width: 600px) {
  .app { padding: 14px 12px 40px; }
  .top h1 { font-size: 24px; }
  .top .sub { font-size: 14px; }
  .card { padding: 14px; border-radius: 16px; }

  /* 按钮在手机上占满整行、更大更好点 */
  .actions { flex-direction: column; gap: 12px; }
  .btn { width: 100%; font-size: 19px; min-height: 58px; padding: 18px; }
  .btn.small { width: auto; font-size: 15px; min-height: 44px; padding: 10px 16px; }
  #pasteBtn, #mergeBtn { font-size: 21px; min-height: 66px; }

  /* 手动粘贴框更大 */
  .manual textarea { min-height: 140px; font-size: 16px; }

  /* 列表项：名字信息不再省略，允许换行，触摸按钮更大 */
  .list li { padding: 12px; gap: 10px; }
  .li-title { font-size: 15px; }
  .li-desc { white-space: normal; font-size: 13px; }
  .icon-btn { width: 46px; height: 46px; font-size: 20px; }

  .result { font-size: 15px; padding: 16px; }
  .hint { font-size: 15px; }
  .list-head { font-size: 15px; }
}

/* 更小的手机 */
@media (max-width: 380px) {
  .top h1 { font-size: 21px; }
  .btn { font-size: 18px; }
  #pasteBtn, #mergeBtn { font-size: 20px; }
}
