:root {
  --bg: #f4efe7;
  --bg-deep: #efe4d2;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffdf9;
  --text: #1f2924;
  --muted: #607067;
  --line: rgba(31, 41, 36, 0.12);
  --primary: #d0603a;
  --primary-deep: #b64c29;
  --secondary: #1f5f59;
  --secondary-soft: rgba(31, 95, 89, 0.1);
  --shadow: 0 20px 50px rgba(31, 41, 36, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --container: 1180px;
}

.admin-form input[type="file"] {
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.inline-media-preview {
  border: 1px solid rgba(43, 41, 36, 0.12);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.inline-media-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(208, 96, 58, 0.18), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(31, 95, 89, 0.18), transparent 24%),
    linear-gradient(180deg, #fcfaf6 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.site-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
  background-size: 26px 26px;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 30px 0 24px;
}

.brand-wrap {
  max-width: 560px;
}

.site-brand {
  display: inline-block;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.site-tagline {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-nav a {
  padding: 11px 16px;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
  background: var(--secondary);
}

.site-main {
  padding-bottom: 52px;
}

.site-footer {
  padding: 6px 0 40px;
  color: var(--muted);
}

.footer-muted {
  margin-top: 8px;
  font-size: 0.95rem;
}

.hero-panel,
.feature-story,
.about-snapshot,
.article-card,
.detail-article,
.topic-panel,
.search-panel,
.profile-preview-card,
.editor-card,
.admin-table-wrap,
.auth-card,
.floating-card,
.stat-card,
.empty-state,
.notice,
.about-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.9fr);
  gap: 28px;
  padding: 32px;
  border-radius: var(--radius-xl);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--secondary);
  font-size: 0.78rem;
}

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

.hero-copy h1,
.page-intro h1,
.detail-article h1,
.auth-copy h1,
.admin-toolbar h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 3.5vw, 4rem);
  line-height: 1.04;
}

.hero-role {
  color: var(--secondary);
  font-size: 1.05rem;
  font-weight: 700;
}

.hero-text,
.page-intro p,
.excerpt,
.detail-excerpt,
.about-text,
.auth-copy p,
.profile-preview-card p,
.admin-toolbar p {
  color: var(--muted);
  line-height: 1.9;
}

.hero-actions,
.toolbar-actions,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.button,
button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.button,
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
}

.button.primary,
button[type="submit"] {
  background: var(--primary);
  color: #fff;
}

.button.primary:hover,
button[type="submit"]:hover {
  background: var(--primary-deep);
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.45);
}

.text-link {
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--primary-deep);
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.hero-avatar,
.about-avatar,
.profile-admin-avatar {
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(135deg, #203f39, #3a7568);
}

.hero-avatar,
.profile-admin-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.about-avatar {
  width: 180px;
  height: 180px;
  flex: 0 0 auto;
}

.hero-avatar img,
.about-avatar img,
.profile-admin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  background: linear-gradient(135deg, #1f5f59 0%, #3a8a7e 50%, #2a6f64 100%);
}

.floating-card {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.floating-card span,
.stat-card span,
.about-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.floating-card strong,
.stat-card strong,
.about-card strong {
  font-size: 1.15rem;
}

.hero-highlights,
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  list-style: none;
  margin: 26px 0 0;
}

.hero-highlights li,
.skill-list li {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--secondary-soft);
  color: var(--secondary);
  font-weight: 700;
}

.split-section,
.home-showcase,
.section-head,
.page-intro,
.admin-toolbar {
  margin-top: 40px;
}

.section-head,
.admin-toolbar,
.page-intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.section-head-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.section-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.section-head-home {
  padding: 6px 4px 2px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 2rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}

.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 24px;
  align-items: stretch;
}

.showcase-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.showcase-feature,
.story-brief {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.showcase-feature {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-radius: 30px;
}

.showcase-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.showcase-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 28px 30px 30px;
}

