:root {
    --tech-bg: #071b31;
    --tech-panel: rgba(13, 46, 78, 0.93);
    --tech-panel-soft: rgba(18, 59, 96, 0.9);
    --tech-line: rgba(91, 220, 255, 0.36);
    --tech-line-strong: rgba(91, 220, 255, 0.68);
    --tech-cyan: #65e2ff;
    --tech-blue: #7197ff;
    --tech-green: #53efb6;
    --tech-text: #f5fcff;
    --tech-muted: #b4d5e7;
    --tech-danger: #ff6687;
    --tech-radius: 18px;
}

* {
    box-sizing: border-box;
}

body.tech-page {
    min-height: 100vh;
    margin: 0;
    color: var(--tech-text);
    background-color: var(--tech-bg);
    background-image:
        radial-gradient(circle at 16% 8%, rgba(55, 166, 255, 0.28), transparent 38%),
        linear-gradient(160deg, rgba(13, 79, 134, 0.36), rgba(7, 43, 79, 0.48)),
        url("../images/tech-watch-bg.jpg");
    background-position: center, center, center top;
    background-repeat: no-repeat;
    background-size: auto, auto, cover;
    background-attachment: fixed;
    font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body.tech-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(67, 212, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(67, 212, 255, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 80%);
    mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

body.tech-page::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: rgba(13, 65, 108, 0.12);
}

.tech-page a,
.tech-page button,
.tech-page input {
    font: inherit;
}

.tech-page a:focus-visible,
.tech-page button:focus-visible,
.tech-page input:focus-visible {
    outline: 2px solid var(--tech-cyan);
    outline-offset: 3px;
}

.tech-page > .container,
.tech-page .header > .container,
.tech-page .sticky-header > .container {
    width: min(100%, 1040px);
    margin-right: auto;
    margin-left: auto;
    padding-right: clamp(14px, 4vw, 28px);
    padding-left: clamp(14px, 4vw, 28px);
}

.tech-page .header {
    width: min(calc(100% - 28px), 1040px);
    margin: 14px auto 28px;
    padding: clamp(30px, 6vw, 58px) 16px;
    position: relative;
    overflow: hidden;
    text-align: center;
    color: var(--tech-text);
    border: 1px solid var(--tech-line);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(31, 105, 170, 0.68), rgba(10, 40, 72, 0.9)),
        var(--tech-panel);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.05);
    animation: none;
}

.tech-page .header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(110deg, transparent 20%, rgba(67, 212, 255, 0.08) 48%, transparent 76%),
        radial-gradient(circle at 50% 0%, rgba(67, 212, 255, 0.19), transparent 54%);
}

.tech-page .header::after {
    content: "";
    position: absolute;
    right: 9%;
    bottom: 0;
    left: 9%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tech-cyan), transparent);
    box-shadow: 0 0 18px rgba(67, 212, 255, 0.55);
    animation: none;
}

.tech-page .header .container {
    position: relative;
    z-index: 1;
}

.tech-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--tech-cyan);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tech-kicker::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tech-green);
    box-shadow: 0 0 9px rgba(54, 227, 162, 0.8);
}

.tech-page .header h1,
.tech-page .header .title {
    margin: 0;
    color: var(--tech-text);
    font-size: clamp(26px, 5vw, 46px);
    font-weight: 760;
    line-height: 1.16;
    letter-spacing: -0.03em;
    text-shadow: 0 0 26px rgba(67, 212, 255, 0.18);
    animation: none;
}

.tech-page .header p,
.tech-page .header .subtitle {
    max-width: 680px;
    margin: 13px auto 0;
    color: var(--tech-muted);
    font-size: clamp(14px, 2.4vw, 17px);
}

.tech-page footer,
.tech-page .footer,
.tech-page .tech-footer {
    margin-top: 28px !important;
    padding: 20px 14px !important;
    color: var(--tech-muted) !important;
    border-top: 1px solid var(--tech-line) !important;
    text-align: center;
    font-size: 13px;
}

.tech-page footer a,
.tech-page .footer a {
    color: var(--tech-cyan);
    text-decoration: none;
}

