/* Download portal, design direction A (designs/deviceadmin, "下载门户" page).
   Light theme only. */
:root {
  --ground: #f2f4f7;
  --surface: #ffffff;
  --ink: #11151b;
  --ink-2: #3e4753;
  --muted: #5b6573;
  --line: #dee2e8;
  --primary: #1550c8;
  --primary-hover: #0f3fa3;
  --primary-tint: #eaf0fb;
  --signal: #f2a900;
  --disabled-bg: #eef1f5;
  --disabled-text: #6b7380;
  --warn-bg: #fff6e0;
  --warn-line: #f1d08a;
  --warn-text: #6e4300;
  --error: #9a3b00;
  --error-line: #c25400;
  --overlap: clamp(24px, 8vw, 120px); /* how far the card covers the banner */
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ header */

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

.brand-line {
  height: 3px;
  background: var(--signal);
}

.header-inner {
  max-width: 1200px;
  height: 64px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-divider {
  flex: none;
  width: 1px;
  height: 18px;
  background: #d3d9e0;
}

.product {
  color: var(--ink-2);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-btn {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #d3d9e0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

.lang-btn:hover {
  border-color: var(--muted);
}

/* ------------------------------------------------------------ banner */

.banner {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  min-height: 240px;
  max-height: 520px;
  overflow: hidden;
  background: #e5e9ef;
}

.slides,
.slide {
  position: absolute;
  inset: 0;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.slide.is-current {
  animation: slide-in 0.45s ease-out;
}

@keyframes slide-in {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

.banner-arrow {
  position: absolute;
  top: calc(50% - var(--overlap) / 2);
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid #d3d9e0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.banner-arrow.prev {
  left: clamp(12px, 2vw, 32px);
}

.banner-arrow.next {
  right: clamp(12px, 2vw, 32px);
}

.banner-arrow:hover {
  background: #ffffff;
}

.banner-dots {
  position: absolute;
  left: 50%;
  bottom: calc(var(--overlap) + 4px);
  transform: translateX(-50%);
  display: flex;
}

.banner-dots button {
  height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.banner-dots span {
  display: block;
  width: 8px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(17, 21, 27, 0.25);
  transition: width 0.2s;
}

.banner-dots button[aria-current="true"] span {
  width: 28px;
  background: var(--signal);
  box-shadow: none;
}

/* ------------------------------------------------------------ card */

.main {
  position: relative;
  max-width: 960px;
  margin: calc(-1 * var(--overlap)) auto 0;
  padding: 0 clamp(12px, 3vw, 24px) 72px;
}

.card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(17, 21, 27, 0.06), 0 16px 40px rgba(17, 21, 27, 0.1);
  padding: clamp(24px, 4vw, 44px) clamp(18px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.3;
  font-weight: 700;
  text-wrap: pretty;
}

.subtitle {
  margin: 0;
  color: var(--ink-2);
  text-wrap: pretty;
}

.search {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search label {
  font-weight: 600;
  font-size: 15px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.search input {
  flex: 1 1 260px;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid #c3cad3;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  letter-spacing: 0.05em;
}

.search input::placeholder {
  color: var(--muted);
  letter-spacing: normal;
}

.search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 80, 200, 0.15);
}

.search input[aria-invalid="true"] {
  border-color: var(--error-line);
}

.primary {
  flex: 1 0 120px;
  max-width: 100%;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

@media (min-width: 561px) {
  .primary {
    flex: 0 0 auto;
    min-width: 120px;
  }
}

.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.primary:disabled {
  background: #e3e7ec;
  color: var(--muted);
  cursor: default;
}

.field-error {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--error);
  font-size: 14px;
}

/* ------------------------------------------------------------ result */

.result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result:not(:has(> :not([hidden]))) {
  display: none;
}

.message {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--ground);
  color: var(--ink);
}

.message svg {
  flex: none;
  color: var(--ink-2);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
}

.notice svg {
  flex: none;
  margin-top: 2px;
  color: #9a6100;
}

.packages {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.packages .col-action {
  width: 116px;
}

.packages th {
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
}

.packages td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.packages .type {
  font-weight: 700;
}

.packages .version {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.packages .action {
  padding-right: 0;
}

.download {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

a.download:hover {
  background: var(--primary);
  color: #ffffff;
}

button.download:disabled {
  border: 1px solid var(--line);
  background: var(--disabled-bg);
  color: var(--disabled-text);
}

.hints {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 14px;
}

.hints p {
  margin: 0;
}

.hints .warn {
  color: var(--warn-text);
  font-weight: 600;
}

.install {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.install h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.install p {
  margin: 0;
  white-space: pre-line;
}

/* ------------------------------------------------------------ contact */

.contact {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.contact-head p {
  margin: 0;
  color: var(--ink-2);
  text-wrap: pretty;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.contact-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.contact-label {
  color: var(--muted);
  font-size: 14px;
}

.contact-value {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-value a {
  color: var(--primary);
  text-decoration: none;
}

.contact-value a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ misc */

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

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .slide.is-current {
    animation: none;
  }
  .banner-dots span {
    transition: none;
  }
}
