:root {
    --query-primary: #0757c9;
    --query-primary-dark: #0645a5;
    --query-primary-soft: #eef4ff;
    --query-success: #16a34a;
    --query-success-soft: #eaf8ef;
    --query-warning: #f59e0b;
    --query-warning-soft: #fff6e5;
    --query-danger: #dc2626;
    --query-danger-soft: #fff1f2;
    --query-text: #111827;
    --query-text-secondary: #4b5563;
    --query-text-muted: #98a2b3;
    --query-page: #f8fafc;
    --query-surface: #ffffff;
    --query-surface-soft: #f8fafc;
    --query-divider: #e5e7eb;
    --query-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    --query-shadow-button: 0 10px 20px rgba(7, 87, 201, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--query-page);
}

body.wechat-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--query-text);
    background: var(--query-page);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(7, 87, 201, 0.28);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.wechat-app {
    width: 100%;
    max-width: 540px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--query-page);
}

.wechat-app.is-query .detail-topbar,
.wechat-app.is-query .result-view,
.wechat-app.is-query .result-actions,
.wechat-app.is-result #queryHeader,
.wechat-app.is-result .query-view {
    display: none !important;
}

.wechat-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

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

.brand-mark,
.hero-mark-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--query-primary);
}

.brand-mark {
    width: 38px;
    height: 38px;
    overflow: hidden;
    background: #ffffff;
    border-radius: 10px;
    font-size: 24px;
}

.brand-logo,
.hero-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    overflow: hidden;
    color: var(--query-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.topbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--query-text-secondary);
    font-size: 21px;
}

.detail-topbar {
    justify-content: space-between;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--query-primary);
    background: transparent;
    border-radius: 50%;
    font-size: 24px;
}

.icon-button:active {
    background: var(--query-primary-soft);
}

.detail-title {
    margin: 0;
    color: var(--query-primary);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.topbar-spacer {
    width: 40px;
    height: 40px;
}

.wechat-main {
    width: 100%;
    padding: 0 18px 40px;
}

.query-view {
    padding: 40px 0 34px;
}

.query-hero {
    text-align: center;
}

.hero-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 108px;
    height: 108px;
    margin-bottom: 24px;
    background: var(--query-primary-soft);
    border-radius: 30px;
}

.hero-mark-inner {
    width: 84px;
    height: 84px;
    overflow: hidden;
    color: var(--query-primary);
    background: var(--query-surface);
    border: 1px solid rgba(7, 87, 201, 0.08);
    border-radius: 24px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    font-size: 48px;
}

