:root {
  --text: #1f2937;
  --muted: #667085;
  --line: #d8dee8;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --red: #b42318;
  --page: #f5f7fa;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font: 14px/1.6 "Microsoft YaHei UI", "PingFang SC", sans-serif;
  isolation: isolate;
}

.scenery {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #c6dfb6 url('/scenery/background.webp') center bottom / cover no-repeat;
}

.scenery-actor {
  position: absolute;
  left: 0;
  top: 0;
  width: 64px;
  height: auto;
  will-change: transform;
}

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

.site-avatar {
  flex: 0 0 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff;
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.container {
  width: min(820px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
}

.header-inner {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 22px;
  line-height: 1.35;
}

.site-header p,
.section-head p,
.pool-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  white-space: nowrap;
}

.legacy-note {
  padding: 2px 8px;
  border-radius: 999px;
  color: #8a5a00;
  background: #fff1cc;
  font-size: 12px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.main {
  padding-block: 24px 36px;
}

.panel {
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .94);
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2,
.pool-head h2 {
  margin-bottom: 3px;
  font-size: 18px;
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 2px 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.auth-tab.active {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

.auth-form {
  display: grid;
  max-width: 420px;
  gap: 14px;
}

.form-error {
  margin: 0;
  padding: 8px 10px;
  color: var(--red);
  background: #fff1f0;
  border: 1px solid #f3b6b0;
  border-radius: 4px;
}

.login-limit {
  color: var(--muted);
  font-size: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

input,
textarea {
  width: 100%;
  border: 1px solid #b9c2d0;
  border-radius: 4px;
  padding: 9px 10px;
  color: var(--text);
  background: var(--white);
}

textarea {
  min-height: 128px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.7;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
}

#upload-form {
  display: grid;
  gap: 12px;
  justify-items: start;
}

#upload-form textarea {
  justify-self: stretch;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
}

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

.paste-status {
  min-height: 26px;
  margin: 0;
  justify-self: stretch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.paste-status.success {
  padding: 8px 12px;
  border-radius: 6px;
  color: #0f6b3f;
  background: #e8f6ee;
  font-size: 19px;
  font-weight: 700;
}

.paste-status.error {
  color: var(--red);
}

.lock-progress {
  margin: 0;
  font-size: 16px;
}

.lock-progress strong {
  color: var(--blue);
  font-size: 22px;
}

.button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
}

.button:disabled {
  cursor: wait;
  opacity: .55;
}

.button.primary {
  color: #fff;
  background: var(--blue);
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button.secondary {
  border-color: #aeb8c7;
  color: var(--text);
  background: #fff;
}

.button.secondary:hover:not(:disabled) {
  border-color: #7c8899;
  background: #f1f3f6;
}

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

#code-count {
  margin-left: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.actions {
  display: flex;
  gap: 8px;
}

.code-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.code-value {
  overflow: hidden;
  font: 700 22px/1.4 Consolas, "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-time {
  color: var(--muted);
  font-size: 12px;
}

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

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .92);
  margin-bottom: 28px;
}

.message {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100% - 32px);
  border-radius: 4px;
  padding: 12px 18px;
  color: #fff;
  background: #344054;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.message.show {
  opacity: 1;
}

.message.error {
  background: var(--red);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 20px, 820px);
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .account {
    width: 100%;
    justify-content: space-between;
  }

  .main {
    padding-top: 14px;
  }

  .panel {
    padding: 16px;
  }

  .pool-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .actions {
    width: 100%;
  }

  .actions .button {
    flex: 1;
  }

  .upload-actions {
    width: 100%;
  }

  .upload-actions .button {
    flex: 1;
  }

  .code-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .code-time {
    grid-column: 1;
  }

  .code-row .button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scenery-actor {
    display: none;
  }
  .message {
    transition: none;
  }
}
