:root {
    color-scheme: light;
    --ink: #18212f;
    --muted: #677181;
    --line: #e6e9ef;
    --paper: #fff;
    --accent: #0071e3;
    --page: #f6f7fa;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}
p, h1, h2, h3, dl, dd { margin: 0; }

.page { width: min(100% - 64px, 1080px); margin: 0 auto; }
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 88px;
    border-bottom: 1px solid var(--line);
}
.brand-group { display: flex; align-items: center; gap: 24px; }
.site-logo-link { display: inline-flex; align-items: center; min-height: 44px; }
.site-logo { display: block; height: 32px; width: auto; object-fit: contain; }
.brand-context { border-left: 1px solid #d9dee6; padding-left: 24px; color: #566171; font-size: 13px; }
.home-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 9px 0 9px 14px;
    color: #4d5869;
    text-decoration: none;
    font-size: 13px;
}
.home-link:hover { color: var(--accent); }
.home-link span { font-size: 17px; }
.page-main { max-width: 960px; margin: 0 auto; padding: 62px 0 0; }
.intro { text-align: center; margin: 0 auto 32px; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 12px; letter-spacing: .08em; }
h1 { font-size: 46px; line-height: 1.2; letter-spacing: -1.8px; font-weight: 700; }
.subtitle { color: var(--muted); margin-top: 17px; font-size: 15px; }