.query-hero h1 {
    margin: 0;
    color: var(--query-text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
}

.query-hero p {
    margin: 10px 0 0;
    color: var(--query-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.search-panel {
    margin-top: 54px;
    padding: 28px 22px 24px;
    background: var(--query-surface);
    border: 1px solid var(--query-divider);
    border-radius: 28px;
    box-shadow: var(--query-shadow);
}

.search-panel-content {
    position: relative;
}

.eyebrow {
    margin: 0 0 18px 4px;
    color: var(--query-text-secondary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.search-field {
    display: flex;
    align-items: center;
    min-height: 62px;
    padding: 0 18px;
    color: var(--query-text-muted);
    background: var(--query-surface-soft);
    border: 1px solid var(--query-divider);
    border-radius: 18px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.search-field:focus-within {
    background: var(--query-surface);
    border-color: var(--query-primary);
    box-shadow: 0 0 0 4px rgba(7, 87, 201, 0.1);
}

.search-field > i {
    flex: 0 0 auto;
    margin-right: 14px;
    font-size: 22px;
}

.search-field input {
    width: 100%;
    min-width: 0;
    padding: 0;
    color: var(--query-text);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 16px;
    line-height: 1.5;
}

.search-field input::placeholder {
    color: var(--query-text-muted);
    opacity: 1;
}

.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    margin-top: 20px;
    padding: 0 18px;
    color: #ffffff;
    background: var(--query-primary);
    border-radius: 17px;
    box-shadow: var(--query-shadow-button);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-action:hover {
    background: var(--query-primary-dark);
}

.primary-action:active {
    transform: scale(0.985);
    box-shadow: 0 6px 12px rgba(7, 87, 201, 0.18);
}

.primary-action:disabled {
    cursor: wait;
    opacity: 0.72;
}

.primary-action .bi-arrow-right {
    font-size: 21px;
}

.primary-action.is-loading .bi-arrow-right {
    display: none;
}

.primary-action.is-loading::after {
    width: 17px;
    height: 17px;
    content: "";
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: query-spin 700ms linear infinite;
}

.query-feedback {
    min-height: 20px;
    margin: 12px 3px 0;
    color: var(--query-danger);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.query-feedback:empty {
    display: none;
}

.query-feedback.success {
    color: var(--query-success);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 52px;
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    color: var(--query-text-secondary);
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
}

.trust-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
}

.trust-icon-success {
    color: var(--query-success);
    background: var(--query-success-soft);
}

.trust-icon-primary {
    color: var(--query-primary);
    background: #eaf1ff;
}

.trust-icon-warning {
    color: var(--query-warning);
    background: var(--query-warning-soft);
}

.query-footer,
.result-footer {
    color: var(--query-text-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.query-footer {
    margin-top: 58px;
}

.assurance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 14px;
    color: var(--query-text-secondary);
    background: #f0f1ff;
    border-radius: 999px;
    font-weight: 600;
}

.assurance-pill i {
    color: var(--query-success);
    font-size: 15px;
}

.query-footer p,
.result-footer p {
    margin: 22px 0 0;
}

.result-view {
    padding: 24px 0 126px;
}

.result-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    justify-content: center;
    padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--query-divider);
}

.result-actions .primary-action {
    display: flex;
    width: min(100%, 504px);
    max-width: 504px;
    min-height: 54px;
    margin: 0;
}

.status-card {
    position: relative;
    overflow: hidden;
    min-height: 200px;
    padding: 28px 24px;
    color: #ffffff;
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.16);
}

.status-watermark {
    position: absolute;
    right: -18px;
    top: -12px;
    z-index: 0;
    color: rgba(255, 255, 255, 0.14);
    pointer-events: none;
    transform: rotate(14deg);
}

.status-watermark-icon {
    display: block;
    width: 176px;
    height: 176px;
    fill: currentColor;
}

.status-card.valid {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

.status-card.expiring {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.16);
}

.status-card.partial-expired {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    box-shadow: 0 8px 18px rgba(234, 88, 12, 0.18);
}

.status-card.expired {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.18);
}

.status-card.empty {
    background: var(--query-primary);
    box-shadow: 0 8px 18px rgba(7, 87, 201, 0.16);
}

.status-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.status-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    font-size: 34px;
}

.status-kicker {
    display: block;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.18em;
}

.status-heading h2 {
    margin: 0;
    color: #ffffff;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.status-products {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    max-width: calc(100% - 88px);
    margin-top: 0;
}

.status-product-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    align-self: flex-start;
    padding: 8px 12px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    font-size: clamp(11px, 3vw, 14px);
    font-weight: 700;
    line-height: 1.35;
}

.material-symbol-icon {
    flex: 0 0 auto;
    display: inline-block;
    fill: currentColor;
}

.status-product-icon {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.95);
}

