:root {
  --blue: #2f80ed;
  --blue-dark: #1767d4;
  --blue-soft: #eef7ff;
  --cyan: #5fc3dd;
  --cyan-dark: #21a6c4;
  --text: #425466;
  --muted: #8796a8;
  --line: #e8edf3;
  --page: #f7f9fc;
  --white: #ffffff;
  --red: #ff1f1f;
  --radius: 6px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.nav,
.footer-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #25364a;
  font-size: 18px;
  font-weight: 700;
}

.brand-mark,
.plane-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: transparent;
  overflow: hidden;
}

.brand-mark {
  width: 30px;
  height: 30px;
  background: #fff url("./brand-logo.png") center / contain no-repeat;
  border-radius: 0;
}

.plane-icon {
  width: 23px;
  height: 23px;
  background: #29a9e0 url("./telegram-logo.jpg") center / cover no-repeat;
  border-radius: 50%;
}

.brand-mark i,
.plane-icon i {
  display: none;
}

.nav-links,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #657488;
  font-size: 15px;
}

.site-footer a:hover,
.product-link:hover,
.tutorial-link:hover {
  color: var(--blue);
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 5px;
  color: #4b5f76;
  font-weight: 600;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.nav-links a:hover {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.nav-links a.active {
  color: var(--blue-dark);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
}

.page-stack {
  padding: 24px 0 36px;
}

.notice-panel {
  background: #fcf2d7;
  border: 1px solid #f2c56d;
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(35, 92, 140, 0.05);
}

.notice-content {
  min-height: 164px;
  padding: 22px 24px;
  background: #fcf2d7;
}

.notice-content p {
  margin: 0 0 8px;
  color: #5f6f82;
}

.notice-lead {
  color: #27384d !important;
  font-weight: 700;
}

.notice-strong {
  font-weight: 700;
}

.notice-gap {
  margin-top: 8px !important;
}

.notice-yellow .notice-panel,
.notice-yellow .notice-content {
  background: #fff8df;
}

.notice-yellow .notice-panel {
  border-color: #f0d78a;
  box-shadow: 0 10px 28px rgba(186, 139, 20, 0.1);
}

.notice-yellow .notice-lead {
  color: #6b4b00 !important;
}

.notice-blue .notice-panel,
.notice-blue .notice-content {
  background: #eef8ff;
}

.notice-blue .notice-panel {
  border-color: #b9def7;
  box-shadow: 0 10px 28px rgba(31, 128, 199, 0.1);
}

.notice-blue .notice-lead {
  color: #155f92 !important;
}

.notice-grayblue .notice-panel,
.notice-grayblue .notice-content {
  background: #f3f7fb;
}

.notice-grayblue .notice-panel {
  border-color: #d8e4ef;
  box-shadow: 0 10px 28px rgba(66, 84, 102, 0.08);
}

.notice-grayblue .notice-lead {
  color: #2f4056 !important;
}

.catalog-panel {
  margin-top: 22px;
}

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

.section-heading h2 {
  margin: 0;
  color: #27384d;
  font-size: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.catalog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tab {
  height: 36px;
  padding: 0 18px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  color: var(--blue);
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.category-tab:hover {
  background: var(--blue-soft);
}

.category-tab.active {
  color: #fff;
  background: var(--blue);
}

.product-search {
  display: flex;
  flex: 0 0 300px;
  align-items: center;
}

.product-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #b8d4f2;
  border-right: 0;
  border-radius: 7px 0 0 7px;
  color: #4b5f76;
  background: #fff;
  font: inherit;
  outline: none;
}

.product-search button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 36px;
  border: 1px solid #b8d4f2;
  border-radius: 0 7px 7px 0;
  color: var(--blue);
  background: #fff;
  cursor: pointer;
}

.search-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  border-radius: 999px;
  background: var(--blue);
  transform: rotate(45deg);
  transform-origin: center;
}

.product-search button:hover {
  background: var(--blue-soft);
}

.product-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12);
}

.product-search input:focus + button {
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12);
}

.product-sections {
  display: grid;
  gap: 18px;
}

.product-section,
.tutorial-panel {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(35, 92, 140, 0.05);
}

.table-title {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: var(--cyan);
  color: #fff;
}

.table-title h2,
.table-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.section-title-link {
  color: #fff;
}

.section-title-link:hover {
  color: #fff;
  text-decoration: underline;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.product-table th,
.product-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 10px;
  color: #7b8b9f;
  text-align: left;
  vertical-align: middle;
}

.product-table th:nth-child(n + 2),
.product-table td:nth-child(n + 2) {
  text-align: center;
}

.product-table th {
  color: #8795a5;
  font-weight: 700;
}

.product-table tr:last-child td {
  border-bottom: 0;
}

.empty-cell {
  height: 76px;
  color: var(--muted);
  text-align: center !important;
}

.table-spacer {
  height: calc(var(--missing-slots) * 63px);
  background: #fff;
}

.product-name-col {
  width: auto;
}

.product-code-col {
  width: 116px;
}

.product-price-col {
  width: 104px;
}

.product-stock-col {
  width: 92px;
}

.product-action-col {
  width: 92px;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #73859a;
  word-break: break-word;
}

.country-flag {
  width: 24px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid #e3e9f0;
  border-radius: 2px;
  object-fit: cover;
  background: #fff;
}

.price {
  color: var(--red);
  font-weight: 700;
  white-space: nowrap;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--blue);
  border-radius: 5px;
  color: var(--blue);
  line-height: 1;
}

.buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 34px;
  border: 1px solid var(--blue);
  border-radius: 3px;
  color: var(--blue);
  background: #fff;
  transition: 0.16s ease;
}

