:root {
    --bg-light: #F8F4F1;
    --bg-dark: #EAE0D8;
    --text-main: #33241B;
    --text-light: #5A473D;
    --accent: #9A7B6B;
    --accent-dark: #7A5C4D;
    --coffee-light: #C4B7A7;
    --footer-bg: #1A120E;
    --footer-text: #E8E0D5;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-dark) 100%);
    color: var(--text-main);
    line-height: 1.7;
    position: relative;
    z-index: 0;
    min-height: 100vh;
}

.bg-geometry {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}
.geo-circle-1 {
    position: absolute;
    width: 800px; height: 800px;
    border: 2px solid rgba(154, 123, 107, 0.15);
    border-radius: 50%;
    top: -200px; right: -200px;
}
.geo-circle-2 {
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(154, 123, 107, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    bottom: 10%; left: -100px;
}
.geo-line {
    position: absolute;
    width: 150vw; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(154,123,107,0.2), transparent);
    top: 30%; left: -25vw;
    transform: rotate(-15deg);
}
.geo-arch {
    position: absolute;
    width: 600px; height: 600px;
    border: 1px dashed rgba(154, 123, 107, 0.2);
    border-radius: 50%;
    top: 50%; right: -150px;
}

nav {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: rgba(248, 244, 241, 0.7);
    backdrop-filter: blur(12px);
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: flex-end;
}
nav ul {
    display: flex;
    list-style: none;
    margin: 0; padding: 20px 40px;
}
nav ul li { margin-left: 35px; }
nav ul li a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.05em;
    font-weight: 500;
    letter-spacing: 1px;
    transition: color 0.3s;
}
nav ul li a:hover { color: var(--accent); }

.container {
    max-width: 900px;
    margin: 120px auto 60px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
    position: relative;
    z-index: 1;
}

h2 {
    font-size: 1.6em;
    font-weight: 600;
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #FFF;
    padding: 12px 25px;
    border-radius: 8px;
    margin-top: 80px;
    margin-bottom: 36px;
    letter-spacing: 2px;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(154, 123, 107, 0.22);
}

h3 {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(196, 183, 167, 0.35);
    padding: 10px 20px;
    border-left: 5px solid var(--accent);
    border-radius: 0 6px 6px 0;
    margin-top: 48px;
    margin-bottom: 24px;
}

.header-title {
    text-align: left;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(154, 123, 107, 0.3);
}
.header-title h1 {
    font-size: 3.2em;
    font-weight: 300;
    margin: 0 0 10px 0;
    letter-spacing: 4px;
    color: var(--text-main);
}
.header-title p.intent {
    font-size: 1.3em;
    color: var(--accent-dark);
    margin: 0;
    font-weight: 500;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
@media(max-width: 650px) {
    .info-grid { grid-template-columns: 1fr; gap: 20px; }
    nav { justify-content: center; }
    nav ul { padding: 15px; }
    nav ul li { margin: 0 15px; }
    .container { margin-top: 100px; padding: 25px; }
}

.info-block p { margin: 10px 0; }
.info-block strong { font-weight: 600; color: var(--text-main); }

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}
.tag {
    background: linear-gradient(135deg, rgba(154, 123, 107, 0.15), rgba(154, 123, 107, 0.05));
    border: 1px solid rgba(154, 123, 107, 0.4);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
}

.about-text {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.6), transparent);
    padding: 25px 30px;
    border-radius: 12px;
    margin-top: 30px;
}
.about-text p { margin: 12px 0; }

.project-desc {
    margin-bottom: 40px;
    background: rgba(255,255,255,0.3);
    padding: 25px;
    border-radius: 10px;
}
.project-desc p:not(.project-title):not(.project-role) {
    max-width: 680px;
}
.project-title {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-main);
}
.project-role {
    color: var(--accent-dark);
    margin-top: -10px;
    font-weight: 500;
}

.placeholder {
    background: rgba(154, 123, 107, 0.1);
    border: 2px dashed rgba(154, 123, 107, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-dark);
    font-size: 1em;
    letter-spacing: 1px;
    border-radius: 8px;
    transition: all 0.3s;
}
.placeholder:hover {
    background: rgba(154, 123, 107, 0.2);
    border-style: solid;
}

.img-box { width: 100%; height: 300px; margin-bottom: 30px; }