.status-product-chip span {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.status-product-chip.is-expired {
    color: #b91c1c;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.92);
}

.status-product-chip.is-expired .status-product-icon {
    color: #dc2626;
}

.status-product-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.status-product-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.status-product-meta {
    color: #dc2626;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.15;
}

.detail-section {
    position: relative;
    margin-top: 16px;
    padding: 20px;
    background: var(--query-surface);
    border: 1px solid var(--query-divider);
    border-radius: 16px;
    box-shadow: var(--query-shadow);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.section-icon {
    width: 24px;
    height: 24px;
    color: var(--query-primary);
}

.section-icon--service {
    width: 25px;
    height: 25px;
}

.section-icon--store {
    width: 24px;
    height: 24px;
}

.section-heading .material-symbol-icon {
    color: var(--query-primary);
}

.section-heading h3 {
    margin: 0;
    color: var(--query-text);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
}

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

.info-item {
    min-width: 0;
}

.info-item-wide {
    grid-column: 1 / -1;
    padding-top: 14px;
    border-top: 1px solid var(--query-divider);
}

.info-label {
    display: block;
    margin-bottom: 7px;
    color: var(--query-text-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.info-value {
    display: block;
    color: var(--query-text);
    font-size: 16px;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.info-value-normal {
    font-weight: 500;
}

.plate-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    min-height: 30px;
    padding: 4px 10px;
    color: #ffffff;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.plate-blue {
    color: #ffffff;
    background: #1677ff;
    box-shadow: 0 2px 6px rgba(22, 119, 255, 0.24);
}

.plate-green {
    color: #ffffff;
    background: #16a34a;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.24);
}

.plate-yellow {
    color: #4a3100;
    background: #f7c948;
}

.plate-white {
    color: #344054;
    background: #f2f4f7;
    border: 1px solid #d0d5dd;
}

.plate-black {
    color: #ffffff;
    background: #344054;
}

.plate-default {
    background: #1769d2;
}

.warranty-records {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
}

.warranty-record {
    position: relative;
    z-index: 1;
    padding: 16px;
    background: var(--query-surface-soft);
    border: 1px solid var(--query-divider);
    border-radius: 10px;
}

.warranty-record.expired-item {
    background: #fff7f7;
    border-color: #fecaca;
}

.warranty-record + .warranty-record {
    margin-top: 2px;
}

.warranty-record-title {
    margin: 0 0 14px;
    color: var(--query-primary);
    font-size: 17px;
    font-weight: 750;
    line-height: 1.4;
}

.record-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    min-height: 30px;
    color: var(--query-text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.record-row + .record-row {
    margin-top: 8px;
}

.record-row > span:first-child {
    flex: 0 0 auto;
}

.record-row > span:last-child {
    min-width: 0;
    max-width: 70%;
    color: var(--query-text);
    font-weight: 600;
    text-align: right;
}

.record-value-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    max-width: 70%;
    flex-wrap: wrap;
}

.record-value-group .expiry-value {
    min-width: 0;
    overflow-wrap: anywhere;
}

.record-row .expiry-value {
    padding: 4px 8px;
    color: #b45309;
    background: #fff1d6;
    border-radius: 6px;
    font-weight: 850;
}

.record-row .expiry-value.expired {
    padding: 0;
    color: #dc2626;
    background: transparent;
    border-radius: 0;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
}

.status-chip.valid {
    color: #166534;
    background: #dcfce7;
}

.status-chip.expiring {
    color: #b45309;
    background: #fff1d6;
}

.status-chip.partial-expired {
    color: #9a3412;
    background: #ffedd5;
}

.status-chip.expired {
    color: #ffffff;
    background: #dc2626;
}

.record-row span.expiry-value {
    color: #b45309;
    font-weight: 850;
}

.record-row span.expiry-value.expired {
    color: #dc2626;
}

.record-row .status-chip.valid {
    color: #166534;
    font-weight: 850;
}

.record-row .status-chip.expiring {
    color: #b45309;
    font-weight: 850;
}

.record-row .status-chip.expired {
    color: #ffffff;
    font-weight: 850;
}

.expired-days {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 8px;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;
}

.warranty-card {
    overflow: hidden;
}

.detail-watermark {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 0;
    color: rgba(7, 87, 201, 0.08);
    pointer-events: none;
}

.detail-watermark-icon {
    display: block;
    width: 72px;
    height: 72px;
    fill: currentColor;
}

.warranty-card .section-heading,
.warranty-card .empty-result {
    position: relative;
    z-index: 1;
}

.store-card {
    padding-bottom: 18px;
}

.store-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.store-name {
    margin: 0;
    color: var(--query-text);
    font-size: 17px;
    font-weight: 750;
    line-height: 1.45;
}

.store-address {
    margin: 5px 0 0;
    color: var(--query-text-muted);
    font-size: 14px;
    line-height: 1.55;
}

.store-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    color: var(--query-primary);
    background: #e4ebff;
    border-radius: 50%;
    font-size: 21px;
    text-decoration: none;
}

.store-action-icon {
    width: 21px;
    height: 21px;
    color: var(--query-primary);
}

.phone-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin-top: 18px;
    padding: 0 15px;
    color: var(--query-primary);
    background: var(--query-surface-soft);
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

.phone-link-icon {
    width: 18px;
    height: 18px;
    color: var(--query-primary);
}

.phone-link:active {
    background: var(--query-primary-soft);
}

.result-footer {
    padding: 28px 0 0;
}

.empty-result,
.loading-result,
.error-result {
    padding: 36px 20px;
    color: var(--query-text-secondary);
    background: var(--query-surface);
    border: 1px solid var(--query-divider);
    border-radius: 16px;
    box-shadow: var(--query-shadow);
    text-align: center;
}

.result-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    color: var(--query-primary);
    background: var(--query-primary-soft);
    border-radius: 50%;
    font-size: 25px;
}

.error-result .result-state-icon {
    color: var(--query-danger);
    background: var(--query-danger-soft);
}

.loading-result .result-state-icon {
    color: var(--query-primary);
    background: var(--query-primary-soft);
}

.loading-result .result-state-icon::before {
    width: 24px;
    height: 24px;
    content: "";
    border: 3px solid rgba(7, 87, 201, 0.22);
    border-top-color: var(--query-primary);
    border-radius: 50%;
    animation: query-spin 700ms linear infinite;
}

.empty-result h2,
.loading-result h2,
.error-result h2 {
    margin: 0;
    color: var(--query-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.empty-result p,
.loading-result p,
.error-result p {
    margin: 8px 0 0;
    color: var(--query-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.warranty-card .empty-result {
    padding: 12px 0 2px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.warranty-card .empty-result .result-state-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    font-size: 20px;
}

.warranty-card .empty-result h2 {
    font-size: 16px;
}

.multiple-summary {
    margin-bottom: 16px;
    padding: 16px 18px;
    color: var(--query-primary);
    background: var(--query-primary-soft);
    border: 1px solid #d9e5ff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
}

.customer-block + .customer-block {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--query-divider);
}

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

.customer-block-heading h2 {
    margin: 0;
    color: var(--query-text);
    font-size: 19px;
    font-weight: 750;
    line-height: 1.35;
}

.customer-block-heading span {
    color: var(--query-text-muted);
    font-size: 12px;
}

.customer-block .detail-section {
    margin-top: 12px;
}

.fade-in {
    animation: query-fade-in 260ms ease-out both;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

@keyframes query-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 541px) {
    body.wechat-page {
        padding: 18px 0;
    }

    .wechat-app {
        min-height: calc(100vh - 36px);
        border: 1px solid var(--query-divider);
        border-radius: 22px;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
        overflow: hidden;
    }

    .wechat-topbar {
        border-radius: 22px 22px 0 0;
    }
}

@media (max-width: 380px) {
    .wechat-main {
        padding-right: 14px;
        padding-left: 14px;
    }

    .wechat-topbar {
        padding-right: 16px;
        padding-left: 16px;
    }

    .search-panel,
    .detail-section {
        padding-right: 16px;
        padding-left: 16px;
    }

    .status-card {
        padding-right: 20px;
        padding-left: 20px;
    }

    .status-heading {
        gap: 10px;
    }

    .status-heading h2 {
        font-size: 25px;
    }

    .record-row {
        gap: 10px;
    }
}
