:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #151922;
  --muted: #657080;
  --line: #dce2ea;
  --primary: #e84d2a;
  --primary-dark: #c63d1d;
  --ink: #111827;
  --teal: #117887;
  --green: #1f8f5f;
  --yellow: #a86c00;
  --shadow: 0 18px 45px rgba(29, 33, 41, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #f4f6f8;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.home-body {
  color: #f8fafc;
  background:
    radial-gradient(circle at 16% 20%, rgba(232, 77, 42, 0.2), transparent 30%),
    radial-gradient(circle at 82% 24%, rgba(17, 120, 135, 0.22), transparent 34%),
    linear-gradient(135deg, #090d16 0%, #121826 48%, #070a11 100%);
}

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

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

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.96;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.15;
}

button,
.primary-link,
.admin-link,
.ghost-link {
  cursor: pointer;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--primary);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

button:hover,
.primary-link:hover,
.admin-link:hover {
  background: var(--primary-dark);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(1180px, calc(100% - 32px));
  height: 76px;
  margin: 0 auto;
  padding: 0;
  background: rgba(9, 13, 22, 0.74);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 22px;
  backdrop-filter: blur(18px);
}

.brand-button {
  min-height: auto;
  padding: 0;
  gap: 10px;
  background: transparent;
  color: inherit;
}

.brand-button:hover {
  background: transparent;
}

.brand-mark,
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  font-weight: 900;
}

.brand-button strong,
.brand-button small {
  display: block;
  text-align: left;
}

.brand-button small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.site-nav button {
  min-height: 38px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  padding: 0 12px;
  border-radius: 999px;
}

.site-nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.social-link,
.header-actions a {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 800;
}

.social-link.strong,
.header-actions a:last-child {
  background: rgba(232, 77, 42, 0.9);
  border-color: transparent;
}

.home-main,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.ai-service {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 30;
  min-height: 48px;
  gap: 8px;
  border-radius: 999px;
  padding: 0 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.ai-service:hover {
  background: rgba(30, 41, 59, 0.94);
}

.ai-service strong {
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
}

.chat-popover {
  position: fixed;
  top: 76px;
  left: 18px;
  z-index: 31;
  width: min(320px, calc(100vw - 36px));
  padding: 18px;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.chat-popover div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chat-popover button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  background: #eef1f5;
  color: var(--text);
}

.chat-popover p {
  color: var(--muted);
  line-height: 1.6;
}

.chat-popover a {
  color: var(--primary-dark);
  font-weight: 900;
  text-decoration: none;
}

.hero-section {
  min-height: calc(100vh - 74px);
  padding: 72px 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  gap: 44px;
  align-items: center;
}

.hero-grid {
  min-height: calc(100vh - 76px);
  padding: 42px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 410px);
  gap: 54px;
  align-items: center;
}

.hero-kicker {
  display: block;
  margin-bottom: 18px;
  color: #ffb199;
  font-weight: 900;
}

.hero-copy p {
  max-width: 720px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 19px;
  line-height: 1.8;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 28px 0;
}

.consult-link,
.tool-link {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 900;
}

.consult-link {
  color: #fff;
  background: var(--primary);
}

.tool-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.tool-link:hover {
  background: rgba(255, 255, 255, 0.16);
}

.secondary-link,
.ghost-button,
.ghost-link {
  color: var(--text);
  background: #e9edf3;
}

.secondary-link:hover,
.ghost-button:hover,
.ghost-link:hover {
  background: #dfe5ed;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  max-width: 620px;
}

.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.hero-stats strong {
  display: block;
  color: #fff;
  font-size: 32px;
}

.hero-stats span {
  color: rgba(248, 250, 252, 0.58);
  font-weight: 700;
}

.stats-grid div {
  min-height: 94px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stats-grid strong {
  display: block;
  font-size: 28px;
}

.stats-grid span {
  color: var(--muted);
}

.hero-card {
  min-height: 520px;
  padding: 34px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.05), rgba(17, 24, 39, 0)),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.profile-showcase {
  min-height: 560px;
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.profile-photo {
  flex: 1;
  min-height: 300px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.24), transparent 22%),
    linear-gradient(135deg, rgba(232, 77, 42, 0.9), rgba(17, 120, 135, 0.82));
  background-size: cover;
  background-position: center;
  font-size: 92px;
  font-weight: 900;
}

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

.profile-card-copy {
  margin-top: 22px;
}

.profile-card-copy strong {
  display: block;
  font-size: 24px;
}

.profile-card-copy span,
.profile-showcase p {
  color: rgba(248, 250, 252, 0.62);
}

.work-status {
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.work-status span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ee59d;
  box-shadow: 0 0 0 7px rgba(46, 229, 157, 0.12);
}

.portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 300px;
  margin-bottom: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.24), transparent 22%),
    linear-gradient(135deg, rgba(232, 77, 42, 0.88), rgba(17, 120, 135, 0.82));
  background-size: cover;
  background-position: center;
  font-size: 88px;
  font-weight: 900;
}

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

.hero-card h2 {
  margin-bottom: 8px;
}

.hero-card p,
.handle,
.bio,
.profile-meta,
.post-meta,
.form-message,
.console-top p,
.section-heading p {
  color: var(--muted);
}

.availability {
  margin: 18px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.availability span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(31, 143, 95, 0.12);
}

