/* AR 3D Viewer Frontend CSS v2.3 */

.ar3d-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

/* ── 覆盖层 ── */
.ar3d-overlay {
    position: absolute;
    inset: 0;
    z-index: 200;
    background: linear-gradient(150deg, #04101f 0%, #091929 55%, #04101f 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    transition: opacity .7s ease;
}

.ar3d-logo {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 5px;
    color: rgba(255,255,255,.85);
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* ── 旋转圈 ── */
.ar3d-spinner {
    width: 54px;
    height: 54px;
    border: 3px solid rgba(79,195,247,.18);
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: ar3d-spin .9s linear infinite;
}
@keyframes ar3d-spin { to { transform: rotate(360deg); } }

/* ── 状态文字 ── */
.ar3d-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
#ar3d-status-text {
    color: rgba(255,255,255,.65);
    font-size: 14px;
    text-align: center;
    padding: 0 28px;
    line-height: 1.6;
    white-space: pre-line;
}

/* ── 错误区 ── */
.ar3d-error {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    max-width: 340px;
    text-align: center;
}
#ar3d-error-msg {
    color: #ff8a80;
    font-size: 13.5px;
    line-height: 1.65;
}

/* ── 就绪 ── */
.ar3d-ready {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.ar3d-pulse-icon {
    font-size: 3.2rem;
    animation: ar3d-pulse 2s ease-in-out infinite;
}
@keyframes ar3d-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }

/* ── 按钮 ── */
.ar3d-btn {
    padding: 12px 30px;
    background: #29b6f6;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s;
    -webkit-appearance: none;
    letter-spacing: .5px;
}
.ar3d-btn:active { transform: scale(.95); }

/* ── AR 容器 ── */
#ar3d-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
#ar3d-container video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: 1;
}
#ar3d-container canvas {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2;
}

/* ── 识别信息卡 ── */
.ar3d-info-card {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #fff;
    padding: 9px 22px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.16);
    transition: opacity .4s;
    pointer-events: none;
}

/* ── 底部面板 ── */
.ar3d-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
}
.ar3d-panel-toggle {
    width: 100%;
    padding: 12px;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255,255,255,.88);
    border: none;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .5px;
    -webkit-appearance: none;
}
.ar3d-panel-body {
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    max-height: 210px;
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,.08);
}
.ar3d-marker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
}
.ar3d-marker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    min-width: 70px;
    cursor: default;
    transition: border-color .25s, background .25s;
}
.ar3d-marker-item.active {
    border-color: #29b6f6;
    background: rgba(41,182,246,.15);
}
.ar3d-mimg {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}
.ar3d-mimg-ph {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,.07);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.ar3d-mlabel {
    font-size: 11px;
    color: rgba(255,255,255,.72);
    text-align: center;
    word-break: break-word;
    max-width: 70px;
    line-height: 1.3;
}

/* ── 停止按钮 ── */
.ar3d-stop-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 160;
    background: rgba(180,30,30,.8);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    -webkit-appearance: none;
    backdrop-filter: blur(6px);
}
