:root {
  --ivory-base: #fbfaf5; /* Creamy warm ivory white, Dehua white porcelain */
  --glaze-white: #f6f7fa; /* Glazed off-white surface */
  --china-white: #ffffff; /* Pure porcelain white */
  --gold-champagne: #d4af37; /* Metallic champagne gold */
  --gold-bronze: #9a7b56; /* Softer bronze gold */
  --charcoal-ink: #2a2c30; /* Fine charcoal calligraphy ink */
  --charcoal-muted: #626873; /* Muted slate ink for subtexts */
  --line-sep: #ebe6dd; /* Warm gray thin lining */
  --red-cinnabar: #b83a30; /* Traditional cinnabar stamp red */
  --red-warning: #c3272b; /* Warning red */
  --red-warning-bg: #fff5f4; /* Muted red warning background */
  --celadon-green: #387a5c; /* Precious celadon jade green */
  --celadon-green-bg: #f0f7f4; /* Celadon light glaze background */
  --gold-shadow: 0 12px 36px rgba(154, 123, 86, 0.16);
  --ink-shadow: 0 20px 50px rgba(30, 34, 41, 0.05);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  
  /* Fallback aliases for undefined legacy variables */
  --muted: var(--charcoal-muted);
  --red: var(--red-warning);
  --line: var(--line-sep);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--charcoal-ink);
  font-family: var(--font-sans);
  letter-spacing: 0.03em;
  background-color: var(--ivory-base);
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

button {
  cursor: pointer;
}

/* Serif Font Stack for Premium Elements */
.brand strong,
.hero-inner h1,
.personal-hero h1,
.personal-journal h2,
.approved-stamp,
.hero-seal,
.section-title h2,
.info-title h3,
.footer-seals {
  font-family: var(--font-serif);
  font-weight: 700;
}

.public-body {
  background: 
    radial-gradient(at 0% 0%, rgba(254, 253, 248, 0.95) 0px, transparent 50%),
    radial-gradient(at 50% 0%, rgba(246, 247, 250, 0.9) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(240, 237, 230, 0.6) 0px, transparent 50%),
    var(--ivory-base);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: -10%;
  right: -10%;
  width: min(600px, 60vw);
  height: min(600px, 60vw);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.045) 0%, transparent 70%);
  filter: blur(80px);
  z-index: -2;
  pointer-events: none;
  animation: driftOne 45s infinite alternate ease-in-out;
}

body::after {
  content: "";
  position: fixed;
  bottom: -10%;
  left: -10%;
  width: min(700px, 70vw);
  height: min(700px, 70vw);
  background: radial-gradient(circle, rgba(56, 122, 92, 0.04) 0%, transparent 70%);
  filter: blur(100px);
  z-index: -2;
  pointer-events: none;
  animation: driftTwo 55s infinite alternate ease-in-out;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  padding: 0 max(6vw, calc((100vw - 1260px) / 2));
  border-bottom: 1px solid rgba(197, 168, 128, 0.25);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 30px rgba(30, 34, 41, 0.02);
  backdrop-filter: blur(16px);
  animation: slideDownFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.brand-logo {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 4px 10px rgba(30, 34, 41, 0.06));
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand:hover .brand-logo {
  transform: rotate(15deg) scale(1.06);
}

.brand strong {
  display: block;
  color: var(--charcoal-ink);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 2px;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--charcoal-muted);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 54px);
  color: var(--charcoal-ink);
  font-size: 15px;
  font-weight: 600;
}

.top-nav form {
  display: flex;
  align-items: center;
  height: 88px;
  margin: 0;
}

.top-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 88px;
  white-space: nowrap;
  color: var(--charcoal-muted);
}

.top-nav a.active,
.top-nav a:hover {
  color: var(--gold-bronze);
}

.top-nav a.active::after,
.top-nav a:hover::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--gold-champagne);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  min-height: auto;
  height: 88px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  white-space: nowrap;
}

.link-button:hover {
  background: transparent;
  color: var(--gold-bronze);
  box-shadow: none;
  transform: none;
}

.portal-page {
  min-height: calc(100vh - 88px);
  position: relative;
  overflow: hidden;
}

.portal-page::before {
  content: "";
  position: absolute;
  top: 80px;
  right: -120px;
  width: min(600px, 45vw);
  height: min(750px, 56vw);
  background: url("/images/dehua-porcelain.svg") no-repeat center center / contain;
  opacity: 0.025;
  z-index: 0;
  pointer-events: none;
  animation: softFloat 24s infinite alternate ease-in-out;
}

.portal-page::after {
  content: "";
  position: absolute;
  bottom: 80px;
  left: -180px;
  width: min(500px, 40vw);
  height: min(500px, 40vw);
  background: url("/images/portal-bg.svg") no-repeat center center / contain;
  opacity: 0.015;
  z-index: 0;
  pointer-events: none;
  animation: softFloatReverse 30s infinite alternate ease-in-out;
}

.portal-hero {
  position: relative;
  z-index: 2;
  min-height: 480px;
  padding-top: 54px;
  overflow: visible;
}

.portal-hero.compact {
  min-height: 280px;
}

.hero-inner {
  width: min(100%, 1260px);
  margin: 0 auto;
  padding: 0 28px;
  text-align: center;
}

