:root {
  color-scheme: light;
  --bg: #f5f8f4;
  --surface: #ffffff;
  --surface-2: #eef5f1;
  --surface-3: #e4eee8;
  --ink: #121714;
  --muted: #65746d;
  --quiet: #899792;
  --line: rgba(18, 23, 20, .12);
  --line-strong: rgba(18, 23, 20, .22);
  --jade: #2d7668;
  --jade-dark: #164a41;
  --brass: #b58a38;
  --blue: #526f94;
  --rose: #a35f67;
  --danger: #9d3845;
  --shadow: 0 20px 55px rgba(30, 42, 36, .09);
  --shadow-soft: 0 10px 30px rgba(30, 42, 36, .07);
  --radius: 8px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fbfdf9 0, var(--bg) 430px),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

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

button {
  cursor: pointer;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(45, 118, 104, .08);
  color: var(--jade-dark);
}

.page {
  min-height: 100vh;
}

.container {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(18, 23, 20, .08);
  background: rgba(249, 251, 248, .88);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 72px;
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: #101613;
  color: #eff8f1;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(239, 248, 241, .36);
  border-radius: 5px;
}

.brand-text strong,
.brand-text span {
  display: block;
}

.brand-text strong {
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
}

.brand-text span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links button,
.nav-button,
.ghost-button,
.secondary-button,
.primary-button,
.danger-button,
.text-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: var(--radius);
  border: 0;
  white-space: nowrap;
}

.nav-links a,
.nav-links button {
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links button:hover {
  background: rgba(45, 118, 104, .09);
  color: var(--jade-dark);
}

.nav-button,
.ghost-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 14px;
}

.primary-button {
  background: #101613;
  color: #eff8f1;
  box-shadow: 0 12px 24px rgba(16, 22, 19, .14);
}

.primary-button:hover {
  background: var(--jade-dark);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
}

.danger-button {
  border: 1px solid rgba(157, 56, 69, .24);
  background: rgba(157, 56, 69, .1);
  color: var(--danger);
}

.text-button {
  color: var(--jade-dark);
  font-weight: 700;
}

.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.stretch {
  width: 100%;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  background: #101613;
  color: #eff8f1;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

i[data-lucide] {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

.flash-wrap {
  position: fixed;
  top: 86px;
  right: 20px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 40px));
}

.flash {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  line-height: 1.5;
}

.flash.success {
  border-color: rgba(45, 118, 104, .24);
}

.flash.error {
  border-color: rgba(163, 95, 103, .28);
  color: var(--danger);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: clamp(28px, 5vw, 58px);
  align-items: end;
  padding: clamp(50px, 7vw, 92px) 0 44px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(45, 118, 104, .18);
  border-radius: var(--radius);
  background: rgba(45, 118, 104, .08);
  color: var(--jade-dark);
  font-size: 13px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hero h1,
.detail-copy h1,
.auth-copy h1,
.dashboard-head h1,
.admin-title h1 {
  margin: 16px 0 0;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(44px, 6.4vw, 82px);
  line-height: .98;
}

.hero p {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

.search-panel,
.compact-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
}

.search-panel {
  width: min(640px, 100%);
  min-height: 58px;
  margin-top: 28px;
  padding: 8px 10px 8px 16px;
}

.search-panel input,
.compact-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.featured-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.featured-image {
  position: relative;
  min-height: 360px;
  background: linear-gradient(135deg, #1d2a26, #596f68);
}

.featured-image img,
.showcase-blank {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.showcase-blank {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .82);
}

.showcase-blank i {
  width: 72px;
  height: 72px;
}

.featured-label {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  background: rgba(16, 22, 19, .72);
  color: #eff8f1;
  backdrop-filter: blur(12px);
}

.featured-label strong,
.featured-label span {
  display: block;
}

.featured-label span {
  margin-top: 6px;
  color: rgba(239, 248, 241, .76);
  font-size: 13px;
  line-height: 1.5;
}

.mini-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.mini-stat {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.mini-stat:last-child {
  border-right: 0;
}

.mini-stat strong,
.mini-stat span {
  display: block;
}

.mini-stat strong {
  font-size: 26px;
}

.mini-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 38px 0;
}

.section.tight {
  padding-top: 18px;
}

.section-head,
.library-toolbar,
.dashboard-head,
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2,
.library-toolbar h1,
.dashboard-head h1,
.admin-title h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
}

.section-head p,
.dashboard-head p,
.admin-title p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.category-grid,
.resource-grid,
.metric-grid {
  display: grid;
  gap: 16px;
}

.category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.resource-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0;
}