.buy-btn:hover {
  color: #fff;
  background: var(--blue);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.page-btn {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #657488;
  background: #fff;
  cursor: pointer;
}

.page-ellipsis {
  min-width: 18px;
  color: #8b9aad;
  text-align: center;
  line-height: 30px;
}

.page-btn.active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

@media (hover: hover) and (pointer: fine) {
  .page-btn:not(.active):hover {
    border-color: var(--blue);
    color: var(--blue);
    background: #fff;
  }
}

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

.tutorial-table {
  background: #fff;
}

.tutorial-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.tutorial-row:last-child {
  border-bottom: 0;
}

.tutorial-head {
  color: #8795a5;
  font-weight: 700;
}

.tutorial-date {
  color: var(--muted);
  white-space: nowrap;
}

.tutorial-link {
  color: #657488;
}

.tutorial-list-card .tutorial-row {
  min-height: 68px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.tutorial-summary {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.tutorial-preview-row .tutorial-link {
  color: #26374c;
  font-weight: 700;
}

.tutorial-excerpt {
  color: #92a0af;
  font-size: 13px;
  line-height: 1.55;
}

.site-footer {
  margin-top: 10px;
  background: #fff;
  border-top: 1px solid var(--line);
  color: #7a8795;
}

.footer-inner {
  position: relative;
  min-height: 46px;
}

.footer-inner nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.detail-main,
.tutorial-main {
  padding: 24px 0 40px;
}

.breadcrumb {
  margin-bottom: 14px;
  color: var(--muted);
}

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

.detail-card,
.reserved-card,
.article-card,
.tutorial-list-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(35, 92, 140, 0.05);
}

.detail-card,
.reserved-card,
.article-card {
  padding: 22px;
}

.detail-card h1,
.article-card h1 {
  margin: 0 0 16px;
  color: #26374c;
  font-size: 22px;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.country-flag-large {
  width: 32px;
  height: 24px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.detail-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

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

.detail-item dd {
  margin: 0;
  color: #4d5d70;
}

.reserved-card {
  min-height: 320px;
  color: var(--muted);
}

.reserved-card h2 {
  margin: 0 0 10px;
  color: #26374c;
  font-size: 16px;
}

.product-description {
  margin-top: 18px;
  color: #35465c;
  line-height: 1.85;
}

.product-description p {
  margin: 0 0 12px;
}

.tg-contact-link {
  color: var(--blue);
  font-weight: 700;
}

.tg-contact-link:hover {
  color: #155fba;
}

.article-meta {
  margin-bottom: 18px;
  color: var(--muted);
}

.article-card p {
  margin: 0 0 12px;
}

.article-image-placeholder {
  margin: 18px 0;
  border: 1px dashed #b8d4f2;
  border-radius: var(--radius);
  background: #f7fbff;
  color: #74859a;
  text-align: center;
  overflow: hidden;
}

.article-image-placeholder div {
  padding: 42px 16px;
  font-weight: 700;
}

.article-image-placeholder figcaption {
  padding: 10px 14px;
  border-top: 1px dashed #d8e6f5;
  background: #fff;
  font-size: 13px;
  line-height: 1.5;
}

.article-image {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  width: min(300px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.article-image img {
  display: block;
  width: 100%;
  height: auto;
}

.article-image figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: #74859a;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.terms-card h2 {
  margin: 22px 0 8px;
  color: #26374c;
  font-size: 17px;
}

.tutorial-list-card {
  overflow: hidden;
}

.tutorial-list-card > .table-title {
  min-height: 54px;
  padding: 12px 16px;
}

.tutorial-list-card > .table-title h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.status-message {
  padding: 18px;
  color: var(--muted);
}

@media (max-width: 780px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .footer-inner {
    min-height: 42px;
    flex-direction: row;
    gap: 12px;
    padding: 8px 0;
  }

  .footer-inner nav {
    position: static;
    transform: none;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
  }

  .nav-links,
  .site-footer nav {
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .catalog-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .product-search {
    flex-basis: auto;
  }

  .product-search input {
    font-size: 16px;
  }

  .product-section {
    overflow: hidden;
  }

  .product-table,
  .product-table tbody,
  .product-table tr,
  .product-table td {
    display: block;
    width: 100%;
  }

  .product-table thead {
    display: none;
  }

  .product-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 14px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .product-table tr:last-child {
    border-bottom: 0;
  }

  .product-table td {
    border-bottom: 0;
    padding: 0;
    text-align: left !important;
  }

  .product-table td:first-child,
  .empty-cell {
    grid-column: 1 / -1;
  }

  .product-table td:nth-child(2)::before {
    content: "编号 ";
    color: var(--muted);
  }

  .product-table td:nth-child(3)::before {
    content: "价格 ";
    color: var(--muted);
    font-weight: 400;
  }

  .product-table td:nth-child(4)::before {
    content: "库存 ";
    color: var(--muted);
  }

  .product-table td:nth-child(5) {
    display: flex;
    justify-content: flex-end;
  }

  .table-spacer {
    height: calc(var(--missing-slots) * 126.5px);
  }

  .product-cell {
    align-items: flex-start;
  }

  .pagination {
    gap: 4px;
    padding: 10px 8px;
    overflow: hidden;
  }

  .page-btn {
    min-width: 30px;
    padding: 0 8px;
  }

  .page-ellipsis {
    min-width: 14px;
  }

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

  .reserved-card {
    display: none;
  }

  .tutorial-row {
    grid-template-columns: 86px 1fr;
    gap: 12px;
  }
}
