:root {
  --gold: #f6c332;
  --deep-gold: #a66f12;
  --ink: #11181e;
  --ink-2: #242a31;
  --paper: #f7f2e6;
  --muted: #6f777f;
  --line: #d7bd72;
  --danger: #c73b31;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: #dde2da;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

.hidden {
  display: none !important;
}

.phone-page {
  width: min(100vw, 520px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #11181e 0 35%, #dce1d9 72%, #e8ece3 100%);
}

.hero {
  position: relative;
  min-height: 290px;
  padding: 34px 30px 0;
  color: #fff;
  background: #11181e;
}

.hero-brand {
  position: relative;
  z-index: 3;
}

.hero-brand img {
  display: block;
  width: 150px;
  height: auto;
  margin-left: 4px;
}

.hero-brand h1 {
  margin-top: 34px;
  font-size: clamp(31px, 7.6vw, 41px);
  line-height: 1.05;
  font-weight: 500;
}

.hero-brand p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  font-weight: 900;
}

.gold-slab,
.dark-slab {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.gold-slab {
  left: -14%;
  right: -10%;
  top: 218px;
  height: 175px;
  transform: skewY(-6deg);
  background: linear-gradient(180deg, #facb38, #efb821);
}

.dark-slab {
  right: -17%;
  top: 205px;
  width: 43%;
  height: 235px;
  transform: skewX(-25deg);
  background: #272c31;
}

.content {
  position: relative;
  z-index: 5;
  margin-top: -54px;
  padding: 0 30px 36px;
}

.lookup-card,
.certificate {
  box-shadow: 0 18px 38px rgba(15, 17, 19, 0.14);
}

.lookup-card {
  padding: 26px 24px 24px;
  border-bottom: 2px solid var(--line);
  border-radius: 0 0 26px 26px;
  background: #fffaf0;
}

.card-head,
.cert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.card-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--deep-gold);
  font-size: 11px;
  font-weight: 900;
}

.card-head h2,
.cert-header h2 {
  color: #57491c;
  font-size: 26px;
  line-height: 1.2;
}

.card-head b,
.cert-header b {
  min-width: 116px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 16px;
  border-radius: 999px;
  color: #050505;
  background: var(--gold);
  font-size: 17px;
  white-space: nowrap;
}

.lookup-form {
  margin-top: 28px;
}

.lookup-form label {
  display: block;
  margin-bottom: 10px;
  color: #5d5f62;
  font-size: 15px;
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 10px;
}

.input-row input,
.admin-token-row input,
.entry-form input,
.entry-form select,
.entry-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #ddc982;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.input-row input,
.admin-token-row input,
.entry-form input,
.entry-form select {
  height: 52px;
  padding: 0 15px;
}

.entry-form textarea {
  padding: 12px 15px;
  resize: vertical;
}

.input-row input:focus,
.admin-token-row input:focus,
.entry-form input:focus,
.entry-form select:focus,
.entry-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(246, 195, 50, 0.24);
}

.input-row button,
.secondary-action,
.admin-actions button,
.admin-token-row button,
.form-actions button {
  height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.message {
  min-height: 24px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.message.ok {
  color: #137333;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.trust-row span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(168, 112, 18, 0.28);
  border-radius: 8px;
  color: #6f5d22;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.certificate {
  border: 2px solid var(--line);
  border-radius: 0 0 26px 26px;
  background: #fff;
}

.cert-header {
  min-height: 86px;
  padding: 20px 24px;
  background: #f7f2e6;
}

.cert-body {
  position: relative;
  padding: 34px 24px 18px;
  background: #fff;
}

.cert-line {
  height: 1px;
  margin: 0 0 38px;
  background: var(--line);
}

.cert-body h3 {
  margin: 0 0 20px;
  font-size: 23px;
  font-weight: 900;
}

.info-list {
  display: grid;
  gap: 18px;
}

.info-list + h3 {
  margin-top: 34px;
}

.info-list div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
}

.info-list dt {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.info-list dd {
  min-width: 0;
  color: #191d22;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.gold-text {
  color: var(--deep-gold) !important;
}

.stamp {
  position: absolute;
  top: 106px;
  right: 56px;
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  border: 4px double rgba(214, 82, 77, 0.88);
  border-radius: 50%;
  color: #d6524d;
  transform: rotate(-9deg);
  opacity: 0.92;
  pointer-events: none;
}

.stamp em,
.stamp i {
  font-style: normal;
  font-weight: 900;
}

.stamp em {
  margin-top: 12px;
  font-size: 12px;
}

.stamp span {
  margin-top: -5px;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.stamp small {
  margin-top: -10px;
  font-size: 14px;
  font-weight: 900;
}

.stamp i {
  margin-top: -14px;
  font-size: 8px;
}

.warranty-code {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #11181e;
  color: #fff;
}

.warranty-code p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
}

.warranty-code strong {
  color: var(--gold);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.cert-note {
  padding: 22px 4px 0;
  color: #4d5551;
  font-size: 14px;
  text-align: left;
}

.secondary-action {
  width: calc(100% - 48px);
  margin: 18px 24px 24px;
}

.admin-link {
  display: block;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  text-decoration: none;
  font-size: 13px;
}

.admin-body {
  background: #f3f5f8;
}

.admin-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 60px;
}

.admin-header {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 22px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.admin-header img {
  width: 160px;
}

.admin-header h1 {
  font-size: 26px;
}

.admin-header p {
  margin-top: 6px;
  color: var(--muted);
}

.admin-header a {
  color: var(--deep-gold);
  font-weight: 900;
  text-decoration: none;
}

.admin-login,
.admin-panel {
  margin-top: 18px;
  padding: 22px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.admin-login p {
  margin-top: 8px;
  color: var(--muted);
}

.admin-token-row {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 130px;
  gap: 12px;
  margin-top: 18px;
}

.admin-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-actions button:nth-child(1),
.form-actions button:nth-child(1) {
  background: var(--gold);
  color: #111;
}

.entry-form {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fbfcfe;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 800;
}

.form-grid label.wide {
  grid-column: span 2;
}

.form-actions {
  margin-top: 18px;
}

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

.records-panel h2 {
  margin-bottom: 12px;
  font-size: 22px;
}

.records-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 14px;
}

th {
  background: #11181e;
  color: #fff;
}

td button {
  margin-right: 6px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: #eef2f7;
  color: #111827;
  font-weight: 800;
}

td button.danger {
  color: #fff;
  background: #b3261e;
}

@media (max-width: 720px) {
  .hero {
    min-height: 276px;
    padding-inline: 16px;
  }

  .hero-brand img {
    width: 150px;
  }

  .hero-brand h1 {
    margin-top: 32px;
  }

  .content {
    margin-top: -52px;
    padding-inline: 16px;
  }

  .input-row,
  .trust-row,
  .admin-header,
  .admin-token-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid label.wide {
    grid-column: span 1;
  }

  .cert-body {
    padding: 30px 22px 18px;
  }

  .stamp {
    right: 34px;
    width: 108px;
    height: 108px;
  }

  .stamp span {
    font-size: 23px;
  }

  .stamp small {
    font-size: 12px;
  }

  .stamp i {
    font-size: 7px;
  }

  .warranty-code {
    grid-template-columns: 92px minmax(0, 1fr);
  }
}
