:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #dfe3e8;
  --border-strong: #c3cad4;
  --text: #1b2028;
  --text-2: #5b6472;
  --text-3: #8b94a3;
  --accent: #1f5fa8;
  --accent-hover: #17497f;
  --accent-soft: #e8f0fa;
  --ok: #2c7a52;
  --ok-soft: #e6f4ec;
  --danger: #b3382f;
  --danger-soft: #fbeceb;
  --warn: #8a6100;
  --warn-soft: #fdf3dd;
  --radius: 10px;
  --radius-sm: 7px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 80px; }
.wrap.narrow { max-width: 520px; }

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.site .inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
header.site .brand { font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
header.site .tag { font-size: 12px; color: var(--text-3); }
header.site .spacer { flex: 1; }
header.site nav a { font-size: 13px; color: var(--text-2); margin-left: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

h1 { font-size: 21px; margin: 0 0 6px; font-weight: 600; letter-spacing: 0.01em; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 600; color: var(--text-2); }

.sub { color: var(--text-2); font-size: 13px; margin: 0 0 20px; }
.muted { color: var(--text-3); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

label.field { display: block; margin-bottom: 16px; }
label.field > .lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
label.field > .hint {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 120px; resize: vertical; }

.row { display: flex; gap: 12px; align-items: flex-start; }
.row > * { flex: 1; }
.row.tight { gap: 8px; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.ghost, .btn.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
button.ghost:hover { background: var(--surface-2); }
button.small { padding: 6px 12px; font-size: 13px; font-weight: 500; }
button.wide { width: 100%; }
button.copied, .btn.copied {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: #bfe0cd;
}

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
}
.choice:hover { border-color: var(--border-strong); }
.choice input { margin: 0; flex: none; }
.choice .ct { font-size: 13.5px; font-weight: 600; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }

.files { list-style: none; margin: 10px 0 0; padding: 0; }
.files li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
  background: var(--surface-2);
}
.files li .fn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li .fs { color: var(--text-3); font-size: 12px; flex: none; }
.files li .fx {
  flex: none; cursor: pointer; color: var(--text-3); border: none;
  background: none; padding: 0 4px; font-size: 15px; line-height: 1;
}

.note {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid;
  margin-bottom: 16px;
}
.note.info { background: var(--accent-soft); border-color: #c5dcf5; color: #17497f; }
.note.warn { background: var(--warn-soft); border-color: #eed9a8; color: var(--warn); }
.note.danger { background: var(--danger-soft); border-color: #f0c8c4; color: var(--danger); }
.note.ok { background: var(--ok-soft); border-color: #bfe0cd; color: var(--ok); }
.note strong { font-weight: 600; }

/* 工具类：替代内联样式，以配合禁止内联样式的 CSP 策略 */
.row > .fixed { flex: none; }
.row > .unit {
  flex: none;
  line-height: 2.4;
  font-size: 13px;
  color: var(--text-2);
}
.linkbox > .fixed { flex: none; }
.inline-row { display: flex; align-items: center; gap: 6px; }

/* 密码行：窄屏时输入框独占一行、两个按钮并排，避免挤成一条。
   选择器写成 .row.pw-row 是为了压过文件末尾媒体查询里的 .row 规则。 */
.row.pw-row { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.row.pw-row > input {
  flex: 1 1 140px;
  min-width: 0;
  width: auto;
  font-family: var(--mono);
}
.row.pw-row > button { flex: 0 0 auto; width: auto; }

/* 复制用的隐藏载体：navigator.clipboard 不可用时的退路 */
.copy-sink {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

h3.sec { margin: 16px 0 0; }
.row.actions { margin-top: 14px; gap: 8px; }

.result { word-break: break-all; }
.linkbox {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}
.linkbox input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-2);
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.ready { background: var(--accent-soft); color: var(--accent); border-color: #c5dcf5; }
.badge.viewed { background: var(--warn-soft); color: var(--warn); border-color: #eed9a8; }
.badge.burned { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.badge.pending { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.badge.gone { background: var(--danger-soft); color: var(--danger); border-color: #f0c8c4; }

.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.inbox li:last-child { border-bottom: none; }
.inbox .meta { flex: 1; min-width: 0; }
.inbox .meta .t { font-size: 12.5px; color: var(--text-3); }
.inbox .meta .id { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--border);
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s ease;
}

.pill-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #eed9a8;
}

.content-text {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  max-height: 60vh;
  overflow: auto;
}
.content-img { margin-top: 14px; }
.content-img img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: block;
}
.content-img .cap { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
  font-size: 13px;
  color: var(--text-2);
}
.steps li::before {
  counter-increment: s;
  content: counter(s);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer.site {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 40px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.8;
}

.hidden { display: none !important; }

hr.sep { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

dl.kv { margin: 0; font-size: 13px; }
dl.kv > div { display: flex; gap: 10px; padding: 4px 0; }
dl.kv dt { flex: none; width: 92px; color: var(--text-3); }
dl.kv dd { margin: 0; flex: 1; word-break: break-all; }

@media (max-width: 620px) {
  .wrap { padding: 20px 14px 60px; }
  .card { padding: 17px; }
  .row { flex-direction: column; gap: 0; }
  .row > * { width: 100%; }

  /* 手机上手指比鼠标粗，所有按钮给足高度，减少点不中的懊恼 */
  button:not(.fx) { min-height: 44px; }

  /* iOS 在字号小于 16px 时会自动放大页面，设为 16px 可彻底避免这一跳动 */
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="datetime-local"],
  select,
  textarea,
  .linkbox input { font-size: 16px; }

  /* 密码行：输入框独占一行，两个按钮各占一半 */
  .row.pw-row > input { flex: 1 1 100%; }
  .row.pw-row > button { flex: 1 1 0; width: auto; }

  .linkbox { gap: 6px; }
  .linkbox > .fixed { padding-left: 14px; padding-right: 14px; }
}