/* Activation console */
.tech-activation .sticky-header {
    width: min(calc(100% - 28px), 820px);
    padding: 13px 16px;
    border: 1px solid var(--tech-line);
    border-radius: 0 0 16px 16px;
    background: rgba(12, 48, 82, 0.96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: none;
}

.tech-activation .sticky-header h2 {
    color: var(--tech-text);
    font-size: 15px;
    animation: none;
    text-shadow: none;
}

.tech-activation .auth-card {
    width: min(100%, 520px);
    margin: 0 auto 28px;
    padding: clamp(22px, 5vw, 34px);
    position: relative;
    border: 1px solid var(--tech-line);
    border-radius: var(--tech-radius);
    color: var(--tech-text);
    background: linear-gradient(155deg, rgba(25, 77, 124, 0.94), rgba(10, 39, 70, 0.96));
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: none;
}

.tech-activation .auth-card::before {
    content: "DEVICE ACCESS";
    display: block;
    margin-bottom: 18px;
    color: var(--tech-cyan);
    font: 700 11px/1.2 ui-monospace, "Cascadia Code", monospace;
    letter-spacing: 0.18em;
}

.tech-activation .logo {
    margin-bottom: 16px;
}

.tech-activation .logo img {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto;
    object-fit: cover;
    border: 1px solid var(--tech-line-strong);
    border-radius: 22px;
    box-shadow: 0 0 0 7px rgba(67, 212, 255, 0.055), 0 14px 32px rgba(0, 0, 0, 0.34);
}

.tech-activation .auth-card > h1 {
    margin: 0 0 16px;
    color: var(--tech-text);
    font-size: clamp(24px, 5vw, 32px);
    line-height: 1.2;
}

.device-meta {
    display: grid;
    gap: 7px;
    margin-bottom: 20px;
    padding: 13px 14px;
    border: 1px solid rgba(143, 169, 189, 0.14);
    border-radius: 12px;
    background: rgba(7, 35, 64, 0.74);
}

.tech-activation .device-meta small {
    display: block;
    margin: 0;
    color: var(--tech-muted);
    font: 600 14px/1.5 ui-monospace, "Cascadia Code", monospace;
    text-align: left;
    overflow-wrap: anywhere;
}

.tech-activation label {
    margin-bottom: 8px;
    color: #cceeff;
    font-size: 14px;
    font-weight: 650;
}

.tech-activation input[type="text"] {
    min-height: 48px;
    padding: 12px 14px;
    color: var(--tech-text);
    caret-color: var(--tech-cyan);
    border: 1px solid rgba(143, 169, 189, 0.25);
    border-radius: 12px;
    background: rgba(7, 35, 64, 0.82);
    box-shadow: inset 0 1px 7px rgba(0, 0, 0, 0.25);
}

.tech-activation input[type="text"]::placeholder {
    color: #698398;
}

.tech-activation input[type="text"]:focus {
    border-color: var(--tech-cyan);
    background: rgba(10, 48, 82, 0.94);
    box-shadow: 0 0 0 3px rgba(67, 212, 255, 0.12);
}

.tech-activation .btn {
    min-height: 48px;
    margin-bottom: 10px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #f4fbff;
    background: linear-gradient(135deg, #1787d3, #315ee9);
    box-shadow: 0 10px 22px rgba(27, 104, 218, 0.22);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.tech-activation .btn:hover {
    transform: none;
    border-color: rgba(125, 229, 255, 0.72);
    box-shadow: 0 11px 28px rgba(40, 139, 255, 0.28);
}

.tech-activation .btn-secondary-tech {
    border-color: var(--tech-line);
    background: rgba(17, 46, 78, 0.78);
    box-shadow: none;
}

.tech-activation .btn-ghost-tech {
    color: var(--tech-cyan);
    border-color: rgba(67, 212, 255, 0.32);
    background: rgba(67, 212, 255, 0.07);
    box-shadow: none;
}

.tech-activation .activation-success {
    margin: 0 0 18px;
    padding: 13px 14px;
    color: #8fffd4;
    border: 1px solid rgba(54, 227, 162, 0.3);
    border-radius: 12px;
    background: rgba(54, 227, 162, 0.08);
}

.tech-activation .device-blocked {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding: 12px 13px;
    color: #ffb4c4;
    border: 1px solid rgba(255, 102, 135, 0.34);
    border-radius: 12px;
    background: rgba(255, 102, 135, 0.08);
    text-align: left;
}

.tech-activation .device-blocked strong {
    color: #ffd7df;
    font-size: 14px;
}

.tech-activation .device-blocked span {
    color: #c9a3ad;
    font-size: 12px;
}

.tech-activation .btn:disabled,
.tech-activation input:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    box-shadow: none;
}

/* App catalog */
.tech-store {
    padding: 0 0 18px;
}

.tech-store > .container {
    width: min(100%, 980px);
}

.tech-store .header {
    width: 100%;
    margin: 0 0 20px;
    padding: clamp(26px, 5vw, 44px) 16px;
}

.store-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px !important;
    margin-bottom: 18px !important;
    padding: 10px;
    border: 1px solid var(--tech-line);
    border-radius: 15px;
    background: var(--tech-panel);
}

.tech-store #searchInput {
    min-width: 0;
    min-height: 44px;
    padding: 10px 13px !important;
    color: var(--tech-text);
    border: 1px solid rgba(143, 169, 189, 0.25) !important;
    border-radius: 10px !important;
    background: rgba(8, 38, 68, 0.84);
    font-size: 14px;
}

