* {
    box-sizing: border-box;
}

:root {
    --primary: #7c5cff;
    --bg: #0b1020;
    --bg-soft: #11182e;
    --text: #f7f8ff;
    --muted: #a8b0c8;
    --card: rgba(255, 255, 255, .08);
    --border: rgba(255, 255, 255, .18);
    --shadow: 0 30px 80px rgba(0, 0, 0, .35);
}

body.light {
    --bg: #eef3ff;
    --bg-soft: #ffffff;
    --text: #172033;
    --muted: #5d6a85;
    --card: rgba(255, 255, 255, .62);
    --border: rgba(80, 100, 160, .16);
    --shadow: 0 30px 80px rgba(80, 100, 160, .18);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 20% 10%, rgba(124, 92, 255, .32), transparent 32%),
        radial-gradient(circle at 80% 20%, rgba(0, 224, 255, .18), transparent 28%),
        linear-gradient(135deg, var(--bg), var(--bg-soft));
    color: var(--text);
    overflow-x: hidden;
}

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

button,
input,
textarea {
    font: inherit;
}

button,
.button-link,
.hero-actions a,
.project-card a {
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #00d4ff);
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 14px 35px rgba(124, 92, 255, .35);
    transition: .25s ease;
    display: inline-block;
}

button:hover,
.button-link:hover,
.hero-actions a:hover,
.project-card a:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(255, 255, 255, .06);
    border-radius: 18px;
    padding: 14px 16px;
    outline: none;
}

input[type="file"] {
    cursor: pointer;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .15);
}

.glass {
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: var(--shadow);
}

.bg-orb {
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    filter: blur(30px);
    opacity: .4;
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.orb-a {
    top: 10%;
    left: -120px;
    background: var(--primary);
}

.orb-b {
    right: -100px;
    top: 30%;
    background: #00e0ff;
    animation-delay: -2s;
}

.orb-c {
    left: 40%;
    bottom: -160px;
    background: #ff4ecd;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(24px, -32px, 0);
    }
}

.nav {
    position: sticky;
    top: 18px;
    z-index: 20;
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto;
    padding: 14px 18px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 25px var(--primary);
}

.nav nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.nav nav a {
    color: var(--muted);
}

.nav nav a:hover {
    color: var(--text);
}

.nav button {
    padding: 9px 14px;
}

.hero {
    width: min(1180px, calc(100% - 32px));
    margin: 80px auto 40px;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 28px;
    align-items: stretch;
}

.hero-content,
.profile-card {
    border-radius: 36px;
    padding: 48px;
}

.eyebrow {
    color: var(--primary);
    letter-spacing: .16em;
    font-size: 13px;
    text-transform: uppercase;
}

