* {
  box-sizing: border-box;
}

:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --border: #e0e0e0;
  --border-strong: #c6c6c6;
  --text: #393939;
  --title: #161616;
  --muted: #6f6f6f;
  --accent: #0f62fe;
  --accent-hover: #4589ff;
  --accent-ink: #0043ce;
  --accent-soft: #edf5ff;
  --danger: #da1e28;
  --danger-soft: #fff1f1;
  --warn-ink: #8a5300;
  --warn-soft: #fdf6ec;
  --ok-ink: #0e6027;
  --ok-soft: #defbe6;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

.icp-footer {
  width: min(720px, 100%);
  margin: -28px auto 0;
  padding: 0 18px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.icp-footer a,
.icp-link {
  color: inherit;
  text-decoration: none;
}

.icp-footer a:hover,
.icp-link:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.platform-footer .icp-link {
  margin-top: 4px;
  font-size: 12px;
}

.page {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 32px 18px 56px;
}

.app-header {
  margin-bottom: 22px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #c8dcff;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.trust-badge svg {
  flex-shrink: 0;
}

.secure-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid #c8dcff;
  color: var(--accent-ink);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.secure-hint svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.title {
  margin: 0 0 8px;
  color: var(--title);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 22, 26, 0.04);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-header strong,
.section-header label {
  margin: 0;
  color: var(--title);
  font-weight: 800;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--title);
  font: inherit;
}

textarea {
  min-height: 230px;
  padding: 14px;
  resize: vertical;
  line-height: 1.6;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

.control-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.control-row input[type="number"],
.control-row input[type="password"],
.control-row select {
  width: 148px;
  max-width: 42vw;
  flex: 0 0 auto;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.row:last-child {
  border-bottom: 0;
}

.row > div {
  flex: 1;
}

.hint {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.action-bar {
  margin: 20px 0 16px;
}

.action-bar button {
  width: 100%;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

button:hover {
  background: var(--accent-hover);
}

button.secondary {
  background: #e8eaed;
  color: var(--text);
}

button.secondary:hover {
  background: #dcdfe4;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #b81922;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  display: inline-flex;
  min-width: 76px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 800;
}

.notice-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  line-height: 1.5;
}

.notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.notice.warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.stack-panel {
  padding: 14px 0 4px;
}

.warning-note,
.quiet-note {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn-ink);
  line-height: 1.5;
  font-size: 14px;
}

.quiet-note {
  margin: 12px 0 0;
  background: var(--surface-soft);
  color: var(--muted);
}

.password-panel {
  margin-bottom: 16px;
}

.content {
  min-height: 180px;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-soft);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
}

.result-link {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  word-break: break-all;
  color: var(--accent-ink);
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* 二维码卡片 */
.qr-card {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
}

.qr-canvas {
  display: block;
  margin: 0 auto;
  border-radius: 4px;
  image-rendering: pixelated;
}

.qr-caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.4px;
}

.status-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.status-title {
  margin-top: 4px;
  color: var(--title);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-height: 82px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--title);
  line-height: 1.35;
  word-break: break-word;
}

.receipt-header {
  margin-top: 20px;
}

.receipt {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.receipt:last-child {
  border-bottom: 0;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  text-align: center;
  padding: 18px 0 4px;
}

@media (max-width: 520px) {
  .page {
    padding: 24px 14px 44px;
  }

  .title {
    font-size: 28px;
  }

  .panel {
    padding: 18px;
  }

  .control-row {
    align-items: flex-start;
  }

  .control-row input[type="number"],
  .control-row input[type="password"],
  .control-row select {
    width: 126px;
  }

  .actions button {
    flex: 1 1 100%;
  }

  .metrics {
    grid-template-columns: 1fr;
  }
}

/* 登录与账号面板 */
.account-panel {
  margin-bottom: 4px;
}

.account-panel .section-header {
  margin-bottom: 2px;
}

.login-row {
  gap: 10px;
  min-height: auto;
  padding: 8px 0;
}

.login-row input {
  flex: 1;
  min-width: 0;
}

.login-row .secondary {
  flex: 0 0 auto;
  min-width: 0;
}

.logged-in-bar {
  justify-content: space-between;
  padding: 8px 0 2px;
}

/* 接收端平台入口 footer */
.platform-footer {
  margin: 24px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.platform-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 14px;
}

.platform-footer .footer-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 360px;
}

.platform-footer .footer-link {
  margin-top: 2px;
}

/* 首页介绍区块与 footer 链接组 */
.about-panel .about-body p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.65;
}

.footer-links {
  display: flex;
  gap: 18px;
  margin-top: 2px;
}

.footer-links .footer-link {
  margin-top: 0;
}

/* 防截屏/录屏: 浏览器无系统级截图拦截 API, 采用禁选禁复制 + 视觉提示的尽力方案 */
.content.anti-capture {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  position: relative;
}

.content.anti-capture::after {
  content: "防截屏保护 · 请勿截屏/录屏传播";
  display: block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.04em;
}