.hero-inner h1 {
  margin: 0;
  color: var(--charcoal-ink);
  font-size: clamp(40px, 4.8vw, 60px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 5px;
  text-shadow: 0 4px 12px rgba(255, 255, 255, 0.8), 0 0 20px rgba(197, 168, 128, 0.1);
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-inner h1 .hero-seal {
  display: inline-block;
  width: 104px;
  height: auto;
  margin-left: 18px;
  filter: drop-shadow(0 10px 18px rgba(166, 48, 38, 0.18));
  transform: rotate(-1.2deg);
  vertical-align: middle;
}

.hero-inner > p {
  margin: 12px 0 24px;
  color: var(--charcoal-muted);
  font-size: 19px;
  letter-spacing: 8px;
  font-weight: 500;
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.query-card {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  border: 1px solid rgba(197, 168, 128, 0.3);
  border-top: 1.5px solid rgba(255, 255, 255, 0.95);
  border-left: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(254, 252, 248, 0.92) 100%);
  box-shadow: 
    0 4px 10px rgba(154, 123, 86, 0.02),
    0 24px 60px rgba(30, 34, 41, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(30px);
  padding: 32px 42px 36px;
  text-align: left;
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.query-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 15px rgba(154, 123, 86, 0.04),
    0 32px 70px rgba(30, 34, 41, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.query-tabs {
  display: flex;
  gap: 40px;
  border-bottom: 1px solid var(--line-sep);
  margin-bottom: 24px;
}

.tab {
  position: relative;
  min-width: 120px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--charcoal-muted);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.25s ease;
}

.tab.active {
  color: var(--gold-bronze);
  font-size: 16px;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--gold-champagne);
  border-radius: 99px;
}

.query-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.05fr) minmax(280px, 0.96fr) 140px;
  gap: 20px;
  align-items: center;
}

.query-form.no-captcha {
  grid-template-columns: minmax(260px, 1fr) 160px;
}

.field {
  display: flex;
  align-items: center;
  height: 54px;
  border: 1px solid var(--line-sep);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(30, 34, 41, 0.01);
}

.field:focus-within {
  border-color: var(--gold-champagne);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15), 0 4px 12px rgba(154, 123, 86, 0.06), inset 0 1px 2px rgba(30, 34, 41, 0.02);
  transform: translateY(-1px);
}

.field-icon {
  display: grid;
  place-items: center;
  width: 46px;
  color: var(--charcoal-muted);
  font-size: 19px;
}

.field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  color: var(--charcoal-ink);
  padding: 0 12px 0 0;
}

.field input::placeholder {
  color: #a7b0bd;
}

.captcha-field input {
  border-right: 1px solid var(--line-sep);
}

.captcha-refresh {
  display: grid;
  place-items: center;
  width: 140px;
  height: 100%;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(253, 252, 247, 0.9), rgba(255, 255, 255, 0.9)),
    #fcfbf7;
  padding: 0;
  box-shadow: none;
  transition: all 0.25s ease;
}

