:root {
    --bg: #07111f;
    --bg-2: #0b1b2f;
    --ink: #eaf6ff;
    --panel: rgba(12, 30, 51, 0.82);
    --panel-strong: rgba(15, 40, 68, 0.94);
    --line: rgba(107, 213, 255, 0.2);
    --steel: #91a9bd;
    --accent: #27d9ff;
    --accent-2: #7c5cff;
    --amber: #ffb86b;
    --ok-bg: rgba(35, 215, 135, 0.12);
    --ok-line: rgba(35, 215, 135, 0.35);
    --warn-bg: rgba(255, 184, 107, 0.12);
    --warn-line: rgba(255, 184, 107, 0.38);
    --danger: #ff6b8b;
    --glow: 0 18px 60px rgba(39, 217, 255, 0.12);
    --card-glow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 0%, rgba(39, 217, 255, 0.16), transparent 32%),
        radial-gradient(circle at 86% 8%, rgba(124, 92, 255, 0.18), transparent 30%),
        linear-gradient(180deg, #07111f 0%, #081829 48%, #050b14 100%);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(107, 213, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 213, 255, 0.045) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 78%);
}

button,
input {
    font: inherit;
}

.shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 360px;
    gap: 16px;
    max-width: 1500px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px;
}

.site-footer {
    max-width: 1500px;
    margin: -6px auto 18px;
    padding: 0 16px;
    text-align: center;
    font-size: 13px;
    color: var(--steel);
}

.site-footer a {
    color: var(--steel);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent);
}

.news-band {
    max-width: 1500px;
    margin: -2px auto 18px;
    padding: 0 16px;
}

.news-inner,
.sidebar,
.parts-panel,
.build-panel,
.detail-hero,
.detail-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(16, 39, 66, 0.9), rgba(8, 22, 38, 0.9));
    box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
}

.news-inner {
    padding: 18px;
}

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

.news-head h2 {
    font-size: 22px;
}

.news-head p {
    color: var(--steel);
}

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

.news-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 12px;
    min-height: 136px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(7, 20, 35, 0.74);
    padding: 12px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.news-card:hover,
.part-card:hover {
    border-color: rgba(39, 217, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(39, 217, 255, 0.12), 0 18px 42px rgba(39, 217, 255, 0.12);
    transform: translateY(-2px);
}

.news-thumb {
    display: grid;
    min-height: 104px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(107, 213, 255, 0.15);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(39, 217, 255, 0.16), rgba(124, 92, 255, 0.18));
    color: var(--accent);
    font-weight: 900;
}

.news-thumb img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: scale-down;
    padding: 8px;
}

.news-body {
    min-width: 0;
}

.news-body span,
.news-body small {
    display: block;
    color: var(--steel);
    font-size: 12px;
}

.news-body strong {
    display: block;
    margin: 8px 0;
    line-height: 1.5;
}

.news-body p {
    display: -webkit-box;
    overflow: hidden;
    color: var(--steel);
    font-size: 13px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sidebar,
.build-panel {
    position: sticky;
    top: 16px;
    height: calc(100vh - 32px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(39, 217, 255, 0.52) rgba(7, 17, 31, 0.42);
    padding: 14px;
}

.sidebar::-webkit-scrollbar,
.build-panel::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.build-panel::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(7, 17, 31, 0.42);
    box-shadow: inset 0 0 0 1px rgba(107, 213, 255, 0.08);
}

.sidebar::-webkit-scrollbar-thumb,
.build-panel::-webkit-scrollbar-thumb {
    border: 2px solid rgba(7, 17, 31, 0.78);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(39, 217, 255, 0.92), rgba(124, 92, 255, 0.88));
    box-shadow: 0 0 14px rgba(39, 217, 255, 0.34);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.build-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #75ecff, #9d86ff);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px 6px 12px;
    border-bottom: 1px solid rgba(107, 213, 255, 0.14);
}

.brand-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: block;
    border: 1px solid rgba(39, 217, 255, 0.55);
    border-radius: 10px;
    background: rgba(7, 17, 31, 0.72);
    box-shadow: 0 0 24px rgba(39, 217, 255, 0.32);
}

.brand-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.brand-copy strong {
    color: var(--ink);
    font-size: 18px;
    line-height: 1.1;
    font-weight: 900;
    white-space: nowrap;
}

.brand-copy span {
    color: var(--accent);
    font-size: 12px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 18px;
    line-height: 1.2;
}

h2 {
    font-size: 22px;
}

.brand p,
.panel-head p,
.total-box span,
.total-box small,
.muted {
    color: var(--steel);
}

