
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: #050510; color: white; font-family: 'Inter', sans-serif; overflow-x: hidden; }

/* 全局导航与右上角按钮 */
#site-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 100; background: linear-gradient(to bottom, rgba(5,5,16,0.9), transparent); }
.top-nav { display: flex; justify-content: space-between; align-items: center; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }
.top-nav .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: #fff; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { font-size: 0.95rem; font-weight: 600; color: #a0a0b0; transition: color 0.2s; padding-bottom: 4px; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: #00f2fe; border-bottom: 2px solid #00f2fe; }

.nav-icons { display: flex; gap: 12px; }
.icon-btn { background: transparent; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; width: 36px; height: 36px; display: flex; justify-content: center; align-items: center; cursor: pointer; color: #fff; font-size: 1rem; transition: 0.3s; }
.icon-btn:hover { border-color: #00f2fe; color: #00f2fe; transform: scale(1.1); }

/* 底部 Footer */
#site-footer { position: relative; z-index: 10; background: #050510; border-top: 1px solid rgba(255,255,255,0.1); width: 100%; margin-top: 50px;}
.site-footer { max-width: 1100px; margin: 0 auto; padding: 3rem 1rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand h3 { font-size: 1.2rem; margin-bottom: 1rem; font-weight: 800; color: #fff; }
.footer-brand p { font-size: 0.9rem; color: #a0a0b0; max-width: 300px; }
.footer-nav { display: flex; flex-direction: column; gap: 0.8rem; }
.footer-nav a { color: #a0a0b0; font-size: 0.95rem; text-decoration: none; }
.footer-nav a:hover { color: #00f2fe; }
.footer-contact h4 { font-size: 0.85rem; letter-spacing: 1px; margin-bottom: 1rem; color: #a0a0b0; }
.footer-contact a { color: #00f2fe; font-size: 0.95rem; text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; font-size: 0.85rem; color: #a0a0b0; }

/* 星空背景 & 首页地球 */
#stars-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.star { position: absolute; width: 2px; height: 2px; background: white; border-radius: 50%; opacity: 0; animation: twinkle infinite alternate; }
@keyframes twinkle { 0% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 10px #fff; } }

#canvas-container { position: relative; width: 100vw; height: 100vh; z-index: 2; cursor: grab; overflow: hidden; }
#canvas-container:active { cursor: grabbing; }
#mouse-coords { position: absolute; display: none; pointer-events: none; color: #00f2fe; font-family: monospace; font-size: 1rem; text-shadow: 0 0 5px #000, 0 0 10px #000; z-index: 100; white-space: nowrap; }
#ui-hints { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.7); font-size: 0.9rem; pointer-events: none; z-index: 10; }

/* 图钉常驻标签 */
.pin-label { position: absolute; color: white; font-size: 12px; font-weight: bold; background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 4px; border: 1px solid #ff2a2a; pointer-events: none; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -10px; text-shadow: 0 0 5px #ff2a2a; z-index: 50; transition: background 0.3s; }

/* Tooltip */
#tooltip { position: fixed; background: rgba(10, 15, 30, 0.85); border: 1px solid #00f2fe; border-radius: 8px; padding: 15px 20px; pointer-events: none; z-index: 999; backdrop-filter: blur(10px); transform: translate(-50%, -120%); }
#tooltip.hidden { display: none; }
#tooltip h3 { font-size: 1.2rem; color: #00f2fe; margin-bottom: 5px; }
#tooltip p { font-size: 0.85rem; color: #a0a0b0; margin-bottom: 10px; }
#tooltip .tooltip-action { font-size: 0.8rem; color: #ffcc00; font-weight: bold; }

/* 通用确认弹窗 */
#portal-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; z-index: 999; backdrop-filter: blur(8px); }
#portal-modal.hidden { display: none; }
.modal-content { background: rgba(20,20,35,0.95); border: 1px solid #00f2fe; padding: 40px; border-radius: 15px; width: 500px; max-width: 90%; text-align: center; box-shadow: 0 0 40px rgba(0,242,254,0.2); }
.modal-content h2 { color: #00f2fe; margin-bottom: 10px; font-size: 1.8rem; }
.modal-content p { color: #a0a0b0; margin-bottom: 20px; }
.portal-buttons { display: flex; justify-content: space-between; gap: 20px; }
.portal-buttons button { flex: 1; padding: 12px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; border: none; transition: 0.3s; }
#cancel-btn { background: transparent; color: #a0a0b0; border: 1px solid #555; }
#cancel-btn:hover { color: white; border-color: white; }
#confirm-btn { background: #00f2fe; color: #000; box-shadow: 0 0 15px rgba(0,242,254,0.4); }
#confirm-btn:hover { box-shadow: 0 0 30px #00f2fe; transform: scale(1.05); }

/* 终极光带吸入遮罩 */
#warp-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 9999; pointer-events: none; display: flex; justify-content: center; align-items: center; background: transparent; opacity: 0; transition: opacity 0.3s; overflow: hidden; }
#warp-overlay.hidden { display: none; }
#warp-overlay.warping { opacity: 1; pointer-events: auto; }
#warp-lines { position: absolute; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; transform: scale(1); transition: transform 1.5s cubic-bezier(0.7, 0, 0.3, 1); }
#warp-overlay.warping #warp-lines { transform: scale(0.1); }
.warp-line { position: absolute; width: 2px; background: linear-gradient(to top, transparent, #ffffff, #ffffff); box-shadow: 0 0 10px #ffffff; opacity: 0; animation: lineWarp 1s linear forwards; }
@keyframes lineWarp { 0% { transform-origin: center bottom; opacity: 0; scale: 1; } 20% { opacity: 1; } 100% { transform-origin: center bottom; opacity: 0; scale: 0.2; } }
#warp-core { position: absolute; width: 10px; height: 10px; background: #ffffff; border-radius: 50%; box-shadow: 0 0 50px 30px #ffffff; transition: all 1.2s cubic-bezier(0.7, 0, 0.3, 1); }
#warp-overlay.warping #warp-core { box-shadow: 0 0 200px 200px #ffffff; background: transparent; }

/* 画廊丝滑阻尼翻页 */
.gallery-wrapper { height: 100vh; width: 100vw; overflow-y: scroll; scroll-snap-type: y mandatory; scroll-behavior: smooth; position: relative; z-index: 2; -ms-overflow-style: none; scrollbar-width: none; }
.gallery-wrapper::-webkit-scrollbar { display: none; }
.scene-card { height: 100vh; width: 100vw; scroll-snap-align: center; display: flex; justify-content: center; align-items: center; position: relative; }
.card-inner { width: 75vw; max-width: 1100px; height: 70vh; border-radius: 24px; background-size: cover; background-position: center; position: relative; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.1); transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); cursor: pointer; }
.card-inner:hover { transform: scale(1.02); }
.card-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 60%); display: flex; flex-direction: column; justify-content: flex-end; padding: 50px; }
.card-overlay h2 { font-size: 3.5rem; color: #fff; text-shadow: 0 0 20px rgba(0,0,0,0.8); margin-bottom: 10px; font-weight: 800; }
.card-overlay p { font-size: 1.2rem; color: #00f2fe; font-weight: 600; letter-spacing: 1px; }

/* 博物馆宇宙漂浮 */
.museum-bg { position: fixed; inset: 0; z-index: 0; background-image: radial-gradient(circle at 50% 0%, rgba(0,242,254,0.15) 0%, transparent 70%), linear-gradient(rgba(0, 242, 254, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 242, 254, 0.05) 1px, transparent 1px); background-size: 100% 100%, 40px 40px, 40px 40px; perspective: 500px; }
.museum-container { position: relative; width: 100vw; height: 100vh; z-index: 2; overflow: hidden; }
.floating-card { position: absolute; width: 280px; background: rgba(20, 20, 35, 0.85); border: 1px solid rgba(0, 242, 254, 0.3); border-radius: 12px; padding: 15px; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,0.8); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s, opacity 0.4s; z-index: 5; cursor: pointer; transform: translate(-50%, -50%); }
.floating-card:hover { z-index: 99; box-shadow: 0 0 50px rgba(0, 242, 254, 0.6); border-color: #00f2fe; transform: translate(-50%, -50%) scale(1.15) !important; opacity: 1 !important; }
.delete-btn { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; color: #fff; display: flex; justify-content: center; align-items: center; cursor: pointer; opacity: 0; transition: 0.3s; backdrop-filter: blur(5px); }
.floating-card:hover .delete-btn { opacity: 1; }
.delete-btn:hover { background: rgba(255, 42, 42, 0.8); transform: rotate(90deg) scale(1.1); }
.card-image { width: 100%; height: 180px; background-size: cover; background-position: center; border-radius: 8px; margin-bottom: 12px; pointer-events: none; }
.card-info { text-align: center; pointer-events: none; }
.card-info h3 { color: #00f2fe; font-size: 1.1rem; margin-bottom: 5px; font-weight: 800;}
.card-info p { color: #ddd; font-size: 0.85rem; font-style: italic; }
.card-info .date { font-size: 0.75rem; color: #666; display: block; text-align: right; margin-top: 5px; }
@keyframes floatAnim { 0% { margin-top: -15px; margin-left: -10px; } 100% { margin-top: 15px; margin-left: 10px; } }

/* 场景页与拍照 UI */
#scene-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; cursor: crosshair; z-index: 1;}
#flash-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: white; opacity: 0; pointer-events: none; z-index: 9999; transition: opacity 0.1s ease; }
#flash-overlay.flash { opacity: 1; transition: none; }
.back-btn { position: fixed; top: 80px; left: 30px; padding: 12px 24px; background: rgba(0,0,0,0.5); color: white; text-decoration: none; border-radius: 30px; font-weight: 600; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); transition: 0.3s; z-index: 10; }
.back-btn:hover { background: rgba(255,255,255,0.2); }
.crosshair { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 6px; height: 6px; background: rgba(255,255,255,0.8); border-radius: 50%; pointer-events: none; z-index: 5; }
.camera-btn { position: fixed; bottom: 80px; right: 40px; padding: 15px 30px; background: rgba(20,20,35,0.8); color: #00f2fe; border: 1px solid #00f2fe; border-radius: 12px; font-size: 1.1rem; font-weight: bold; cursor: pointer; backdrop-filter: blur(10px); transition: 0.3s; z-index: 10; }
.camera-btn:hover { background: #00f2fe; color: #000; }
#memory-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; z-index: 999; backdrop-filter: blur(8px); }
#memory-modal.hidden { display: none; }
#memory-text { width: 100%; height: 120px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 15px; color: white; resize: none; margin-bottom: 20px; }
#memory-text:focus { outline: none; border-color: #00f2fe; }
.modal-buttons { display: flex; justify-content: space-between; }
.modal-buttons button { padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; border: none; transition: 0.3s; }
#cancel-memory { background: transparent; color: #a0a0b0; border: 1px solid #555; }
#save-memory { background: #00f2fe; color: #000; }

/* 控制面板 */
.control-panel { position: fixed; bottom: 30px; left: 30px; background: rgba(10, 15, 30, 0.7); border: 1px solid #00f2fe; border-radius: 12px; padding: 15px; backdrop-filter: blur(10px); z-index: 10; width: 140px; color: #fff; }
.panel-title { color: #00f2fe; font-size: 0.8rem; font-weight: bold; margin-bottom: 8px; letter-spacing: 1px; }
.panel-icons { display: flex; gap: 8px; margin-bottom: 15px; }
.panel-icons button { width: 30px; height: 30px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; color: white; cursor: pointer; }
.time-slider { width: 100%; accent-color: #00f2fe; }

/* 关于我 */
.about-split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; }
.about-left h2 { font-size: 2rem; color: #fff; margin-bottom: 1rem; }
.big-statement { font-size: 1.4rem; font-weight: 800; color: #00f2fe; line-height: 1.4; margin-bottom: 1.5rem; }
.small-desc { font-size: 1.05rem; color: #a0a0b0; line-height: 1.7; margin-bottom: 2rem; }
.skills-tags { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.skills-tags span { background-color: rgba(0, 242, 254, 0.1); color: #00f2fe; padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; border: 1px solid rgba(0,242,254,0.3); }
.about-right { background-color: rgba(255,255,255,0.03); padding: 2rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }
.about-right h3 { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }
.about-right > p { font-size: 0.95rem; color: #a0a0b0; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; color: #ddd; margin-bottom: 0.5rem; }
.form-group input { width: 100%; padding: 0.8rem 1rem; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.3); border-radius: 8px; font-size: 1rem; color: white; transition: 0.2s; }
.form-group input:focus { outline: none; border-color: #00f2fe; }
.action-btn { background-color: #00f2fe; color: black; border: none; padding: 1rem 2rem; font-weight: 800; border-radius: 8px; cursor: pointer; transition: 0.2s; width: 100%; }

/* 响应式 */
@media (max-width: 768px) {
    .footer-grid, .about-split { grid-template-columns: 1fr; gap: 2rem; }
    .top-nav { flex-direction: column; gap: 1rem; }
    .card-overlay h2 { font-size: 2rem; }
    .card-inner { width: 90vw; height: 60vh; }
}
/* 语义图片 / 天气 / 触屏 / 浅色主题 / 手机布局 */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* 画廊卡片使用真实 <img>，背景图不再靠 CSS 注入 */
.card-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-inner { background-image: none; }

/* 博物馆记忆卡 */
.memory-grid { position: absolute; inset: 0; }
.card-img { display: block; width: 100%; height: 170px; object-fit: cover; border-radius: 8px; margin-bottom: 12px; }
.card-info h2 { color: #00f2fe; font-size: 1.05rem; font-weight: 800; margin-bottom: 6px; }
.card-info blockquote { color: #ddd; font-size: 0.85rem; font-style: italic; line-height: 1.5; margin: 0; }
.credits { grid-column: 1 / -1; margin: 0 0 1.6rem; font-size: 0.78rem; line-height: 1.6; color: #7f8ba3; }

/* 天气层（由控制面板按钮切换） */
#wx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; transition: background 0.6s; }
#wx-layer.wx-rain { background: repeating-linear-gradient(105deg, rgba(150,200,255,.11) 0 2px, transparent 2px 13px), linear-gradient(rgba(20,35,70,.32), rgba(20,35,70,.16)); animation: wxMove 1.1s linear infinite; }
#wx-layer.wx-snow { background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.55) 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.45) 0 2px, transparent 3px), linear-gradient(rgba(190,215,255,.14), rgba(190,215,255,.08)); background-size: 90px 90px, 120px 120px, auto; animation: wxMove 5s linear infinite; }
#wx-layer.wx-sun { background: linear-gradient(rgba(255,205,120,.15), transparent 60%); }
@keyframes wxMove { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 0 60px, 0 60px, 0 0; } }

/* 触屏移动按钮 */
.move-pad { display: none; position: fixed; right: 18px; bottom: 100px; z-index: 20; flex-direction: column; gap: 10px; }
.move-pad button { width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(0,242,254,.6); background: rgba(5,10,25,.72); color: #8fe3ff; font-size: 24px; touch-action: none; }
.move-pad button.held { background: rgba(0,242,254,.28); }

/* 浅色主题：只改可读性相关的颜色，不破坏深空视觉元素 */
body.light-theme { background-color: #eef3fb; color: #16223a; }
body.light-theme #stars-container { opacity: 0.18; }
body.light-theme #site-header { background: linear-gradient(to bottom, rgba(238,243,251,.96), rgba(238,243,251,0)); }
body.light-theme .top-nav .logo,
body.light-theme .nav-links a,
body.light-theme .site-footer,
body.light-theme .footer-brand h3,
body.light-theme .footer-bottom,
body.light-theme .main-card h1,
body.light-theme .main-card h2,
body.light-theme .main-card h3,
body.light-theme .main-card p,
body.light-theme .subtitle,
body.light-theme .card-overlay h2,
body.light-theme .card-overlay p,
body.light-theme .about-right > p,
body.light-theme .form-group label { color: #16223a; }
body.light-theme .nav-links a:hover,
body.light-theme .nav-links a.active { color: #0057a8; border-bottom-color: #0057a8; }
body.light-theme .icon-btn { color: #16223a; border-color: rgba(20,34,58,.3); }
body.light-theme .site-footer { background: #eef3fb; border-top-color: rgba(20,34,58,.15); }
body.light-theme .form-group input { color: #16223a; background: rgba(255,255,255,.7); border-color: rgba(20,34,58,.25); }
body.light-theme .about-right { background: rgba(255,255,255,.6); border-color: rgba(20,34,58,.15); }
body.light-theme .small-desc,
body.light-theme .footer-brand p,
body.light-theme .footer-nav a { color: #40506b; }

/* 手机布局：导航折行、控件缩小、弹窗自适应、触屏摇杆出现 */
@media (max-width: 820px) {
    .top-nav { flex-wrap: wrap; gap: 0.7rem; padding: 1rem; }
    .nav-links { flex-wrap: wrap; gap: 0.9rem; order: 3; justify-content: center; width: 100%; }
    .nav-links a { font-size: 0.85rem; }
    .nav-icons { gap: 8px; }
    .icon-btn { width: 34px; height: 34px; font-size: 0.9rem; }
    .back-btn { top: 70px; left: 14px; padding: 9px 16px; font-size: 0.85rem; }
    .control-panel { width: 118px; padding: 10px; bottom: 16px; left: 14px; }
    .control-panel .icon-btn { width: 30px; height: 30px; font-size: 0.8rem; }
    .panel-title { font-size: 0.72rem; }
    .camera-btn { bottom: 16px; right: 14px; padding: 10px 14px; font-size: 0.85rem; }
    .move-pad { display: flex; right: 14px; bottom: 80px; }
    #ui-hints { bottom: 64px; width: 90%; text-align: center; font-size: 0.72rem; }
    .modal-content { width: 92vw; padding: 24px 18px; }
    .modal-content h2 { font-size: 1.35rem; }
    .modal-buttons { flex-wrap: wrap; gap: 10px; }
    .floating-card { width: min(76vw, 260px); padding: 11px; }
    .card-img { height: 120px; }
    .glow-title { font-size: 2rem !important; }
    .about-split { padding: 0 4px; }
    .footer-grid { padding: 0 6px; }
    #tooltip { max-width: 80vw; }
    .card-inner { width: 92vw; height: 58vh; }
    .card-overlay h2 { font-size: 1.5rem; }
    .card-overlay { padding: 24px; }
}
@media (pointer: coarse) { .move-pad { display: flex; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 手机导航：五个链接必须完整可见，不能横向溢出 */
@media (max-width: 820px) {
    .top-nav { justify-content: center; }
    .nav-links { width: 100%; justify-content: center; gap: 0.35rem 0.7rem; }
    .nav-links a { font-size: 0.8rem; white-space: nowrap; padding-bottom: 2px; }
    .logo { width: 100%; justify-content: center; }
}

/* 手机场景页：操作提示移到上方，避免与左下控制面板 / 右下按钮重叠 */
@media (max-width: 820px) {
    #ui-hints { top: 126px; bottom: auto; width: 94%; left: 3%; transform: none; font-size: 0.72rem; }
}