.captcha-refresh img {
  display: block;
  width: 138px;
  height: 52px;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.query-submit {
  min-height: 54px;
}

.captcha-refresh:hover {
  background: #fdf9ee;
}

.captcha-refresh:hover img {
  transform: scale(1.05);
}

.captcha-refresh:active img {
  transform: scale(0.95) rotate(2deg);
}

.captcha-refresh:disabled {
  cursor: wait;
  opacity: 0.72;
}

.query-submit,
.primary-action,
.stack-form > button,
.product-form > button,
.form-actions > button,
.auth-card > button,
.settings-form > button,
.search-form > button,
.sticky-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 50px;
  border: 1px solid rgba(197, 168, 128, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-bronze) 0%, #7d6549 100%);
  color: #fff;
  padding: 0 26px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(154, 123, 86, 0.22);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.query-submit:hover,
.primary-action:hover,
.stack-form > button:hover,
.product-form > button:hover,
.form-actions > button:hover,
.auth-card > button:hover,
.settings-form > button:hover,
.search-form > button:hover,
.sticky-actions > button:hover {
  background: linear-gradient(135deg, #ab8d69 0%, #856a4b 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(154, 123, 86, 0.36);
}

.query-note {
  margin: 18px 0 0;
  color: var(--charcoal-muted);
  font-size: 13.5px;
}

/* Personal sharing home page styles */
.personal-home {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.personal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 60px;
  align-items: center;
  min-height: 480px;
  margin-bottom: 40px;
}

.personal-hero-copy {
  max-width: 660px;
}

.personal-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-bottom: 2px solid var(--gold-champagne);
  color: var(--gold-bronze);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.personal-hero h1,
.personal-journal h2 {
  margin: 10px 0 0;
  color: var(--charcoal-ink);
  font-weight: 800;
  line-height: 1.15;
}

.personal-hero h1 {
  font-size: clamp(38px, 5.2vw, 68px);
}

.personal-hero p,
.personal-journal p,
.personal-note-grid p {
  color: var(--charcoal-muted);
  line-height: 1.85;
}

.personal-hero p {
  max-width: 580px;
  margin: 22px 0 0;
  font-size: 16px;
}

.personal-hero-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 380px;
  margin: 0;
}

.personal-hero-media::before {
  content: "";
  position: absolute;
  inset: 30px 10px 10px 30px;
  border: 1px solid rgba(197, 168, 128, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 40px rgba(30, 34, 41, 0.05);
}

.personal-hero-media img {
  position: relative;
  z-index: 1;
  width: min(320px, 80%);
  height: auto;
  filter: drop-shadow(0 20px 30px rgba(30, 34, 41, 0.12));
}

.personal-section,
.personal-journal {
  border-top: 1px solid var(--line-sep);
  padding-top: 40px;
}

.personal-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.personal-section-title span {
  color: var(--charcoal-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.personal-section-title h2 {
  margin: 0;
  color: var(--charcoal-ink);
  font-size: 24px;
}

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

.personal-note-grid article {
  min-height: 180px;
  border: 1px solid rgba(197, 168, 128, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(30, 34, 41, 0.02);
  transition: all 0.3s ease;
}

.personal-note-grid article:hover {
  transform: translateY(-3px);
  border-color: var(--gold-champagne);
  box-shadow: 0 12px 30px rgba(197, 168, 128, 0.12);
}

.personal-note-grid time {
  color: var(--gold-bronze);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
}

.personal-note-grid h3 {
  margin: 12px 0 8px;
  color: var(--charcoal-ink);
  font-size: 18px;
  font-weight: 700;
}

.personal-note-grid p {
  margin: 0;
  font-size: 14px;
}

.personal-journal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 48px;
  align-items: center;
  margin-top: 48px;
  padding-bottom: 40px;
}

.personal-journal h2 {
  font-size: clamp(28px, 3.2vw, 42px);
}

.personal-journal p {
  max-width: 620px;
  margin: 20px 0 0;
}

.personal-image-stack {
  display: grid;
  grid-template-columns: 1fr 0.65fr;
  gap: 16px;
  align-items: center;
}

.personal-image-stack img {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(197, 168, 128, 0.2);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(30, 34, 41, 0.03);
}

.personal-image-stack img:first-child {
  padding: 24px;
}

.personal-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  border-top: 1px solid var(--line-sep);
  color: var(--charcoal-muted);
  padding: 24px 0 36px;
  font-size: 13px;
}

.inline-error {
  margin: 0 0 14px;
  color: var(--red-warning);
  font-size: 14px;
  font-weight: 700;
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmerSweep {
  0% { left: -150%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

@keyframes stampEffect {
  0% {
    opacity: 0;
    transform: scale(2.5) rotate(-35deg);
    filter: blur(4px);
  }
  45% {
    opacity: 0.9;
    transform: scale(0.85) rotate(-6deg);
    filter: none;
  }
  65% {
    transform: scale(1.15) rotate(-10deg);
  }
  80% {
    transform: scale(0.95) rotate(-7deg);
  }
  100% {
    opacity: 0.92;
    transform: scale(1) rotate(-8deg);
  }
}

@keyframes itemFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.query-submit {
  position: relative;
  overflow: hidden;
}

.query-submit::before {
  content: "";
  position: absolute;
  top: 0; left: -150%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg);
  animation: shimmerSweep 5s infinite ease-in-out;
}

/* Premium Certificate style for results */
.result-card {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 48px));
  margin: 48px auto;
  border: 1px solid rgba(197, 168, 128, 0.28);
  border-top: 1.5px solid rgba(255, 255, 255, 0.95);
  border-left: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  background: var(--china-white);
  box-shadow: 
    0 4px 12px rgba(30, 34, 41, 0.01),
    0 28px 70px rgba(30, 34, 41, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  padding: 16px;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 20px rgba(30, 34, 41, 0.02),
    0 36px 80px rgba(30, 34, 41, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.certificate-inner {
  border: 1px solid rgba(197, 168, 128, 0.4);
  border-radius: 8px;
  padding: 32px 36px;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(254, 253, 249, 0.95) 100%);
}

.certificate-inner::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(197, 168, 128, 0.2);
  border-radius: 6px;
  pointer-events: none;
}

/* Corner filigrees styled dynamically */
.cert-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--gold-champagne);
  pointer-events: none;
  opacity: 0.8;
}
.cert-corner.tl { top: 11px; left: 11px; border-right: 0; border-bottom: 0; }
.cert-corner.tr { top: 11px; right: 11px; border-left: 0; border-bottom: 0; }
.cert-corner.bl { bottom: 11px; left: 11px; border-right: 0; border-top: 0; }
.cert-corner.br { bottom: 11px; right: 11px; border-left: 0; border-top: 0; }

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  border-bottom: 1px solid var(--line-sep);
  margin-bottom: 24px;
  padding-bottom: 12px;
  position: relative;
  z-index: 2;
}

.section-title h2 {
  margin: 0;
  color: var(--charcoal-ink);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
}

.section-title time {
  margin-left: auto;
  color: var(--charcoal-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
}

.line-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--gold-bronze);
  font-weight: 800;
}