.tech-store #searchInput::placeholder {
    color: #70899d;
}

.tech-store #searchInput:focus {
    outline: none;
    border-color: var(--tech-cyan) !important;
    box-shadow: 0 0 0 3px rgba(67, 212, 255, 0.1);
}

.tech-store #searchButton,
.tech-store #resetButton {
    min-height: 44px;
    padding: 9px 16px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.tech-store #searchButton {
    color: #fff !important;
    background: linear-gradient(135deg, #168cd7, #315ee9) !important;
}

.tech-store #resetButton {
    color: #b9d7e8 !important;
    border-color: var(--tech-line) !important;
    background: rgba(18, 42, 68, 0.78) !important;
}

.tech-store .group {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--tech-line);
    border-radius: 15px;
    background: var(--tech-panel);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    transition: border-color 160ms ease;
}

.tech-store .group.active {
    border-color: rgba(67, 212, 255, 0.42);
}

.tech-store .group-header {
    min-height: 52px;
    padding: 13px 16px;
    color: #dff6ff;
    background: linear-gradient(90deg, rgba(29, 94, 148, 0.92), rgba(13, 52, 88, 0.95));
    font-size: 16px !important;
    font-weight: 700;
    cursor: pointer;
}

.tech-store .group-header:hover {
    background: linear-gradient(90deg, rgba(22, 73, 119, 0.92), rgba(8, 29, 54, 0.96));
}

.tech-store .toggle-icon {
    color: var(--tech-cyan);
    font-size: 13px;
    transition: transform 160ms ease;
}

.tech-store .group-content {
    background: rgba(8, 35, 62, 0.86);
}

.tech-store .app-list {
    gap: 9px;
    padding: 10px;
}