.hero h1 {
    margin: 10px 0;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.hero-desc {
    max-width: 720px;
    font-size: 18px;
    color: var(--muted);
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.hero-actions .ghost {
    background: rgba(255, 255, 255, .1);
    color: var(--text);
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.profile-card img,
.avatar-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 36px;
    object-fit: cover;
    margin-bottom: 22px;
}

.avatar-placeholder {
    background: linear-gradient(135deg, var(--primary), #00d4ff);
    display: grid;
    place-items: center;
    font-size: 64px;
    color: #fff;
    font-weight: 900;
}

.profile-card p {
    color: var(--muted);
}

.section {
    width: min(1180px, calc(100% - 32px));
    margin: 100px auto;
}

.section-title {
    margin-bottom: 24px;
}

.section-title p {
    color: var(--primary);
    letter-spacing: .2em;
    font-size: 12px;
}

.section-title h2 {
    margin: 0;
    font-size: clamp(30px, 5vw, 52px);
    letter-spacing: -0.04em;
}

.content-card {
    border-radius: 32px;
    padding: 32px;
    line-height: 2;
    color: var(--muted);
    font-size: 17px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    border-radius: 32px;
    padding: 18px;
    overflow: hidden;
    transition: .3s ease;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-card-link {
    display: block;
}

.project-card img,
.project-cover {
    width: 100%;
    height: 220px;
    border-radius: 24px;
    object-fit: cover;
    margin-bottom: 18px;
}

.project-cover {
    background:
        linear-gradient(135deg, rgba(124, 92, 255, .85), rgba(0, 212, 255, .65)),
        repeating-linear-gradient(45deg, transparent 0 10px, rgba(255, 255, 255, .08) 10px 11px);
    display: grid;
    place-items: center;
    color: #fff;
    letter-spacing: .3em;
}

.project-card h3 {
    font-size: 24px;
    margin: 10px 0;
}

.project-card p {
    color: var(--muted);
    line-height: 1.8;
}

.project-more {
    color: var(--primary);
    font-weight: 700;
    display: inline-block;
    margin-top: 8px;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.site-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.case-card {
    border-radius: 32px;
    padding: 14px;
    overflow: hidden;
}

.case-preview-trigger {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 24px;
    overflow: hidden;
    display: block;
}

.case-preview-trigger:hover {
    transform: none;
    filter: none;
}

.case-card img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 24px;
    display: block;
    transition: transform .3s ease, filter .3s ease;
    cursor: zoom-in;
}

.case-preview-trigger:hover img {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.cases-page {
    margin-top: 70px;
}

.sites-page {
    margin-top: 70px;
}

.site-card {
    border-radius: 32px;
    padding: 24px;
    display: block;
    transition: transform .3s ease, box-shadow .3s ease;
}

.site-card:hover {
    transform: translateY(-8px);
}

.site-card-body h3 {
    margin: 0 0 10px;
    font-size: 22px;
}

.site-card-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    word-break: break-all;
}

.site-more {
    color: var(--primary);
    font-weight: 700;
    display: inline-block;
    margin-top: 12px;
}

.video-card {
    border-radius: 32px;
    padding: 24px;
    display: block;
    transition: transform .3s ease, box-shadow .3s ease;
}

.video-card:hover {
    transform: translateY(-8px);
}

.video-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(124, 92, 255, .16);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
}

.video-card h3 {
    margin: 18px 0 12px;
    font-size: 24px;
}

.video-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    word-break: break-all;
}

.section-action-row {
    margin-top: 24px;
}

.preview-open {
    overflow: hidden;
}

.service-open {
    overflow: hidden;
}

.service-float {
    position: fixed;
    right: 24px;
    bottom: 28px;
    z-index: 9997;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
}

.service-float-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .18);
    font-weight: 800;
}

.service-float-text {
    font-weight: 700;
    letter-spacing: .08em;
}

.service-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.service-modal.show {
    display: flex;
}

.service-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 18, .78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.service-modal-card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    padding: 28px;
    border-radius: 32px;
    text-align: center;
}

.service-modal-eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    letter-spacing: .18em;
    font-size: 12px;
}

.service-modal-card h3 {
    margin: 0 0 10px;
    font-size: 28px;
}

.service-modal-card p {
    color: var(--muted);
    line-height: 1.8;
}

.service-modal-card img {
    width: min(260px, 100%);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 24px;
    margin-top: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
}

.service-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 26px;
}

.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.image-preview-modal.show {
    display: flex;
}

.image-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 18, .82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.image-preview-content {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: calc(100vh - 80px);
    display: grid;
    place-items: center;
}

.image-preview-content img {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    background: rgba(255, 255, 255, .04);
}

.image-preview-close {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 2;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 999px;
    font-size: 30px;
    line-height: 1;
    display: grid;
    place-items: center;
}

.project-detail {
    display: grid;
    gap: 24px;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(280px, 520px) 1fr;
    gap: 32px;
    border-radius: 36px;
    padding: 24px;
    align-items: start;
}

