/* ============================================
   Pointcloud Lab — 点群技術検証プラットフォーム
   Design System (based on IPS Lab theme)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- CSS Custom Properties --- */
:root {
    /* Color Palette - Dark Cyberpunk Theme */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1f2847;
    --bg-glass: rgba(26, 32, 53, 0.85);
    --bg-overlay: rgba(10, 14, 26, 0.9);

    --text-primary: #e8ecf4;
    --text-secondary: #8b95a8;
    --text-muted: #5a6478;
    --text-accent: #64d2ff;

    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;

    --gradient-blue: linear-gradient(135deg, #3b82f6, #06b6d4);
    --gradient-green: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #ec4899);
    --gradient-orange: linear-gradient(135deg, #f97316, #f59e0b);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);

    /* Borders */
    --border-color: rgba(59, 130, 246, 0.15);
    --border-glow: rgba(59, 130, 246, 0.3);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.2);
    --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.2);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 3px;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-blue);
}

code,
.mono {
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.site-header {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-primary);
    text-decoration: none;
}

/* --- Header Ping Animation --- */
.header-ping {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.header-ping .orbit {
    position: absolute;
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.header-ping .orbit:nth-child(1) {
    width: 16px;
    height: 16px;
}

.header-ping .orbit:nth-child(2) {
    width: 26px;
    height: 26px;
    border-color: rgba(6, 182, 212, 0.12);
}

.header-ping .orbit:nth-child(3) {
    width: 36px;
    height: 36px;
    border-color: rgba(139, 92, 246, 0.1);
}

.header-ping .center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--gradient-purple);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.header-ping .ping-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border: 1px solid rgba(139, 92, 246, 0.6);
    border-radius: 50%;
    animation: ping 2s ease-out infinite;
}

.header-ping .ping-ring:nth-of-type(2) {
    animation-delay: 0.7s;
}

.header-ping .ping-ring:nth-of-type(3) {
    animation-delay: 1.4s;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e8ecf4, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-link {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-lg);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* --- Stats Bar --- */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-xl);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Section --- */
.section {
    padding: var(--space-2xl) 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0;
}

/* --- Cards --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.tech-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-slow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tech-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.tech-card[data-tech="colmap"]::before {
    background: var(--gradient-purple);
}

.tech-card[data-tech="gsplat"]::before {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.tech-card[data-tech="potree"]::before {
    background: var(--gradient-green);
}

.tech-card[data-tech="threejs"]::before {
    background: var(--gradient-blue);
}

.tech-card[data-tech="meshroom"]::before {
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
}

.tech-card[data-tech="polycam"]::before {
    background: linear-gradient(90deg, #06b6d4, #10b981);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
    margin-bottom: var(--space-md);
}

.card-meta {
    display: flex;
    gap: var(--space-md);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- 3D Viewer --- */
.viewer-container {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.viewer-container canvas {
    display: block;
    width: 100%;
}

.viewer-overlay {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.viewer-stat {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px 10px;
    background: var(--bg-overlay);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-accent);
    backdrop-filter: blur(8px);
}

.viewer-controls {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    display: flex;
    gap: var(--space-xs);
}

.viewer-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-overlay);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(8px);
}

.viewer-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.15);
}

/* --- Viewer Toolbar --- */
.viewer-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toolbar-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.toolbar-select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    padding: var(--space-xs) var(--space-md);
    min-width: 260px;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b95a8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.toolbar-select:hover,
.toolbar-select:focus {
    border-color: var(--accent-purple);
    outline: none;
    box-shadow: var(--shadow-glow-blue);
}

.toolbar-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* --- File Upload Area --- */
.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl);
    margin-bottom: var(--space-md);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(26, 32, 53, 0.5);
    transition: all var(--transition-base);
}

.file-upload-area:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.05);
}

