/* ========================
   通用设置：深蓝主题 + 白字统一
   ======================== */

body {
    background-color: #001E3C;
    color: #ffffff;
    font-family: 'Microsoft YaHei', sans-serif;
    margin: 0;
}

.grid-layout {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar main";
    grid-template-columns: 220px 1fr;
    grid-template-rows: 80px auto;
    height: 100vh;
}

/* 顶部栏 */
.page-header {
    grid-area: header;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 80px;
    box-shadow: 0 2px 6px rgba(0, 255, 255, 0.2);
    text-align: center;
    padding: 0;
}

.page-header h1,
.page-header p {
    margin: 0;
}

.page-header h1 {
    font-size: 24px;
}

.page-header p {
    font-size: 12px;
}

/* 左侧导航栏样式 */
.sidebar a {
    display: block;
    padding: 10px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 悬停效果 */
.sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    /* 比较柔和的透明白 */
    color: #ffffff;
}

/* 当前选中项（高亮） */
.sidebar a.active {
    background-color: rgba(255, 255, 255, 0.2);
    /* 更明显一点的选中态 */
    color: #ffffff;
}


/* 主区域内容 */
.main-content {
    grid-area: main;
    padding: 20px;
    overflow-y: auto;
    box-shadow: inset 0 0 12px rgba(0, 255, 255, 0.2);
    /* 内阴影，向内发光 */
}

/* 卡片区域 */
.section {
    background: rgba(0, 153, 255, 0.08);
    border: 1px solid rgba(0, 153, 255, 0.3);
    box-shadow: 0 0 8px rgba(0, 153, 255, 0.4);
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 20px;
}

/* 标题 */
h2,
h3,
h4,
h5 {
    border-left: 5px solid #00ffff;
    padding-left: 10px;
}

/* 表单控件 */
form input[type="file"] {
    margin-top: 10px;
    margin-bottom: 10px;
}

.btn {
    background: linear-gradient(to right, #007bff, #00ffff);
    color: #ffffff;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    background: linear-gradient(to right, #00ffff, #007bff);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.7);
}


/* 视频样式 */
video {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 10px;
}

/* 列表样式 */
ul {
    list-style-type: none;
    padding: 0;
}

ul li {
    margin-bottom: 5px;
}

ul li a {
    color: #ffffff;
    text-decoration: none;
}

ul li a:hover {
    color: #00ffff;
    text-decoration: underline;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th,
td {
    border: 1px solid #bbb;
    padding: 8px;
    text-align: center;
}

th {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 说明文字 */
.note {
    font-size: 0.9em;
    color: #ffffff;
    margin-top: 4px;
}

/* 帧图展示 */
.frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px 24px;
    margin-top: 20px;
}

.frame-item a {
    display: block;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s;
}

.frame-item a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #00ffff;
}

/* 分页控件 */
.pagination {
    margin-top: 20px;
    text-align: center;
    color: #ffffff;
}

.pagination a {
    margin: 0 5px;
    color: #ffffff;
    text-decoration: none;
}

.pagination a:hover {
    color: #00ffff;
}

.pagination strong {
    margin: 0 5px;
    color: #ffffff;
}

/* 图表统计容器 */
.stats-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 地区/颜色统计文本展示 */
.fallback-stats {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    font-size: 15px;
    color: #ffffff;
}

.fallback-stats ul {
    list-style: disc inside;
    margin-left: 10px;
    color: #ffffff;
}


#loading,
#recognition-status {
    background: rgba(0, 153, 255, 0.08);
    border: 1px solid rgba(0, 153, 255, 0.3);
    box-shadow: 0 0 8px rgba(0, 153, 255, 0.4);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    color: #ffffff;
}


#loading p {
    font-weight: 600;
    font-size: 16px;
}

#progress-log {
    padding: 12px;
    border-radius: 8px;
    color: #ccc;
    height: 180px;
    overflow-y: auto;
    font-size: 13px;
    margin-top: 10px;
}

.progress-hint {
    text-align: center;
    font-weight: bold;
    color: #ffffff;
    font-size: 16px;
}

/* 视频项容器，便于定位删除按钮 */
.video-item {
    position: relative;
    padding-right: 30px;
    /* 给删除按钮腾点右边空间 */
}

/* 删除按钮默认隐藏 */
.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    color: red;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: none;
}

/* 鼠标悬停时显示删除按钮 */
.video-item:hover .delete-btn {
    display: inline;
}

/* 删除按钮悬停样式 */
.delete-btn:hover {
    color: darkred;
}

/* 美化上传文件按钮样式 */
.file-label {
    display: inline-block;
    font-weight: bold;
    background: linear-gradient(to right, #007bff, #00ffff);
    padding: 10px 20px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    margin-top: 10px;
}

.file-label:hover {
    background: linear-gradient(to right, #00ffff, #007bff);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
}

.file-label input[type="file"] {
    display: none;
    /* 隐藏原生按钮 */
}

/* ------------------------------
   表单整体布局：横向一行多个输入项，支持换行
-------------------------------- */
.form-row {
    display: flex;
    gap: 20px;
    /* 控件之间间距 */
    flex-wrap: wrap;
    /* 小屏幕换行 */
    align-items: flex-start;
    margin-bottom: 15px;
}

/* ------------------------------
   单个输入项布局：垂直排列 label + input
-------------------------------- */
.form-item {
    flex: 1;
    min-width: 240px;
    /* 保证控件不会太窄 */
    display: flex;
    flex-direction: column;
}

/* ------------------------------
   label 样式（控件说明文字）
-------------------------------- */
.form-item label {
    font-weight: bold;
    margin-bottom: 6px;
    /* 与输入框间距 */
    color: #ffffff;
    display: block;
}

/* ------------------------------
   输入框 / 下拉框通用样式（深色主题统一风格）
-------------------------------- */
.form-item input[type="text"],
.form-item input[type="number"],
.form-item input[type="password"],
.form-item select {
    width: 100%;
    max-width: 400px;
    /* ✅ 限制最大宽度，防止撑满整个页面 */
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ------------------------------
   输入框 focus 高亮边框效果
-------------------------------- */
.form-item input:focus,
.form-item select:focus {
    border-color: #00ffff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}