/* Tianjin University of Science & Technology visual refresh */
.site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(26, 72, 126, 0.14);
  box-shadow: 0 8px 30px rgba(15, 61, 108, 0.08);
  animation: tust-header-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand {
  min-width: 0;
}

.brand-mark {
  width: 210px;
  height: 46px;
  flex: 0 0 210px;
  overflow: visible;
  transform: none;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("/tust-official-logo.png");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  filter: drop-shadow(0 5px 10px rgba(21, 63, 121, 0.1));
  box-shadow: none;
  animation: tust-logo-float 4.8s ease-in-out 0.8s infinite;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.brand-mark b {
  display: none;
}

.brand:hover .brand-mark {
  transform: translateY(-2px) scale(1.018);
  filter: drop-shadow(0 8px 14px rgba(21, 63, 121, 0.16));
  box-shadow: none;
}

.brand > span:last-child {
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid rgba(25, 76, 134, 0.18);
}

.brand strong {
  overflow: hidden;
  color: #123d77;
  font-size: 17px;
  letter-spacing: -0.35px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: #6f8096;
  letter-spacing: 0.85px;
}

.header-service {
  padding: 9px 13px;
  border: 1px solid rgba(30, 105, 189, 0.12);
  border-radius: 14px;
  background: rgba(242, 248, 255, 0.86);
}

.hero-panel h1 {
  letter-spacing: -1.35px;
}

.hero-heading {
  animation: tust-rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.product-image-panel,
.order-card,
.receipt-card {
  border-color: rgba(126, 158, 193, 0.38);
  box-shadow: 0 22px 58px rgba(17, 73, 132, 0.15);
}

.product-image-panel {
  animation: tust-rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.product-image-panel img {
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-image-panel:hover img {
  transform: scale(1.025);
}

.order-card,
.receipt-card {
  background: rgba(255, 255, 255, 0.98);
  animation: tust-card-in 0.78s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(22, 111, 221, 0.2);
  outline-offset: 2px;
}

.primary-button {
  overflow: hidden;
  position: relative;
  box-shadow: 0 12px 24px rgba(18, 98, 219, 0.22);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.primary-button::after {
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -45%;
  width: 32%;
  content: "";
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.42),
    transparent
  );
  transform: skewX(-22deg);
  animation: tust-button-shine 4.8s ease-in-out 1.4s infinite;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 16px 30px rgba(18, 98, 219, 0.3);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

.desktop-nav button,
.mobile-nav button,
.mode-button,
.payment-option,
.quantity-button {
  transition:
    transform 0.22s ease,
    color 0.22s ease,
    background-color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.desktop-nav button:hover,
.mode-button:hover,
.payment-option:hover,
.quantity-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.form-section {
  animation: tust-section-in 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.form-section:nth-of-type(1) {
  animation-delay: 0.3s;
}

.form-section:nth-of-type(2) {
  animation-delay: 0.38s;
}

.form-section:nth-of-type(3) {
  animation-delay: 0.46s;
}

.form-section:nth-of-type(4) {
  animation-delay: 0.54s;
}

.phone-history-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 22px 32px;
  margin: 0 auto 24px;
  padding: 24px 26px;
  border: 1px solid rgba(107, 151, 195, 0.32);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 0, rgba(70, 157, 255, 0.13), transparent 36%),
    rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 46px rgba(17, 73, 132, 0.12);
  animation: tust-rise-in 0.66s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.phone-history-intro {
  display: flex;
  align-items: center;
  gap: 14px;
}

.phone-history-icon {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  place-items: center;
  border-radius: 16px;
  color: #1769dd;
  background: #eaf4ff;
  font-size: 23px;
  font-weight: 800;
}

.phone-history-intro .eyebrow {
  font-size: 10px;
}

.phone-history-intro h2 {
  margin: 4px 0 3px;
  color: #0b2b57;
  font-size: 20px;
}

.phone-history-intro p {
  margin: 0;
  color: #72859a;
  font-size: 11px;
  line-height: 1.65;
}

.phone-history-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #52677f;
  font-size: 11px;
  font-weight: 700;
}

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

.phone-history-input-row input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #c8d8e8;
  border-radius: 12px;
  color: #17385e;
  background: #fbfdff;
  font: inherit;
  font-size: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.phone-history-input-row input:focus {
  border-color: #2d7fe7;
  box-shadow: 0 0 0 4px rgba(45, 127, 231, 0.1);
}

.phone-history-input-row .primary-button {
  min-width: 148px;
  height: 48px;
  padding-inline: 20px;
}

.phone-history-feedback {
  min-height: 18px;
  margin: 5px 0 0;
  color: #467197;
  font-size: 10px;
}

.phone-history-feedback.is-error {
  color: #cb3d4e;
}

.query-mode-hidden {
  display: none !important;
}

.phone-history-results {
  grid-column: 1 / -1;
}

.phone-history-results:empty {
  display: none;
}

.phone-history-results-heading {
  margin: 2px 0 12px;
  color: #496681;
  font-size: 12px;
  font-weight: 750;
}

.phone-history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.phone-history-item {
  padding: 17px;
  border: 1px solid #dbe7f2;
  border-radius: 16px;
  background: #fbfdff;
  animation: tust-history-item-in 0.48s cubic-bezier(0.22, 1, 0.36, 1)
    calc(var(--history-index, 0) * 55ms) both;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.phone-history-item:hover {
  transform: translateY(-3px);
  border-color: #abc9e7;
  box-shadow: 0 13px 28px rgba(25, 75, 124, 0.11);
}

.phone-history-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5eef7;
}

.phone-history-item-head > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.phone-history-item-head span {
  color: #8697a8;
  font-size: 9px;
}

.phone-history-item-head strong {
  overflow: hidden;
  color: #153b68;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-history-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #1769dd;
  background: #e9f3ff;
  font-size: 10px;
  white-space: nowrap;
}

.phone-history-status.status-completed {
  color: #187b54;
  background: #e7f7ef;
}

.phone-history-status.status-cancelled {
  color: #a44b58;
  background: #f9eaed;
}

.phone-history-status.status-delivering {
  color: #9c6400;
  background: #fff3d5;
}

.phone-history-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 13px 0;
}

.phone-history-fact {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.phone-history-fact span {
  color: #91a0af;
  font-size: 9px;
}

.phone-history-fact strong {
  overflow: hidden;
  color: #344f6c;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-history-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1px 0 14px;
  padding: 0;
  list-style: none;
}

.phone-history-progress li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #96a7b8;
  font-size: 9px;
  text-align: center;
}

.phone-history-progress li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 10px;
  left: calc(50% + 12px);
  width: calc(100% - 24px);
  height: 2px;
  border-radius: 999px;
  background: #dce8f2;
  content: "";
}

.phone-history-progress li.is-done:not(:last-child)::after,
.phone-history-progress li.is-current:not(:last-child)::after {
  background: #78acf0;
}

.phone-history-progress li span {
  z-index: 1;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #7890a7;
  background: #e7eef5;
  font-size: 9px;
  font-weight: 800;
}

.phone-history-progress li.is-done span,
.phone-history-progress li.is-current span {
  color: #fff;
  background: #2779df;
  box-shadow: 0 4px 10px rgba(39, 121, 223, 0.22);
}

.phone-history-progress li.is-current b {
  color: #1769dd;
}

.phone-history-progress.is-cancelled {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: #a44b58;
  background: #f9eaed;
}

.phone-history-progress.is-cancelled li {
  display: block;
  color: inherit;
  font-size: 10px;
  font-weight: 750;
}

.phone-history-details {
  margin: 0 0 13px;
  padding: 13px;
  border: 1px solid #d9e7f3;
  border-radius: 12px;
  background: #f5f9fd;
  animation: tust-detail-open 0.24s ease-out both;
}

.phone-history-details[hidden] {
  display: none;
}

.phone-history-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.phone-history-detail-grid > div {
  min-width: 0;
}

.phone-history-detail-grid > div.is-wide {
  grid-column: 1 / -1;
}

.phone-history-detail-grid dt {
  margin-bottom: 3px;
  color: #879aad;
  font-size: 9px;
}

.phone-history-detail-grid dd {
  margin: 0;
  color: #274866;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.phone-history-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: start;
}

.phone-history-detail-button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfe0f0;
  border-radius: 10px;
  color: #1769dd;
  background: #f1f7ff;
  font-size: 11px;
  font-weight: 750;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.phone-history-detail-button:hover {
  transform: translateY(-1px);
  border-color: #9fc4ea;
  background: #e6f2ff;
}

.push-reminder-control {
  margin: 16px 0 10px;
  padding: 14px;
  border: 1px solid #cfe1f2;
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(232, 245, 255, 0.9), rgba(249, 252, 255, 0.98));
}

.push-reminder-control.is-compact {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.receipt-actions .push-reminder-control {
  grid-column: 1 / -1;
  width: 100%;
}

.push-reminder-button {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid #9bc5ef;
  border-radius: 10px;
  color: #0c62ca;
  background: #eaf4ff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.push-reminder-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #5e9fe2;
  background: #dceeff;
  box-shadow: 0 7px 16px rgba(30, 104, 184, 0.13);
}

.push-reminder-button.is-enabled {
  border-color: #8fd0ae;
  color: #11764d;
  background: #e9f8f0;
}

.push-reminder-button:disabled {
  cursor: default;
  opacity: 0.78;
}

.push-reminder-feedback {
  min-height: 0;
  margin: 6px 2px 0;
  color: #647d96;
  font-size: 9px;
  line-height: 1.5;
}

.push-reminder-feedback:empty {
  display: none;
}

.push-reminder-feedback.is-error {
  color: #bf3f50;
}

.push-reminder-feedback.is-success {
  color: #197450;
}

.phone-history-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed #cbddeb;
  border-radius: 14px;
  color: #7890a7;
  background: #f8fbfe;
  text-align: center;
}

.phone-history-empty span {
  color: #3e88e4;
  font-size: 20px;
}

.phone-history-empty strong {
  color: #3a5877;
  font-size: 12px;
}

.phone-history-empty p {
  margin: 0;
  font-size: 10px;
}

@keyframes tust-header-in {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tust-rise-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tust-card-in {
  from {
    opacity: 0;
    transform: translateX(26px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes tust-section-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tust-logo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes tust-button-shine {
  0%,
  58% {
    left: -45%;
  }
  78%,
  100% {
    left: 120%;
  }
}

@keyframes tust-history-item-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tust-detail-open {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (width <= 767px) {
  .site-header {
    position: sticky;
    height: 68px;
    padding: 0 14px;
  }

  .brand {
    gap: 10px;
    max-width: 100%;
  }

  .brand-mark {
    width: 142px;
    height: 32px;
    flex-basis: 142px;
    background-size: contain;
    filter: drop-shadow(0 4px 8px rgba(21, 63, 121, 0.09));
    box-shadow: none;
  }

  .brand > span:last-child {
    padding-left: 9px;
  }

  .brand strong {
    font-size: 14px;
    letter-spacing: -0.45px;
  }

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

  .hero-panel h1 {
    letter-spacing: -0.8px;
  }

  .track-hero h1 em {
    display: block;
  }

  .order-card,
  .receipt-card {
    box-shadow: 0 16px 42px rgba(17, 73, 132, 0.13);
  }

  .phone-history-card {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
    padding: 20px 16px;
    border-radius: 16px;
  }

  .phone-history-input-row,
  .phone-history-list {
    grid-template-columns: 1fr;
  }

  .phone-history-actions {
    grid-template-columns: 1fr;
  }

  .phone-history-detail-grid {
    grid-template-columns: 1fr;
  }

  .phone-history-detail-grid > div.is-wide {
    grid-column: auto;
  }

  .phone-history-input-row .primary-button {
    width: 100%;
  }

  .phone-history-empty {
    flex-direction: column;
  }
}

@media (width <= 360px) {
  .site-header {
    padding-inline: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 124px;
    height: 28px;
    flex-basis: 124px;
  }

  .brand strong {
    font-size: 13px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .brand-mark,
  .hero-heading,
  .product-image-panel,
  .order-card,
  .receipt-card,
  .form-section,
  .primary-button::after,
  .phone-history-card,
  .phone-history-item {
    animation: none !important;
  }

  .brand-mark,
  .product-image-panel img,
  .primary-button,
  .desktop-nav button,
  .mobile-nav button,
  .mode-button,
  .payment-option,
  .quantity-button,
  .phone-history-item,
  .phone-history-detail-button {
    transition-duration: 0.01ms !important;
  }
}