.showcase-body h3 {
  margin: 0;
  font-size: clamp(2rem, 2.4vw, 3.2rem);
  line-height: 1.12;
}

.showcase-body .excerpt {
  max-width: 40rem;
  margin-bottom: 0;
  font-size: 1.04rem;
  line-height: 1.9;
}

.showcase-actions {
  margin-top: auto;
}

.story-brief {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px;
  border-radius: 24px;
}

.story-brief-thumb {
  display: block;
  flex: 0 0 128px;
  width: 128px;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 1 / 1;
}

.story-brief-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-brief-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.story-brief-body h3 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.4;
}

.story-brief-body .excerpt {
  margin-bottom: 0;
  line-height: 1.8;
}

.story-brief-body .text-link {
  margin-top: auto;
}

.article-card {
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  overflow: hidden;
}

.article-cover {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.meta-row,
.detail-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-card h3 {
  margin: 0;
  font-size: clamp(1.18rem, 1.3vw + 0.9rem, 1.8rem);
  line-height: 1.38;
}

.tag-row,
.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.article-card .excerpt {
  margin-bottom: 0;
}

.article-card .tag-row {
  margin-top: auto;
}

.tag,
.topic-chip,
.static-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--secondary-soft);
  color: var(--secondary);
  font-weight: 700;
}

.static-tag {
  cursor: default;
}

.feature-story,
.about-snapshot,
.detail-article,
.search-panel,
.editor-card,
.profile-preview-card,
.auth-card,
.auth-copy,
.topic-panel,
.about-card {
  border-radius: var(--radius-xl);
  padding: 30px;
}

.feature-story {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(320px, 0.88fr);
  gap: 36px;
  align-items: center;
  overflow: hidden;
}

.feature-story h2,
.about-snapshot h2 {
  font-size: 2rem;
  line-height: 1.2;
}

.feature-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.feature-copy h2 {
  font-size: clamp(2rem, 2.3vw, 3rem);
  line-height: 1.14;
}

.feature-copy p {
  max-width: 32rem;
  margin-bottom: 0;
}

.feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.feature-media {
  justify-self: end;
  width: min(100%, 520px);
}

.feature-media img {
  width: 100%;
  border-radius: 24px;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.about-snapshot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
  margin-top: 64px;
}

.snapshot-text {
  max-width: 36rem;
}

.snapshot-meta {
  display: grid;
  gap: 18px;
}

.snapshot-meta div {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.36);
}

.snapshot-meta span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.detail-cover {
  width: 100%;
  max-height: 520px;
  margin: 24px 0;
  border-radius: 24px;
  object-fit: cover;
}

.detail-content {
  font-size: 1.06rem;
  line-height: 1.95;
}

.detail-content p {
  margin-bottom: 1.3rem;
}

.back-link-wrap {
  margin-top: 24px;
}

.topics-grid,
.profile-admin-grid,
.auth-layout,
.about-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.topic-list {
  margin-top: 20px;
}

.topic-chip strong {
  color: var(--text);
}

.search-form,
.admin-form {
  display: grid;
  gap: 18px;
}

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

.admin-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(31, 41, 36, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
}

textarea {
  resize: vertical;
}

.checkbox-field {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkbox-field input {
  width: auto;
}

.form-error {
  margin: 0 0 16px;
  color: #b02c21;
  font-weight: 700;
}

.notice {
  padding: 14px 18px;
  border-radius: 18px;
  margin-bottom: 18px;
}

.notice.success {
  background: rgba(31, 95, 89, 0.12);
  color: var(--secondary);
}

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

.stat-card {
  padding: 22px;
  border-radius: 22px;
}

.admin-table-wrap {
  overflow: auto;
  border-radius: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.table-actions form {
  margin: 0;
}

.table-actions button {
  background: transparent;
  color: #b02c21;
  min-height: auto;
  padding: 0;
}

.profile-preview-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 22px;
}

.admin-tabs a,
.comment-filter-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  transition: 0.2s ease;
}

