:root {
  color-scheme: light;
  --bg-base: #fff3ef;
  --bg-accent: #ffe1d6;
  --text-main: #1b1b1f;
  --text-muted: #6b5b55;
  --primary: #e24a3b;
  --primary-dark: #b93a2e;
  --accent: #ff8a54;
  --card: rgba(255, 255, 255, 0.92);
  --line: #f1d9d1;
  --shadow: 0 28px 60px rgba(27, 20, 18, 0.15);
  --shadow-soft: 0 14px 30px rgba(27, 20, 18, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1000px 540px at 85% -8%, #ffd8c8 0%, transparent 60%),
    radial-gradient(860px 480px at 10% 18%, #ffe9df 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-base) 0%, #fff7f4 100%);
  display: flex;
  justify-content: center;
  padding: 0 16px 72px;
}

.page {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-items: stretch;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 8px;
  background: #f3f4f7;
  box-shadow: inset 0 0 0 1px rgba(27, 20, 18, 0.06);
  gap: 6px;
  width: fit-content;
  align-self: center;
  margin-top: 20px;
}

.tab-btn {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  background: transparent;
  color: #6f6a66;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #ff6b57 0%, #ff8a54 100%);
  box-shadow: 0 6px 16px rgba(255, 120, 90, 0.25);
  transform: translateY(-1px);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.tab-panel.active {
  display: flex;
}

.hero {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.badge {
  align-self: stretch;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #fff3ee 100%);
  border: 1px solid rgba(226, 74, 59, 0.2);
  box-shadow: var(--shadow-soft);
}

.badge img {
  width: 60%;
  height: 60%;
  display: block;
  object-fit: contain;
}

.douyin-logo {
  filter: drop-shadow(0 4px 10px rgba(226, 74, 59, 0.25));
}

.input-icon .douyin-logo {
  width: 18px;
  height: 18px;
  filter: none;
}

.input-icon .name-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.hero-text h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.4px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary-dark);
  font-weight: 600;
}

.subtext {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 22px 22px 26px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(241, 217, 209, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.unbind-card {
  padding: 16px;
}

.unbind-image {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid #f2d8cf;
  display: block;
  box-shadow: 0 14px 28px rgba(27, 20, 18, 0.12);
}

form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-actions {
  display: flex;
  justify-content: center;
  padding: 10px 0 0;
}

.notice-card {
  padding: 14px 18px;
  gap: 8px;
}

.notice-title {
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 2px;
  font-size: clamp(12px, 3vw, 13px);
}

.notice-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notice-item {
  font-size: clamp(12px, 2.4vw, 13.5px);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  letter-spacing: -0.1px;
}

.notice-item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0;
  font-size: 14px;
}

.input-wrap {
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  background: #fffaf8;
  border: 1px solid #f2d8cf;
  padding: 12px 14px;
  gap: 12px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
  border-color: rgba(226, 74, 59, 0.6);
  box-shadow: 0 0 0 3px rgba(226, 74, 59, 0.12);
}

.input-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff1ea;
  border: 1px solid #f2d8cf;
}

.input-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  flex: 1;
  color: var(--text-main);
}

input::placeholder {
  color: #9aa6b2;
}

.helper {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.helper-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.nickname-row {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff4ef;
  border: 1px dashed transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  transition: border 0.2s ease, color 0.2s ease;
}

.nickname-row[data-state="loading"] {
  color: #8a5a30;
  border-color: rgba(255, 138, 84, 0.45);
  background: rgba(255, 236, 226, 0.9);
}

.nickname-row[data-state="success"] {
  color: var(--text-muted);
  border-color: transparent;
  background: #fff4ef;
}

#nicknameRow[data-state="success"] #nicknameValue {
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 14px;
}

.nickname-row[data-state="error"] {
  color: #8f2b2b;
  border-color: rgba(219, 70, 70, 0.35);
  background: rgba(255, 232, 232, 0.9);
}

.nickname-label {
  font-weight: 600;
}

.notice {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: #fff7f2;
  border: 1px solid #f2d8cf;
}

.notice-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 13px;
  letter-spacing: 0.4px;
}

.notice ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.notice li {
  position: relative;
  padding-left: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #e24a3b 0%, #ff764a 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(226, 74, 59, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  width: 100%;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(226, 74, 59, 0.32);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.modal-card .primary-btn {
  margin-top: 16px;
}

.modal,
.zoom-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(30, 24, 22, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
  overscroll-behavior: contain;
  touch-action: none;
}

.modal.show,
.zoom-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(560px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
  box-shadow: 0 30px 70px rgba(27, 20, 18, 0.25);
  position: relative;
  border: 1px solid rgba(241, 217, 209, 0.85);
}

.icon-btn {
  position: absolute;
  right: 16px;
  top: 16px;
  border: none;
  background: #fff2ec;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #6b5b55;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.status-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8060 0%, #e24a3b 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 26px rgba(226, 74, 59, 0.35);
}

.status-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-icon.error {
  background: linear-gradient(135deg, #f06a6a 0%, #d93636 100%);
  box-shadow: 0 12px 26px rgba(217, 54, 54, 0.3);
}

.status-icon.error svg {
  stroke-width: 2.4;
}

.guide-block img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid #f2d8cf;
  box-shadow: 0 12px 28px rgba(27, 20, 18, 0.12);
  cursor: pointer;
}

.guide-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-tip {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.guide-block h3 {
  margin: 12px 0 2px;
  font-size: 16px;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.65;
}

.steps li::before {
  content: counter(step);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(226, 74, 59, 0.12);
  color: var(--primary-dark);
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 12px;
}

.key {
  color: var(--primary);
  font-weight: 600;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(226, 74, 59, 0.08);
}

.zoom-overlay img {
  max-width: min(92vw, 720px);
  max-height: 88vh;
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(27, 20, 18, 0.35);
  transition: transform 0.2s ease;
  transform-origin: center center;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  will-change: transform;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  backface-visibility: hidden;
}

.zoom-overlay.zoomed img {
  cursor: zoom-out;
}

@media (max-width: 480px) {
  .hero {
    align-items: center;
  }

  .badge {
    width: 48px;
    height: 48px;
    align-self: center;
    border-radius: 14px;
  }

  .card {
    padding: 18px;
  }

  .modal-card {
    padding: 20px;
  }
}

@media (max-width: 360px) {
  .notice-card {
    padding: 12px 14px;
  }

  .notice-item {
    font-size: 10px;
    white-space: normal;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
