@charset "UTF-8";

:root {
    --ck-green: #0bb07b;
    --ck-green-dark: #049a69;
    --ck-bg: #f7f8fa;
    /* Global Light Gray */
    --ck-card: #ffffff;
    --ck-text: #1f2937;
    --ck-sub: #9ca3af;
    --ck-border: #ebedf0;
    --ck-active-bg: #e6f7f1;
    /* Light green for bubbles */
}

[v-cloak] {
    display: none;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--ck-bg);
    color: var(--ck-text);
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    padding-bottom: 80px;
    /* Space for Tabbar */
}

/* --- Standard Navbar --- */
.navbar {
    background: #fff;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid var(--ck-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 12px;
}

.navbar-title {
    font-size: 17px;
    font-weight: 600;
    color: #000;
    flex: 1;
    text-align: left;
    padding-right: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-actions {
    position: absolute;
    right: 12px;
    top: 0;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.navbar-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0bb07b;
    border-radius: 8px;
    background: #f0fdf9;
    border: 1px solid #d6f5ea;
}

.navbar-actions .spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.global-loading {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.loading-card {
    background: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
}

.loading-text {
    font-size: 15px;
    color: #0f172a;
}

/* --- Login Page --- */
.login-container {
    padding: 24px 16px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
}

.login-sub {
    color: var(--ck-sub);
    font-size: 14px;
}

/* --- TTI Card Style --- */
.tti-card {
    background: #fff;
    margin: 12px 16px;
    padding: 16px;
    border-radius: 8px;
    /* Clean, no deep shadow */
}

.tti-card-title {
    font-size: 17px;
    font-weight: 500;
    margin: 0 0 12px;
    color: #000;
}

/* --- Bubble Grid --- */
.bubble-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bubble {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    position: relative;
    /* transition: all 0.2s; */
}

.bubble.status-0 {
    background: #e5e7eb;
    border-color: #f3f4f6;
}

.bubble.status-1 {
    background: #12b76a;
    border-color: #ecfdf3;
    color: #ffffff;
}

.bubble.status--2 {
    background: #f59e0b;
    border-color: #fff7ed;
    color: #7c2d12;
}

.bubble.status--1 {
    background: #f04438;
    border-color: #fef2f2;
    color: #ffffff;
}

.bubble.status-2 {
    background: #1677ff;
    border-color: #eff6ff;
    color: #ffffff;
}

/* --- Legend --- */
.status-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    background: #fff;
    padding: 8px 0;
    font-size: 12px;
    color: var(--ck-sub);
    border-bottom: 1px solid var(--ck-border);
    /* Separator */
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

/* --- Action Button --- */
.scan-action-bar {
    position: sticky;
    bottom: 88px;
    left: 0;
    right: 0;
    padding: 12px 16px 20px;
    background: linear-gradient(180deg, rgba(247, 248, 250, 0) 0%, #f7f8fa 45%, #f7f8fa 100%);
    z-index: 90;
}

/* --- Discovery List --- */
.discovery-list {
    background: #fff;
    margin-top: 10px;
}

.discovery-cell {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--ck-border);
    background: #fff;
    cursor: pointer;
}

.discovery-cell:active {
    background-color: #f9fafb;
}

.discovery-divider {
    height: 10px;
    background: var(--ck-bg);
    border-top: 1px solid var(--ck-border);
    border-bottom: 1px solid var(--ck-border);
}

.discovery-icon {
    font-size: 20px;
    color: var(--ck-green);
    margin-right: 12px;
    display: flex;
}

.discovery-text {
    flex: 1;
    font-size: 16px;
    color: #000;
}

.discovery-arrow {
    color: #c7c7cc;
    /* iOS gray arrow */
    font-size: 16px;
}

.discovery-popup {
    padding: 0;
    height: 92vh;
    max-height: 92vh;
    width: 100vw;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
}

@supports (-webkit-touch-callout: none) {
    .discovery-popup {
        height: 88vh;
        max-height: 88vh;
    }
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: #fff;
    padding: calc(12px + env(safe-area-inset-top)) 12px 8px;
    z-index: 2;
}

.popup-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.popup-close {
    color: #111827;
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
}

.discovery-body {
    font-size: 15px;
    line-height: 1.6;
    color: #111827;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    margin: 0;
    padding: 0 12px 12px 0;
    width: 100%;
}

.discovery-body iframe {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: 0;
    display: block;
    flex: 1;
}

.discovery-body .discovery-embed {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    margin: 0 -12px 0 0;
}

.discovery-body .discovery-embed iframe {
    flex: 1;
    min-height: 0;
    height: 100%;
}

/* 移动端滚动条优化 */
.discovery-body::-webkit-scrollbar {
    width: 3px;
}

.discovery-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0);
    border-radius: 999px;
    transition: background 0.2s ease;
}

.discovery-body::-webkit-scrollbar-track {
    background: transparent;
}

.discovery-body:hover::-webkit-scrollbar-thumb {
    background: #cfd3dc;
}

/* --- Profile --- */
.profile-header {
    background: #fff;
    padding: 32px 16px;
    text-align: center;
    position: relative;
    margin-bottom: 10px;
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.profile-email {
    margin-top: 6px;
    font-size: 14px;
    color: #6b7280;
}

.feedback-btn {
    position: absolute;
    top: 16px;
    right: 16px;
}

.profile-info {
    background: #fff;
    padding: 0 16px;
}

.info-row {
    display: flex;
    padding: 16px 0;
    border-bottom: 1px solid var(--ck-border);
    font-size: 16px;
}

.info-label {
    width: 100px;
    color: var(--ck-sub);
}

.info-value {
    flex: 1;
    color: #000;
}

.logout-bar {
    margin-top: 32px;
    padding: 0 16px;
}

.failure-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 32px;
    text-align: center;
    background: #fff;
}

.failure-overlay h2 {
    margin: 24px 0 12px;
    font-size: 22px;
    color: #1f2937;
}

.failure-overlay p {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* --- Discovery Loading & Skeleton --- */
.discovery-body.is-loading {
    min-height: 70vh;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite linear;
}

.discovery-body.is-loading * {
    visibility: hidden !important;
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.discovery-loading-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Install Guide --- */
.install-guide-popup {
    padding: 0;
    height: 92vh;
    max-height: 92vh;
    width: 100vw;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
}

@supports (-webkit-touch-callout: none) {
    .install-guide-popup {
        height: 88vh;
        max-height: 88vh;
    }
}

.install-guide-body {
    padding: 8px 16px 96px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    color: #111827;
    font-size: 15px;
    line-height: 1.7;
}

.install-guide-section {
    margin-bottom: 16px;
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #eef2f7;
}

.install-guide-section h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #0f172a;
}

.install-guide-section p {
    margin: 0;
    color: #4b5563;
}

.install-guide-section ol {
    margin: 0;
    padding-left: 18px;
    color: #4b5563;
}

.install-guide-section li {
    margin: 6px 0;
}

.install-guide-tip {
    margin-top: 4px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}

.install-guide-action {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}
