
:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #eef1f6;
  --text: #202532;
  --muted: #687184;
  --border: #e4e8ef;
  --accent: #5367e8;
  --accent-hover: #4052ce;
  --shadow: 0 12px 36px rgba(31, 42, 68, 0.06);
  --radius: 20px;
  --container: 1080px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11141b;
  --surface: #191e28;
  --surface-soft: #222938;
  --text: #edf0f7;
  --muted: #a2adbf;
  --border: #30394a;
  --accent: #91a0ff;
  --accent-hover: #b1bbff;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  transition: background-color 0.2s, color 0.2s;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

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

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  width: min(calc(100% - 40px), var(--container));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}

.brand {
  flex-shrink: 0;
  color: var(--text);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand span {
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 26px;
}

.main-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--text);
}

.quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.quiet:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.theme-toggle {
  flex-shrink: 0;
  font-size: 13px;
}

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

.hero {
  padding: clamp(70px, 12vw, 130px) 0 90px;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 1.2;
}

.hero-description {
  max-width: 560px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  transition: transform 0.15s, opacity 0.15s;
}

.button:hover {
  color: #fff;
  opacity: 0.92;
  transform: translateY(-1px);
}

.content-section {
  padding: 28px 0 76px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-heading h2,
.welcome-panel h2 {
  margin: 0;
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: -1px;
  line-height: 1.35;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
}

.section-heading > a {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
}

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

.post-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

.post-card h3 {
  margin: 8px 0 10px;
  font-size: 19px;
  line-height: 1.5;
}

.post-card h3 a {
  color: var(--text);
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.post-meta {
  color: var(--muted);
  font-size: 12px;
}

.post-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.welcome-panel {
  margin: 10px 0 90px;
  padding: clamp(28px, 6vw, 54px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-soft);
}

.welcome-panel p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
  padding: 26px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.page-header {
  padding: 64px 0 34px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 52px);
  letter-spacing: -2px;
  line-height: 1.3;
}

.page-header p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
}

.content-section p {
  overflow-wrap: anywhere;
}

.empty-state,
.notice {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}

.form-field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.form-field label {
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
}

@media (max-width: 760px) {
  .site-header {
    width: min(calc(100% - 28px), var(--container));
    min-height: auto;
    padding: 18px 0;
    flex-wrap: wrap;
    gap: 14px;
  }

  .brand {
    font-size: 23px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
    padding: 4px 0;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .hero {
    padding: 70px 0 68px;
  }

  .hero h1 {
    letter-spacing: -2px;
  }

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

  .post-card {
    padding: 21px;
  }

  .welcome-panel {
    margin-bottom: 58px;
  }

  .site-footer {
    width: min(calc(100% - 28px), var(--container));
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* MBLog article and project detail pages */

.article-content {
  max-width: 780px;
  margin: 0 auto;
  padding-bottom: 48px;
  overflow-wrap: anywhere;
}

.article-title {
  margin: 12px 0 18px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.3;
  letter-spacing: -1.5px;
}

.article-summary {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 18px;
}

.article-body {
  margin-top: 34px;
  color: var(--text);
  font-size: 17px;
  line-height: 2;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.article-body a {
  overflow-wrap: anywhere;
}

.article-content > .button {
  margin-top: 28px;
}

@media (max-width: 600px) {
  .article-title {
    letter-spacing: -1px;
  }

  .article-summary {
    padding: 16px;
    font-size: 16px;
  }

  .article-body {
    font-size: 16px;
    line-height: 1.9;
  }
}


/* MBLog admin panel */

.admin-container {
  padding-bottom: 60px;
}

.admin-panel {
  margin: 0 0 28px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-panel h2 {
  margin-top: 0;
}

.admin-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.admin-section-heading h2 {
  margin-bottom: 4px;
}

.admin-section-heading p {
  margin-top: 0;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  padding: 5px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.admin-tab {
  min-height: 42px;
  padding: 8px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.admin-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.admin-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}

.admin-item h3 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.admin-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.admin-item-actions button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.admin-item-actions button:hover {
  border-color: var(--accent);
}

.admin-status {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.admin-status.published {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .admin-section-heading,
  .admin-item {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-item-actions {
    flex-shrink: 1;
  }

  .admin-tabs {
    width: 100%;
  }

  .admin-tab {
    flex: 1;
    padding-inline: 8px;
  }
}