.category-list {
    display: grid;
    gap: 8px;
}

.category-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 44px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(8, 25, 43, 0.76);
    color: var(--ink);
    text-align: left;
    padding: 0 12px;
    font-weight: 700;
}

.category-button.selected:not(.active) {
    border-color: var(--ok-line);
    background: rgba(35, 215, 135, 0.1);
}

.category-state {
    min-width: 34px;
    color: inherit;
    font-size: 12px;
    text-align: right;
    opacity: 0.86;
}

.category-button.active {
    border-color: rgba(39, 217, 255, 0.75);
    background: linear-gradient(135deg, rgba(39, 217, 255, 0.92), rgba(124, 92, 255, 0.9));
    color: #06111f;
    box-shadow: 0 0 22px rgba(39, 217, 255, 0.28);
}

.parts-panel {
    min-width: 0;
    padding: 18px;
}

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

.panel-head.compact {
    align-items: flex-start;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 290px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 17, 30, 0.78);
    color: var(--steel);
    font-size: 14px;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(39, 217, 255, 0.12);
}

.search-box input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.search-box input::placeholder {
    color: rgba(145, 169, 189, 0.72);
}

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

.budget-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(5, 17, 30, 0.62);
    padding: 12px;
}

.budget-box label {
    display: grid;
    gap: 6px;
    color: var(--steel);
    font-size: 13px;
    font-weight: 900;
}

.budget-box input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 17, 30, 0.84);
    color: var(--ink);
    padding: 0 12px;
    outline: none;
}

.budget-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(39, 217, 255, 0.12);
}

.budget-box button {
    height: 40px;
    cursor: pointer;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #06111f;
    font-weight: 900;
}

.budget-box p {
    grid-column: 1 / -1;
    color: var(--steel);
    font-size: 13px;
    line-height: 1.6;
}

.part-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(8, 25, 43, 0.78);
    overflow: hidden;
    box-shadow: var(--card-glow);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.part-image-wrap {
    display: grid;
    width: 100%;
    aspect-ratio: 16 / 10;
    place-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 50% 40%, rgba(39, 217, 255, 0.13), transparent 42%),
        linear-gradient(135deg, rgba(13, 38, 63, 0.95), rgba(5, 16, 29, 0.95));
}

.part-image-wrap img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: scale-down;
    padding: 12px;
}

.part-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 0;
}

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

.brand-pill {
    display: inline-block;
    margin-right: 8px;
    padding: 4px 8px;
    border: 1px solid rgba(39, 217, 255, 0.28);
    border-radius: 999px;
    background: rgba(39, 217, 255, 0.09);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.part-card h3 {
    margin: 10px 0 6px;
    font-size: 16px;
    line-height: 1.35;
}

.part-card p {
    color: var(--steel);
    font-size: 14px;
    line-height: 1.7;
}

.detail-link,
.back-link,
.primary-link {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.primary-link {
    height: 40px;
    margin-top: 16px;
    padding: 0 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #06111f;
}

.icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 17, 30, 0.88);
    color: var(--ink);
    font-size: 20px;
}

.icon-button.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #06111f;
}

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

.metric {
    min-width: 0;
    border: 1px solid rgba(107, 213, 255, 0.16);
    border-radius: 10px;
    background: rgba(4, 14, 25, 0.72);
    padding: 9px;
}

.metric span {
    display: block;
    overflow: hidden;
    color: var(--steel);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric strong {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: var(--ink);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.badge.ok {
    background: var(--ok-bg);
    color: #60f0b0;
}

.badge.warn {
    background: var(--warn-bg);
    color: var(--amber);
}

.total-box,
.selected-item,
.empty,
.status-card {
    border: 1px solid var(--line);
    border-radius: 10px;
}

.total-box {
    background: rgba(5, 17, 30, 0.76);
    padding: 14px;
}

.total-box strong {
    display: block;
    margin: 5px 0;
    color: var(--accent);
    font-size: 24px;
    text-shadow: 0 0 20px rgba(39, 217, 255, 0.24);
}

.selected-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    background: rgba(5, 17, 30, 0.64);
}

.selected-item strong {
    display: block;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty {
    border-style: dashed;
    padding: 16px;
    color: var(--steel);
    font-size: 14px;
    background: rgba(5, 17, 30, 0.45);
}

.status-card {
    margin-top: 14px;
    padding: 12px;
}

.status-card p {
    margin-top: 6px;
    color: var(--steel);
    font-size: 14px;
    line-height: 1.7;
}

.status-card.ok {
    border-color: var(--ok-line);
    background: var(--ok-bg);
}

.status-card.warn {
    border-color: var(--warn-line);
    background: var(--warn-bg);
}

.submit-build-button {
    width: 100%;
    height: 44px;
    margin-top: 14px;
    cursor: not-allowed;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(145, 169, 189, 0.14);
    color: var(--steel);
    font-weight: 900;
}

.submit-build-button.ready {
    cursor: pointer;
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #06111f;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(2, 8, 16, 0.72);
    backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
    display: none;
}

.contact-modal {
    width: min(460px, 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-strong);
    padding: 18px;
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.44);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.modal-head h2 {
    font-size: 20px;
}

.modal-head p,
.form-message {
    margin-top: 4px;
    color: var(--steel);
    font-size: 14px;
}

.modal-close {
    width: 34px;
    height: 34px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 17, 30, 0.72);
    color: var(--ink);
    font-size: 22px;
}

.contact-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.contact-options label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 17, 30, 0.7);
    font-weight: 800;
}