.tech-store .app-item {
    min-height: 54px;
    padding: 10px 12px;
    color: var(--tech-text);
    border: 1px solid rgba(143, 169, 189, 0.13);
    border-radius: 11px;
    background: rgba(18, 58, 94, 0.88);
    box-shadow: none;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.tech-store .app-item:hover {
    border-color: rgba(67, 212, 255, 0.4);
    background: rgba(25, 78, 123, 0.94);
}

.tech-store .app-item:active {
    transform: none;
    background: rgba(20, 52, 87, 0.94);
}

.tech-store .app-info,
.tech-store .app-name-wrapper {
    width: 100%;
}

.tech-store .app-name {
    margin: 0;
    color: #e9f8ff;
    font-size: 14px;
    font-weight: 650;
}

.tech-store .download-btn {
    display: inline-grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    color: var(--tech-cyan);
    border: 1px solid rgba(67, 212, 255, 0.34);
    border-radius: 10px;
    background: rgba(67, 212, 255, 0.08);
    transition: background-color 150ms ease, border-color 150ms ease;
}

.tech-store .download-btn:hover {
    transform: none;
    color: #fff;
    border-color: var(--tech-cyan);
    background: rgba(67, 212, 255, 0.18);
}

.tech-store .device-status-panel {
    margin: 14px 0 18px;
    padding: 14px 16px;
    color: #cce7f5;
    border: 1px solid rgba(54, 227, 162, 0.3);
    border-left: 3px solid var(--tech-green);
    border-radius: 13px;
    background: rgba(8, 31, 45, 0.92);
    box-shadow: none;
}

.tech-store .device-status-title,
.tech-store .device-status-details {
    color: #cce7f5;
}

.tech-store .device-status-activated {
    color: var(--tech-green);
}

.tech-store .app-download-modal {
    padding: 14px;
    background: rgba(0, 5, 13, 0.82);
    backdrop-filter: none;
}

.tech-store .modal-content {
    width: min(100%, 500px);
    color: var(--tech-text);
    border: 1px solid var(--tech-line-strong);
    border-radius: 16px;
    background: #07162a;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
}

.tech-store .modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--tech-line);
}

.tech-store .modal-title {
    color: var(--tech-text);
}

.tech-store .modal-close {
    color: var(--tech-muted);
}

.tech-store .modal-close:hover {
    color: var(--tech-text);
    background: rgba(67, 212, 255, 0.1);
}

.tech-store .modal-body {
    padding: 16px 18px 18px;
}

.tech-store .download-options {
    gap: 10px;
}

.tech-store .download-option {
    padding: 14px;
    color: var(--tech-text);
    border: 1px solid rgba(143, 169, 189, 0.18);
    border-radius: 12px;
    background: rgba(12, 34, 59, 0.86);
}

.tech-store .download-option:hover {
    transform: none;
    border-color: var(--tech-cyan);
    background: rgba(16, 47, 80, 0.95);
    box-shadow: none;
}

.tech-store .option-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--tech-cyan);
    border: 1px solid rgba(67, 212, 255, 0.28);
    border-radius: 11px;
    background: rgba(67, 212, 255, 0.08);
    box-shadow: none;
}

.tech-store .option-icon svg {
    width: 22px;
    height: 22px;
}

.tech-store .option-title {
    color: var(--tech-text);
}

.tech-store .option-description,
.tech-store .option-size,
.tech-store .option-arrow,
.tech-store #resultCount,
.tech-store #noResultsHint {
    color: var(--tech-muted) !important;
}

.tech-store .highlight {
    padding: 1px 3px;
    color: #03111e;
    border-radius: 3px;
    background: var(--tech-cyan);
}

/* Purchase page */
.tech-purchase {
    min-height: 100vh;
    padding: 14px;
}

