/* ==========================================================================
 * /contribute — 投稿
 * ========================================================================== */

body.page-contribute {
  --ctb-accent: #ff5745;
  --ctb-accent-2: #ff5745;
  --ctb-ink: #15202b;
  --ctb-muted: #667085;
  --ctb-line: rgba(21, 32, 43, 0.08);
  --ctb-surface: #ffffff;
  --ctb-surface-2: #f3f6f8;
  --ctb-canvas: #eef3f6;
  --ctb-radius: 16px;
  --ctb-ease: cubic-bezier(0.22, 0.8, 0.28, 1);
  --ctb-header-offset: 56px;
}

body.page-contribute.nice-dark-mode {
  --ctb-ink: #f2f4f7;
  --ctb-muted: #a8b0bd;
  --ctb-line: rgba(255, 255, 255, 0.1);
  --ctb-surface: #23272e;
  --ctb-surface-2: #2c313a;
  --ctb-canvas: #171a1f;
}

body.page-contribute.ctb-lock {
  overflow: hidden;
}

.ctb-page {
  color: var(--ctb-ink);
  background:
    radial-gradient(900px 380px at 88% -6%, rgba(255, 87, 69, 0.08), transparent 55%),
    linear-gradient(180deg, #f7fafb 0%, var(--ctb-canvas) 50%);
  min-height: 70vh;
  padding-bottom: 5.5rem;
}

.nice-dark-mode .ctb-page {
  background:
    radial-gradient(800px 360px at 90% 0%, rgba(255, 87, 69, 0.12), transparent 52%),
    linear-gradient(180deg, #14171c 0%, #171a1f 100%);
}

#ctb-kind-card,
#ctb-cover-card,
#ctb-video-card,
#ctb-info-card,
#ctb-publish-card {
  scroll-margin-top: calc(var(--ctb-header-offset) + 0.75rem);
}

.ctb-page .container,
.ctb-page .ctb-shell {
  width: 100%;
}

.ctb-hero {
  position: relative;
  color: inherit;
  margin: 0 0 1rem;
  padding-top: calc(var(--ctb-header-offset) + 0.75rem);
  background: transparent;
}

@keyframes ctbRise {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}

.ctb-hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  animation: ctbRise 0.5s var(--ctb-ease) both;
}

.ctb-hero-copy {
  min-width: 0;
}

.ctb-hero h1 {
  margin: 0;
  font-family: "OPPOSans", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: clamp(1.28rem, 2.4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ctb-ink);
}

.ctb-hero-aside {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.2rem;
  padding-bottom: 0.12rem;
}

.ctb-hero-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 2rem;
  padding: 0.2rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ctb-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.18s var(--ctb-ease), background 0.18s var(--ctb-ease);
}

.ctb-hero-link .iconfont {
  font-size: 0.95rem;
  line-height: 1;
}

.ctb-hero-link:hover {
  color: var(--ctb-ink);
  background: var(--ctb-surface);
}

.ctb-hero-link:focus-visible {
  outline: 2px solid var(--ctb-accent);
  outline-offset: 2px;
}

#ctb-draft-chip {
  color: var(--ctb-accent);
  background: rgba(255, 87, 69, 0.1);
}

#ctb-draft-chip:hover {
  color: var(--ctb-accent);
  background: rgba(255, 87, 69, 0.16);
}

.ctb-steps {
  margin: 0.9rem 0 0;
  padding: 0.22rem;
  border-radius: 999px;
  background: var(--ctb-surface);
  border: 1px solid var(--ctb-line);
  box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.45);
}

.ctb-steps ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.18rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ctb-steps li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 2.15rem;
  border-radius: 999px;
  color: var(--ctb-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s var(--ctb-ease), color 0.18s var(--ctb-ease);
}

.ctb-steps li:hover { color: var(--ctb-ink); background: var(--ctb-surface-2); }

.ctb-steps i {
  display: grid;
  place-items: center;
  width: 1.22rem;
  height: 1.22rem;
  border-radius: 99px;
  background: var(--ctb-surface-2);
  font-style: normal;
  font-size: 0.68rem;
}