.result-layout {
  display: grid;
  grid-template-columns: 240px minmax(220px, 1fr) minmax(220px, 1fr) 180px;
  gap: 36px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.result-layout.no-thumb {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 180px;
}

.result-layout.no-stamp {
  grid-template-columns: 240px minmax(220px, 1fr) minmax(220px, 1fr);
}

.result-layout.no-thumb.no-stamp {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.product-thumb {
  position: relative;
  display: block;
  height: 150px;
  border-radius: 8px;
  background: #fbfbf9;
  border: 1px solid rgba(197, 168, 128, 0.25);
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(30, 34, 41, 0.02);
  padding: 8px;
  cursor: zoom-in;
  font: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.product-thumb:hover {
  border-color: var(--gold-champagne);
  box-shadow: 0 8px 24px rgba(154, 123, 86, 0.12), inset 0 2px 8px rgba(30, 34, 41, 0.02);
  transform: translateY(-1px);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(30, 34, 41, 0.04));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-thumb:hover img {
  transform: scale(1.03);
}

.result-data {
  display: grid;
  gap: 20px;
  margin: 0;
}

.result-data div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  animation: itemFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Staggered animation delays for rows */
.result-data:nth-of-type(1) div:nth-child(1) { animation-delay: 0.15s; }
.result-data:nth-of-type(1) div:nth-child(2) { animation-delay: 0.25s; }
.result-data:nth-of-type(1) div:nth-child(3) { animation-delay: 0.35s; }
.result-data:nth-of-type(2) div:nth-child(1) { animation-delay: 0.2s; }
.result-data:nth-of-type(2) div:nth-child(2) { animation-delay: 0.3; }
.result-data:nth-of-type(2) div:nth-child(3) { animation-delay: 0.4s; }

.result-data dt {
  color: var(--charcoal-muted);
  font-weight: 700;
  font-size: 14px;
}

.result-data dd {
  margin: 0;
  color: var(--charcoal-ink);
  font-weight: 600;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.valid-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 99px;
  background: linear-gradient(135deg, #f0f8f4 0%, #dcf0e6 100%);
  color: var(--celadon-green);
  border: 1.5px solid rgba(56, 122, 92, 0.25);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 6px rgba(56, 122, 92, 0.06);
  letter-spacing: 1px;
}

.stamp-area {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
}

.approved-stamp {
  position: absolute;
  z-index: 5;
  right: -5px;
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border: 3px double var(--red-cinnabar);
  border-radius: 50%;
  color: var(--red-cinnabar);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 2px;
  white-space: nowrap;
  transform: rotate(-8deg);
  text-align: center;
  box-shadow:
    inset 0 0 0 2px rgba(184, 58, 48, 0.08),
    inset 0 0 0 5px rgba(184, 58, 48, 0.03),
    0 4px 12px rgba(184, 58, 48, 0.05);
  opacity: 0.88;
  mix-blend-mode: multiply;
  background-image: radial-gradient(rgba(184, 58, 48, 0.08) 1.2px, transparent 0);
  background-size: 3px 3px;
  pointer-events: none;
  animation: stampEffect 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.2) 0.45s both;
}

.anti-counterfeit-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 0;
  border: 1px solid rgba(183, 61, 53, 0.25);
  background: var(--red-warning-bg);
  color: var(--red-warning);
  padding: 14px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(183, 61, 53, 0.03);
}

.product-detail-section {
  width: min(1180px, calc(100% - 48px));
  margin: 26px auto 0;
  border: 1px solid rgba(197, 168, 128, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 28px;
  box-shadow: var(--ink-shadow);
}

.product-detail-images {
  display: grid;
  gap: 18px;
}

.detail-image-item {
  display: block;
  width: 100%;
  border: 1px solid rgba(197, 168, 128, 0.22);
  border-radius: 8px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 8px 24px rgba(30, 34, 41, 0.04);
}

.detail-image-item img {
  display: block;
  width: 100%;
  height: auto;
}

.anti-counterfeit-warning p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.log-modal-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid rgba(183, 61, 53, 0.3);
  border-radius: 6px;
  background: #fff;
  color: var(--red-cinnabar);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(183, 61, 53, 0.04);
}

.log-modal-trigger:hover {
  background: var(--red-warning-bg);
  box-shadow: 0 4px 12px rgba(183, 61, 53, 0.1);
}

.public-query-log-dialog {
  width: min(560px, calc(100% - 36px));
  border: 1px solid var(--line-sep);
  border-radius: 12px;
  background: #fff;
  color: var(--charcoal-ink);
  padding: 0;
  box-shadow: 0 24px 70px rgba(30, 34, 41, 0.18);
}

.public-query-log-dialog.is-open {
  display: block;
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 1000;
  transform: translate(-50%, -50%);
}

.public-query-log-dialog::backdrop {
  background: rgba(30, 34, 41, 0.4);
  backdrop-filter: blur(4px);
}

.log-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-sep);
  background: var(--glaze-white);
  padding: 16px 20px;
}

.log-dialog-head h3 {
  margin: 0;
  color: var(--charcoal-ink);
  font-size: 18px;
  font-weight: 800;
}

.log-dialog-head button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-sep);
  border-radius: 50%;
  background: #fff;
  color: var(--charcoal-muted);
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
}

.log-dialog-head button:hover {
  color: var(--charcoal-ink);
  background: #f0f0f0;
}

.public-query-log-dialog ol {
  display: grid;
  gap: 10px;
  max-height: min(50vh, 380px);
  overflow: auto;
  margin: 0;
  padding: 20px;
  list-style: none;
}

.public-query-log-dialog li {
  display: grid;
  grid-template-columns: 86px minmax(150px, 1fr) minmax(92px, 0.72fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-sep);
  border-radius: 6px;
  background: #fbfbf9;
  color: var(--charcoal-ink);
  padding: 10px 14px;
}

.public-query-log-dialog li span {
  color: var(--gold-bronze);
  font-size: 13px;
  font-weight: 800;
}

.public-query-log-dialog time {
  color: var(--charcoal-ink);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
}

.public-query-log-dialog li em {
  color: var(--charcoal-muted);
  font-size: 13px;
  font-style: normal;
  text-align: right;
}

.public-log-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-sep);
  background: var(--glaze-white);
  padding: 14px 20px;
}

.public-log-pagination button {
  min-height: 36px;
  border: 1px solid var(--line-sep);
  border-radius: 6px;
  background: #fff;
  color: var(--charcoal-ink);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s ease;
}

.public-log-pagination button:hover:not(:disabled) {
  border-color: var(--gold-champagne);
  color: var(--gold-bronze);
}

.public-log-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.public-log-pagination span {
  color: var(--charcoal-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
}

.empty-result-body {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--charcoal-muted);
  padding: 40px 24px;
  text-align: center;
}

.empty-result-body .warning-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--red-cinnabar);
  animation: pulseGlow 2s infinite ease-in-out;
}

.empty-result-body strong {
  color: var(--red-warning);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  font-family: var(--font-serif);
}

.empty-result-body .searched-code-label {
  margin: 0 0 16px 0;
  font-size: 15px;
  color: var(--charcoal-ink);
}

.empty-result-body code {
  font-family: var(--font-mono);
  font-weight: 700;
  background: #fff5f4;
  color: var(--red-warning);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(184, 58, 48, 0.15);
  margin-left: 6px;
}

.empty-result-body .warning-hint {
  margin: 0;
  max-width: 480px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--charcoal-muted);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1.28fr 1.04fr 1.25fr;
  gap: 20px;
  width: min(1260px, calc(100% - 48px));
  margin: 0 auto 48px;
}