.detail-media img,
.detail-media .project-cover {
    width: 100%;
    height: auto;
    max-height: 360px;
    border-radius: 28px;
    object-fit: contain;
    margin: 0;
    background: rgba(255, 255, 255, .06);
}

.detail-info {
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-info h1 {
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.05;
    margin: 8px 0 18px;
    letter-spacing: -0.05em;
}

.detail-info p,
.detail-content p {
    color: var(--muted);
    line-height: 2;
    font-size: 17px;
}

.project-credential {
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .06);
    border-radius: 18px;
    padding: 16px 18px;
}

.project-credential p {
    margin: 4px 0;
    color: var(--text);
    line-height: 1.8;
}

.project-credential strong {
    color: var(--muted);
    margin-right: 6px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0;
}

.detail-meta span {
    color: var(--muted);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .06);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 14px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.detail-actions a {
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #00d4ff);
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 14px 35px rgba(124, 92, 255, .35);
    transition: .25s ease;
    display: inline-block;
}

.detail-actions a:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.detail-actions .ghost {
    background: rgba(255, 255, 255, .1);
    color: var(--text);
}

.detail-content,
.not-found-card {
    border-radius: 32px;
    padding: 32px;
}

.video-detail-layout {
    grid-template-columns: minmax(320px, 1.25fr) minmax(280px, .75fr);
}

.video-player-shell {
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(0, 0, 0, .32);
    border: 1px solid var(--border);
    min-height: 320px;
}

.video-player-shell video,
.video-player-shell iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border: 0;
    background: #000;
}

.video-fallback {
    min-height: 320px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-fallback h3 {
    margin: 0 0 12px;
}

.video-fallback p {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

.video-detail-description {
    margin: 18px 0 0;
    color: var(--muted);
    line-height: 1.9;
    font-size: 18px;
}

.detail-content h2,
.not-found-card h1 {
    margin-top: 0;
}

.hidden-field {
    display: none;
}

footer {
    width: min(1180px, calc(100% - 32px));
    margin: 80px auto 40px;
    text-align: center;
    color: var(--muted);
}

footer a {
    color: var(--primary);
}

.cursor-dot,
.cursor-ring {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--primary);
}

.cursor-ring {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--primary);
    transition: width .2s, height .2s, opacity .2s;
    opacity: .7;
}

.context-menu {
    position: fixed;
    z-index: 9998;
    display: none;
    min-width: 170px;
    padding: 10px;
    border-radius: 18px;
}

.context-menu button {
    width: 100%;
    margin: 4px 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    box-shadow: none;
    color: var(--text);
    text-align: left;
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: .8s cubic-bezier(.2, .8, .2, 1);
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
}

/* Admin */
.admin-body {
    padding: 24px;
}

.login-card {
    width: min(420px, calc(100% - 32px));
    margin: 10vh auto;
    padding: 32px;
    border-radius: 32px;
}

.login-card form {
    display: grid;
    gap: 14px;
}

.alert {
    background: rgba(255, 76, 110, .15);
    color: #ff8fa3;
    padding: 12px;
    border-radius: 14px;
    margin: 14px 0;
}

.back-link {
    color: var(--muted);
    display: inline-block;
    margin-top: 18px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    border-radius: 28px;
    padding: 24px;
    display: grid;
    gap: 12px;
}

.admin-sidebar a {
    color: var(--muted);
    padding: 10px 12px;
    border-radius: 14px;
}

.admin-sidebar a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .08);
}

.admin-sidebar a.active {
    color: var(--text);
    background: rgba(255, 255, 255, .14);
}

.admin-main {
    display: grid;
    gap: 24px;
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.admin-page-header h2 {
    margin: 6px 0 0;
}

.admin-page-intro {
    color: var(--muted);
    line-height: 1.8;
    margin: 0 0 18px;
}

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

.admin-shortcut-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    background: rgba(255, 255, 255, .05);
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
}

.admin-shortcut-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, .09);
    border-color: rgba(124, 92, 255, .35);
}

