:root {
  --gold: #db9d65;
  --line: rgba(160, 185, 255, 0.28);
  --text: #ffffff;
  --muted: rgba(226, 236, 255, 0.78);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #021a70 url("../assets/certbg2.jpg") center / cover repeat;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

.container {
  width: 100%;
  max-width: 900px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 14px 34px;
  overflow: hidden;
  text-align: center;
}

/* ---------- header ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 8px;
}

.logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: contain;
}

.title-box { min-width: 0; text-align: left; }

.cn-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.en-title {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1px;
  white-space: nowrap;
  transform: scale(0.92);
  transform-origin: left center;
}

.moddile-title {
  margin: 18px 0 20px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* ---------- certificate card ---------- */
.box {
  position: relative;
  width: 92%;
  margin: 0 auto;
  padding: 4px 0;
  border: 1px solid rgba(198, 214, 255, 0.45);
  border-radius: 10px;
  background: rgba(2, 16, 70, 0.12);
  overflow: visible;
}

.item-hr {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 38%;
  border-left: 1px solid var(--line);
  pointer-events: none;
}

.item {
  display: flex;
  align-items: center;
  width: 88%;
  margin: 0 auto;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.item:last-child { border-bottom: 0; }

.item-left {
  width: 38%;
  flex: 0 0 38%;
  text-align: left;
  color: #e8f0ff;
  letter-spacing: 0.4px;
}

.item-right {
  width: 62%;
  min-width: 0;
  padding-left: 10px;
  text-align: left;
  word-break: break-word;
}

.item-right.is-status { color: #26ff07; }
.item-right.is-status-invalid { color: #ff8b7a; }

/* ---------- seal ---------- */
.seal {
  position: absolute;
  top: -58px;
  right: -42px;
  width: 150px;
  pointer-events: none;
}

.seal img {
  display: block;
  width: 100%;
  height: auto;
}

.seal span {
  position: absolute;
  top: 50%;
  left: 45%;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  transform: translate(-50%, -50%) rotate(30deg);
  white-space: nowrap;
}

.seal.is-invalid { display: none; }

/* ---------- states ---------- */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 54px 20px 42px;
  color: var(--muted);
  text-align: center;
}

.state-title {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.state-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- footer ---------- */
.buttom {
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.buttom div { text-align: left; width: 76%; margin: 0 auto; }

.slug {
  margin: 12px 0 0;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
}

/* ---------- desktop ---------- */
@media (min-width: 768px) {
  body { background: #021a70; }

  .container {
    min-height: 960px;
    margin: 18px auto;
    padding: 28px 30px 34px;
    background: url("../assets/certbg3.jpg") center / cover no-repeat;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  }

  .logo { width: 66px; height: 66px; flex-basis: 66px; }
  .cn-title { font-size: 22px; }
  .en-title { font-size: 12px; transform: scale(0.82); }
  .moddile-title { margin: 22px 0 24px; font-size: 23px; }

  .box { width: 60%; }

  .item {
    width: 86%;
    padding: 17px 4px;
    font-size: 15px;
  }

  .item-hr { left: 40%; }

  .seal { width: 176px; top: -76px; right: -47px; }
  .seal span { font-size: 15px; }

  .buttom { margin-top: 22px; font-size: 15px; }
  .buttom div { width: 58%; }
  .slug { font-size: 21px; }
}

@media (max-width: 600px) {
  .seal { display: none; }
}

@media (max-width: 420px) {
  .container { padding: 16px 10px 28px; }
  .logo { width: 46px; height: 46px; flex-basis: 46px; }
  .cn-title { font-size: 15px; }
  .en-title { font-size: 8.5px; }
  .moddile-title { font-size: 18px; margin: 16px 0 18px; }
  .item { font-size: 13px; padding: 12px 2px; }
  .seal { width: 116px; top: -38px; right: -20px; }
  .seal span { top: 29px; right: 19px; font-size: 11px; }
  .buttom { font-size: 12px; }
  .slug { font-size: 17px; letter-spacing: 2px; }
}