.info-card {
  min-height: 160px;
  border: 1px solid rgba(197, 168, 128, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(30, 34, 41, 0.02);
  padding: 22px 24px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.info-grid article:nth-child(1) { animation-delay: 0.4s; }
.info-grid article:nth-child(2) { animation-delay: 0.5s; }
.info-grid article:nth-child(3) { animation-delay: 0.6s; }
.info-grid article:nth-child(4) { animation-delay: 0.7s; }

.info-card:hover {
  border-color: var(--gold-champagne);
  box-shadow: var(--gold-shadow);
}

.info-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.info-title h3 {
  margin: 0;
  color: var(--charcoal-ink);
  font-size: 18px;
  font-weight: 800;
}

.info-title > a {
  margin-left: auto;
  color: var(--gold-bronze);
  font-size: 13px;
  font-weight: 700;
}

.info-card p,
.info-card ol {
  margin: 0;
  color: var(--charcoal-muted);
  font-size: 13.5px;
  line-height: 1.8;
}

.info-card > a {
  display: inline-flex;
  margin-top: 16px;
  color: var(--gold-bronze);
  font-size: 13px;
  font-weight: 700;
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, 58px 16px);
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}

.flow span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(197, 168, 128, 0.25);
  border-radius: 12px;
  color: var(--gold-bronze);
  background: #fbfbf9;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(30, 34, 41, 0.01);
}

.flow i {
  color: var(--gold-champagne);
  font-size: 26px;
  font-style: normal;
}

.flow i:last-of-type {
  display: none;
}

.news-card ul {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-card li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--charcoal-ink);
  font-size: 13px;
}

.news-card time {
  color: var(--charcoal-muted);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.portal-footer {
  margin-top: 16px;
}

.contact-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1260px, calc(100% - 48px));
  margin: 0 auto;
  padding: 16px 0 20px;
  border-top: 1px solid var(--line-sep);
}

.contact-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  flex: 1 1 auto;
  min-width: 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  border-right: 1px solid var(--line-sep);
  padding-right: 20px;
  margin-right: 20px;
}

.contact-item:last-child {
  border-right: 1px solid var(--line-sep);
}

.round-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(197, 168, 128, 0.35);
  border-radius: 50%;
  color: var(--gold-bronze);
  background: #fff;
  box-shadow: 0 4px 10px rgba(30, 34, 41, 0.02);
}

.contact-item p {
  margin: 0;
}

.contact-item strong,
.contact-item small {
  display: block;
}

.contact-item strong {
  color: var(--charcoal-ink);
  font-size: 14px;
  font-weight: 700;
}

.contact-item small {
  color: var(--charcoal-muted);
  font-size: 12px;
  margin-top: 4px;
}

.footer-seals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 168px;
}

.footer-seals img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(30, 34, 41, 0.06));
}

.copyright-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 max(6vw, calc((100vw - 1260px) / 2));
  background: #15181c; /* Soft charcoal-black for footer base */
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.copyright-bar div {
  display: flex;
  align-items: center;
  gap: 20px;
}

.record-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5f6f7, #cfd3d8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 4px 10px rgba(0, 0, 0, 0.16);
}

.record-icon svg {
  width: 23px;
  height: 23px;
  display: block;
}

.record-shield {
  fill: none;
  stroke: #5f6670;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.record-vase {
  fill: #5f6670;
}

.record-line {
  fill: none;
  stroke: #5f6670;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.admin-body {
  min-height: 100vh;
  color: var(--charcoal-ink);
  background: 
    radial-gradient(at 0% 0%, rgba(254, 253, 248, 0.95) 0px, transparent 50%),
    radial-gradient(at 50% 0%, rgba(246, 247, 250, 0.9) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(240, 237, 230, 0.6) 0px, transparent 50%),
    var(--ivory-base);
  position: relative;
}

.admin-header .top-nav {
  gap: 28px;
}

.admin-header .top-nav a,
.admin-header .top-nav form,
.admin-header .link-button {
  height: 78px;
}

.admin-header .link-button {
  position: relative;
  color: #202b3e;
}

.admin-shell,
.auth-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
  padding: 46px 0;
}

.auth-card,
.admin-card,
.empty-state {
  border: 1px solid rgba(197, 168, 128, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 36px rgba(154, 123, 86, 0.08);
  backdrop-filter: blur(12px);
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(100%, 390px);
  padding: 34px;
}

.eyebrow {
  color: var(--gold-bronze);
  font-weight: 800;
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.auth-card h1,
.admin-title h1 {
  color: var(--charcoal-ink);
}

.stack-form label,
.product-form label,
.auth-card label {
  display: grid;
  gap: 8px;
  color: var(--charcoal-muted);
  font-weight: 650;
}

.admin-body input,
.admin-body select,
.admin-body textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-sep);
  border-radius: 5px;
  background: #fff;
  color: var(--charcoal-ink);
  padding: 0.72rem 0.86rem;
  outline: none;
  transition: all 0.3s ease;
}

textarea {
  resize: vertical;
}

.admin-body input:focus,
.admin-body select:focus,
.admin-body textarea:focus {
  border-color: var(--gold-champagne);
  box-shadow: 0 0 0 4px rgba(197, 168, 128, 0.18);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 104px;
  min-height: 44px;
  border-radius: 5px;
  padding: 0 20px;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.secondary-action {
  border: 1px solid var(--line-sep);
  background: #fff;
  color: var(--charcoal-muted);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(154, 123, 86, 0.04);
  transition: all 0.2s ease;
}

.secondary-action:hover {
  border-color: var(--gold-champagne);
  background: #fbfaf6;
  color: var(--gold-bronze);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(154, 123, 86, 0.1);
}

.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 104px;
  min-height: 44px;
  border: 1px solid #efb7b2 !important;
  border-radius: 5px;
  background: #fff3f2 !important;
  color: var(--red) !important;
  padding: 0 20px !important;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none !important;
}