.ctb-steps li.is-current,
.ctb-steps li.is-current:hover {
  color: #fff;
  background: linear-gradient(180deg, #ff6b5b, var(--ctb-accent));
}
.ctb-steps li.is-current i { background: rgba(255, 255, 255, 0.22); color: #fff; }
.ctb-steps li.is-done { color: var(--ctb-ink); }
.ctb-steps li.is-done i { background: rgba(22, 163, 74, 0.16); color: #16a34a; }

.nice-dark-mode .ctb-hero-link:hover {
  background: var(--ctb-surface-2);
}

.nice-dark-mode .ctb-steps {
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.7);
}

.ctb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.ctb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.45rem;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ctb-ease), background 0.2s var(--ctb-ease), box-shadow 0.2s var(--ctb-ease), color 0.2s;
}

.ctb-btn:active { transform: translateY(1px); }
.ctb-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.ctb-btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #ff6b5b, var(--ctb-accent));
  box-shadow: 0 10px 22px -12px rgba(255, 87, 69, 0.9);
}

.ctb-btn-primary:hover { color: #fff; filter: brightness(1.04); }

.ctb-btn-ghost {
  color: inherit;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.ctb-page .ctb-btn-ghost {
  color: var(--ctb-ink);
  background: var(--ctb-surface);
  border-color: var(--ctb-line);
}

.ctb-btn-sm {
  min-height: 2rem;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
}

.ctb-btn-block { width: 100%; }

.ctb-shell { padding-bottom: 1rem; }

.ctb-login-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--ctb-radius);
  background: var(--ctb-surface);
  border: 1px solid var(--ctb-line);
  box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.45);
}

.ctb-login-banner strong {
  display: block;
  font-size: 0.92rem;
}

.ctb-login-banner span {
  display: block;
  margin-top: 0.15rem;
  color: var(--ctb-muted);
  font-size: 0.8rem;
}

.ctb-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 992px) {
  .ctb-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
  .ctb-side { position: sticky; top: calc(var(--ctb-header-offset) + 1rem); }
}

.ctb-card {
  background: var(--ctb-surface);
  border: 1px solid var(--ctb-line);
  border-radius: var(--ctb-radius);
  padding: 1.15rem 1.15rem 1.25rem;
  box-shadow: 0 16px 36px -28px rgba(15, 23, 42, 0.55);
}

.ctb-card + .ctb-card { margin-top: 1rem; }

.ctb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.ctb-card-head h2,
.ctb-success h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.ctb-card-head p {
  margin: 0.25rem 0 0;
  color: var(--ctb-muted);
  font-size: 0.82rem;
}

.ctb-req,
.ctb-complete {
  flex: 0 0 auto;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 87, 69, 0.1);
  color: var(--ctb-accent);
}

.ctb-complete { background: rgba(255, 87, 69, 0.1); color: var(--ctb-accent); }

.ctb-check {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: -0.35rem 0 0.85rem;
  padding: 0;
  list-style: none;
}

.ctb-check li {
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--ctb-surface-2);
  color: var(--ctb-muted);
  font-size: 0.72rem;
}

.ctb-check li.is-on {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.nice-dark-mode .ctb-check li.is-on {
  background: rgba(74, 222, 128, 0.16);
  color: #86efac;
}

.ctb-kinds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.ctb-kind {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--ctb-line);
  background: var(--ctb-surface-2);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.ctb-kind strong { font-size: 0.92rem; }
.ctb-kind:hover { border-color: rgba(255, 87, 69, 0.35); }
.ctb-kind.is-on {
  border-color: color-mix(in srgb, var(--ctb-accent) 55%, var(--ctb-line));
  background: rgba(255, 87, 69, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 87, 69, 0.12);
}

.ctb-kind:focus-visible {
  outline: 2px solid var(--ctb-accent);
  outline-offset: 2px;
}

.ctb-md {
  border: 1px solid var(--ctb-line);
  border-radius: 12px;
  background: var(--ctb-surface-2);
  overflow: hidden;
}

.ctb-md-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--ctb-line);
  background: var(--ctb-surface);
}

