:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --panel: #ffffff;
  --ink: #18212f;
  --muted: #687385;
  --line: #dfe5ec;
  --accent: #0f766e;
  --accent-strong: #0b5d56;
  --accent-soft: #e7f5f3;
  --warn: #b45309;
  --shadow: 0 16px 45px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

.resource-panel {
  width: min(100%, 640px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.brand-row,
.author-strip,
.meta-line,
.desktop-qr,
.file-row,
.action-stack,
.fallback-actions,
.link-form {
  display: flex;
}

.brand-row {
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.meta-line {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.author-strip {
  align-items: center;
  gap: 10px;
  margin: 22px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.author-strip img,
.avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.author-strip img {
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.file-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.file-row {
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-icon {
  flex: 0 0 44px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.file-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-size {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.action-stack {
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

.fallback-actions {
  gap: 10px;
}

button,
a.secondary-action {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-action {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.secondary-action {
  flex: 1;
  background: #18212f;
  color: #fff;
}

.ghost-action {
  flex: 1;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.ghost-action.wide {
  width: 100%;
  margin-top: 16px;
}

.desktop-qr {
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.desktop-qr img {
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
}

.empty-state h1 {
  margin-bottom: 18px;
}

.link-form {
  flex-direction: column;
  gap: 10px;
}

.link-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.link-form button {
  background: var(--accent);
  color: #fff;
}

.error-text {
  margin: 0 0 14px;
  color: var(--warn);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 8px;
  background: #18212f;
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
}

[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .page-shell {
    padding: 14px;
    place-items: stretch;
  }

  .resource-panel {
    padding: 18px;
  }

  h1 {
    font-size: 21px;
  }

  .desktop-qr,
  .fallback-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .file-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .file-size {
    margin-left: 56px;
  }
}