.danger-action:hover {
  background: #ffe6e4 !important;
}

.danger-action:disabled,
.danger-action[disabled] {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none !important;
}

.site-footer.admin-footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.flash {
  width: min(1180px, calc(100% - 48px));
  margin: 18px auto 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 650;
}

.flash-success {
  border: 1px solid rgba(56, 122, 92, 0.28);
  background: var(--celadon-green-bg);
  color: var(--celadon-green);
}

.flash-error {
  border: 1px solid rgba(195, 39, 43, 0.28);
  background: var(--red-warning-bg);
  color: var(--red-warning);
}

.admin-shell {
  padding: 34px 0;
}

.admin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-title h1 {
  margin: 6px 0 0;
}

.title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stats-grid div {
  border: 1px solid rgba(197, 168, 128, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(154, 123, 86, 0.08);
  padding: 20px;
}

.stats-grid span {
  display: block;
  color: var(--charcoal-muted);
}

.stats-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--charcoal-ink);
  font-size: 32px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.stats-grid .stat-text {
  font-size: 21px;
}

.overview-card {
  margin-bottom: 18px;
}

.overview-card .card-head {
  margin-bottom: 14px;
}

.overview-card .stats-grid {
  margin-bottom: 0;
}

.overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.overview-grid div {
  padding: 16px;
}

.overview-grid strong {
  font-size: 28px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.detail-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.6fr);
}

.admin-card {
  padding: 22px;
}

.admin-card a:not(.primary-action):not(.secondary-action) {
  color: var(--gold-bronze);
  font-weight: 750;
}

.admin-card h2 {
  margin: 0 0 16px;
  color: var(--charcoal-ink);
  font-size: 19px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 38px;
  border: 1px solid var(--line-sep);
  border-radius: 5px;
  background: #fff;
  color: var(--gold-bronze);
  padding: 0 16px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(154, 123, 86, 0.04);
}

.card-head a:hover {
  border-color: var(--gold-champagne);
  background: #fbfaf6;
}

.admin-detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.admin-detail-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.admin-detail-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.admin-detail-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.admin-detail-list dd {
  min-width: 0;
  margin: 0;
  color: var(--charcoal-ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.inline-detail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-table table {
  min-width: 480px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid var(--line-sep);
  padding: 13px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  color: var(--charcoal-muted) !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

.sort-link:hover {
  color: var(--gold-bronze) !important;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--celadon-green-bg);
  color: var(--celadon-green);
  border: 1px solid rgba(56, 122, 92, 0.2);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.lock-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: rgba(154, 123, 86, 0.08);
  color: var(--gold-bronze);
  border: 1px solid rgba(154, 123, 86, 0.2);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.muted-status {
  color: var(--charcoal-muted);
  font-size: 13px;
  font-weight: 650;
}

.locked-row td {
  background: rgba(154, 123, 86, 0.02);
}

.locked-row td:first-child {
  box-shadow: inset 3px 0 0 var(--gold-champagne);
}

.batch-link {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.actions form {
  margin: 0;
}

.actions .mini-password {
  width: 116px;
  min-height: 28px;
  border: 1px solid var(--line-sep);
  border-radius: 4px;
  background: #fff;
  color: var(--charcoal-ink);
  padding: 0 8px;
  font-size: 12px;
}

.actions a,
.actions button {
  min-height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--gold-bronze);
  padding: 0;
}

.actions button {
  color: var(--red);
}

.actions .lock-action {
  color: var(--gold-bronze);
  font-weight: 800;
}

.lock-button {
  border: 1px solid rgba(154, 123, 86, 0.28) !important;
  background: rgba(154, 123, 86, 0.05) !important;
  color: var(--gold-bronze) !important;
  box-shadow: none !important;
}

.lock-button:hover {
  background: rgba(154, 123, 86, 0.1) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(154, 123, 86, 0.12) !important;
}

.actions .plain-action {
  color: var(--charcoal-muted);
}

.lock-form {
  margin-top: 12px;
}

.stack-form,
.product-form {
  display: grid;
  gap: 16px;
}

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

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.current-image {
  display: grid;
  gap: 8px;
}

.current-image img {
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--charcoal-muted);
  font-size: 12px;
}

.detail-image-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.detail-image-admin-grid figure {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line-sep);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.detail-image-admin-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--glaze-white);
}

.narrow {
  width: min(960px, calc(100% - 48px));
}

.list-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.list-tools .search-form {
  margin-bottom: 0;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(160px, 0.22fr) minmax(240px, 1fr) minmax(140px, 0.2fr) minmax(104px, auto);
  gap: 12px;
  margin-bottom: 16px;
}

.ip-filter-form {
  grid-template-columns: minmax(160px, 0.22fr) minmax(260px, 1fr) minmax(104px, auto);
}

.danger-inline-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.7fr) auto;
  justify-self: end;
  width: min(680px, 100%);
  gap: 12px;
  border: 1px solid rgba(195, 39, 43, 0.25);
  border-radius: 8px;
  background: var(--red-warning-bg);
  padding: 12px;
}

.code-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.code-inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(96px, 0.28fr) minmax(118px, auto);
  gap: 12px;
  width: 100%;
  min-height: 126px;
  border-radius: 8px;
  padding: 12px;
}

.bind-inline-form {
  border: 1px solid rgba(154, 123, 86, 0.24);
  background: rgba(154, 123, 86, 0.055);
}

.bind-inline-form .danger-hint {
  color: var(--gold-bronze);
}

.code-action-grid .danger-inline-form {
  justify-self: stretch;
  width: 100%;
}

.danger-inline-form.password-only-danger {
  grid-template-columns: minmax(180px, 1fr) auto;
  width: min(520px, 100%);
}

.danger-inline-form input {
  border-color: rgba(195, 39, 43, 0.2);
  background: #fff;
}