.ctb-md-bar button {
  min-height: 1.85rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.ctb-md-bar button:hover,
.ctb-md-bar button.is-on { background: rgba(255, 87, 69, 0.1); color: var(--ctb-accent); }
.ctb-md-sep { width: 1px; align-self: stretch; background: var(--ctb-line); margin: 0.15rem 0.2rem; }

.ctb-md textarea {
  display: block;
  width: 100%;
  min-height: 10rem;
  padding: 0.8rem 0.9rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  resize: vertical;
}

.ctb-md textarea:focus { box-shadow: none; background: transparent; }
.ctb-md-preview {
  min-height: 10rem;
  padding: 0.8rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.7;
  word-break: break-word;
}

.ctb-md-preview h2,
.ctb-md-preview h3 { margin: 0.7em 0 0.35em; font-size: 1.05rem; color: var(--ctb-ink); }
.ctb-md-preview p { margin: 0.4em 0; }
.ctb-md-preview ul,
.ctb-md-preview ol { margin: 0.4em 0; padding-left: 1.2rem; }
.ctb-md-preview blockquote {
  margin: 0.5em 0;
  padding: 0.15em 0.8em;
  border-left: 3px solid var(--ctb-accent-2);
  color: var(--ctb-muted);
}
.ctb-md-preview code {
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: var(--ctb-surface);
  font-size: 0.85em;
}
.ctb-md.is-preview textarea { display: none; }
.ctb-md.is-preview .ctb-md-preview { display: block; }

.ctb-md .ctb-count { position: static; display: block; text-align: right; padding: 0.2rem 0.7rem 0.45rem; }

.ctb-drop-video.has-file { min-height: 200px; }
.ctb-video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}

.ctb-drop {
  position: relative;
  min-height: 168px;
  border: 1.5px dashed rgba(255, 87, 69, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 87, 69, 0.05), transparent 46%),
    var(--ctb-surface-2);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ctb-ease);
}

.ctb-drop:hover,
.ctb-drop.is-over,
.ctb-drop:focus-visible {
  border-color: var(--ctb-accent);
  box-shadow: 0 0 0 4px rgba(255, 87, 69, 0.14);
  outline: none;
}

.ctb-drop.is-over { transform: scale(1.01); }

.ctb-drop.has-file {
  min-height: 220px;
  border-style: solid;
  cursor: default;
}

.ctb-drop-idle,
.ctb-drop-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  padding: 1.1rem 1.15rem;
  text-align: center;
  gap: 0.3rem;
}

.ctb-drop-idle .ctb-btn {
  margin-top: 0.55rem;
  pointer-events: auto;
}

.ctb-drop-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  margin-bottom: 0.25rem;
  border-radius: 999px;
  color: var(--ctb-accent);
  background: rgba(255, 87, 69, 0.1);
}

.ctb-drop-idle strong { font-size: 1rem; }
.ctb-drop-idle span,
.ctb-drop-progress span { color: var(--ctb-muted); font-size: 0.82rem; }

.ctb-drop-preview { position: absolute; inset: 0; }
.ctb-drop-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ctb-drop-mask {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 2.4rem 0.9rem 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.62));
  color: #fff;
}

.ctb-drop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.ctb-drop-meta span {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.ctb-drop-actions { display: flex; gap: 0.4rem; }
.ctb-drop-actions .ctb-btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.ctb-progress {
  width: min(18rem, 80%);
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 87, 69, 0.14);
  overflow: hidden;
}

.ctb-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a7a, var(--ctb-accent));
  transition: width 0.18s linear;
}

.ctb-field { display: block; margin-top: 0.95rem; position: relative; }
.ctb-field:first-child { margin-top: 0; }

.ctb-label {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.ctb-label em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ctb-accent);
}

.ctb-label small,
.ctb-hint { color: var(--ctb-muted); font-weight: 400; font-size: 0.78rem; }

