@import "scrollbar.css";

/* 扁平化现代化样式 - 用于各测试项目的查看器页面 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary); /* Fallback */
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.06);
    --scrollbar-thumb: #cbd5e0;
    --scrollbar-thumb-hover: #a0aec0;
    --transition: all 0.3s ease;
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: #404040;
        --text-primary: #f8f9fa;
        --text-secondary: #adb5bd;
        --border-color: #495057;
        --accent-color: #0d6efd;
        --accent-hover: #0a58ca;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.2);
        --scrollbar-thumb: #4a5568;
        --scrollbar-thumb-hover: #718096;
    }
}


.navbar {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 6px 4px; /* 减小左右padding以适应按钮 */
    display: flex;
    align-items: center;
    gap: 0; /* 间隙由内部控制 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 90vw;
    /* 移除 overflow-x: auto，改由 .nav-scroll-area 控制 */
    transition: all 0.3s ease;
    opacity: 1;
}

/* 滚动区域容器 */
.nav-scroll-area {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    padding: 0 6px; /* 给内容一点呼吸空间 */
    scroll-behavior: smooth;
    max-width: calc(90vw - 60px); /* 预留按钮空间 */
}

.nav-scroll-area::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* 左右滚动按钮 */
.nav-scroll-btn {
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-scroll-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.nav-scroll-btn.visible {
    display: flex;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    margin: 0;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background-color: transparent;
    border: none;
    font-size: 13px;
    text-decoration: none;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-item.active {
    background-color: #ffffff;
    color: #000000;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Separator style */
.nav-separator {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
    flex-shrink: 0;
}


.nav-item.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.container {
    flex: 1;
    position: relative;
    overflow: hidden;
    margin-top: 70px; /* 为顶部导航栏预留空间 */
    height: calc(100vh - 70px); /* 减去 margin-top 的高度，防止溢出 */
}

iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    transition: opacity 0.3s;
    border-radius: 12px 12px 0 0; /* 顶部圆角，增加美感 */
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05); /* 顶部阴影分割 */
}

iframe.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 悬浮菜单和模态框样式 */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 12px;
}

.fab-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.fab-button:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.fab-button svg {
    width: 24px;
    height: 24px;
}

.fab-button.secondary {
    width: 48px;
    height: 48px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    z-index: 1;
    border: 1px solid var(--border-color);
}

.fab-button.secondary svg {
    width: 20px;
    height: 20px;
}

.fab-container:hover .fab-button.secondary,
.fab-container.active .fab-button.secondary {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fab-tooltip {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.75);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.fab-button:hover .fab-tooltip {
    opacity: 1;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-primary);
    width: 90%;
    max-width: 960px; /* 调整为更宽的横屏比例 */
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary); /* 确保头部背景色 */
    border-radius: 12px 12px 0 0; /* 顶部圆角 */
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    height: 70vh; /* 增加高度，配合宽度形成横屏比例 */
    background-color: var(--bg-primary);
}

.prompt-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

/* Dark mode support for iframe background if needed, 
   though prompt.html usually has its own styles. 
   We'll rely on prompt.html's styles. */
