:root {
    --ink: #101418;
    --panel: #ffffff;
    --soft: #f4f7f8;
    --line: #dde5e8;
    --muted: #68747c;
    --teal: #0f9b8e;
    --teal-dark: #08786f;
    --amber: #f1a208;
    --red: #d64545;
    --violet: #5661c9;
    --shadow: 0 18px 45px rgba(13, 27, 38, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Arial, "Microsoft YaHei", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-hero {
    min-height: 380px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(9, 16, 24, .92), rgba(9, 16, 24, .64) 48%, rgba(9, 16, 24, .28)),
        url("datacenter.jpg") center / cover no-repeat,
        #111820;
}

.topbar {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand-mark {
    width: 28px;
    height: 28px;
    display: inline-block;
    border-radius: 7px;
    background:
        linear-gradient(90deg, transparent 46%, rgba(255,255,255,.35) 48%, transparent 52%),
        linear-gradient(180deg, var(--teal), var(--violet));
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
}

.top-actions {
    display: flex;
    gap: 10px;
}

.top-actions a,
.buy-btn,
.primary-btn,
.small-btn,
.hero-search button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.top-actions a {
    padding: 10px 14px;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.24);
}

.hero-inner {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 44px 0 58px;
    display: grid;
    grid-template-columns: minmax(0, 820px);
    align-items: start;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--amber);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
}

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

.hero-inner h1 {
    max-width: 760px;
    margin-bottom: 14px;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: 0;
}

.hero-copy {
    max-width: 630px;
    color: rgba(255,255,255,.78);
    font-size: 16px;
    line-height: 1.55;
}

.hero-search {
    width: min(620px, 100%);
    margin-top: 22px;
    padding: 8px;
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.hero-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    border-radius: 7px;
    padding: 14px 16px;
    font-size: 15px;
}

.hero-search button,
.primary-btn {
    padding: 12px 20px;
    color: #fff;
    background: var(--teal);
}

.catalog-shell {
    width: min(1280px, calc(100% - 36px));
    margin: 28px auto 52px;
    position: relative;
}

.category-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 28px;
}

.category-tile {
    min-height: 72px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #17212b;
    background: #e8e6e6;
    border: 1px solid rgba(255,255,255,.7);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    transition: background .18s ease, border-color .18s ease;
}

.category-tile span {
    overflow-wrap: anywhere;
}

.category-tile.active {
    color: #101418;
    background: #ffe600;
    border-color: #ffe600;
}

.category-tile:hover {
    background: #f1eeee;
}

.category-tile.active:hover {
    background: #ffe600;
}

