:root {

  --brand: #7a5cff;
  --brand-600: #6b4fff;
  --brand-700: #5a42ee;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e6e8ef;
  --ring: rgba(122, 92, 255, 0.35);

  --radius: 18px;
  --radius-lg: 22px;
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.06);

  --font-sans: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f14;
    --surface: #14161e;
    --surface-2: #0f1117;
    --text: #e7e9f0;
    --muted: #a3a9b7;
    --border: rgba(255, 255, 255, 0.08);
    --ring: rgba(122, 92, 255, 0.45);
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrapper {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-shadow: var(--shadow);
}

.site-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
}
.site-logo img[data-theme="dark"] { display: none; }
@media (prefers-color-scheme: dark) {
  .site-logo img[data-theme="light"] { display: none; }
  .site-logo img[data-theme="dark"] { display: block; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
}

.title {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 6px 0;
}

.subtitle,
.fileline,
.note {
  color: var(--muted);
  font-size: 15px;
}

.subtitle { margin: 0 0 18px; }
.fileline { margin-bottom: 18px; }
.note { margin-top: 10px; font-size: 14px; }

.ad {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 18px;
  margin: 20px 0;
}

.content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin: 22px 0;
  text-align: left;
}
.content h2 { margin: 0 0 8px; font-size: 20px; }
.content p { margin: 0 0 14px; }
.content .readmore {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.content .readmore:hover { text-decoration: underline; }

.cover {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
}
.cover img {
  max-width: 100%;
  max-height: 280px;
  height: auto;
  width: auto;
  border-radius: 12px;
  display: block;
}

.url-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  max-width: 100%;
  word-break: break-all;
  color: #5b36ad;
}
@media (prefers-color-scheme: dark) {
  .url-box { color: #b9a5f7; }
}

.actions,
.download-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  transition:
    transform .04s ease,
    box-shadow .2s ease,
    background .2s ease,
    opacity .2s ease;
  color: var(--text);
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 4px var(--ring); }

.btn-ghost {
  border-color: var(--border);
  background: transparent;
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-600) 100%);
  box-shadow: 0 8px 20px rgba(122, 92, 255, 0.35);
  padding: 14px 28px;
  font-size: 16px;
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--brand-600) 0%, var(--brand-700) 100%);
  transform: translateY(-1px);
}
.btn-primary[aria-disabled="true"] {
  background: linear-gradient(180deg, #b8b8b8, #a4a4a4);
  box-shadow: none;
  cursor: not-allowed;
  color: #fff;
  opacity: 1;
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.spinner--dark {
  border-color: rgba(0, 0, 0, 0.18);
  border-top-color: #000;
}
@media (prefers-color-scheme: dark) {
  .spinner {
    border-color: rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
  }
}

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

@media (max-width: 768px) {
  .wrapper { padding: 14px; }
  .card { padding: 22px 16px; }
  .title { font-size: 24px; }
  .cover img { max-height: 200px; }
  .site-logo img { width: 150px; height: 36px; }
}

@media (max-width: 480px) {
  .site-logo img { width: 120px; height: 29px; }
}

.text-center { text-align: center; }