.contact-input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 17, 30, 0.78);
    color: var(--ink);
    padding: 0 12px;
    outline: none;
}

.request-note {
    min-height: 96px;
    padding-top: 10px;
    resize: vertical;
}

.contact-input:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.primary-button,
.secondary-button {
    height: 40px;
    cursor: pointer;
    border-radius: 10px;
    padding: 0 16px;
    font-weight: 900;
}

.primary-button {
    border: 1px solid var(--accent);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #06111f;
}

.secondary-button {
    border: 1px solid var(--line);
    background: rgba(5, 17, 30, 0.74);
    color: var(--ink);
}

.detail-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px;
    color: var(--ink);
}

.detail-hero {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 22px;
    margin-top: 14px;
    padding: 18px;
    overflow: hidden;
    position: relative;
}

.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(39, 217, 255, 0.08), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(124, 92, 255, 0.18), transparent 34%);
}

.part-image {
    display: grid;
    position: relative;
    min-height: 280px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 40%, rgba(39, 217, 255, 0.15), transparent 42%),
        linear-gradient(135deg, rgba(12, 34, 58, 0.92), rgba(5, 16, 29, 0.94));
    box-shadow: inset 0 0 28px rgba(39, 217, 255, 0.08);
}

.part-image img {
    display: block;
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    padding: 14px;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.32));
}

.image-placeholder {
    color: var(--steel);
    font-weight: 800;
}

.detail-summary h1 {
    margin-top: 12px;
    font-size: 30px;
    line-height: 1.25;
    text-shadow: 0 0 20px rgba(39, 217, 255, 0.14);
}

.detail-summary p {
    margin-top: 10px;
    color: var(--steel);
    line-height: 1.8;
}

.detail-price {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(39, 217, 255, 0.1), rgba(124, 92, 255, 0.08)),
        rgba(5, 17, 30, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.detail-price span,
.detail-price small {
    display: block;
    color: var(--steel);
}

.detail-price strong {
    display: block;
    margin: 6px 0;
    color: var(--accent);
    font-size: 28px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 16px;
    margin-top: 16px;
}

.detail-card {
    margin-top: 16px;
    padding: 18px;
    color: var(--ink);
}

.detail-card h2 {
    margin-bottom: 14px;
    font-size: 20px;
    color: var(--ink);
}

.spec-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.spec-list div {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(5, 17, 30, 0.42);
}

.spec-list dt {
    color: var(--steel);
}

.spec-list dd {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
}

#priceChart {
    width: 100%;
    height: auto;
    border: 1px solid rgba(107, 213, 255, 0.16);
    border-radius: 10px;
    background:
        linear-gradient(rgba(107, 213, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 213, 255, 0.04) 1px, transparent 1px),
        rgba(5, 17, 30, 0.5);
    background-size: 24px 24px;
}

.history-empty {
    display: none;
    color: var(--steel);
}

.offer-table {
    display: grid;
    gap: 8px;
}

.offer-table a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 170px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 17, 30, 0.66);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.offer-table a:hover {
    border-color: rgba(39, 217, 255, 0.46);
    background: rgba(12, 34, 58, 0.82);
    transform: translateY(-1px);
}

.offer-table span,
.offer-table small {
    overflow: hidden;
    color: var(--steel);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offer-table strong {
    color: var(--accent);
}

@media (max-width: 1100px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .build-panel {
        position: static;
        height: auto;
    }

    .category-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .detail-hero,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .offer-table a {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .shell {
        padding: 10px;
    }

    .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box,
    .parts-grid,
    .budget-box {
        min-width: 0;
        grid-template-columns: 1fr;
    }

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

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

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