/* 尺寸全部照成绩报告单原图量取，基准宽度 472px、1rem = 16px。
   根字号按视口宽度缩放，页面在任意手机宽度上都保持原图比例。 */
html {
  font-size: 3.38983vw;
}

@media (min-width: 472px) {
  html {
    font-size: 16px;
  }
}

:root {
  --bg: #ffffff;
  --title: #111111;
  --label: #111111;
  --value: #6b6b6b;
  --line: #ebebeb;
  --badge-from: #6481e9;
  --badge-to: #49aefc;
  --photo-bg: #e8eaed;
  --photo-text: #b0b4ba;
  /* 标签列宽：两到四字的标签都两端对齐撑满这个宽度 */
  --label-col: 4em;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--bg);
}

body {
  /* 西文字体排在前面，数字和字母走 Helvetica 一路，汉字再回落到黑体，
     这样中西文宽度都和原成绩报告单一致 */
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--title);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.page {
  width: 100%;
  max-width: 472px;
  min-height: 100vh;
  margin: 0 auto;
  padding-top: 1.1875rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  background: var(--bg);
}

.header {
  text-align: center;
}

.header h1,
.header h2 {
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.75rem;
  color: var(--title);
}

.header h2 {
  margin-top: 0.46875rem;
}

.badge-wrap {
  margin-top: 0.625rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9.4375rem;
  height: 1.8125rem;
  color: #fff;
  font-size: 0.9375rem;
  letter-spacing: 0.225rem;
  /* 抵掉末字后面多出的一个字距，让文字真正居中 */
  text-indent: 0.225rem;
  background: linear-gradient(90deg, var(--badge-from) 0%, var(--badge-to) 100%);
  border-radius: 0 999px 999px 0;
}

.photo {
  position: relative;
  width: 6.625rem;
  height: 8.75rem;
  margin: 0.625rem auto 0;
  overflow: hidden;
  background: var(--photo-bg);
}

.photo-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--photo-text);
  font-size: 0.8125rem;
  letter-spacing: 0.125rem;
}

.photo img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.card {
  position: relative;
  margin: 1rem 1.4375rem 0;
  overflow: hidden;
  background: #fff;
  border-radius: 0.375rem;
  box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.24);
}

/* 水印是一整块填色圆盘，徽标在圆盘上镂空成白色，
   直径占卡片宽度 83%，圆心与卡片中心重合。 */
.card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 83.1%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url("watermark.png") no-repeat center / contain;
  pointer-events: none;
}

.card-inner {
  position: relative;
  padding: 0 0.6875rem;
}

.row {
  display: flex;
  align-items: center;
  height: 2.675rem;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: none;
}

.label {
  flex: 0 0 auto;
  font-size: 1rem;
  color: var(--label);
}

/* 两到四字的标签两端对齐撑满标签列，字数不同也能对齐 */
.label.pad {
  width: var(--label-col);
  text-align: justify;
  text-align-last: justify;
}

.value {
  flex: 1;
  min-width: 0;
  padding-left: 0.75rem;
  font-size: 1rem;
  color: var(--value);
  text-align: right;
  word-break: break-all;
}

/* 听力、阅读、写作和翻译是总分的分项，整行缩进一个标签列 */
.row.sub {
  padding-left: var(--label-col);
}

.footer {
  margin-top: 0.75rem;
  padding: 0 1.5rem;
}

.tip {
  font-size: 0.875rem;
  line-height: 1rem;
  color: var(--value);
}