.upload-icon {
    font-size: 2rem;
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upload-btn {
    cursor: pointer;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 26, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    z-index: 10;
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-label {
    font-size: 0.9rem;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

/* --- Error Toast --- */
.error-toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    z-index: 200;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.error-toast.show {
    bottom: var(--space-xl);
}

/* --- Drag & Drop --- */
#viewer-3d.drag-over {
    outline: 3px dashed var(--accent-cyan);
    outline-offset: -3px;
}

#viewer-3d.drag-over::after {
    content: '📁 ファイルをドロップして読み込み';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 5;
    pointer-events: none;
    border-radius: var(--radius-lg);
}

/* --- Roadmap --- */
.roadmap {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding-left: var(--space-lg);
    border-left: 2px solid var(--border-color);
}

.roadmap-item {
    position: relative;
    padding-left: var(--space-lg);
}

.roadmap-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-lg) - 5px);
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--accent-purple);
    background: var(--bg-primary);
}

.roadmap-item.active::before {
    background: var(--accent-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.roadmap-item.done::before {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.roadmap-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.roadmap-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.roadmap-tag {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: var(--space-xs);
}

.tag-now {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.tag-next {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.tag-future {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-yellow);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.2);
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--space-lg) 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes ping {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* --- Utility --- */
.text-center {
    text-align: center;
}

.text-mono {
    font-family: var(--font-mono);
}

.text-accent {
    color: var(--text-accent);
}

.text-muted {
    color: var(--text-muted);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-1 {
    flex: 1;
}

/* --- Pipeline --- */
.pipeline-flow {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding-left: var(--space-xl);
}

.pipeline-connector {
    position: absolute;
    left: 18px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-purple), var(--accent-cyan), var(--accent-green));
    opacity: 0.3;
}

.pipeline-step {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-slow);
}

.pipeline-step:hover {
    border-color: var(--border-glow);
}

.pipeline-step.open {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-glow-blue);
}

.step-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    cursor: pointer;
    user-select: none;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-purple);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.step-info {
    flex: 1;
}

.step-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.step-brief {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.step-toggle {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.step-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid transparent;
}

.pipeline-step.open .step-details {
    border-top-color: var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-lg);
}

.detail-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.detail-card h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--accent-cyan);
}

