﻿:root {
  --bg: #ffffff;
  --text: #000000;
  --muted: #6b7280;
  --line: #ececec;
  --hover: #f7f7f7;
  --accent: #0ea5e9;
}

html.dark {
  --bg: #000000;
  --text: #ffffff;
  --muted: #9ca3af;
  --line: #1f1f1f;
  --hover: #101010;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--hover) 35%, transparent), transparent 35%), var(--bg);
  color: var(--text);
}

.wrap {
  width: min(96vw, 1280px);
  margin: 0 auto;
}

.side-progress {
  position: fixed;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 0;
  z-index: 25;
  width: 86px;
  padding: 8px 6px;
  background: transparent;
  border: none;
  backdrop-filter: none;
}

.side-title {
  display: none;
}

.side-list {
  position: relative;
  display: grid;
  gap: 20px;
  padding-left: 20px;
}

.side-list::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 999px;
}

.progress-item {
  position: relative;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 0 0 0 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  opacity: 0.8;
  max-width: 56px;
}

.progress-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--line) 94%, transparent);
  transition: all 0.25s ease;
}

.progress-item.is-active,
.progress-item:hover {
  color: var(--text);
  transform: translateX(3px);
  opacity: 1;
}

.progress-item::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  width: 8px;
  height: 1px;
  background: color-mix(in srgb, var(--text) 70%, transparent);
  transition: transform 0.25s ease;
}

.progress-item.is-active::before,
.progress-item:hover::before {
  border-color: var(--text);
  background: var(--text);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 12%, transparent);
}

.progress-item.is-active::after,
.progress-item:hover::after {
  transform: translateY(-50%) scaleX(1);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 2px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  min-height: 88px;
  display: grid;
  gap: 16px;
  padding: 10px 0;
}

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

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  min-width: 60px;
}