.danger-hint {
  display: inline-flex;
  align-items: center;
  grid-column: 1 / -1;
  min-height: 44px;
  color: var(--red-warning);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.danger-zone {
  margin-top: 18px;
  border-color: rgba(195, 39, 43, 0.25);
  background:
    linear-gradient(180deg, var(--red-warning-bg) 0%, rgba(255, 255, 255, 0.96) 100%),
    #fff;
}

.danger-zone h2 {
  color: var(--red-warning);
}

.danger-zone .muted {
  margin: -4px 0 16px;
  color: var(--charcoal-muted);
  font-weight: 650;
}

.ip-danger-zone {
  display: grid;
  align-content: start;
  gap: 14px;
}

.ip-danger-zone .danger-inline-form {
  justify-self: stretch;
  width: 100%;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span,
.pagination strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line-sep);
  border-radius: 5px;
  background: #fff;
  color: var(--charcoal-ink);
  padding: 0 10px;
  font-weight: 750;
}

.pagination a:hover {
  border-color: var(--gold-champagne);
  background: #fdf9ee;
  color: var(--gold-bronze);
}

.pagination strong {
  border-color: var(--gold-champagne);
  background: #fdf9ee;
  color: var(--gold-bronze);
}

.pagination span {
  color: var(--charcoal-muted);
  background: var(--glaze-white);
  border: 1px solid var(--line-sep);
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-section h2 {
  margin-bottom: 18px;
}

.password-card {
  margin-top: 18px;
}

.wide-field {
  grid-column: 1 / -1;
}

.check-line {
  display: flex !important;
  align-items: center;
  grid-template-columns: none !important;
  gap: 10px !important;
  min-height: 44px;
  color: var(--charcoal-ink);
}

.check-line input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.settings-toggle {
  margin-bottom: 16px;
  border: 1px solid var(--line-sep);
  border-radius: 8px;
  background: var(--china-white);
  padding: 10px 12px;
}

.settings-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.settings-switch-grid .check-line {
  min-height: 40px;
  border: 1px solid var(--line-sep);
  border-radius: 8px;
  background: var(--china-white);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.temporary-toggle {
  border-color: rgba(56, 122, 92, 0.35);
  background: var(--celadon-green-bg);
  color: var(--celadon-green);
  font-weight: 800;
}

.settings-help {
  margin: 14px 0 0;
  color: var(--charcoal-muted);
  font-size: 13px;
  line-height: 1.7;
}

.field-config-table {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.field-config-row {
  display: grid;
  grid-template-columns: 90px 130px minmax(180px, 1fr) 86px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-sep);
  border-radius: 8px;
  background: var(--china-white);
  padding: 10px;
}

.field-config-row strong {
  color: var(--charcoal-ink);
  font-size: 13px;
}

.field-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line-sep);
  border-radius: 5px;
  background: var(--glaze-white);
  color: var(--charcoal-muted);
  font-size: 13px;
  font-weight: 800;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-sep);
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 30px rgba(154, 123, 86, 0.06);
  padding: 14px;
}

.muted,
.empty-table {
  color: var(--muted);
}