.search-panel {
    max-width: 740px;
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: 0 2px 4px #18212f03, 0 12px 36px #18212f05;
}
.search-label-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 13px; }
.input-label { font-size: 13px; font-weight: 600; color: #465164; }
.keyboard-hint { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
kbd { display: inline-grid; place-items: center; width: 22px; height: 20px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: #fafbfc; font: inherit; font-size: 14px; }
.input-group { display: flex; gap: 12px; }
.number-field {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    padding: 0 18px;
    border: 1px solid #dde3eb;
    border-radius: 10px;
    background: #f8f9fc;
    transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.number-field:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px #0071e312; }
.number-field:has([aria-invalid="true"]) { border-color: #bc514b; box-shadow: 0 0 0 3px #bc514b0b; }
.number-prefix { font-family: ui-monospace, Consolas, monospace; font-size: 22px; color: #788397; }
#qiid-input {
    width: 100%;
    min-width: 0;
    height: 62px;
    padding: 0;
    border: 0;
    outline: none;
    color: var(--ink);
    background: transparent;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 26px;
    font-weight: 500;
    letter-spacing: .06em;
    font-variant-numeric: tabular-nums;
}
#qiid-input::placeholder { color: var(--muted); font-family: inherit; font-size: 20px; font-weight: 400; letter-spacing: 0; }
#qiid-input:disabled { color: var(--muted); }
.search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 122px;
    gap: 9px;
    padding: 0 20px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 150ms, box-shadow 150ms;
}
.search-button:hover { background: #0065ce; border-color: #0065ce; box-shadow: 0 4px 12px #0071e320; }
.search-button:disabled { opacity: .65; box-shadow: none; }
.search-icon { width: 19px; height: 19px; stroke-width: 1.8; }
.input-help { color: var(--muted); margin-top: 12px; font-size: 12px; }
.source-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 18px 0 0; padding-inline: 16px; font-size: 12px; color: var(--muted); }
.source-note svg { width: 15px; height: 15px; stroke-width: 1.6; flex: 0 0 auto; color: #748298; }

.loading-container, .error-container {
    align-items: center;
    gap: 12px;
    max-width: 740px;
    margin: 24px auto 0;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--muted);
    font-size: 14px;
}
.loading-spinner { flex: 0 0 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-container { background: #fff7f5; border-color: #f0dcd5; color: #9d4035; justify-content: space-between; }
.retry-button { flex-shrink: 0; min-height: 36px; padding: 4px 12px; color: #9d4035; background: #fff; border: 1px solid #e4c7bd; border-radius: 7px; font-size: 12px; }
.retry-button:hover { background: #fbece7; }

.results-container { margin-top: 38px; }
.result-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 24px #18212f03; overflow: hidden; }
.product-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 30px; border-bottom: 1px solid var(--line); }
.product-title { font-size: 14px; font-weight: 600; color: #4a5668; }
.product-title:focus { outline: none; }
.certification-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: #eef7f2; color: #26784e; font-size: 11px; font-weight: 600; }
.result-overview { display: flex; gap: 44px; padding: 30px; }
.product-details { flex: 1; min-width: 0; }
.product-brand { color: var(--muted); font-size: 13px; margin-bottom: 7px; overflow-wrap: anywhere; }
.product-name { font-size: 23px; font-weight: 650; line-height: 1.35; letter-spacing: -.45px; overflow-wrap: anywhere; }
.spec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; margin-top: 24px; }
.spec-row { min-width: 0; padding: 14px 0; border-top: 1px solid #edf0f5; }
.spec-row dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.spec-row dd { font-size: 15px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.primary-spec { padding-top: 0; border-top: 0; padding-bottom: 18px; }
.primary-spec dd { font-size: 23px; line-height: 1.25; font-weight: 600; letter-spacing: -.4px; }
#power-rating { color: var(--accent); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-variant-numeric: tabular-nums; }

.product-images { width: 300px; flex: 0 0 34%; min-width: 0; align-self: flex-start; padding-top: 4px; }
.carousel-container { overflow: hidden; background: #f8f9fb; border: 1px solid #edf0f5; border-radius: 12px; }
.image-gallery { display: flex; transition: transform 180ms ease; }
.product-image { flex: 0 0 100%; width: 100%; aspect-ratio: 1; position: relative; padding: 20px; border: 0; background: transparent; overflow: hidden; cursor: zoom-in; }
.product-image:focus-visible { outline-offset: -5px; }
.product-image:disabled { cursor: default; }
.product-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-placeholder, .loading-image::before { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.loading-image::before { content: '图片加载中…'; position: absolute; inset: 0; background: #f8f9fb; }
.carousel-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.carousel-btn { flex: 0 0 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: #566171; background: var(--paper); font-size: 23px; line-height: 1; }
.carousel-btn:hover { background: #f0f5fc; color: var(--accent); border-color: #d6e4f7; }
.carousel-dots { display: flex; flex-wrap: wrap; justify-content: center; }
.carousel-dot { display: grid; place-items: center; width: 28px; height: 32px; padding: 0; border: 0; background: transparent; }
.carousel-dot::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #c7ced9; }
.carousel-dot.active::after { background: var(--accent); width: 16px; border-radius: 3px; }
.image-status { margin-top: 6px; color: var(--muted); font-size: 11px; text-align: center; }
.additional-details { border-top: 1px solid var(--line); padding: 0 30px; }
.additional-details summary { display: flex; align-items: center; gap: 16px; cursor: pointer; padding: 19px 0; font-size: 13px; font-weight: 600; list-style: none; }
.additional-details summary::-webkit-details-marker { display: none; }
.additional-details summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid #677181; border-bottom: 1.5px solid #677181; transform: rotate(45deg); margin: -4px 3px 0 auto; }
.additional-details[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.details-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.additional-details[open] { padding-bottom: 20px; }
.detail-item { display: grid; grid-template-columns: minmax(140px, 32%) minmax(0, 1fr); gap: 24px; padding: 12px 0; border-top: 1px solid #edf0f5; font-size: 13px; }
.detail-label { color: var(--muted); overflow-wrap: anywhere; }
.detail-value { overflow-wrap: anywhere; }

.site-footer { max-width: 960px; margin: 64px auto 0; display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 32px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.powered-by { white-space: nowrap; }
.powered-by a { color: var(--ink); text-decoration: none; font-weight: 700; margin-left: 3px; }
.powered-by a:hover { color: var(--accent); }

.image-modal { width: fit-content; max-width: min(960px, 92vw); max-height: 90svh; padding: 0; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); }
.image-modal::backdrop { background: #141b21b8; }
.modal-content { position: relative; }
.modal-content img { display: block; max-width: 100%; max-height: 78svh; object-fit: contain; margin: 0 auto; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center; font-size: 26px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--paper); }
.modal-close:hover { background: #f0f3f8; }
.modal-caption { text-align: center; padding: 12px 56px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

@media (max-width: 700px) {
    .page { width: calc(100% - 40px); }
    .site-header { min-height: 76px; }
    .brand-group { gap: 16px; }
    .brand-context { padding-left: 16px; font-size: 12px; }
    .page-main { padding-top: 40px; }
    .intro { margin-bottom: 26px; }
    h1 { font-size: 38px; letter-spacing: -1.4px; }
    .subtitle { font-size: 14px; max-width: 290px; margin: 14px auto 0; }
    .search-panel { padding: 20px; border-radius: 15px; }
    .keyboard-hint { display: none; }
    .input-group { gap: 10px; }
    .number-field { padding: 0 14px; gap: 8px; }
    #qiid-input { height: 56px; font-size: 24px; }
    .search-button { flex-basis: 96px; padding: 0 14px; }
    .source-note { align-items: flex-start; font-size: 11px; gap: 5px; padding: 0 4px; }
    .source-note svg { margin-top: 2px; }
    .results-container { margin-top: 30px; }
    .product-header { padding: 16px 22px; }
    .result-overview { flex-direction: column; gap: 24px; padding: 24px 22px; }
    .product-name { font-size: 22px; }
    .spec-list { gap: 0 20px; }
    .product-images { width: 100%; flex-basis: auto; max-width: 400px; align-self: center; }
    .product-image { aspect-ratio: 4 / 3; }
    .additional-details { padding-inline: 22px; }
    .details-hint { display: none; }
    .detail-item { grid-template-columns: 1fr; gap: 4px; }
    .error-container { align-items: flex-start; }
    .site-footer { margin-top: 40px; padding-top: 20px; }
}

@media (max-width: 400px) {
    .page { width: calc(100% - 32px); }
    .brand-context { display: none; }
    .site-logo { height: 28px; }
    .search-panel { padding: 18px 16px; }
    .number-field { padding: 0 10px; gap: 6px; }
    .number-prefix { font-size: 18px; }
    #qiid-input { font-size: 22px; letter-spacing: .02em; }
    .input-group { gap: 8px; }
    .search-button { flex-basis: 76px; gap: 6px; padding: 0 10px; font-size: 14px; }
    .search-icon { width: 16px; height: 16px; }
    .input-help { font-size: 11px; }
    .spec-row dd { font-size: 14px; }
    .primary-spec dd { font-size: 21px; }
    .error-container { flex-direction: column; }
    .site-footer { flex-wrap: wrap; gap: 6px 20px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