.admin-tabs a:hover,
.admin-tabs a.is-active,
.comment-filter-bar a:hover,
.comment-filter-bar a.is-active {
  color: #fff;
  background: var(--secondary);
  border-color: var(--secondary);
}

.comments-section {
  margin-top: 32px;
}

.comments-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.comment-form-card,
.comment-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
}

.comment-form-card {
  padding: 24px;
  position: sticky;
  top: 18px;
}

.comment-list {
  display: grid;
  gap: 16px;
}

.comment-card {
  padding: 20px 22px;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.comment-head strong {
  font-size: 1rem;
}

.comment-head span,
.comment-count {
  color: var(--muted);
  font-size: 0.92rem;
}

.comment-body {
  margin-bottom: 0;
  line-height: 1.8;
  color: var(--text);
  overflow-wrap: anywhere;
}

.comment-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.comment-cell {
  max-width: 360px;
  white-space: normal;
  line-height: 1.7;
  color: var(--muted);
}

.empty-table {
  text-align: center !important;
  color: var(--muted);
}

.login-tips {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.avatar-form {
  margin-top: 8px;
}

.auth-layout {
  align-items: stretch;
}

.auth-copy {
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(31, 95, 89, 0.95), rgba(16, 54, 50, 0.98));
  color: #f9f4ec;
  padding: 34px;
}

.auth-copy .eyebrow,
.auth-copy p {
  color: rgba(249, 244, 236, 0.85);
}

.about-main {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.about-side {
  display: grid;
  gap: 16px;
}

.empty-state {
  padding: 44px 28px;
  border-radius: 26px;
  text-align: center;
}

.empty-state.large {
  margin-top: 40px;
}

@media (max-width: 980px) {
  .hero-panel,
  .feature-story,
  .about-snapshot,
  .topics-grid,
  .profile-admin-grid,
  .auth-layout,
  .about-layout,
  .card-grid,
  .showcase-grid,
  .stats-grid,
  .comments-layout {
    grid-template-columns: 1fr;
  }

  .comment-form-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(var(--container), calc(100% - 20px));
  }

  .site-header,
  .page-intro,
  .section-head,
  .admin-toolbar,
  .search-form,
  .about-main {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero-panel,
  .feature-story,
  .about-snapshot,
  .detail-article,
  .search-panel,
  .editor-card,
  .profile-preview-card,
  .auth-card,
  .auth-copy,
  .topic-panel,
  .about-card,
  .comment-form-card,
  .comment-card {
    padding: 24px;
  }

  .table-actions {
    flex-wrap: wrap;
  }

  .section-head-actions {
    justify-content: flex-start;
  }

  .site-brand {
    font-size: 1.55rem;
  }

  .story-brief {
    flex-direction: column;
  }

  .hero-copy h1,
  .page-intro h1,
  .detail-article h1,
  .auth-copy h1,
  .admin-toolbar h1 {
    font-size: clamp(1.9rem, 10vw, 2.6rem);
  }

  .hero-avatar,
  .profile-admin-avatar,
  .article-cover,
  .showcase-media,
  .story-brief-thumb,
  .feature-media img,
  .detail-cover {
    width: 100%;
    height: auto;
  }

  .story-brief-thumb {
    flex-basis: auto;
  }

  .feature-media {
    width: 100%;
    justify-self: stretch;
  }

  .showcase-body {
    padding: 24px;
  }

  .showcase-body h3 {
    font-size: clamp(1.7rem, 8vw, 2.5rem);
  }

  .comment-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .comment-cell {
    min-width: 220px;
  }

  .admin-tabs,
  .comment-filter-bar,
  .hero-actions,
  .toolbar-actions,
  .editor-actions {
    gap: 10px;
  }

  .admin-tabs a,
  .comment-filter-bar a,
  .button,
  button[type="submit"] {
    width: 100%;
  }

  .meta-row,
  .detail-meta,
  .tag-row,
  .topic-list,
  .skill-list,
  .hero-highlights {
    gap: 8px;
  }
}
