/* ===== Design Tokens ===== */
:root {
  --pink-50:  #fff0f5;
  --pink-100: #ffe0ef;
  --pink-200: #ffb3d1;
  --pink-300: #ff80b3;
  --pink-400: #f06292;
  --pink-500: #ec407a;
  --pink-600: #d81b60;
  --pink-700: #c2185b;

  --text-primary:   #3d1a2e;
  --text-secondary: #7a4060;
  --text-muted:     #b07090;
  --white:          #ffffff;

  --shadow-card:  0 8px 32px rgba(236, 64, 122, 0.18);
  --shadow-hover: 0 14px 44px rgba(236, 64, 122, 0.35);
  --radius-card:  24px;
  --radius-pill:  999px;
  --radius-repo:  12px;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== Base ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: linear-gradient(145deg, #fce4ec 0%, #fff0f5 55%, #fce4ec 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

/* ===== Screen Containers ===== */
.main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.unsupported,
.csdn-warning {
  display: none;
}

/* ===== Card ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 48px 40px 44px;
  text-align: center;
  box-shadow: var(--shadow-card);
  max-width: 380px;
  width: 100%;
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== Card Icon ===== */
.card-icon {
  font-size: 60px;
  line-height: 1;
  margin-bottom: 16px;
  display: block;
}

/* ===== Typography ===== */
.card-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 28px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 12px;
}

/* ===== Status Row ===== */
.status-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius-pill);
  margin-bottom: 28px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status-dot.connected {
  background: #43a047;
  box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.2);
  animation: pulse-green 2s ease-in-out infinite;
}

.status-dot.pending {
  background: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(240, 98, 146, 0.25);
  animation: pulse-pink 0.9s ease-in-out infinite;
}

/* ===== Main Action Button ===== */
#main-button {
  display: block;
  width: 100%;
  padding: 15px 32px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-400) 0%, var(--pink-600) 100%);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(216, 27, 96, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#main-button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--pink-500) 0%, var(--pink-700) 100%);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

#main-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(216, 27, 96, 0.3);
}

#main-button:disabled {
  background: linear-gradient(135deg, var(--pink-200) 0%, var(--pink-300) 100%);
  box-shadow: none;
  cursor: not-allowed;
  letter-spacing: 0.5px;
}

/* ===== Pill Link (unsupported card) ===== */
.pill-link {
  display: inline-block;
  margin-top: 8px;
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pink-600);
  background: var(--white);
  border: 2px solid var(--pink-300);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pill-link:hover {
  background: var(--pink-50);
  border-color: var(--pink-500);
  color: var(--pink-700);
}

/* ===== Warning Card ===== */
.warning-card {
  border-top: 4px solid #ff9800;
}

.warning-title {
  color: #bf360c;
}

.repo-link {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 18px;
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: var(--radius-repo);
  color: var(--pink-600);
  font-size: 13px;
  text-decoration: none;
  word-break: break-all;
  transition: background 0.2s ease;
}

.repo-link:hover {
  background: var(--pink-100);
}

/* ===== Error Dialog ===== */
dialog {
  border: none;
  border-radius: var(--radius-card);
  padding: 0;
  max-width: 440px;
  width: calc(100% - 48px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  animation: fadeUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

dialog::backdrop {
  background: rgba(61, 26, 46, 0.45);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: block;
  padding: 20px 24px;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-700));
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

#dialog-content {
  padding: 20px 24px 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.75;
  margin: 0;
}

#dialog-debug-container {
  margin: 14px 24px;
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  overflow-x: auto;
  color: var(--text-secondary);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 14px 24px 20px;
}

.dialog-actions button {
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.dialog-actions button:hover {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  transform: translateY(-1px);
}

/* ===== Noscript ===== */
.noscript-notice {
  display: block;
  background: var(--pink-100);
  color: var(--pink-700);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);     }
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.2); }
  50%       { box-shadow: 0 0 0 5px rgba(67, 160, 71, 0.08); }
}

@keyframes pulse-pink {
  0%, 100% { box-shadow: 0 0 0 3px rgba(240, 98, 146, 0.25); }
  50%       { box-shadow: 0 0 0 6px rgba(240, 98, 146, 0.08); }
}