.filter-panel,
.product-card,
.empty-state,
.admin-section,
.login-box,
.source-box,
.stat-grid div {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.filter-panel {
    padding: 14px;
    position: sticky;
    top: 16px;
}

.panel-title {
    padding: 10px 10px 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.filter-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 12px;
    border-radius: 7px;
}

.filter-link em {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.filter-link b {
    color: var(--teal-dark);
}

.filter-link.active,
.filter-link:hover {
    background: #e7f6f4;
}

.product-area {
    min-width: 0;
}

.section-head,
.admin-section-head {
    margin-bottom: 16px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.section-head h2,
.admin-section-head h2 {
    margin-bottom: 0;
}

.section-head > span {
    color: var(--muted);
}

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

.product-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.card-topline b,
.pill {
    padding: 4px 8px;
    color: #fff;
    background: var(--amber);
    border-radius: 999px;
    font-size: 12px;
}

.pill.hot {
    background: var(--red);
}

.product-card h3 {
    margin-bottom: 0;
    font-size: 20px;
    line-height: 1.35;
}

.spec-list {
    min-height: 138px;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    list-style: none;
    color: #34434b;
}

.spec-list li {
    padding-left: 18px;
    position: relative;
}

.spec-list li::before {
    content: "";
    width: 7px;
    height: 7px;
    position: absolute;
    left: 0;
    top: .55em;
    border-radius: 50%;
    background: var(--teal);
}

.spec-list li.spec-warning {
    color: #e60012;
}

.spec-list li.spec-warning::before {
    background: #e60012;
}

.note {
    margin: 0;
    padding: 10px 12px;
    color: #6a4700;
    background: #fff4d7;
    border-radius: 7px;
}

.price-row {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.price {
    display: block;
    color: var(--red);
    font-size: 22px;
    font-weight: 900;
}

.price-row small {
    color: var(--muted);
}

.buy-btn {
    flex: 0 0 auto;
    padding: 11px 16px;
    color: #fff;
    background: var(--ink);
}

.empty-state {
    padding: 36px;
}

.site-footer {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto 34px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
}

.admin-login-body,
.admin-body {
    min-height: 100vh;
}

.admin-login-body {
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(16,20,24,.9), rgba(15,155,142,.68)),
        url("datacenter.jpg") center / cover no-repeat,
        #111820;
}

.login-box {
    width: min(420px, calc(100% - 28px));
    padding: 28px;
}

.login-brand {
    margin-bottom: 22px;
}

.admin-body {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
}

.admin-sidebar {
    min-height: 100vh;
    padding: 22px;
    color: #fff;
    background: #111820;
}

.admin-sidebar nav {
    margin-top: 28px;
    display: grid;
    gap: 8px;
}

.admin-sidebar nav a {
    padding: 12px;
    border-radius: 7px;
    color: rgba(255,255,255,.78);
}

.admin-sidebar nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.09);
}

.admin-main {
    padding: 28px;
    min-width: 0;
}

.admin-head {
    margin-bottom: 18px;
}

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

.stat-grid div {
    padding: 18px;
}

.stat-grid b {
    display: block;
    font-size: 24px;
}

.stat-grid span,
.muted {
    color: var(--muted);
}

.admin-section {
    margin-bottom: 20px;
    padding: 18px;
}

.admin-filter-form {
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(150px, .8fr) auto;
    gap: 12px;
    align-items: end;
}

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

.bulk-actions {
    margin-bottom: 12px;
    padding: 12px;
    background: #f4f7f8;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.bulk-actions select {
    width: min(240px, 100%);
}

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

.select-col {
    width: 42px;
    text-align: center;
}

.select-col input {
    width: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

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

td small {
    color: var(--muted);
}

.edit-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

textarea {
    resize: vertical;
}

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

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.check-row input {
    width: auto;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.small-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--ink);
    background: #e8eef0;
}

.link-btn {
    border: 0;
    padding: 0;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.link-btn:hover {
    color: var(--teal-dark);
}

.link-btn.danger {
    color: var(--red);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.source-box {
    padding: 14px;
    box-shadow: none;
}

.source-box p {
    margin: 8px 0 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.alert.ok {
    color: #075d54;
    background: #dff5f2;
}

.alert.warn {
    color: #745000;
    background: #fff2c7;
}

.alert.bad {
    color: #8c1f1f;
    background: #ffe2e2;
}

.log-item {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
}

pre {
    overflow: auto;
    padding: 12px;
    color: #d8f3ef;
    background: #111820;
    border-radius: 7px;
}

.modal-open {
    overflow: hidden;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    padding: 28px;
    display: grid;
    place-items: center;
    background: rgba(8, 14, 20, .58);
}

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

.modal-panel {
    width: min(860px, 100%);
    max-height: calc(100vh - 56px);
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .26);
}

.modal-head {
    padding: 20px 20px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.modal-head h2 {
    margin-bottom: 0;
}

.modal-message {
    margin: 14px 20px 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 700;
}

.modal-message.ok {
    color: #075d54;
    background: #dff5f2;
}

.modal-message.bad {
    color: #8c1f1f;
    background: #ffe2e2;
}

.modal-form {
    min-height: 0;
    overflow: auto;
    padding: 16px 20px 0;
    display: grid;
    gap: 14px;
}

.modal-form .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 2px -20px 0;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px rgba(13, 27, 38, .08);
}

.modal-form button[disabled] {
    opacity: .62;
    cursor: wait;
}

@media (max-width: 1180px) {
    .category-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .hero-inner,
    .admin-body {
        grid-template-columns: 1fr;
    }

    .site-hero {
        min-height: 330px;
    }

    .hero-inner {
        padding: 34px 0 44px;
    }

    .admin-sidebar {
        min-height: auto;
    }

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

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

    .product-grid,
    .stat-grid,
    .admin-filter-form,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .site-footer,
    .price-row,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .site-hero {
        min-height: 280px;
    }

    .topbar {
        width: calc(100% - 22px);
        padding: 12px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .brand {
        max-width: 100%;
        font-size: 15px;
    }

    .brand-mark {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }

    .top-actions {
        width: 100%;
        gap: 8px;
    }

    .top-actions a {
        min-width: 0;
        flex: 1;
        padding: 8px 10px;
        font-size: 13px;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .hero-inner {
        width: calc(100% - 22px);
        padding: 18px 0 28px;
    }

    .eyebrow {
        margin-bottom: 8px;
        font-size: 11px;
    }

    .hero-inner h1 {
        max-width: 100%;
        margin-bottom: 10px;
        font-size: 30px;
        line-height: 1.12;
    }

    .hero-copy {
        font-size: 14px;
        line-height: 1.45;
    }

    .hero-search {
        margin-top: 16px;
        padding: 6px;
    }

    .hero-search input {
        padding: 11px 12px;
        font-size: 14px;
    }

    .hero-search button {
        padding: 10px 14px;
        white-space: nowrap;
    }

    .catalog-shell {
        width: calc(100% - 22px);
    }

    .category-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .category-tile {
        min-height: 58px;
        padding: 8px 10px;
        font-size: 16px;
    }

    .admin-modal {
        padding: 10px;
        align-items: start;
    }

    .modal-panel {
        max-height: calc(100vh - 20px);
    }

    .modal-head {
        padding: 14px 14px 10px;
    }

    .modal-message {
        margin: 12px 14px 0;
    }

    .modal-form {
        padding: 12px 14px 0;
    }

    .modal-form .form-actions {
        margin-right: -14px;
        margin-left: -14px;
        padding: 12px 14px;
    }
}
