* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
}

.ar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.camera-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 2500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease-out;
}

.camera-flash.flash {
    opacity: 0.8;
}

.header-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    padding: env(safe-area-inset-top, 20px) 20px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #66ccff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.scan-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.scan-guide.show {
    opacity: 1;
}

.image-container {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
    width: 300px;
    height: 300px;
}

.target-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0.6;
    border: 2px solid rgba(102, 204, 255, 0.3);
    display: block;
}

.scan-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    object-fit: contain;
    opacity: 0.8;
}

.scan-text {
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.scan-tip {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.ui-elements {
    transition: opacity 0.05s ease;
}

.ui-elements.hidden-for-capture {
    opacity: 0;
    pointer-events: none;
}

.camera-btn {
    position: absolute;
    bottom: env(safe-area-inset-bottom, 30px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #66ccff;
    border: 4px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) scale(0.8);
}

.camera-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.camera-btn:hover {
    background: #4db8ff;
    transform: translateX(-50%) scale(1.05);
}

.camera-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.camera-btn.capturing {
    background: #999;
    pointer-events: none;
}

.photo-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.photo-preview-overlay.show {
    display: flex;
}

.photo-preview-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    opacity: 0;
    transform: scale(1.2);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.photo-preview-container.animate-in {
    opacity: 1;
    transform: scale(1);
}

.photo-preview-image {
    max-width: 33vw;
    max-height: 33vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.photo-preview-image:active {
    transform: scale(0.98);
}

.photo-preview-tip {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: center;
}

.photo-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #fff;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.photo-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.control-panel {
    position: absolute;
    bottom: env(safe-area-inset-bottom, 30px);
    right: 20px;
    z-index: 998;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #66ccff;
    border: 1px solid rgba(102, 204, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 10px;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(102, 204, 255, 0.4);
}

.control-btn:active {
    transform: scale(0.95);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-content {
    background: #fff;
    color: #333;
    padding: 24px;
    border-radius: 12px;
    width: 90vw;
    max-width: 400px;
    text-align: center;
    position: relative;
    margin: auto;
}

.modal-title {
    margin-bottom: 16px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.modal-text {
    text-align: left;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.modal-text p {
    margin-bottom: 8px;
}

.modal-close-btn {
    background: #66ccff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.modal-close-btn:hover {
    background: #4db8ff;
}

@media (max-width: 768px) {
    .photo-preview-image {
        max-width: 50vw;
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .photo-preview-image {
        max-width: 60vw;
        max-height: 60vh;
    }
}

a-scene {
    width: 100%;
    height: 100%;
}

.hidden {
    display: none !important;
}

/* 修改加载提示样式，移除进度条相关 */
.loading-tip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #66ccff;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.loading-tip.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    max-width: 80vw;
}

.loading-icon {
    font-size: 64px;
    margin-bottom: 24px;
    animation: loadingFloat 2s ease-in-out infinite;
}

@keyframes loadingFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.loading-text {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.loading-sub {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
}