.category-card,
.resource-card,
.metric-card,
.form-panel,
.table-panel,
.filter-panel,
.aside-panel,
.content-panel,
.notice-panel,
.download-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-soft);
}

.category-card {
  display: grid;
  min-height: 218px;
  padding: 18px;
  align-content: start;
  transition: transform .18s ease, box-shadow .18s ease;
}

.category-card:hover,
.resource-card:hover,
.list-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-icon,
.notice-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(45, 118, 104, .1);
  color: var(--jade-dark);
}

.category-card h3,
.resource-card h3,
.empty-state h3,
.aside-panel h2,
.panel-head h2 {
  margin: 14px 0 8px;
}

.category-card p,
.resource-card p,
.filter-panel p,
.aside-panel p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.count {
  margin-top: auto;
  color: var(--jade-dark);
  font-weight: 800;
}

.resource-card {
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.resource-thumb,
.list-thumb {
  position: relative;
  background: var(--surface-3);
}

.resource-thumb {
  height: 210px;
}

.resource-thumb img,
.list-thumb img,
.thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--jade-dark);
  background: linear-gradient(135deg, #e6efe9, #f8fbf6);
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  color: var(--jade-dark);
  font-size: 12px;
  font-weight: 700;
}

.resource-thumb .state {
  position: absolute;
  right: 12px;
  top: 12px;
}

.resource-body {
  padding: 16px;
}

.tag-row,
.meta-row,
.row-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: var(--radius);
  background: rgba(45, 118, 104, .1);
  color: var(--jade-dark);
  font-size: 12px;
  font-weight: 800;
}

.tag.blue {
  background: rgba(82, 111, 148, .12);
  color: #314e72;
}

.tag.gold {
  background: rgba(181, 138, 56, .14);
  color: #7a5520;
}

.tag.rose {
  background: rgba(163, 95, 103, .12);
  color: #873944;
}

.tag.green {
  background: rgba(45, 118, 104, .12);
  color: var(--jade-dark);
}

.meta-row {
  margin-top: 12px;
  color: var(--quiet);
  font-size: 13px;
}

.notice-stack {
  display: grid;
  gap: 10px;
}

.notice-panel,
.download-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.notice-panel strong,
.download-panel strong {
  display: block;
}

.notice-panel p,
.download-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.library-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 34px 0 54px;
}

.sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}

.filter-panel {
  padding: 16px;
}

.filter-panel h2,
.filter-panel h3 {
  margin: 0 0 12px;
}

.filter-list {
  display: grid;
  gap: 6px;
}

.filter-list a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  align-items: center;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--muted);
}

.filter-list a:hover,
.filter-list a.active {
  background: rgba(45, 118, 104, .09);
  color: var(--jade-dark);
}

.library-main {
  min-width: 0;
}

.compact-search {
  width: min(420px, 100%);
  min-height: 44px;
  padding: 5px 6px 5px 12px;
}

.resource-list {
  display: grid;
  gap: 12px;
}

.list-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease;
}

.list-thumb {
  height: 118px;
  border-radius: var(--radius);
  overflow: hidden;
}

.list-content h2 {
  margin: 8px 0 8px;
  font-size: 22px;
}

.list-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.detail-page {
  background:
    linear-gradient(180deg, #fbfdf9 0, #eef5f1 330px, var(--bg) 331px),
    var(--bg);
}

.detail-hero {
  padding: 54px 0 28px;
}

.detail-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: end;
}

.detail-copy h1 {
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 1.04;
}

.detail-copy p {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
  padding: 22px 0 56px;
}

.content-panel {
  padding: 18px;
}

