:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: rgba(255, 255, 255, 0.92);
  --line: #d9e0ef;
  --text: #162033;
  --muted: #64718a;
  --accent: #4f46e5;
  --pink: #ef5da8;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top, #ffffff 0, #eef3ff 35%, var(--bg) 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 48px;
}

.hero-card,
.composer-card,
.photo-card,
.audit-tips {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  border-radius: 28px;
  padding: 32px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-copy {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-badge {
  min-width: 160px;
  border-radius: 24px;
  padding: 28px 20px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: white;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}

.composer-card {
  margin-top: 28px;
  border-radius: 28px;
  padding: 24px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(280px, 0.95fr) 1.4fr;
}

.login-card {
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(130deg, rgba(79, 70, 229, 0.08), rgba(239, 93, 168, 0.12));
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.login-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.upload-panel {
  display: grid;
  gap: 18px;
}

.upload-dropzone {
  min-height: 320px;
  border: 2px dashed #b9c4e2;
  border-radius: 24px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 28px;
  cursor: pointer;
  transition: 0.25s ease;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.05), rgba(239, 93, 168, 0.08));
  text-align: center;
}

.upload-dropzone:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 2rem;
}

.upload-dropzone strong {
  font-size: 1.2rem;
}

.upload-dropzone span {
  color: var(--muted);
  line-height: 1.6;
}

#auditBadge,
#previewImage {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 18px;
  margin-top: 12px;
}

#previewImage {
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.18);
}

.audit-tips {
  border-radius: 20px;
  padding: 20px;
}

.audit-tips ul {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

#mailConfigNote {
  color: var(--muted);
  margin-bottom: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label span {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.7;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(79, 70, 229, 0.25);
  border-color: var(--accent);
}

.full-width {
  grid-column: 1 / -1;
}

.actions-row {
  margin-top: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.primary-btn,
.like-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: white;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.28);
}

.primary-btn:hover,
.like-btn:hover {
  transform: translateY(-1px) scale(1.01);
}

.form-status,
.refresh-note,
.card-author,
.card-description,
.vote-feedback {
  color: var(--muted);
}

.gallery-section {
  margin-top: 36px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.gallery-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.photo-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
}

.card-rank {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  min-width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(22, 32, 51, 0.78);
  color: white;
  font-weight: 800;
}

.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 20px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card-title {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.card-subtitle {
  margin-bottom: 8px;
  color: #4f46e5;
  font-weight: 600;
}

.likes-pill {
  white-space: nowrap;
  background: #ffe3f1;
  color: #b4236d;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
}

.card-meta {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.card-meta dt {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.card-meta dd {
  margin: 0;
  font-weight: 600;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-content {
  margin: 0 0 16px;
  color: #2d3a55;
  line-height: 1.7;
}

.like-btn {
  background: #162033;
  color: white;
  min-width: 104px;
}

.like-btn.liked {
  background: linear-gradient(135deg, #ef5da8, #f97316);
  animation: pulseLike 0.55s ease;
}

.like-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@keyframes pulseLike {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.nav-brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-link,
.secondary-link {
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.nav-link.active {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: white;
  border-color: transparent;
}

.single-column-card {
  grid-template-columns: 1fr;
}

.upload-layout {
  grid-template-columns: minmax(280px, 0.95fr) 1fr;
  display: grid;
  gap: 24px;
  align-items: stretch;
}

.gallery-page-section {
  margin-top: 28px;
}

.gallery-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* 文章来源类型 + 删除新闻 */
.source-type-block {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 18px 16px;
  background: rgba(255, 255, 255, 0.72);
}

.source-type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.source-type-title {
  display: block;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.delete-news-link {
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid #efc9cf;
  color: #b42318;
  background: #fff4f5;
  font-weight: 700;
  white-space: nowrap;
}

.delete-news-link:hover {
  background: #ffe9ec;
}

.source-type-options {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.source-type-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
}

.source-type-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.source-type-option span {
  display: inline;
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 900px) {
  .composer-card {
    grid-template-columns: 1fr;
  }

  .upload-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    margin-top: 20px;
  }

  .hero-card,
  .composer-card {
    padding: 20px;
    border-radius: 22px;
  }

  .hero-card,
  .section-head,
  .card-actions,
  .top-nav,
  .gallery-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .nav-links {
    width: 100%;
  }

  .nav-link,
  .secondary-link {
    text-align: center;
  }

  .login-form {
    grid-template-columns: 1fr;
  }

  .source-type-header {
    flex-direction: column;
    align-items: stretch;
  }

  .source-type-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .delete-news-link {
    text-align: center;
  }
}