.media-image {
    display: block;
    width: 100%;
    height: auto;
    padding: 6px;
    border: 1px solid rgba(154, 123, 107, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.flex-row {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-start;
}
.flex-row > .media-image {
    flex: 1 1 0;
    min-width: 0;
}
.flex-row .img-box { margin-bottom: 0; flex: 1; }

.flex-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}
.flex-col .img-box { margin-bottom: 0; }

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 40px;
    overflow: hidden;
    border: 1px solid rgba(154, 123, 107, 0.18);
    border-radius: 10px;
    background: #000;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.video-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.video-stage video {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 100%;
    height: auto;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.5625);
    transform-origin: center;
}
.video-fallback {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    font-size: 0.95em;
    letter-spacing: 1px;
}
.video-controls {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 14px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    color: #fff;
    font-size: 0.8rem;
}
.video-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}
.video-btn:hover { background: rgba(255, 255, 255, 0.15); }
.video-btn:focus-visible { outline: 2px solid var(--coffee-light); outline-offset: 2px; }
.video-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.icon-pause, .icon-volume-off { display: none; }
#videoToggle.is-playing .icon-play { display: none; }
#videoToggle.is-playing .icon-pause { display: block; }
#videoMute.is-muted .icon-volume-on { display: none; }
#videoMute.is-muted .icon-volume-off { display: block; }
.video-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    opacity: 0.92;
}
.video-progress {
    flex: 1;
    min-width: 0;
    height: 4px;
    cursor: pointer;
    accent-color: var(--coffee-light);
}
.video-frame:fullscreen {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.video-frame:fullscreen .video-stage {
    position: relative;
    inset: auto;
    width: min(100vw, 177.78vh);
    height: auto;
    aspect-ratio: 16 / 9;
}

@media(max-width: 650px) {
    .flex-row { flex-direction: column; gap: 30px; }
    .flex-row > .media-image { flex: none; width: 100%; }
    .img-box { height: 200px; }
    .video-controls { gap: 6px; padding: 20px 8px 8px; }
    .video-btn { width: 28px; height: 28px; }
    .video-btn svg { width: 16px; height: 16px; }
    .video-time { font-size: 0.7rem; }
}

footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 70px 20px;
    text-align: center;
    margin-top: 100px;
    position: relative;
    z-index: 1;
}
footer h3 {
    color: var(--accent);
    border: none; margin-top: 0;
    background: none; padding: 0;
    font-weight: 400; letter-spacing: 3px;
    text-align: center;
}
footer p {
    margin: 12px 0;
    font-size: 1em;
    opacity: 0.9;
}
.footer-copyright {
    font-size: 0.85em;
    margin-top: 40px;
    opacity: 0.4;
}

.back-to-top {
    position: fixed;
    bottom: 50px; right: 50px;
    width: 48px; height: 48px;
    background: var(--coffee-light);
    color: #FFF;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    font-size: 1.4em;
    font-weight: bold;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    z-index: 99;
}
.back-to-top:hover {
    background: var(--accent-dark);
    transform: translateY(-5px);
}
@media(max-width: 650px) {
    .back-to-top { bottom: 25px; right: 25px; width: 42px; height: 42px; border-radius: 10px; }
}

/* 滚动渐显动效，延长持续时间 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.1s ease-out, transform 1.1s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 证书两列同高对齐 */
.cert-row {
    height: min(520px, 52vw);
    align-items: stretch;
}
.cert-card {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cert-card > .media-image {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* 图片点击放大提示 */
.media-image {
    cursor: zoom-in;
}
.media-image:not(.fade-in) {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.media-image:hover {
    border-color: rgba(154, 123, 107, 0.36);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.video-stage,
.video-stage video {
    cursor: zoom-in;
}
.video-frame.is-expanded .video-stage,
.video-frame.is-expanded .video-stage video {
    cursor: default;
}

/* 视频点击放大层 */
.video-frame.is-expanded {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 7, 5, 0.96);
    box-shadow: none;
}
.video-frame.is-expanded .video-stage {
    position: relative;
    inset: auto;
    width: min(92vw, 163.56vh);
    height: auto;
    aspect-ratio: 16 / 9;
}
.video-frame.is-expanded .video-controls {
    left: 50%;
    right: auto;
    bottom: max(3vh, 16px);
    transform: translateX(-50%);
    width: min(92vw, 163.56vh);
    border-radius: 0 0 8px 8px;
}
.video-expand-close {
    display: none;
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 4;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.video-expand-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}
.video-frame.is-expanded .video-expand-close {
    display: flex;
}

/* 图片预览层 */
body.no-scroll {
    overflow: hidden;
}
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    background: rgba(20, 14, 10, 0.92);
    backdrop-filter: blur(6px);
}
.lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 88vh;
}
.lightbox-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

@media (max-width: 650px) {
    .cert-row {
        height: auto;
    }
    .cert-card {
        display: block;
        height: auto;
    }
    .cert-card > .media-image {
        width: 100%;
        height: auto;
    }
    .lightbox-close,
    .video-expand-close {
        top: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}


/* 虚拟样机与动画演示并排：按宽高比分配宽度，保证两格同高 */
.sim-row {
    align-items: stretch;
}
.sim-row > .media-image {
    flex: 1.163 1 0; /* 728 / 626 */
    min-width: 0;
}
.sim-video-wrap {
    position: relative;
    flex: 2.353 1 0; /* 1920 / 816 */
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(154, 123, 107, 0.18);
    border-radius: 10px;
    background: #000;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    cursor: zoom-in;
}
.sim-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sim-video-hint {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.2;
    pointer-events: none;
}

@media (max-width: 650px) {
    .sim-row > .media-image,
    .sim-video-wrap {
        flex: none;
        width: 100%;
    }
    .sim-video-wrap {
        aspect-ratio: 1920 / 816;
    }
}

/* 放大层里的动画视频 */
.lightbox-content video {
    display: block;
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}


/* 电路设计：左文右图 */
.design-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 30px;
    align-items: center;
    margin-bottom: 40px;
}
.design-text {
    font-size: 1em;
    line-height: 1.8;
    color: var(--text-main);
    border-left: 2px solid rgba(154, 123, 107, 0.3);
    padding-left: 18px;
}
.design-text p {
    margin: 0 0 12px;
}
.design-text p:last-child {
    margin-bottom: 0;
}

@media (max-width: 650px) {
    .design-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}


/* 固定导航下的锚点偏移 */
section[id] {
    scroll-margin-top: 90px;
}