.detail-card ul,
.detail-card ol {
    list-style: none;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.detail-card li::before {
    content: '•';
    color: var(--accent-purple);
    margin-right: var(--space-xs);
}

.detail-card ol li::before {
    content: none;
}

.detail-card ol {
    list-style: decimal;
    padding-left: var(--space-lg);
}

.detail-full {
    grid-column: 1 / -1;
}

.cmd-block {
    background: #0d1117;
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-cyan);
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

.step-tips {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: rgba(245, 158, 11, 0.05);
    border-top: 1px solid rgba(245, 158, 11, 0.1);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.tip-tag {
    flex-shrink: 0;
}

.tip-link {
    color: var(--accent-cyan);
    font-weight: 500;
    margin-left: var(--space-sm);
}

/* --- Requirement List --- */
.req-list {
    list-style: none;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.req-list li::before {
    content: '▸';
    color: var(--accent-purple);
    margin-right: var(--space-xs);
}

.req-list code {
    background: rgba(139, 92, 246, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.78rem;
    color: var(--accent-cyan);
}

/* --- Section Divider --- */
.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0;
    opacity: 0.3;
}

/* --- Comparison Table --- */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.comparison-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.comparison-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.comparison-table tr:hover td {
    background: rgba(139, 92, 246, 0.03);
}

.comparison-table .highlight-cell {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* --- Architecture Diagram --- */
.architecture-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.arch-layer {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.arch-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.arch-items {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.arch-item {
    flex: 1;
    min-width: 150px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

.arch-blue {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.arch-purple {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.arch-cyan {
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.arch-green {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.arch-orange {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.arch-pink {
    background: rgba(236, 72, 153, 0.12);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.arch-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* --- POI System --- */
.toolbar-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.toolbar-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.toolbar-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.2);
}

.poi-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    overflow-y: auto;
    z-index: 20;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.poi-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.poi-panel-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.poi-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.poi-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.poi-form {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.poi-form-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: var(--space-md);
}

.poi-field {
    margin-bottom: var(--space-sm);
}

.poi-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.poi-field input,
.poi-field select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
}

.poi-field input:focus,
.poi-field select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
}

.poi-coords {
    display: block;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.poi-coords.has-value {
    color: var(--accent-cyan);
    border-style: solid;
    border-color: rgba(6, 182, 212, 0.3);
}

.poi-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.poi-save-btn {
    flex: 1;
    font-size: 0.82rem;
    padding: 8px;
}

.poi-save-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.poi-list-section {
    padding: var(--space-md);
}

.poi-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.poi-list-actions {
    display: flex;
    gap: 4px;
}

.poi-small-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all var(--transition-base);
}

.poi-small-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.poi-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.poi-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.poi-item:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.04);
}

.poi-item-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.poi-item-info {
    flex: 1;
    min-width: 0;
}

.poi-item-name {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poi-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.poi-item-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: all var(--transition-base);
}

.poi-item:hover .poi-item-delete {
    opacity: 1;
}

.poi-item-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* POI 3D marker label (CSS2DRenderer) */
.poi-marker-label {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: var(--font-sans);
    color: #e2e8f0;
    pointer-events: auto;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.poi-marker-label:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.viewer-container {
    position: relative;
}

/* POI mode cursor */
.poi-mode-active canvas,
.wp-mode-active canvas {
    cursor: crosshair !important;
}

/* --- Navigation --- */
.navi-info {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.navi-info-header {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.navi-info-stat {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    text-align: center;
}

.navi-stat-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.navi-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.navi-directions {
    margin-top: var(--space-sm);
}

.navi-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.navi-step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.navi-step:hover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.04);
}

.navi-step-num {
    width: 22px;
    height: 22px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.navi-step-text {
    flex: 1;
    color: var(--text-secondary);
}

.navi-step-dist {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.navi-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.navi-select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
}

/* --- Measurement Tools --- */
.measure-points {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--space-sm);
    max-height: 120px;
    overflow-y: auto;
}

.measure-point-tag {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.measure-point-num {
    width: 18px;
    height: 18px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.measure-result {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    text-align: center;
}

.measure-result-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fbbf24;
    font-family: var(--font-mono);
}

.measure-result-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.measure-mode-active canvas {
    cursor: crosshair !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        gap: var(--space-lg);
        flex-wrap: wrap;
    }

    h1 {
        font-size: 1.8rem;
    }

    .header-title {
        font-size: 0.9rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .pipeline-flow {
        padding-left: var(--space-md);
    }
}

/* ═══ Reconstruction Page ═══ */
.recon-upload-area {
    min-height: 160px;
}

.recon-upload-area.drag-over {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, .08);
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.photo-preview-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.photo-preview-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.photo-preview-name {
    display: block;
    padding: 2px 6px;
    font-size: 0.6rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .7);
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jobs-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.jobs-empty {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.job-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border-left: 3px solid var(--border);
}

.job-status-running {
    border-left-color: var(--accent-cyan);
}

.job-status-completed {
    border-left-color: var(--accent-green);
}

.job-status-error {
    border-left-color: var(--accent-red, #ef4444);
}

.job-status-ready {
    border-left-color: var(--accent-purple);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.job-id {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-purple);
    margin-right: var(--space-sm);
}

.job-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.job-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.badge-ready {
    background: rgba(139, 92, 246, .15);
    color: var(--accent-purple);
}

.badge-running {
    background: rgba(6, 182, 212, .15);
    color: var(--accent-cyan);
}

.badge-completed {
    background: rgba(16, 185, 129, .15);
    color: var(--accent-green);
}

.badge-error {
    background: rgba(239, 68, 68, .15);
    color: #ef4444;
}

.job-card-body {
    margin-bottom: var(--space-sm);
    font-size: 0.85rem;
}

.job-progress {
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
    margin: var(--space-xs) 0;
}

.job-progress-bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 2px;
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {

    0%,
    100% {
        width: 30%;
        opacity: .7
    }

    50% {
        width: 70%;
        opacity: 1
    }
}

.job-progress-text {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin-top: 2px;
}

.job-result-info {
    display: flex;
    gap: var(--space-md);
    font-size: 0.8rem;
    color: var(--accent-green);
    margin-top: var(--space-xs);
}

.job-error-text {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: var(--space-xs);
}

.job-card-actions {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.75rem;
}

.btn-danger {
    background: rgba(239, 68, 68, .15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, .3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, .25);
}