.ctb-field input[type="text"],
.ctb-field input[type="number"],
.ctb-field input[type="url"],
.ctb-field textarea {
  width: 100%;
  border: 1px solid var(--ctb-line);
  border-radius: 12px;
  background: var(--ctb-surface-2);
  color: inherit;
  padding: 0.72rem 0.85rem;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.ctb-field textarea { resize: vertical; min-height: 7rem; line-height: 1.65; }

.ctb-field input:focus,
.ctb-field textarea:focus {
  border-color: rgba(255, 87, 69, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 87, 69, 0.12);
  background: var(--ctb-surface);
}

.ctb-count {
  position: absolute;
  right: 0.7rem;
  bottom: 0.55rem;
  font-size: 0.72rem;
  color: var(--ctb-muted);
  pointer-events: none;
}

.ctb-field input[type="text"] + .ctb-count { bottom: auto; top: 2.55rem; }

.ctb-field.is-invalid input,
.ctb-field.is-invalid textarea,
.ctb-drop.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.ctb-field-msg {
  margin: 0.4rem 0 0;
  color: #ef4444;
  font-size: 0.78rem;
}

.ctb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--ctb-line);
  background: var(--ctb-surface-2);
  min-height: 2.7rem;
}

.ctb-tags input {
  flex: 1 1 7rem;
  min-width: 6rem;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.35rem 0.4rem;
  outline: none;
  font-size: 16px;
}

.ctb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.5rem 0.22rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 87, 69, 0.1);
  color: var(--ctb-accent);
  font-size: 0.8rem;
}

.ctb-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
}

.ctb-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.ctb-cat {
  text-align: center;
  border: 1px solid var(--ctb-line);
  background: var(--ctb-surface-2);
  color: inherit;
  border-radius: 12px;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ctb-ease);
}

.ctb-cat strong { display: block; font-size: 0.86rem; }

.ctb-cat:hover { border-color: rgba(255, 87, 69, 0.35); }
.ctb-cat.is-on {
  border-color: color-mix(in srgb, var(--ctb-accent) 55%, var(--ctb-line));
  background: rgba(255, 87, 69, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 87, 69, 0.12);
}

.ctb-license { display: grid; gap: 0.45rem; }

.ctb-license-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--ctb-line);
  background: var(--ctb-surface-2);
  cursor: pointer;
}

.ctb-license-item.is-on {
  border-color: color-mix(in srgb, var(--ctb-accent) 50%, var(--ctb-line));
  background: rgba(255, 87, 69, 0.06);
}

.ctb-license-item input { margin-top: 0.15rem; accent-color: var(--ctb-accent); }
.ctb-license-item strong { display: block; font-size: 0.86rem; }

.ctb-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ctb-switch-row .ctb-label { margin-bottom: 0; }

.ctb-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

.ctb-switch input { position: absolute; opacity: 0; }
.ctb-switch i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: #c5ccd4;
  transition: background 0.2s;
}

.ctb-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s var(--ctb-ease);
}

.ctb-switch input:checked + i { background: var(--ctb-accent); }
.ctb-switch input:checked + i::after { transform: translateX(18px); }

.ctb-price { margin-top: 0.7rem; }
.ctb-price-pills { display: flex; gap: 0.4rem; margin-bottom: 0.55rem; }
.ctb-price-pills button {
  flex: 1;
  min-height: 2.2rem;
  border-radius: 10px;
  border: 1px solid var(--ctb-line);
  background: var(--ctb-surface-2);
  color: inherit;
  cursor: pointer;
}
.ctb-price-pills button.is-on {
  border-color: var(--ctb-accent);
  background: rgba(255, 87, 69, 0.1);
  color: var(--ctb-accent);
  font-weight: 600;
}

.ctb-agree {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  margin: 1rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--ctb-muted);
}

.ctb-agree label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.ctb-agree input { margin: 0; accent-color: var(--ctb-accent); }

.ctb-link {
  border: 0;
  background: none;
  color: var(--ctb-accent);
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.ctb-draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0.95rem 0 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: var(--ctb-surface-2);
  border: 1px solid var(--ctb-line);
}