@media (max-width: 1080px) {
  .site-header {
    padding-inline: 28px;
  }

  .top-nav {
    gap: 24px;
  }

  .result-layout {
  display: grid;
  grid-template-columns: 240px minmax(240px, 1fr) minmax(240px, 1fr) 180px;
  gap: 36px;
  align-items: center;
}

  .result-layout.no-thumb {
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) 180px;
  }

  .result-layout.no-stamp {
    grid-template-columns: 240px minmax(240px, 1fr) minmax(240px, 1fr);
  }

  .result-layout.no-thumb.no-stamp {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .stamp-area {
    grid-column: 1 / -1;
    justify-content: end;
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-strip {
    align-items: flex-start;
  }

  .contact-items {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    height: auto;
    min-height: 78px;
    flex-direction: column;
    align-items: flex-start;
    padding-block: 14px;
  }

  .brand strong {
  display: block;
  color: var(--charcoal-ink);
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 2px;
  white-space: nowrap;
}

  .top-nav {
    width: 100%;
    gap: 18px;
    overflow-x: auto;
  }

  .top-nav a,
  .top-nav form,
  .link-button {
    height: 38px;
    flex: 0 0 auto;
  }

  .top-nav a.active::after,
  .top-nav a:hover::after {
    bottom: 0;
  }

  .hero-inner h1 {
  margin: 0;
  color: var(--charcoal-ink);
  font-family: var(--font-serif);
  font-size: clamp(42px, 4.8vw, 64px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

  .hero-inner h1 .hero-seal {
    width: 86px;
    height: auto;
    margin-left: 12px;
  }

  .hero-inner > p {
    font-size: 16px;
    letter-spacing: 4px;
  }

  .query-form {
    grid-template-columns: 1fr;
  }

  .anti-counterfeit-warning {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-layout,
  .admin-grid,
  .code-action-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .product-thumb {
  height: 118px;
  border-radius: 8px;
  background: #f8f9fa;
  border: 1px solid #e1e6eb;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
}

  .stamp-area {
    justify-content: start;
  }

  .flow {
    grid-template-columns: repeat(4, 58px);
  }

  .flow i {
    display: none;
  }

  .copyright-bar,
  .copyright-bar div,
  .admin-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .copyright-bar {
    gap: 12px;
    padding-block: 18px;
  }

  .form-grid,
  .inline-detail,
  .list-tools,
  .search-form,
  .danger-inline-form {
    grid-template-columns: 1fr;
  }

  .contact-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-items {
    grid-template-columns: 1fr;
  }

  .contact-item {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
  }

  .footer-seals {
    align-self: flex-end;
  }

  .danger-inline-form {
    justify-self: stretch;
    width: 100%;
  }

  .title-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-inline: 16px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand strong {
  display: block;
  color: var(--charcoal-ink);
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 2px;
  white-space: nowrap;
}

  .brand small {
    font-size: 9px;
  }

  .portal-hero {
    min-height: 560px;
    padding-top: 34px;
  }

  .hero-inner {
    padding: 0 14px;
  }

  .hero-inner h1 {
  margin: 0;
  color: var(--charcoal-ink);
  font-family: var(--font-serif);
  font-size: clamp(42px, 4.8vw, 64px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

  .hero-inner h1 .hero-seal {
    width: 72px;
    height: auto;
    margin-left: 8px;
  }

  .hero-inner > p {
    font-size: 13px;
    letter-spacing: 2px;
  }

  .query-card,
  .result-card,
  .info-grid,
  .contact-strip {
    width: calc(100% - 24px);
  }

  .query-card {
    padding: 18px 16px;
  }

  .query-tabs {
    gap: 14px;
  }

  .tab {
    min-width: 112px;
  }

  

  .section-title {
    flex-wrap: wrap;
  }

  .section-title time {
    width: 100%;
    margin-left: 34px;
  }

  .result-data div {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
  }

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

  .footer-seals {
    justify-content: flex-end;
  }

  table {
    min-width: 620px;
  }

  .admin-shell,
  .auth-shell,
  .site-footer.admin-footer,
  .flash,
  .narrow {
    width: calc(100% - 24px);
  }

  .admin-card {
    padding: 18px 16px;
  }

  .title-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .title-actions a,
  .form-actions a,
  .form-actions button,
  .list-tools button,
  .danger-inline-form button {
    width: 100%;
  }

  .admin-detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 1080px) {
  .personal-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 0;
  }

  .personal-hero-media {
    min-height: 360px;
  }

  .personal-note-grid {
    grid-template-columns: 1fr;
  }

  .personal-journal {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .personal-home {
    width: min(100% - 32px, 680px);
    padding-top: 34px;
  }

  .personal-hero h1 {
    font-size: clamp(36px, 11vw, 54px);
  }

  .personal-hero p {
    font-size: 15px;
  }

  .personal-section-title {
    display: grid;
    gap: 8px;
    align-items: start;
  }

  .personal-image-stack {
    grid-template-columns: 1fr;
  }

  .personal-footer {
    width: min(100% - 32px, 680px);
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .personal-hero-media {
    min-height: 300px;
  }

  .personal-hero-media img {
    width: min(260px, 78%);
  }

  .personal-note-grid article {
    min-height: 0;
    padding: 18px;
  }
}

/* Premium Back to Query Button */
.back-query-btn-container {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.back-query-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--gold-champagne);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #fbfaf7 100%);
  color: var(--gold-bronze);
  padding: 0 32px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  box-shadow: 
    0 6px 18px rgba(154, 123, 86, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.back-query-btn::before {
  content: "";
  position: absolute;
  top: 0; left: -150%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.18), transparent);
  transform: skewX(-20deg);
  animation: shimmerSweep 6s infinite ease-in-out;
}

.back-query-btn:hover {
  background: linear-gradient(135deg, #fdfcf9 0%, #f6f3eb 100%);
  border-color: var(--gold-bronze);
  color: #7d6549;
  transform: translateY(-2px);
  box-shadow: 
    0 10px 24px rgba(154, 123, 86, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.back-query-btn:active {
  transform: translateY(-0.5px);
  box-shadow: 
    0 4px 12px rgba(154, 123, 86, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.back-query-btn .btn-icon {
  font-size: 18px;
  font-weight: 800;
  transition: transform 0.3s ease;
}

.back-query-btn:hover .btn-icon {
  transform: rotate(-360deg);
}

/* Slide Down Entry Animation */
@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Warning Seal Pulse Glow */
@keyframes pulseGlow {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(184, 58, 48, 0.3));
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

/* Custom Webkit Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--ivory-base);
}
::-webkit-scrollbar-thumb {
  background: rgba(197, 168, 128, 0.4);
  border-radius: 99px;
  border: 2px solid var(--ivory-base);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(154, 123, 86, 0.6);
}

/* Layered Floating & Drifting Keyframes */
@keyframes softFloat {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(18px) rotate(1.5deg) scale(1.02); }
  100% { transform: translateY(-12px) rotate(-1.5deg) scale(0.98); }
}

@keyframes softFloatReverse {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-15px) rotate(-2deg) scale(0.97); }
  100% { transform: translateY(10px) rotate(2deg) scale(1.03); }
}

@keyframes driftOne {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-4vw, 5vh) scale(1.1); }
  100% { transform: translate(5vw, -5vh) scale(0.9); }
}

@keyframes driftTwo {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, -8vh) scale(0.95); }
  100% { transform: translate(-3vw, 4vh) scale(1.1); }
}

/* Image zoom hint styling */
.image-zoom-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translate(-50%, 4px);
  background: rgba(42, 44, 48, 0.76);
  color: var(--ivory-base);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(30, 34, 41, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.product-thumb:hover .image-zoom-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Lightbox Modal styling */
.image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-preview-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.image-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 34, 41, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: zoom-out;
}

.image-preview-container {
  position: relative;
  z-index: 2002;
  max-width: 90vw;
  max-height: 85vh;
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-modal.active .image-preview-container {
  transform: scale(1);
}

.image-preview-content {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  border: 1px solid rgba(197, 168, 128, 0.32);
  background: var(--china-white);
  box-shadow: 0 24px 70px rgba(30, 34, 41, 0.35);
  object-fit: contain;
}

.image-preview-close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(197, 168, 128, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  outline: none;
}

.image-preview-close:hover {
  background: var(--china-white);
  color: var(--charcoal-ink);
  border-color: var(--gold-champagne);
  transform: rotate(90deg) scale(1.08);
}


