:root {
  --ink: #222222;
  --brand: #1b3a6b;
  --link: #0645ad;
  --err: #c00000;
  --ok: #1a7f37;
  --line: #cccccc;
  --muted: #666666;
  --bg: #ffffff;
  --soft: #fafafa;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "SimSun", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

.page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.site-header h1 {
  margin: 0;
  font-size: 18px;
  color: var(--brand);
  font-weight: 700;
}

.site-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

h2 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--brand);
  font-weight: 700;
}

.home-title {
  color: #ffb7c5;
}

.part-title {
  font-size: 22px;
}

.part-pink {
  color: #ff69b4;
}

.part-blue {
  color: #0066cc;
}

.label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

input[type="text"]:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}

.btn {
  display: inline-block;
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #f2f2f2;
  color: var(--ink);
  font-size: 15px;
  line-height: 38px;
  text-align: center;
  cursor: pointer;
}

.btn:hover {
  background: #e8e8e8;
  text-decoration: none;
}

.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.btn-primary:hover {
  background: #16305a;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.error {
  color: var(--err);
}

.ok {
  color: var(--ok);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.strong {
  font-weight: 700;
  color: var(--brand);
}

.center {
  text-align: center;
}

.notice {
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 16px;
}

.tag {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 22px;
}

.result-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.avatar {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--soft);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.link-btn.copied {
  color: var(--ok);
  text-decoration: none;
}

.candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid var(--line);
  cursor: pointer;
}

.candidate:hover {
  background: var(--soft);
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.numbers span {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  text-align: center;
  line-height: 26px;
  color: var(--muted);
  font-size: 13px;
}

.numbers span.current {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
  font-weight: 700;
}

.stem {
  margin: 0 0 16px;
  font-weight: 600;
}

.multi-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border: 1px solid var(--err);
  border-radius: 2px;
  color: var(--err);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  vertical-align: 2px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.option:hover {
  background: var(--soft);
}

.option input {
  margin-top: 5px;
}

.site-footer {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 2;
}

.site-footer a {
  color: var(--muted);
}

.site-footer img {
  vertical-align: -2px;
  margin: 0 4px;
}

.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  color: var(--brand);
  font-size: 15px;
}

.loading-mask.show {
  display: flex;
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -5px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.section {
  margin-top: 24px;
}

@media (max-width: 640px) {
  .page {
    padding: 12px 0;
  }

  .container {
    padding: 16px 16px 40px;
  }

  .site-header {
    padding: 16px 16px 10px;
  }

  .site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 6px;
    padding: 8px 10px 12px;
    font-size: 11px;
    line-height: 1.8;
  }

  .site-footer a {
    font-size: 11px;
    white-space: nowrap;
  }

  .actions .btn {
    flex: 1;
    min-width: 120px;
  }

  .result-line {
    gap: 8px;
  }
}