.ctb-draft-bar > small {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ctb-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.ctb-draft-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.ctb-draft-help {
  margin: 0 0 0.75rem;
  color: var(--ctb-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.ctb-draft-list {
  display: grid;
  gap: 0.5rem;
}

.ctb-draft-empty {
  padding: 1.6rem 0.8rem;
  text-align: center;
  color: var(--ctb-muted);
  font-size: 0.86rem;
}

.ctb-draft-item {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--ctb-line);
  background: var(--ctb-surface-2);
  overflow: hidden;
}

.ctb-draft-item.is-current {
  border-color: var(--ctb-accent);
  box-shadow: 0 0 0 3px rgba(255, 87, 69, 0.12);
}

.ctb-draft-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.ctb-draft-main strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctb-draft-main span {
  display: block;
  margin-top: 0.2rem;
  color: var(--ctb-muted);
  font-size: 0.74rem;
}

.ctb-draft-item [data-action="delete-draft"] {
  flex: 0 0 auto;
  width: 2.4rem;
  border: 0;
  background: transparent;
  color: var(--ctb-muted);
  font-size: 1.15rem;
  cursor: pointer;
}

.ctb-draft-item [data-action="delete-draft"]:hover {
  color: var(--ctb-accent);
  background: rgba(255, 87, 69, 0.08);
}

.ctb-tips h3 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.ctb-tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.ctb-tips-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  background: var(--ctb-surface-2);
  border: 1px solid var(--ctb-line);
}

.ctb-tips-list i {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--ctb-accent-2);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
}

.ctb-tips-list span {
  display: block;
  color: var(--ctb-ink);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

body.page-contribute.ctb-success-mode .ctb-page {
  padding-bottom: 2rem;
}

body.page-contribute.ctb-success-mode .ctb-dock {
  display: none !important;
}

.ctb-success {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: calc(100svh - var(--ctb-header-offset));
  padding: calc(var(--ctb-header-offset) + 1.25rem) 0.75rem calc(2rem + env(safe-area-inset-bottom, 0px));
  scroll-margin-top: calc(var(--ctb-header-offset) + 0.5rem);
}

.ctb-success-card {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1.25rem 1.5rem;
  border-radius: var(--ctb-radius);
  background: var(--ctb-surface);
  border: 1px solid var(--ctb-line);
  box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.45);
  animation: ctbRise 0.5s var(--ctb-ease) both;
}

.ctb-success-icon {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 0.85rem;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: rgba(22, 163, 74, 0.14);
  color: #16a34a;
  font-size: 1.55rem;
  line-height: 1;
}

.ctb-success-icon .iconfont {
  font-size: 1.55rem;
  line-height: 1;
}

