:root {
  --primary: #009688;
  --primary-hover: #008a7a;
  --nav-active: #009688;
  --text: #333;
  --muted: #8c8c8c;
  --line: #e6e6e6;
  --bg: #fafafa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.layui-btn {
  background-color: var(--primary);
  border-color: var(--primary);
}
.layui-btn:hover,
.layui-btn:focus {
  color: #fff;
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  background: #fff;
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 2px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
}
.brand-text {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}
.brand-text strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}
.brand-text em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  color: #333;
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}
.nav a {
  min-height: 68px;
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 0 14px;
  border-radius: 0;
  white-space: nowrap;
  color: inherit;
  background: transparent;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  background: var(--nav-active);
  opacity: 0;
}

.nav a:hover,
.nav a.is-active {
  color: inherit;
  background: transparent;
}

.nav a:hover::after,
.nav a.is-active::after {
  opacity: 1;
}
.nav-muted {
  color: #6b7280;
}
.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 8px;
}
.publish-link {
  color: inherit !important;
  background: transparent;
  margin-left: 6px;
  padding: 0 14px !important;
}
.publish-link:hover {
  color: inherit !important;
  background: transparent !important;
}
.header-search {
  display: flex;
  align-items: center;
  width: 230px;
  height: 36px;
  margin-left: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}