.tech-purchase > .container {
    width: min(100%, 760px);
    min-height: calc(100vh - 28px);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.tech-purchase .header {
    width: 100%;
    margin: 0 0 16px;
    padding: clamp(26px, 5vw, 42px) 16px;
}

.purchase-panel {
    padding: clamp(18px, 4vw, 30px);
    overflow: hidden;
    text-align: center;
    border: 1px solid var(--tech-line);
    border-radius: var(--tech-radius);
    background: linear-gradient(145deg, rgba(27, 87, 137, 0.94), rgba(13, 50, 86, 0.96));
    box-shadow: 0 20px 48px rgba(0, 18, 38, 0.25);
}

.tech-purchase .purchase-panel img {
    display: inline-block;
    width: auto;
    max-width: min(100%, 360px);
    height: auto;
    padding: 8px;
    border: 1px solid var(--tech-line);
    border-radius: 14px;
    background: #fff;
}

.tech-purchase .purchase-panel,
.tech-purchase .purchase-panel p,
.tech-purchase .purchase-panel div,
.tech-purchase .purchase-panel span,
.tech-purchase .purchase-panel strong {
    color: #edfaff !important;
}

.tech-purchase .purchase-panel a {
    color: var(--tech-cyan);
}

.tech-purchase .tech-footer {
    margin-top: auto !important;
    color: #c2e3f2 !important;
    border: 1px solid rgba(91, 220, 255, 0.24) !important;
    border-radius: 14px;
    background: rgba(14, 54, 91, 0.72);
}

/* Watch and compact displays */
@media (max-width: 480px), (max-height: 520px) {
    body.tech-page {
        font-size: 14px;
        background-color: var(--tech-bg);
        background-image:
            radial-gradient(circle at 18% 8%, rgba(77, 186, 255, 0.28), transparent 42%),
            linear-gradient(160deg, rgba(18, 91, 148, 0.38), rgba(8, 48, 87, 0.48)),
            url("../images/tech-watch-bg.jpg");
        background-position: center, center, center top;
        background-repeat: no-repeat;
        background-size: auto, auto, cover;
        background-attachment: scroll;
    }

    body.tech-page::before {
        background-size: 24px 24px;
        opacity: 0.6;
    }

    .tech-page .header {
        width: calc(100% - 16px);
        margin: 8px auto 12px;
        padding: 18px 8px;
        border-radius: 16px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    }

    .tech-page .header h1,
    .tech-page .header .title {
        font-size: clamp(22px, 8vw, 29px);
        max-width: 100%;
        margin-right: auto;
        margin-left: auto;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-wrap: balance;
    }

    .tech-page .header p,
    .tech-page .header .subtitle {
        margin-top: 8px;
        font-size: 12px;
    }

    .tech-kicker {
        margin-bottom: 8px;
        font-size: 9px;
    }

    .tech-activation .sticky-header {
        display: none !important;
    }

    .tech-activation .auth-card {
        padding: 17px 14px;
        border-radius: 15px;
    }

    .tech-activation .auth-card::before {
        margin-bottom: 12px;
        font-size: 9px;
    }

    .tech-activation .logo img {
        width: 62px;
        height: 62px;
        border-radius: 16px;
    }

    .tech-activation .auth-card > h1 {
        margin-bottom: 12px;
        font-size: 21px;
    }

    .device-meta {
        gap: 4px;
        margin-bottom: 13px;
        padding: 10px;
    }

    .tech-activation .device-meta small {
        font-size: 13px;
        line-height: 1.5;
    }

    .tech-activation .form-group {
        margin-bottom: 12px;
    }

    .tech-activation input[type="text"],
    .tech-activation .btn {
        min-height: 44px;
    }

    .tech-store {
        padding: 0 0 10px;
    }

    .tech-store > .container,
    .tech-store .device-status-panel + .container {
        padding-right: 8px;
        padding-left: 8px;
    }

    .store-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 7px;
    }

    .tech-store #resetButton {
        grid-column: 1 / -1;
        min-height: 38px;
    }

    .tech-store .group-header {
        min-height: 58px;
        padding: 15px 16px;
        font-size: 16px !important;
    }

    .tech-store .app-list {
        gap: 11px;
        padding: 11px;
    }

    .tech-store .app-item {
        min-height: 70px;
        padding: 12px 13px;
        border-radius: 14px;
    }

    .tech-store .app-name-wrapper {
        gap: 12px;
    }

    .tech-store .app-name {
        font-size: 16px;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    .tech-store .download-btn {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .tech-store .download-option {
        min-height: 68px;
        padding: 14px;
    }

    .tech-store .option-description {
        font-size: 11px;
    }

    .tech-purchase {
        padding: 8px;
    }

    .tech-purchase > .container {
        min-height: calc(100vh - 16px);
    }

    .purchase-panel {
        padding: 18px 12px;
        border-radius: 16px;
    }

    .tech-purchase .tech-footer {
        margin-top: auto !important;
    }

    .tech-page footer,
    .tech-page .footer {
        margin-top: 16px !important;
        padding: 14px 8px !important;
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce), (max-width: 480px) {
    .tech-page *,
    .tech-page *::before,
    .tech-page *::after {
        scroll-behavior: auto !important;
        animation: none !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}