.admin-shortcut-card strong {
    display: block;
    font-size: 18px;
}

.admin-shortcut-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.panel {
    border-radius: 28px;
    padding: 28px;
}

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

.grid-form label span {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.upload-field {
    grid-column: 1 / -1;
}

.admin-preview-image {
    display: block;
    width: min(220px, 100%);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
    background: rgba(255, 255, 255, .05);
}

.form-hint {
    display: block;
    color: var(--muted);
    margin-top: 10px;
    line-height: 1.8;
}

.inline-link {
    margin-top: 12px;
}

.grid-form textarea,
.grid-form button {
    grid-column: 1 / -1;
}

.admin-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.admin-item {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, .05);
}

.admin-item span,
.admin-item small {
    color: var(--muted);
    display: block;
    margin: 6px 0;
}

.admin-item a {
    color: var(--primary);
    margin-right: 12px;
}

.admin-thumb {
    width: 72px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    display: inline-block;
    margin: 0 12px 8px 0;
    vertical-align: middle;
    border: 1px solid var(--border);
}

.case-admin-list {
    margin-top: 22px;
}

.case-admin-item {
    display: grid;
    gap: 10px;
}

.case-admin-thumb {
    width: min(100%, 260px);
    height: 160px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.site-admin-item {
    display: grid;
    gap: 10px;
}

.site-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.site-admin-actions a {
    margin-right: 0;
}

.site-admin-thumb {
    width: min(100%, 320px);
    height: 180px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .05);
}

@media (max-width: 860px) {
    .nav {
        top: 10px;
        width: min(1180px, calc(100% - 20px));
        margin: 10px auto;
        padding: 12px 14px;
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .nav nav {
        flex-wrap: wrap;
    }

    .hero,
    .project-grid,
    .video-grid,
    .site-grid,
    .detail-hero,
    .admin-layout,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .hero {
        margin: 28px auto 20px;
        gap: 16px;
    }

    .section {
        width: min(1180px, calc(100% - 20px));
        margin: 56px auto;
    }

    .section-title {
        margin-bottom: 16px;
    }

    .hero-content,
    .profile-card {
        padding: 32px;
    }

    .profile-card {
        display: none;
    }

    .hero-actions {
        display: none;
    }

    .image-preview-modal {
        padding: 16px;
    }

    .service-float {
        right: 14px;
        bottom: 18px;
        padding: 10px 14px;
        gap: 8px;
    }

    .service-float-icon {
        width: 30px;
        height: 30px;
    }

    .service-modal {
        padding: 16px;
    }

    .service-modal-card {
        padding: 24px 18px;
        border-radius: 24px;
    }

    .service-modal-card img {
        width: min(220px, 100%);
        border-radius: 18px;
    }

    .image-preview-content img {
        max-height: calc(100vh - 120px);
    }

    .admin-sidebar {
        position: static;
    }

    .admin-shortcut-grid {
        grid-template-columns: 1fr;
    }

    .detail-hero {
        gap: 18px;
        padding: 18px;
    }

    .detail-content,
    .not-found-card,
    .panel {
        padding: 22px;
    }

    .cases-page,
    .sites-page,
    footer {
        margin-top: 36px;
    }

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

    .case-gallery-page .case-card {
        padding: 0;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 6px;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .case-gallery-page .case-preview-trigger {
        border-radius: 6px;
    }

    .case-gallery-page .case-card img {
        aspect-ratio: 3 / 4;
        height: auto;
        min-height: 220px;
        border-radius: 6px;
    }

    footer {
        width: min(1180px, calc(100% - 20px));
        margin-bottom: 24px;
    }

    .detail-media img,
    .detail-media .project-cover {
        max-height: 260px;
    }

    .video-player-shell {
        min-height: 0;
    }

    .video-fallback {
        min-height: 220px;
    }

    .site-card-hide-mobile {
        display: none;
    }
}