.header-search .layui-input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 10px;
  outline: none;
  font: inherit;
  font-weight: 400;
}
.header-search .layui-btn {
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 0;
  font-size: 13px;
  flex-shrink: 0;
}
.menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0;
  border-radius: 2px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.menu-btn span {
  width: 18px;
  height: 2px;
  border-radius: 0;
  background: #20222a;
}
.hero { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 0; }
.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.hero-copy {
  min-width: 0;
}
.hero h1 { margin: 0; font-size: 20px; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }
.hero-search {
  width: min(420px, 42%);
  height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.hero-search .layui-input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 14px;
  outline: none;
  font: inherit;
}
.hero-search .layui-btn {
  height: 42px;
  min-height: 42px;
  border-radius: 0;
  padding: 0 18px;
  flex-shrink: 0;
}
.search, .inline-search { display: flex; gap: 10px; }
.search .layui-input, .inline-search .layui-input {
  height: 42px;
  min-width: 280px;
}
.section { padding: 32px 0; }
.section-title, .page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-title h2, .page-heading h1 { margin: 0; font-size: 24px; }
.section-title a { color: var(--primary); font-size: 14px; }
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 9px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.category-item:hover {
  border-color: #d9e2ea;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
  transform: translateY(-1px);
}
.category-icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.category-icon .layui-icon { font-size: 15px; }
.category-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.category-meta strong {
  color: #1f2937;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-meta em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}
.category-tabs a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  text-align: center;
}
.category-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.category-tabs a { padding: 8px 14px; font-size: 14px; }
.category-tabs a.active { border-color: var(--primary); color: var(--primary); }
.category-tabs a:hover { border-color: var(--primary); color: var(--primary); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 100%;
}
.product-card-media,
.detail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f4f6f8;
  color: #9ca3af;
  overflow: hidden;
}
.product-card-media {
  border-radius: 8px 8px 0 0;
  font-size: 14px;
  min-height: clamp(160px, 18vw, 260px);
}
.product-card-media img,
.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4f6f8;
}
.product-card strong {
  display: block;
  min-height: 54px;
  padding: 18px 14px 8px;
  color: #1f2937;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px 12px;
}
.product-tags em {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 4px;
  background: #eef4fb;
  color: #5b9a9a;
  font-size: 14px;
  font-style: normal;
}
.product-price {
  display: block;
  margin: 0 14px;
  padding: 13px 0 16px;
  border-top: 1px solid #edf0f2;
  color: #d84b4b;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.article-list { display: grid; gap: 10px; }
.article-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 14px 16px;
}
.article-row strong { display: block; margin-bottom: 6px; }
.article-row span { color: var(--muted); font-size: 14px; }
.article-row em { display: block; margin-top: 6px; color: #9ca3af; font-style: normal; font-size: 12px; }
.product-detail-shell {
  display: grid;
  gap: 16px;
}
.product-hero {
  display: grid;
  grid-template-columns: 48% 1fr;
  gap: 28px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 2px;
}
.detail-media {
  min-width: 0;
  min-height: clamp(220px, 36vw, 520px);
  border: 1px solid #edf0f2;
  border-radius: 8px;
  font-size: 15px;
}
.media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 180px;
}
.detail-info h1 { margin: 0 0 14px; font-size: 28px; }
.product-summary { margin: 0 0 16px; color: var(--muted); line-height: 1.8; }
.price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}
.price-row strong {
  color: #dc2626;
  font-size: 30px;
  font-weight: 700;
}
.price-row span {
  color: #9ca3af;
  text-decoration: line-through;
}
.product-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}
.product-meta-grid span,
.product-meta-grid a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.product-meta-grid span + span::before,
.product-meta-grid span + a::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 1px;
  height: 12px;
  background: #e5e7eb;
  transform: translateY(-50%);
}
.demo-link {
  color: var(--primary);
}
.order-bar {
  display: block;
  width: 100%;
  height: 48px;
  line-height: 48px;
  padding: 0;
  font-size: 17px;
  text-align: center;
}
.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}
.product-content-card,
.publisher-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 22px;
}
.product-content-card h2,
.publisher-card h2 {
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 6px solid var(--primary);
  font-size: 20px;
  line-height: 1.3;
}
.product-content {
  color: #4b5563;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
}
.publisher-name {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eeeeee;
}
.publisher-name strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}
.publisher-name span,
.empty-text {
  color: var(--muted);
  line-height: 1.7;
}
.publisher-card dl {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px 8px;
  margin: 0;
}
.publisher-card dt {
  color: var(--muted);
}
.publisher-card dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  word-break: break-all;
}
.article-detail, .text-block, .message-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 22px;
  margin-bottom: 16px;
}
.article-detail h1 { margin-top: 0; }
.summary {
  margin: 18px 0 22px;
  padding: 14px 18px;
  border: 1px solid #eeeeee;
  border-left: 6px solid var(--primary);
  border-radius: 2px;
  background: #f7f7f7;
  color: #555;
}
.content { line-height: 1.9; white-space: pre-wrap; }
.markdown-content {
  white-space: normal;
}
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin: 20px 0 10px;
  line-height: 1.35;
}
.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content pre,
.markdown-content blockquote,
.markdown-content table {
  margin: 0 0 14px;
}
.markdown-content ul,
.markdown-content ol {
  padding-left: 24px;
}
.markdown-content li {
  margin: 4px 0;
}
.markdown-content code {
  padding: 2px 5px;
  border-radius: 2px;
  background: #f2f3f5;
  font-family: Consolas, Monaco, monospace;
}
.markdown-content pre {
  padding: 14px 18px;
  overflow: auto;
  border: 1px solid #eeeeee;
  border-left: 6px solid var(--primary);
  border-radius: 2px;
  background: #f7f8fa;
}
.markdown-content pre code {
  padding: 0;
  background: transparent;
}
.markdown-content blockquote {
  padding: 14px 18px;
  border: 1px solid #eeeeee;
  border-left: 6px solid var(--primary);
  border-radius: 2px;
  background: #f7f7f7;
  color: #555;
}
.markdown-content table {
  width: 100%;
  border-collapse: collapse;
}
.markdown-content th,
.markdown-content td {
  border: 1px solid var(--line);
  padding: 8px 10px;
}
.markdown-content th {
  background: #f8f8f8;
}
.article-neighbor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.article-neighbor-link {
  display: block;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #eeeeee;
  border-radius: 2px;
  background: #f7f7f7;
}
.article-neighbor-link:hover {
  border-color: var(--primary);
}
.article-neighbor-link span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}
.article-neighbor-link strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article-neighbor-link.is-disabled {
  color: var(--muted);
  cursor: default;
}
.article-neighbor-link.is-disabled strong {
  color: var(--muted);
}
.narrow { max-width: 860px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 24px; }
.pager a { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; }
.site-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; }
.footer-inner { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-contact { margin-left: 28px; }
.auth-page {
  min-height: calc(100vh - 122px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-panel {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: 1fr 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.auth-brand {
  background: #393d49;
  color: #fff;
  padding: 54px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-brand h1 { margin: 0 0 12px; font-size: 34px; }
.auth-brand p { margin: 0; color: #e5e7eb; line-height: 1.7; }
.auth-form { padding: 34px; display: grid; gap: 16px; }
.auth-form h2 { margin: 0 0 4px; }
.auth-form label, .publish-form label { display: grid; gap: 7px; font-size: 14px; font-weight: 600; }
.form-stack { display: grid; gap: 16px; }
.captcha-line { display: grid; grid-template-columns: 1fr 118px; gap: 10px; }
.captcha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  min-height: 42px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  overflow: hidden;
}
.captcha-btn img { width: 118px; height: 42px; object-fit: cover; }
.auth-switch { text-align: center; color: var(--muted); margin: 0; }
.auth-switch a { color: var(--primary); margin-left: 6px; }
.publish-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 26px;
}
.publish-form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.publish-form textarea { resize: vertical; line-height: 1.7; }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .product-hero,
  .product-detail-grid { grid-template-columns: 1fr; }
  .article-neighbor { grid-template-columns: 1fr; }
  .auth-panel { grid-template-columns: 1fr; }
  .auth-brand { padding: 30px; }
}

@media (max-width: 640px) {
  .menu-btn { display: inline-flex; }
  .brand { min-width: 0; }
  .brand-text strong { font-size: 22px; }
  .brand-text em { display: none; }
  .header-inner { height: 62px; }
  .nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 70px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: none;
    padding: 8px;
    border-radius: 2px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .nav.is-open { display: flex; }
  .nav a {
    justify-content: center;
    min-height: 40px;
  }
  .nav-divider {
    width: 100%;
    height: 1px;
    margin: 6px 0;
  }
  .publish-link {
    margin-left: 0;
  }
  .header-search {
    width: 100%;
    margin: 6px 0 0;
  }
  .hero-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
  .hero h1 { font-size: 20px; }
  .hero-search {
    width: 100%;
  }
  .search, .inline-search, .page-heading { flex-direction: column; align-items: stretch; }
  .search .layui-input, .inline-search .layui-input { min-width: 0; width: 100%; }
  .product-grid, .category-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; justify-content: center; padding: 14px 0; }
}
