:root {
  --f1-bg: #09090b;
  --f1-surface: #141418;
  --f1-surface-soft: rgba(255, 255, 255, 0.035);
  --f1-border: rgba(255, 255, 255, 0.11);
  --f1-text: #f5f5f7;
  --f1-muted: #a1a1aa;
  --f1-soft: #d4d4d8;
  --f1-red: #e10600;
  --f1-red-bright: #ff332b;
  --f1-success: #34d399;
  --f1-danger: #f87171;
  --f1-warning: #fde68a;
  --f1-radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--f1-bg);
  color: var(--f1-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-wrap {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.public-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 7, 9, 0.92);
  backdrop-filter: blur(18px);
}

.public-topbar-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.public-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-brand-mark {
  width: 22px;
  height: 8px;
  background: var(--f1-red);
  transform: skewX(-18deg);
  flex: none;
}

.public-brand-copy { display: grid; gap: 2px; min-width: 0; }
.public-brand-title { font-size: 15px; line-height: 1.1; font-weight: 850; }
.public-brand-sub { color: var(--f1-muted); font-size: 11px; line-height: 1.2; }

.public-pill {
  border: 1px solid var(--f1-border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--f1-soft);
  background: var(--f1-surface-soft);
  font-size: 12px;
  white-space: nowrap;
}

.public-field { display: grid; gap: 8px; }
.public-field label { color: #e7e7ea; font-size: 13px; font-weight: 650; }

.public-control {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--f1-radius);
  outline: 0;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--f1-text);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.public-control:focus {
  border-color: rgba(225, 6, 0, 0.72);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.13);
}

textarea.public-control { min-height: 106px; padding-block: 13px; resize: vertical; line-height: 1.6; }

.public-btn {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--f1-radius);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.public-btn:not(:disabled):active { transform: translateY(1px); }
.public-btn:disabled { cursor: not-allowed; opacity: 0.45; }
.public-btn-primary { color: #fff; background: var(--f1-red); }
.public-btn-primary:not(:disabled):hover { background: #c90500; }
.public-btn-secondary { color: var(--f1-text); background: rgba(255, 255, 255, 0.075); border-color: var(--f1-border); }

.public-status {
  min-height: 46px;
  border: 1px solid var(--f1-border);
  border-radius: var(--f1-radius);
  padding: 12px 14px;
  background: var(--f1-surface-soft);
  color: var(--f1-soft);
  font-size: 13px;
  line-height: 1.6;
}

.public-status.success { border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); color: #bbf7d0; }
.public-status.error { border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.08); color: #fecaca; }
.public-status.loading { border-color: rgba(253, 230, 138, 0.25); background: rgba(253, 230, 138, 0.06); color: var(--f1-warning); }

.public-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--f1-radius);
  padding: 13px;
  background: var(--f1-surface-soft);
}

.public-checkbox input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--f1-red); flex: none; }
.public-checkbox p { margin: 0; color: var(--f1-soft); font-size: 12px; line-height: 1.65; }
.public-checkbox a { color: #fca5a5; text-decoration: underline; text-underline-offset: 3px; }

.public-footer { margin-top: auto; padding: 24px 0 30px; color: var(--f1-muted); font-size: 12px; }
.public-footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 18px; }
.public-footer a { color: #fca5a5; }

@media (max-width: 640px) {
  .public-wrap { width: min(100% - 20px, 1160px); }
  .public-topbar-inner { min-height: 62px; }
  .public-pill { display: none; }
}
