:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: #f4f7fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(29, 45, 68, 0.12);
}

#shareContent[hidden] {
  display: none;
}

h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

.countdown-card {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.countdown-card[hidden] {
  display: none;
}

.countdown-label {
  color: #166534;
  font-size: 13px;
  font-weight: 700;
}

.countdown-value {
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.countdown-card[data-mode="message"] .countdown-value {
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
}

.countdown-card[data-tone="success"] {
  border-color: #86efac;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.countdown-card[data-tone="error"] {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff1f2 0%, #fff7ed 100%);
}

.countdown-card[data-tone="muted"] {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}

.page-title {
  margin-bottom: 18px;
  text-align: center;
  color: #172033;
  white-space: nowrap;
  font-size: clamp(16px, 4.8vw, 22px);
}

.primary-button {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: #1769aa;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: #0f548c;
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.78;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.primary-button.is-loading .spinner {
  display: inline-block;
}

.status {
  min-height: 0;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.status:empty {
  margin: 0;
  line-height: 0;
}

.status[data-tone="muted"] {
  color: #56657a;
}

.status[data-tone="success"] {
  color: #15803d;
  font-weight: 400;
}

.status[data-tone="notice"] {
  color: #d97706;
  font-weight: 400;
}

.status[data-tone="error"] {
  color: #b42318;
}

.credential-card {
  margin-top: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.apple-row {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  margin-top: 9px;
  color: #172033;
  font-size: 16px;
}

.apple-label {
  flex: none;
  color: #172033;
  font-weight: 700;
}

.apple-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #c2410c;
  font-weight: 800;
  letter-spacing: 0;
}

.copy-small {
  flex: none;
  min-width: 72px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d9e2ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #172033;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.copy-small:hover {
  background: #eef3f8;
}

.tutorial {
  margin: 8px 0 0;
}

.tutorial h2 {
  margin: 0 0 12px;
  color: #172033;
  font-size: 26px;
  line-height: 1.2;
  text-align: center;
}

.tutorial img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
}

.tutorial-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.zoom {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.82);
}

.zoom[hidden] {
  display: none;
}

.zoom img {
  max-width: min(100%, 960px);
  max-height: 92vh;
  border-radius: 8px;
  background: #ffffff;
}

.zoom-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #172033;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.admin-shell {
  min-height: 100vh;
  padding: 24px;
  background: #eef4f8;
}

.admin-dashboard {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-header p {
  margin: 8px 0 0;
  color: #56657a;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.admin-panel {
  width: min(100%, 1180px);
  margin: 0 auto 16px;
  padding: 20px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(29, 45, 68, 0.08);
}

.admin-panel h1,
.admin-panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.25;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: #172033;
  font-size: 14px;
  font-weight: 600;
}

.admin-form input,
.admin-form select,
.links-output {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cdd8e6;
  border-radius: 6px;
  padding: 8px 10px;
  color: #172033;
  background: #ffffff;
  font: inherit;
}

.secondary-button,
.admin-actions button {
  min-height: 34px;
  border: 1px solid #cdd8e6;
  border-radius: 6px;
  padding: 0 12px;
  background: #f8fafc;
  color: #172033;
  font-weight: 600;
  cursor: pointer;
}

.secondary-button:hover,
.admin-actions button:hover {
  background: #eef3f8;
}

.admin-list,
.link-table {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5ecf4;
  border-radius: 8px;
  background: #fbfdff;
}

.admin-item div:first-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.admin-item strong,
.admin-item span,
.admin-item small {
  overflow-wrap: anywhere;
}

.admin-item small {
  color: #56657a;
}

.admin-actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.copy-all-row {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0 8px;
}

.links-output {
  min-height: 140px;
  resize: vertical;
}

.empty {
  margin: 0;
  color: #56657a;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .shell {
    align-items: start;
    padding: 18px;
  }

  .panel {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 24px;
  }

  .tutorial h2 {
    font-size: 24px;
  }

  .countdown-value {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .shell {
    padding: 14px;
  }

  .panel {
    padding: 20px;
  }

  h1 {
    font-size: 19px;
  }

  .apple-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    font-size: 15px;
  }

  .copy-small {
    min-width: 44px;
    padding: 0 8px;
  }

  .tutorial h2 {
    font-size: 22px;
  }

  .countdown-card {
    padding: 12px;
  }

  .countdown-value {
    font-size: 25px;
  }

  .admin-shell {
    padding: 14px;
  }

  .admin-header,
  .admin-item {
    display: grid;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}