.ctb-success h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ctb-success p {
  margin: 0.55rem 0 0;
  color: var(--ctb-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.ctb-success .ctb-hero-actions {
  justify-content: center;
  margin-top: 1.25rem;
  gap: 0.5rem;
}

@supports not (min-height: 100svh) {
  .ctb-success {
    min-height: calc(100vh - var(--ctb-header-offset));
  }
}

.ctb-dock {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  padding: 0.65rem 0.9rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  background: color-mix(in srgb, var(--ctb-surface, #fff) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ctb-line, rgba(21, 32, 43, 0.08));
  box-shadow: 0 -10px 28px -18px rgba(15, 23, 42, 0.35);
}

.nice-dark-mode .ctb-dock {
  background: color-mix(in srgb, var(--ctb-surface, #23272e) 92%, transparent);
}

.ctb-dock-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 42rem;
  margin: 0 auto;
}

.ctb-dock-hint {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ctb-muted, #667085);
  font-size: 0.76rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctb-dock-fix {
  flex: 0 0 auto;
  min-width: 0;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.ctb-dock .ctb-dock-submit {
  flex: 0 0 auto;
  min-width: 5.8rem;
  min-height: 2.65rem;
  color: #fff;
  background: linear-gradient(180deg, #ff6b5b, #ff5745);
  box-shadow: 0 10px 22px -12px rgba(255, 87, 69, 0.9);
}

@media (max-width: 991.98px) {
  .ctb-dock { display: block; }
  .ctb-side-card .ctb-btn-block { display: none; }
  body.page-contribute .fixed-to-top { display: none !important; }
  .ctb-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ctb-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ctb-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 24, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ctb-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 36rem;
  max-height: min(86vh, 640px);
  overflow: hidden;
  background: var(--ctb-surface, #fff);
  color: var(--ctb-ink, #15202b);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
  .ctb-modal {
    align-items: center;
    padding: 1.25rem;
  }
  .ctb-modal-panel {
    border-radius: 18px;
    max-height: min(80vh, 640px);
  }
}

.ctb-dialog-head,
.ctb-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  flex: 0 0 auto;
}

.ctb-dialog-head { border-bottom: 1px solid var(--ctb-line, rgba(21, 32, 43, 0.08)); }
.ctb-dialog-foot { border-top: 1px solid var(--ctb-line, rgba(21, 32, 43, 0.08)); justify-content: flex-end; }
.ctb-dialog-head h2 { margin: 0; font-size: 1rem; line-height: 1.35; }

.ctb-dialog-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 99px;
  background: var(--ctb-surface-2, #f3f6f8);
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.ctb-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem 1.1rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ctb-muted, #667085);
}

.ctb-dialog-body h3 { margin: 1rem 0 0.35rem; color: var(--ctb-ink, #15202b); font-size: 0.92rem; }
.ctb-dialog-body p { margin: 0.4rem 0; }
.ctb-dialog-body ul { padding-left: 1.1rem; }
.ctb-dialog-foot .ctb-btn-ghost {
  color: var(--ctb-ink, #15202b);
  background: var(--ctb-surface-2, #f3f6f8);
  border-color: var(--ctb-line, rgba(21, 32, 43, 0.08));
}
.ctb-dialog-foot .ctb-btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #ff6b5b, #ff5745);
}

.ctb-page [hidden],
.ctb-dock[hidden],
.ctb-modal[hidden] { display: none !important; }

@media (max-width: 767.98px) {
  .ctb-hero { padding-top: calc(var(--ctb-header-offset) + 0.55rem); margin-bottom: 0.7rem; }
  .ctb-hero-top {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
  .ctb-hero-aside { width: auto; margin-left: 0; }
  .ctb-hero h1 { font-size: 1.2rem; }
  .ctb-steps {
    border-radius: 14px;
    position: sticky;
    top: var(--ctb-header-offset);
    z-index: 30;
  }
  .ctb-steps ol { gap: 0.1rem; }
  .ctb-steps li {
    min-height: 2rem;
    font-size: 0.72rem;
    gap: 0.22rem;
  }
  .ctb-steps i {
    width: 1.05rem;
    height: 1.05rem;
    font-size: 0.62rem;
  }
  .ctb-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ctb-kind { min-height: 2.55rem; }
  .ctb-login-banner { flex-direction: row; align-items: center; }
  .ctb-login-banner .ctb-btn { flex: 0 0 auto; }
  .ctb-drop-mask { flex-direction: column; align-items: flex-start; }
  .ctb-card { padding: 0.9rem 0.85rem 1rem; }
  .ctb-card-head { margin-bottom: 0.7rem; }
  .ctb-md-bar { overflow-x: auto; flex-wrap: nowrap; }
  .ctb-draft-bar { flex-direction: row; align-items: center; }
  .ctb-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ctb-cats .ctb-cat:nth-child(4),
  .ctb-cats .ctb-cat:nth-child(5) { grid-column: span 1; }
  .ctb-dock-inner { gap: 0.4rem; }
  .ctb-dock-fix { font-size: 0.78rem; min-height: 2.45rem; }
  .ctb-dock .ctb-dock-submit {
    min-width: 5.2rem;
    min-height: 2.55rem;
    font-size: 0.88rem;
  }
  .ctb-success {
    min-height: calc(100svh - var(--ctb-header-offset));
    padding-top: calc(var(--ctb-header-offset) + 1rem);
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    align-items: flex-start;
  }
  .ctb-success-card {
    margin-top: 0.35rem;
    padding: 1.65rem 1.1rem 1.35rem;
  }
  .ctb-success .ctb-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ctb-success .ctb-hero-actions .ctb-btn {
    width: 100%;
    min-height: 2.65rem;
  }
  .ctb-dialog-foot {
    padding-bottom: calc(0.95rem + env(safe-area-inset-bottom, 0px));
  }
  .ctb-dialog-foot .ctb-btn {
    min-height: 2.6rem;
  }
}