.profile-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: -32px 0 34px;
  position: relative;
  z-index: 3;
}

.entry-card {
  min-height: 156px;
  padding: 24px;
  border-radius: 22px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.25);
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  text-align: left;
  backdrop-filter: blur(16px);
}

.entry-card:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-3px);
}

.entry-card span {
  font-size: 23px;
  font-weight: 950;
}

.entry-card i {
  font-style: normal;
  font-size: 26px;
  color: #ffb199;
}

.entry-card p {
  grid-column: 1 / -1;
  margin: 22px 0 0;
  color: rgba(248, 250, 252, 0.68);
}

.module-card {
  min-height: 148px;
  padding: 22px;
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  text-align: left;
}

.module-card:hover {
  color: var(--text);
  background: #fbfcfd;
  transform: translateY(-2px);
}

.module-card span {
  grid-column: 1 / -1;
  font-size: 21px;
  font-weight: 900;
}

.module-card strong {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.module-card i {
  font-style: normal;
  color: var(--primary);
  font-weight: 900;
}

.content-band,
.timeline-panel,
.tools-panel,
.login-panel,
.editor-panel,
.manage-panel,
.console-top {
  background: var(--panel);
  border: 1px solid rgba(217, 222, 232, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.posts-drawer {
  margin: 28px 0;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.25);
}

.drawer-head {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drawer-head span {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.refresh-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}

.tool-drawer {
  margin: 0 0 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.tool-drawer a {
  min-height: 64px;
  border-radius: 18px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.content-band {
  margin: 26px 0;
  padding: 28px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 22px;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feature-list article,
.exchange-grid a,
.tool-list a {
  padding: 18px;
  border-radius: 8px;
  background: #f7f9fb;
  border: 1px solid var(--line);
}

.feature-list strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

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

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 24px;
  align-items: center;
}

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

.exchange-grid a,
.tool-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.exchange-grid a span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 500;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  margin: 26px 0 36px;
}

.timeline-panel {
  min-height: 520px;
}

.timeline-head,
.section-title,
.console-top {
  padding: 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 20px;
}

.post-list,
.admin-post-list {
  display: grid;
}

.post-card {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.post-card:last-child {
  border-bottom: 0;
}

.post-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.pin {
  color: var(--primary);
  font-weight: 800;
}

.post-content {
  margin-bottom: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  background: #f1f4f8;
  color: #405062;
  padding: 5px 10px;
  font-size: 13px;
}

.empty-state {
  padding: 56px 22px;
  text-align: center;
  color: var(--muted);
}

.tools-panel {
  position: sticky;
  top: 96px;
  padding: 22px;
}

.tool-list {
  display: grid;
  gap: 10px;
}

.tool-list a:hover,
.exchange-grid a:hover {
  border-color: rgba(232, 77, 42, 0.4);
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(248, 250, 252, 0.58);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.site-footer div {
  display: flex;
  gap: 14px;
}

.admin-body {
  background: #f2f5f7;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.console-top {
  margin-bottom: 20px;
}

.console-top h1 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1.15;
}

.login-panel {
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.editor-panel {
  padding-bottom: 22px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.editor-panel .stack-form,
.login-panel .stack-form {
  padding: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 77, 42, 0.12);
}

.option-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(160px, 1fr);
  gap: 14px;
  align-items: end;
}

.check-label {
  min-height: 42px;
  grid-template-columns: 18px 1fr;
  align-items: center;
  align-self: end;
}

.check-label input {
  width: 18px;
  height: 18px;
}

.form-message {
  min-height: 20px;
  margin-bottom: 0;
}

.form-message.success {
  color: var(--green);
}

.form-message.error {
  color: var(--primary-dark);
}

.manage-panel {
  margin-top: 20px;
}

.content-editor-panel {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid rgba(217, 222, 232, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.content-form {
  padding: 22px;
}

.content-form h3 {
  margin: 8px 0 0;
  font-size: 18px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

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

.repeat-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  gap: 12px;
}

.admin-post-card {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.admin-post-card:last-child {
  border-bottom: 0;
}

.status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  background: #eef1f5;
  color: #405062;
}

.status-badge.published {
  background: rgba(31, 143, 95, 0.12);
  color: var(--green);
}

.status-badge.draft {
  background: rgba(168, 108, 0, 0.12);
  color: var(--yellow);
}

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

.admin-actions button {
  min-width: 72px;
}

.danger-button {
  background: #b42318;
}

.danger-button:hover {
  background: #912018;
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .site-header {
    height: auto;
    min-height: 74px;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero-section,
  .split-band,
  .content-layout,
  .console-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding-top: 44px;
  }

  .module-grid,
  .feature-list {
    grid-template-columns: 1fr;
  }

  .tools-panel {
    position: static;
  }

  .console-top,
  .timeline-head,
  .section-title,
  .admin-post-card {
    align-items: stretch;
    flex-direction: column;
  }

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

  .admin-form-grid,
  .repeat-grid,
  .tools-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  main,
  .site-footer,
  .admin-shell {
    width: min(100% - 20px, 1180px);
  }

  .header-actions {
    margin-left: auto;
  }

  .hero-card {
    min-height: auto;
    padding: 20px;
  }

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

  .content-band {
    padding: 20px;
  }

  .site-footer {
    flex-direction: column;
  }

  .option-row {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