.brand {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.theme-fab {
  flex: 0 0 auto;
  min-width: 38px;
  padding-inline: 0;
}

.header-rail {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  min-width: 0;
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto;
}

.tab,
.mini-btn,
.primary-btn {
  border: 2px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-break: keep-all;
}

.tab:hover,
.mini-btn:hover,
.primary-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.primary-btn {
  border-color: var(--accent);
}

.tab.is-active {
  border-color: var(--text);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.page {
  padding-top: 78px;
  min-height: calc(100vh - 150px);
}

.view {
  display: none;
  padding-top: 8px;
}

.view.is-show {
  display: block;
}

.reveal {
  opacity: 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-intro {
  display: grid;
  grid-template-columns: 140px 1fr;
  grid-template-areas:
    "profile heading"
    "profile copy";
  gap: 32px;
  align-items: center;
}

.hero-heading {
  grid-area: heading;
  display: grid;
  gap: 8px;
}

.hero-profile {
  grid-area: profile;
  position: relative;
  display: grid;
  justify-items: center;
  align-self: start;
}

.hero-copy {
  grid-area: copy;
}

.avatar {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--line);
}

.hero-meta {
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.32;
}

.kicker {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-weight: 700;
}

.hero-title {
  margin: 16px 0 0;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 0.9;
  font-weight: 900;
}

.hero-sub {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.35rem);
  max-width: 760px;
  line-height: 1.9;
}

.home-sections {
  display: grid;
  gap: 26px;
  margin-top: 40px;
}

.home-block {
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: color-mix(in srgb, var(--hover) 70%, transparent);
}

.section-mini {
  margin: 0;
  color: var(--muted);
}

.timeline-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.timeline-item {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.timeline-item span {
  color: var(--muted);
  font-size: 12px;
}

.timeline-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.cards,
.contacts {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.cards.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.card,
.contact-card,
.about-box,
.blog-detail,
.inline-edit,
.resume-card {
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.card,
.contact-card,
.resume-card {
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.card:hover,
.contact-card:hover,
.resume-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.view-title {
  margin: 4px 0 0;
  font-size: clamp(2.2rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 0.88;
}

.view-sub {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.35;
}

.blog-toolbar {
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.toolbar-combo {
  position: relative;
  min-width: 0;
}

.toolbar-combo input {
  width: 100%;
  padding-right: 164px;
}

.toolbar-combo select {
  position: absolute;
  top: 2px;
  right: 2px;
  bottom: 2px;
  width: 150px;
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
}

.contact-toolbar {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
}

input,
textarea,
select {
  border: 2px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.post-card {
  cursor: pointer;
}

.post-meta {
  color: var(--muted);
  margin-top: 8px;
}

.post-tags,
.detail-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--muted);
}

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

.detail-cover {
  margin-top: 12px;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
}

.detail-content {
  margin-top: 12px;
}

.detail-nav {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

.resume-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
}

.about-contact-block {
  margin-top: 18px;
}

.about-contact-head {
  margin-bottom: 10px;
}

.about-contact-title {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 7rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 0.95;
}

.resume-item {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

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

.chips {
  margin-top: 10px;
  color: var(--muted);
}

.contact-card {
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 10px;
}

.contact-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.contact-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.inline-edit {
  margin-top: 16px;
  background: color-mix(in srgb, var(--hover) 70%, transparent);
  display: grid;
  gap: 10px;
}

.inline-edit label {
  display: grid;
  gap: 8px;
}

.inline-edit input,
.inline-edit textarea {
  width: 100%;
}

#inlinePostMarkdown,
#workInlineMarkdown {
  min-height: 360px;
  resize: vertical;
}

.inline-edit.hidden,
.hidden {
  display: none !important;
}

.editable-live {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

#avatarUploadLabel {
  margin-top: 10px;
  display: inline-flex;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cover-preview {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
}

.cover-preview img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 8px;
}

.preview {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  min-height: 100px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 16px 0 8px;
}

.markdown-body p {
  margin: 0 0 12px;
}

.markdown-body img {
  max-width: 100%;
  border-radius: 10px;
}

.footer {
  border-top: 2px solid var(--line);
  margin-top: 70px;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.edit-actions {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  gap: 8px;
  align-items: center;
}

.autosave-status {
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.autosave-status[data-state="pending"] {
  color: var(--text);
}

.autosave-status[data-state="success"] {
  color: var(--text);
}

@media (max-width: 1200px) {
  .side-progress {
    display: none;
  }
}

@media (max-width: 900px) {
  .cards,
  .contacts,
  .resume-grid,
  .cards.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .topbar.is-hidden-mobile {
    transform: translateY(calc(-100% - 6px));
    opacity: 0;
    pointer-events: none;
  }

  .topbar {
    transition: transform 220ms ease, opacity 220ms ease;
  }

  .blog-toolbar,
  .cards,
  .cards.two-col,
  .contacts,
  .resume-grid {
    grid-template-columns: 1fr;
  }

  .wrap {
    width: min(100vw - 28px, 100%);
  }

  .page {
    padding-top: 46px;
  }

  .topbar-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 0 16px;
  }

  .brand {
    font-size: 1rem;
    letter-spacing: 0.06em;
  }

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

  .header-rail {
    display: grid;
    position: static;
    gap: 10px;
    width: 100%;
    min-height: 0;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
    gap: 8px;
    margin: 0;
    padding: 2px 0 6px;
  }

  .nav::-webkit-scrollbar,
  .actions::-webkit-scrollbar {
    display: none;
  }

  .actions {
    display: flex;
    flex-wrap: nowrap;
    position: static;
    transform: none;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    margin: 0;
    padding: 0 0 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .tab,
  .mini-btn,
  .primary-btn {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 10px;
    font-size: 13px;
    scroll-snap-align: start;
  }

  .tab {
    width: 100%;
    justify-content: center;
    text-align: center;
    line-height: 1.1;
  }

  .home-intro {
    display: grid;
    grid-template-columns: 84px 1fr;
    grid-template-areas:
      "heading heading"
      "profile copy";
    gap: 18px 18px;
    align-items: start;
  }

  .avatar {
    width: 84px;
    height: 84px;
    border-width: 2px;
  }

  #avatarUploadLabel {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    padding: 6px 10px;
    font-size: 12px;
    min-height: auto;
  }

  .hero-title {
    margin-top: 0;
    font-size: clamp(2.45rem, 13.6vw, 3.9rem);
    line-height: 0.94;
    white-space: nowrap;
  }

  .kicker {
    margin: 0;
    font-size: 0.76rem;
    letter-spacing: 0.16em;
  }

  .hero-sub {
    margin-top: 0;
    font-size: 0.98rem;
    line-height: 1.95;
  }

  .hero-meta,
  .view-sub,
  .post-meta,
  .muted {
    font-size: 0.95rem;
    line-height: 1.32;
  }

  .hero-copy {
    display: grid;
    gap: 10px;
    align-content: start;
  }

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

  .about-contact-block {
    margin-top: 22px;
  }

  .about-contact-head {
    margin-bottom: 10px;
  }

  .about-contact-title {
    font-size: clamp(2.2rem, 8vw, 7rem);
    line-height: 0.95;
  }

  .contact-card {
    padding: 20px 18px;
    gap: 12px;
  }

  .contact-card p {
    margin: 0;
    line-height: 1.9;
  }

  .blog-toolbar {
    gap: 12px;
    margin-top: 24px;
  }

  .toolbar-combo input {
    padding-right: 126px;
  }

  .toolbar-combo select {
    width: 118px;
  }

  .blog-toolbar input,
  .blog-toolbar button {
    width: 100%;
  }

  .blog-detail,
  .inline-edit,
  .home-block,
  .card,
  .contact-card,
  .resume-card {
    border-radius: 18px;
  }

  .detail-cover {
    border-radius: 16px;
  }

  .edit-actions {
    left: 14px;
    right: 14px;
    bottom: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .autosave-status {
    width: 100%;
    text-align: center;
  }
}
