:root {
  --bg: #f7efe3;
  --bg-deep: #efe2cf;
  --surface: rgba(255, 250, 243, 0.8);
  --surface-strong: #fffdf9;
  --surface-deep: #fff7eb;
  --text: #1f2933;
  --muted: #5c6f7f;
  --line: #dbc7ac;
  --accent: #9a3412;
  --accent-dark: #7c2d12;
  --accent-soft: #f6dfc3;
  --shadow: 0 24px 80px rgba(87, 57, 22, 0.14);
  --shadow-soft: 0 14px 30px rgba(87, 57, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", "Noto Serif TC", serif;
  background:
    radial-gradient(circle at top left, rgba(234, 179, 8, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(154, 52, 18, 0.08), transparent 24%),
    linear-gradient(180deg, #fffaf3 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 44px;
  border-bottom: 1px solid rgba(154, 52, 18, 0.08);
}

.hero-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.hero-panel {
  border: 1px solid rgba(219, 199, 172, 0.55);
  background: rgba(255, 250, 243, 0.58);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 34px;
  padding: 34px 34px 38px;
}

.hero-panel {
  border-radius: 28px;
  padding: 24px;
}

.hero-panel-title,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-panel-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.hero-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.4;
}

.hero-glow-left {
  top: -90px;
  left: -80px;
  background: rgba(245, 158, 11, 0.24);
}

.hero-glow-right {
  top: 8px;
  right: -110px;
  background: rgba(249, 115, 22, 0.16);
}

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

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.subtitle {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.nav {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.nav a,
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #c2410c 70%, #ea580c 100%);
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.nav a:hover,
.button:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(124, 45, 18, 0.18);
}

main {
  padding: 36px 0 72px;
}

.section-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
  max-width: 660px;
}

.intro-card,
.post-card,
.form-card,
.detail-card,
.flash,
.empty-state {
  background: var(--surface);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(217, 203, 181, 0.8);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.intro-card,
.detail-card,
.form-card,
.empty-state {
  padding: 28px;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 18px;
  align-items: center;
}

.intro-note {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.intro-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(154, 52, 18, 0.12);
  border-radius: 999px;
  background: var(--surface-deep);
  color: var(--accent-dark);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

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

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

.stat-card,
.feature-card,
.guide-item,
.sidebar-card {
  border: 1px solid rgba(217, 203, 181, 0.8);
  background: rgba(255, 252, 247, 0.78);
  box-shadow: var(--shadow-soft);
}

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

.stat-value {
  margin: 0;
  color: var(--accent-dark);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 24px;
  border-radius: 28px;
}

.feature-card h2 {
  margin: 0 0 12px;
  font-size: 1.55rem;
  line-height: 1.25;
}

.feature-copy {
  margin: 14px 0 0;
  color: #34495a;
  line-height: 1.85;
  flex: 1;
}

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

.guide-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 24px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.guide-item:hover,
.sidebar-link:hover {
  transform: translateY(-2px);
  border-color: rgba(154, 52, 18, 0.18);
  box-shadow: 0 18px 34px rgba(87, 57, 22, 0.12);
}

.guide-step {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff3de 0%, #f6dfc3 100%);
  color: var(--accent-dark);
  font-size: 1.1rem;
  font-weight: 700;
}

.guide-title {
  font-size: 1.08rem;
  line-height: 1.55;
  font-weight: 700;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-actions form {
  margin: 0;
}

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

.secondary-button {
  background: linear-gradient(135deg, #fff7eb 0%, #f6dfc3 100%);
  color: var(--accent-dark);
  box-shadow: none;
  border: 1px solid rgba(154, 52, 18, 0.14);
}

.secondary-button:hover {
  box-shadow: 0 14px 26px rgba(124, 45, 18, 0.12);
}

.post-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(154, 52, 18, 0.18);
  box-shadow: 0 26px 56px rgba(87, 57, 22, 0.16);
}

.post-card h3,
.detail-card h2,
.form-card h2,
.intro-card h2 {
  margin-top: 0;
  margin-bottom: 14px;
}

.post-card h3 {
  font-size: 1.34rem;
  line-height: 1.35;
}

.post-link {
  color: inherit;
  text-decoration: none;
}

.post-link:hover,
.text-link:hover {
  text-decoration: underline;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.meta {
  color: var(--muted);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.post-excerpt {
  margin: 0;
  color: #34495a;
  line-height: 1.9;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-readmore {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.post-readmore::after {
  content: "→";
  transition: transform 0.18s ease;
}

.post-card:hover .post-readmore::after {
  transform: translateX(3px);
}

.article-shell {
  max-width: none;
  margin: 0;
  padding: 34px 34px 30px;
}

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

.article-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(154, 52, 18, 0.1);
}

.article-lead {
  margin: 14px 0 0;
  color: #34495a;
  font-size: 1.05rem;
  line-height: 1.85;
}

.detail-content {
  line-height: 1.9;
  font-size: 1.08rem;
  color: #21303f;
}

.detail-content > p:first-child {
  font-size: 1.14rem;
}

.detail-content p {
  margin: 0 0 18px;
}

.terminal-block,
.code-block {
  margin: 26px 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(31, 41, 51, 0.12);
  box-shadow: var(--shadow);
}

.terminal-head,
.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.terminal-head {
  background: linear-gradient(180deg, #24303a 0%, #18212a 100%);
  color: #d8e1e8;
}

.code-head {
  background: #eef2f5;
  color: #334e68;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: block;
}

.terminal-dots span:nth-child(1) {
  background: #fb7185;
}

.terminal-dots span:nth-child(2) {
  background: #fbbf24;
}

.terminal-dots span:nth-child(3) {
  background: #34d399;
}

.code-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.copy-code-button {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: none;
  font-size: 0.84rem;
}

.terminal-block pre,
.code-block pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px;
}

.terminal-block pre {
  background: #10171d;
  color: #eef5fb;
}

.terminal-block pre code {
  color: #d8f7db;
}

.code-block pre {
  background: #fffdf8;
  color: #1f2933;
}

.terminal-block code,
.code-block code {
  font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
  font-size: 0.95rem;
  line-height: 1.7;
}

.detail-back {
  margin-top: 30px;
}

.detail-sidebar {
  display: grid;
  gap: 18px;
}

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

.sidebar-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.sidebar-card p {
  margin: 0;
  color: #34495a;
  line-height: 1.75;
}

.sidebar-links {
  display: grid;
  gap: 12px;
}

.sidebar-link {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 203, 181, 0.8);
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.sidebar-link-title {
  font-weight: 700;
  line-height: 1.45;
}

.sidebar-link-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.post-form {
  display: grid;
  gap: 14px;
}

label {
  font-weight: 700;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font: inherit;
  background: var(--surface-strong);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(154, 52, 18, 0.45);
  box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.1);
  background: #fff;
}

textarea {
  resize: vertical;
}

.flash-list {
  margin-bottom: 20px;
}

.flash {
  padding: 16px 18px;
  color: var(--accent-dark);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.danger-button {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}

.error-shell {
  max-width: 760px;
  margin: 0 auto;
}

.error-card {
  padding: 34px;
  border-radius: 32px;
  border: 1px solid rgba(217, 203, 181, 0.8);
  background: rgba(255, 252, 247, 0.84);
  box-shadow: var(--shadow);
}

.error-card h2 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.error-copy {
  margin: 0;
  color: #34495a;
  line-height: 1.85;
  font-size: 1.04rem;
}

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

@media (max-width: 880px) {
  .hero-shell,
  .intro-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .stats-strip,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .intro-note {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .hero {
    padding: 40px 0 28px;
  }

  .hero-copy,
  .hero-panel,
  .article-shell,
  .sidebar-card,
  .stat-card,
  .feature-card,
  .error-card,
  .intro-card,
  .detail-card,
  .form-card,
  .empty-state {
    padding: 22px;
  }

  .guide-item {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 16px;
  }

  .guide-step {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-card-actions,
  .error-actions {
    flex-direction: column;
  }

  .nav a,
  .button,
  button {
    width: 100%;
  }
}