.detail-cover {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.article-body {
  color: #26322d;
  font-size: 17px;
  line-height: 1.9;
}

.article-body p {
  margin: 0 0 16px;
}

.article-body a {
  color: var(--jade-dark);
  font-weight: 700;
  text-decoration: underline;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--jade-dark);
  font-weight: 800;
}

.detail-aside {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}

.aside-panel {
  padding: 16px;
}

.auth-page,
.admin-body {
  background:
    linear-gradient(180deg, #fbfdf9 0, #eef5f1 300px, var(--bg) 301px),
    var(--bg);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 46px 0;
}

.auth-copy h1 {
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
}

.auth-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.form-page,
.dashboard-layout {
  padding: 38px 0 56px;
}

.form-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.auth-panel {
  padding: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  outline: 0;
}

input,
select {
  min-height: 42px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(45, 118, 104, .48);
  box-shadow: 0 0 0 3px rgba(45, 118, 104, .1);
}

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

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-note {
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.form-note a {
  color: var(--jade-dark);
  font-weight: 800;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: auto;
  min-height: 0;
}

.table-panel {
  padding: 16px;
}

.responsive-table {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--quiet);
  font-size: 13px;
  font-weight: 800;
}

td {
  color: var(--ink);
}

td small {
  color: var(--quiet);
}

.dashboard-head {
  align-items: center;
}

.empty-state {
  padding: 28px;
  text-align: center;
}

.empty-state.small {
  padding: 18px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 26px 0 58px;
}

.admin-side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-soft);
}

.admin-side-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-side-title strong,
.admin-side-title span {
  display: block;
}

.admin-side-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-tabs {
  display: grid;
  gap: 6px;
}

.admin-tabs a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

.admin-tabs a:hover,
.admin-tabs a.active {
  background: rgba(45, 118, 104, .09);
  color: var(--jade-dark);
}

.admin-main {
  min-width: 0;
}

.admin-title {
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
}

.metric-card span,
.metric-card strong {
  display: block;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  margin-top: 8px;
  font-size: 36px;
}

.admin-stack {
  display: grid;
  gap: 14px;
}

.compact-list .list-card {
  grid-template-columns: 120px minmax(0, 1fr) auto;
}

.compact-list .list-thumb {
  height: 84px;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1220px, calc(100% - 40px));
  min-height: 68px;
  align-items: center;
  margin: 0 auto;
  font-size: 13px;
}

@media (max-width: 980px) {
  .hero,
  .auth-layout,
  .detail-hero-inner,
  .detail-layout,
  .library-layout,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .detail-aside,
  .admin-side {
    position: static;
  }

  .category-grid,
  .resource-grid,
  .metric-grid,
  .form-grid.two,
  .form-grid.three,
  .form-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-card {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .list-card .primary-button {
    grid-column: 2;
    width: fit-content;
  }
}

@media (max-width: 720px) {
  .container,
  .nav,
  .footer-inner {
    width: min(100% - 28px, 1220px);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .nav-links {
    justify-content: flex-start;
    width: 100%;
  }

  .brand-text span {
    white-space: normal;
  }

  .hero {
    padding-top: 34px;
  }

  .hero h1,
  .detail-copy h1,
  .auth-copy h1 {
    font-size: 42px;
  }

  .hero p,
  .detail-copy p,
  .auth-copy p {
    font-size: 16px;
  }

  .category-grid,
  .resource-grid,
  .metric-grid,
  .form-grid.two,
  .form-grid.three,
  .form-grid.four {
    grid-template-columns: 1fr;
  }

  .mini-board {
    grid-template-columns: 1fr;
  }

  .mini-stat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mini-stat:last-child {
    border-bottom: 0;
  }

  .section-head,
  .library-toolbar,
  .dashboard-head,
  .panel-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .list-card,
  .compact-list .list-card {
    grid-template-columns: 1fr;
  }

  .list-thumb {
    height: 180px;
  }

  .download-panel,
  .notice-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .flash-wrap {
    top: 120px;
    right: 14px;
    width: calc(100% - 28px);
  }
}
