:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --ink: #1c242b;
  --muted: #68747e;
  --line: #dde3e0;
  --teal: #0f766e;
  --teal-dark: #0b5d56;
  --coral: #e2613f;
  --coral-dark: #c34c2d;
  --amber: #b58b1f;
  --blue: #2f6db3;
  --shadow: 0 1px 2px rgba(28, 36, 43, 0.06), 0 10px 28px rgba(28, 36, 43, 0.08);
  --radius: 8px;
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  background: var(--teal);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  border-radius: 8px;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn i {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  flex: 0 0 38px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-primary:hover {
  background: var(--teal-dark);
}

.btn-coral {
  background: var(--coral);
  color: #fff;
}

.btn-coral:hover {
  background: var(--coral-dark);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: #b9c4bf;
  background: #f8faf9;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--radius);
}

.contact-link:hover {
  color: var(--ink);
  background: #eef2f0;
}

.contact-link i {
  width: 16px;
  height: 16px;
}

.intro {
  background: #edf3f1;
  border-bottom: 1px solid var(--line);
}

.intro-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
  padding: 34px 20px 38px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 600;
}

.intro h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.stats {
  display: flex;
  gap: 26px;
  margin-top: 20px;
}

.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.package-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--coral);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.package-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.package-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  background: #fbe8e1;
  color: var(--coral);
  border-radius: var(--radius);
}

.package-icon i {
  width: 20px;
  height: 20px;
}

.package-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.package-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.package-meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.package-code {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff7e8;
  border: 1px solid #ecd9ae;
  border-radius: var(--radius);
  font-size: 13px;
}

.package-code strong {
  color: #8a6412;
  font-size: 15px;
  letter-spacing: 2px;
}

.package-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.version-chip:hover {
  border-color: #b9c4bf;
  color: var(--ink);
}

.version-chip.is-active {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

.version-pending {
  font-size: 11px;
  opacity: 0.85;
}

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

.package-actions .btn {
  flex: 1;
}

.catalog {
  padding: 22px 0 80px;
  scroll-margin-top: 70px;
}

.catalog-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.catalog-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.catalog-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.catalog-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.catalog-jump {
  margin-top: 18px;
  width: max-content;
}

.toolbar {
  position: sticky;
  top: 59px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  background: var(--bg);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 320px);
  min-height: 40px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.search-box i {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.filters {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-chip:hover {
  border-color: #b9c4bf;
  color: var(--ink);
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.filter-chip .chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 11px;
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sort-box i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.sort-box select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.material-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(28, 36, 43, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.material-card:hover {
  border-color: #c3cdc8;
  box-shadow: var(--shadow);
}

.material-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chip i {
  width: 13px;
  height: 13px;
}

.category-chip {
  background: color-mix(in srgb, var(--chip-color) 13%, #ffffff);
  color: var(--chip-color);
}

.type-chip {
  background: #f0f2f1;
  color: var(--muted);
}

.material-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.material-card .desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  background: #f0f4f2;
  color: #4d5a62;
  border-radius: 6px;
  font-size: 12px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-meta i {
  width: 13px;
  height: 13px;
}

.pending-chip {
  color: var(--amber);
  background: #fbf3dd;
  border-radius: 999px;
  padding: 0 8px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid #edf0ee;
}

.card-actions .btn-primary {
  flex: 1;
  min-width: 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state i {
  width: 34px;
  height: 34px;
}

.empty-state p {
  margin: 0;
}

.site-footer {
  padding: 22px 20px 90px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 10px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(28, 36, 43, 0.28);
  transform: translateX(-50%);
}

.selection-count {
  padding: 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.selection-bar .btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.selection-bar .btn-primary {
  background: var(--coral);
}

.selection-bar .btn-primary:hover {
  background: var(--coral-dark);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 28, 34, 0.5);
}

.modal-panel {
  display: flex;
  flex-direction: column;
  width: min(580px, 100%);
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(20, 28, 34, 0.3);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.form-view {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field select {
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.email-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.email-input-row input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.email-at {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 14px;
}

.email-input-row select {
  flex-shrink: 0;
}

.selected-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
}

.selected-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f5f7f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.selected-item .selected-info {
  flex: 1;
  min-width: 0;
}

.selected-item .selected-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.selected-item .btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  flex: 0 0 34px;
}

.result-view {
  display: grid;
  gap: 14px;
  text-align: center;
}

.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin: 6px auto 0;
  background: #e4f3ef;
  color: var(--teal);
  border-radius: 50%;
}

.result-icon i {
  width: 26px;
  height: 26px;
}

.result-view h3 {
  margin: 0;
  font-size: 18px;
}

.result-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.result-links {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  text-align: left;
}

.result-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f5f7f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.result-link-row .link-info {
  flex: 1;
  min-width: 0;
}

.result-link-row .link-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-link-row .link-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-link-row .btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 36px;
}

.modal-panel-lg {
  width: min(760px, 100%);
}

.detail-header {
  align-items: flex-start;
}

.detail-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.detail-heading-copy {
  min-width: 0;
}

.detail-heading-copy h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-search {
  width: min(100%, 340px);
}

.file-list {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 2px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f6f8f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  background: #eef2f0;
  color: var(--teal);
  border-radius: var(--radius);
}

.file-icon i {
  width: 17px;
  height: 17px;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.file-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.file-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.file-date i {
  width: 12px;
  height: 12px;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.file-actions .btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  flex: 0 0 34px;
}

.card-open-row {
  margin-top: 2px;
}

.card-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.card-open:hover {
  color: var(--teal-dark);
}

.card-open i {
  width: 14px;
  height: 14px;
}

.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  z-index: 120;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(20, 28, 34, 0.3);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

i[data-lucide] {
  display: inline-block;
  flex: none;
}

i[data-lucide] svg {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 860px) {
  .intro-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 26px;
    padding-bottom: 28px;
  }

  .toolbar {
    top: 59px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .site-header {
    padding: 10px 14px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 15px;
  }

  .brand-name {
    font-size: 15px;
  }

  .contact-link span {
    display: none;
  }

  .contact-link {
    width: 34px;
    min-height: 34px;
    padding: 0;
    justify-content: center;
  }

  .intro-inner,
  .catalog-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .intro h1 {
    font-size: 26px;
  }

  .stats {
    gap: 18px;
  }

  .toolbar {
    top: 51px;
  }

  .search-box {
    width: 100%;
  }

  .sort-box {
    margin-left: auto;
  }

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

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .file-row {
    flex-wrap: wrap;
  }

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

  .detail-search {
    width: 100%;
  }
}
