/* ========================================
   微信文档收集表风格 - 全局样式
   ======================================== */

:root {
    --bg-white: #fff;
    --bg-gray: #f2f3f5;
    --bg-gray-light: #f7f8fa;
    --text-primary: #10141a;
    --text-secondary: rgba(11, 18, 26, 0.6);
    --text-placeholder: rgba(11, 18, 26, 0.35);
    --border-light: rgba(6, 15, 26, 0.08);
    --border-medium: rgba(6, 15, 26, 0.12);
    --accent-blue: #3370ff;
    --accent-green: #07C160;
    --error-red: #f04a3e;
    --warning-orange: #ff9800;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-gray);
    min-height: 100vh;
    padding: 0;
}

/* ========================================
   页面容器 - 带封面图
   ======================================== */

.container {
    max-width: 640px;
    margin: 0 auto;
    background-color: var(--bg-gray);
    min-height: 100vh;
    position: relative;
}

/* 封面图区域 */
.form-cover {
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #a855f7 50%, #ec4899 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}

.debug-files-top-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.debug-files-top-btn:hover {
    background: #fff;
}

/* 表单卡片 */
.form-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: -20px;
    position: relative;
    min-height: calc(100vh - 100px);
    padding: 24px 20px 40px;
}

/* 页面标题 */
.form-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

/* 顶部操作栏 */
.form-header-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

/* ========================================
   表单字段样式 - 底部边框风格
   ======================================== */

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.required {
    color: var(--error-red);
    margin-right: 2px;
}

.field-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    pointer-events: none;
}

.field-hint-warning {
    color: var(--warning-orange);
    margin-top: 8px;
    margin-bottom: 0;
}

/* 输入框 - 底部边框样式 */
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    height: 40px;
    padding: 8px 0;
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border-medium);
    border-radius: 0;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-placeholder);
}

/* 授权码输入框placeholder字号减小 */
.form-group input[name$="_auth_code"]::placeholder {
    font-size: 12px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-bottom-color: var(--accent-blue);
}

.form-group input.error,
.form-group textarea.error {
    border-bottom-color: var(--error-red);
}

/* 下拉选择框 - 底部边框样式 */
.form-group select {
    width: 100%;
    height: 40px;
    padding: 8px 28px 8px 0;
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border-medium);
    border-radius: 0;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2310141a' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
}

.form-group select:focus {
    outline: none;
    border-bottom-color: var(--accent-blue);
}

/* 只读输入框 */
input[readonly] {
    cursor: pointer;
}

input[readonly]:hover {
    border-bottom-color: var(--accent-blue);
}

/* 错误提示 */
.error-message {
    display: none;
    color: var(--error-red);
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
}

/* 限制提示 */
.limit-message {
    display: none;
    color: var(--warning-orange);
    font-size: 13px;
    margin-top: 12px;
    padding: 10px 14px;
    background-color: #fff8e6;
    border-radius: var(--radius-sm);
}

/* ========================================
   单选按钮组
   ======================================== */

.radio-group {
    display: flex;
    gap: 24px;
    margin-top: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 0;
}

.radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

/* ========================================
   提交按钮 - 居中圆角
   ======================================== */

.submit-btn {
    display: block;
    width: 160px;
    height: 44px;
    margin: 40px auto 0;
    padding: 0 32px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    background-color: var(--accent-blue);
    border: none;
    border-radius: 22px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.submit-btn:hover {
    background-color: #2860d8;
}

.submit-btn:active {
    background-color: #1e4fc2;
}

.submit-btn:disabled {
    background-color: #a0c4ff;
    cursor: not-allowed;
}

/* ========================================
   通用按钮
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
    line-height: 1.5;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #fff;
}

.btn-primary:hover {
    background-color: #2860d8;
}

.btn-secondary {
    background-color: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
}

.btn-outline {
    background: var(--bg-white);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.btn-outline:hover {
    background: rgba(51, 112, 255, 0.05);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ========================================
   设备条目样式
   ======================================== */

.device-entry {
    background-color: var(--bg-gray-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.device-entry:nth-child(odd) {
    background-color: #f0f5ff;
}

.device-entry:nth-child(even) {
    background-color: #f6ffed;
}

.device-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-medium);
}

.device-entry-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.device-entry-header h3 .entry-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: var(--accent-blue);
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
    margin-left: 6px;
}

.delete-entry-btn {
    background-color: transparent;
    color: var(--error-red);
    border: 1px solid var(--error-red);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    flex-shrink: 0;
}

.delete-entry-btn:hover {
    background-color: var(--error-red);
    color: #fff;
}

.floor-fields {
    background-color: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 16px;
}

.add-device-btn {
    display: block;
    width: auto;
    height: 36px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 400;
    color: var(--accent-blue);
    background-color: var(--bg-white);
    border: 1px dashed var(--border-medium);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 12px auto 0;
}

.add-device-btn:hover {
    border-color: var(--accent-blue);
    background-color: rgba(51, 112, 255, 0.02);
}

.add-device-btn:disabled {
    color: var(--text-placeholder);
    border-color: var(--border-light);
    cursor: not-allowed;
}

#camera_area h2,
#dvr_area h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

#dvr_area h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

/* ========================================
   图片上传组件 - 大区域样式
   ======================================== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-uploader {
    margin-top: 12px;
}

.image-upload-area {
    width: 100%;
    height: 100px;
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-gray-light);
    transition: border-color 0.2s, background-color 0.2s;
    color: var(--text-placeholder);
    font-size: 14px;
}

.image-upload-area:hover {
    border-color: var(--accent-blue);
    background: rgba(51, 112, 255, 0.02);
}

.image-upload-area:active {
    background: rgba(51, 112, 255, 0.05);
}

.image-upload-preview {
    width: 100px;
    height: 100px;
    position: relative;
    display: none;
}

.image-upload-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    display: block;
}

.image-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-delete-btn:active {
    background: rgba(0, 0, 0, 0.7);
}

.image-upload-loading {
    width: 100%;
    height: 100px;
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-md);
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray-light);
}

.image-upload-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.upload-error {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #fef2f2;
    color: var(--error-red);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* ========================================
   图片全屏预览
   ======================================== */

.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    cursor: pointer;
}

.image-lightbox img {
    max-width: 92%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    user-select: none;
    touch-action: none;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

.image-lightbox-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    -webkit-overflow-scrolling: touch;
}

.image-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-lightbox-close:active {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   地图选择器样式
   ======================================== */

.map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.map-picker-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.map-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.map-cancel-btn,
.map-send-btn {
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.map-cancel-btn {
    background: none;
    color: var(--accent-blue);
}

.map-cancel-btn:active {
    opacity: 0.6;
}

.map-send-btn {
    background-color: var(--accent-green);
    color: #fff;
    font-weight: 500;
}

.map-send-btn:active {
    background-color: #06AD56;
}

.map-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.map-canvas {
    height: 50vh;
    width: 100%;
    position: relative;
}

.map-center-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 50;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.map-locate-btn {
    position: absolute;
    right: 15px;
    bottom: 15px;
    width: 44px;
    height: 44px;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    color: var(--accent-blue);
    transition: all 0.2s;
}

.map-locate-btn:active {
    transform: scale(0.95);
    background-color: #f5f5f5;
}

.map-permission-tip {
    position: absolute;
    top: 60px;
    left: 10px;
    right: 10px;
    background: rgba(255, 152, 0, 0.9);
    color: #fff;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
}

.map-bottom-panel {
    height: 50vh;
    background-color: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-search-container {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-light);
}

.map-search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-gray-light);
    border-radius: var(--radius-md);
    padding: 0 12px;
    height: 40px;
}

.map-search-box .search-icon {
    flex-shrink: 0;
    margin-right: 8px;
}

.map-search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    min-height: auto;
    padding: 0;
}

.map-search-box input::placeholder {
    color: var(--text-placeholder);
}

.search-clear-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ccc;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
}

.search-clear-btn:active {
    background: #999;
}

.current-address-panel {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.address-item {
    position: relative;
    padding: 14px 45px 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s;
}

.address-item:active {
    background-color: var(--bg-gray-light);
}

.address-item.selected {
    background-color: var(--bg-gray-light);
}

.address-name {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}

.address-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.check-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.search-results-panel {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.search-results-list {
    padding-bottom: 20px;
}

.search-result-item {
    position: relative;
    padding: 14px 45px 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:active {
    background-color: var(--bg-gray-light);
}

.search-result-item.selected {
    background-color: var(--bg-gray-light);
}

.search-result-item .address-name {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.search-result-item .address-detail {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.search-result-distance {
    font-size: 11px;
    color: var(--text-placeholder);
}

.highlight {
    color: var(--accent-green);
    font-weight: 500;
}

.current-address-panel::-webkit-scrollbar,
.search-results-panel::-webkit-scrollbar {
    width: 4px;
}

.current-address-panel::-webkit-scrollbar-thumb,
.search-results-panel::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.current-address-panel::-webkit-scrollbar-track,
.search-results-panel::-webkit-scrollbar-track {
    background-color: transparent;
}

/* ========================================
   通用页面布局（历史/详情页）
   ======================================== */

.page-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
}

.page-header {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.page-body {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ========================================
   加载 / 空状态 / 错误状态
   ======================================== */

.page-loading {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.page-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e8e8e8;
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

.page-empty {
    text-align: center;
    padding: 48px 20px;
}

.page-empty-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.page-empty-icon svg {
    width: 28px;
    height: 28px;
    stroke: #ccc;
    stroke-width: 2;
}

.page-empty-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.page-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--error-red);
    font-size: 13px;
}

/* ========================================
   提交历史列表
   ======================================== */

.submission-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.submission-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: border-color 0.2s;
    cursor: pointer;
}

.submission-card:active {
    background: var(--bg-gray-light);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: nowrap;
}

.card-id {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.card-header .card-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.badge-camera {
    background: #eef4ff;
    color: #2563eb;
}

.badge-dvr {
    background: #fef3c7;
    color: #d97706;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.card-info .info-item {
    display: flex;
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.5;
}

.card-info .info-label {
    min-width: 60px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.card-info .info-value {
    color: var(--text-primary);
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.card-time {
    font-size: 11px;
    color: var(--text-placeholder);
}

.card-actions {
    display: flex;
    gap: 6px;
}

/* ========================================
   分页
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-medium);
    background: var(--bg-white);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: border-color 0.2s, color 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 6px;
}

/* ========================================
   详情页
   ======================================== */

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    line-height: 1.5;
}

.detail-label {
    min-width: 90px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.detail-value {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    word-break: break-all;
}

.device-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
}

.device-card:last-child {
    margin-bottom: 0;
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.device-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.device-card-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-monitor {
    background: #fef3c7;
    color: #d97706;
}

.device-image {
    margin-top: 12px;
}

.device-image img {
    display: block;
    max-width: 200px;
    max-height: 150px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-gray-light);
    padding: 4px;
}

.no-image {
    padding: 16px;
    background: var(--bg-gray-light);
    border-radius: var(--radius-md);
    color: var(--text-placeholder);
    font-size: 12px;
    text-align: center;
}

/* ========================================
   搜索框
   ======================================== */

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.serial-numbers {
    word-break: break-all;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.action-icon:hover {
    background: var(--bg-gray-light);
    color: var(--accent-blue);
}

.action-icon svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Toast 提示
   ======================================== */

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    z-index: 10000;
    max-width: 80%;
    text-align: center;
    animation: toastFadeIn 0.2s ease;
}

.toast.toast-success {
    background: rgba(7, 193, 96, 0.9);
}

.toast.toast-error {
    background: rgba(240, 74, 62, 0.9);
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ========================================
   消息提示
   ======================================== */

.message {
    margin-top: 20px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-align: center;
    display: none;
}

.message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
}

.message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
}

/* ========================================
   移动端响应式
   ======================================== */

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .form-cover {
        height: 100px;
    }

    .form-card {
        padding: 20px 16px 32px;
    }

    .form-title {
        font-size: 17px;
    }

    .radio-group {
        gap: 20px;
    }

    .device-entry {
        padding: 16px;
    }

    .device-entry-header {
        flex-direction: row;
        align-items: center;
        gap: 0;
    }

    .delete-entry-btn {
        width: auto;
    }

    .page-wrap {
        padding: 12px;
    }

    .page-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding: 14px 16px;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
        text-align: center;
    }

    .page-body {
        padding: 14px;
    }

    .card-footer {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .card-footer .card-actions {
        width: 100%;
    }

    .card-footer .card-actions .btn {
        flex: 1;
        text-align: center;
    }

    .detail-row {
        flex-direction: column;
        gap: 2px;
    }

    .detail-label {
        min-width: auto;
    }

    .map-top-bar {
        height: 50px;
    }

    .map-bottom-panel {
        height: 50vh;
    }
}

/* ========================================
   新用户权限引导弹窗
   ======================================== */

.permission-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.permission-guide-overlay.fade-out {
    animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.permission-guide-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 340px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px 20px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.permission-guide-header {
    text-align: center;
    margin-bottom: 16px;
}

.permission-guide-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.permission-guide-content {
    margin-bottom: 24px;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.guide-item:last-child {
    margin-bottom: 0;
}

.guide-number {
    width: 22px;
    height: 22px;
    background: var(--accent-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.guide-text {
    flex: 1;
    margin-left: 10px;
}

.guide-text p {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.guide-text strong {
    color: var(--accent-blue);
}

.guide-sub {
    font-size: 12px !important;
    color: var(--text-secondary) !important;
    margin-top: 6px !important;
}

.guide-warning {
    color: var(--warning-orange) !important;
}

.copy-link {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-blue);
    cursor: pointer;
}

.copy-link:active {
    opacity: 0.7;
}

.copy-link.copied {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    cursor: pointer;
    vertical-align: middle;
}

.help-icon:active {
    opacity: 0.7;
}

.permission-guide-btn {
    display: block;
    width: 100%;
    height: 44px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.permission-guide-btn:active {
    background: #2860d8;
}

/* ========================================
   权限确认弹窗
   ======================================== */

.permission-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.permission-confirm-modal {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.permission-confirm-image {
    width: 100%;
    max-height: 50vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.permission-confirm-image img {
    max-width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    touch-action: none;
}

.permission-confirm-content {
    width: 100%;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.permission-confirm-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 16px;
}

.permission-confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.permission-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.permission-btn:active {
    opacity: 0.8;
}

.permission-btn-allow {
    background: var(--accent-blue);
    color: #fff;
}

.permission-btn-deny {
    background: var(--bg-gray);
    color: var(--text-secondary);
}

/* 权限拒绝提示弹窗 */
.permission-denied-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.permission-denied-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    width: 100%;
    max-width: 280px;
    text-align: center;
}

.permission-denied-icon {
    margin-bottom: 16px;
}

.permission-denied-text {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.permission-denied-btn {
    width: 100%;
    height: 40px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.permission-denied-btn:active {
    background: #2860d8;
}

/* ========================================
   扫码按钮
   ======================================== */

.scan-btn-container {
    margin-bottom: 16px;
}

.scan-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.scan-btn:active {
    background: #2860d8;
}

.scan-btn svg {
    flex-shrink: 0;
}

/* ========================================
   二维码扫描器
   ======================================== */

.qr-scanner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 10003;
    display: flex;
    flex-direction: column;
}

.qr-scanner-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.qr-scanner-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
}

.qr-scanner-close {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-scanner-title {
    color: #fff;
    font-size: 17px;
    font-weight: 500;
}

.qr-scanner-video-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qr-scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-scanner-frame {
    position: absolute;
    width: 250px;
    height: 250px;
    border: none;
}

.qr-scanner-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--accent-green);
    border-style: solid;
    border-width: 0;
}

.qr-scanner-corner.top-left {
    top: 0;
    left: 0;
    border-top-width: 3px;
    border-left-width: 3px;
}

.qr-scanner-corner.top-right {
    top: 0;
    right: 0;
    border-top-width: 3px;
    border-right-width: 3px;
}

.qr-scanner-corner.bottom-left {
    bottom: 0;
    left: 0;
    border-bottom-width: 3px;
    border-left-width: 3px;
}

.qr-scanner-corner.bottom-right {
    bottom: 0;
    right: 0;
    border-bottom-width: 3px;
    border-right-width: 3px;
}

.qr-scanner-tip {
    padding: 15px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.3);
}

.qr-scanner-actions {
    padding: 20px;
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.qr-scanner-capture-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.qr-scanner-capture-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   调试资料弹窗
   ======================================== */

.debug-files-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.debug-files-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.debug-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.debug-files-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.debug-files-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
}

.debug-files-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.debug-files-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.debug-file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-gray);
    cursor: pointer;
    transition: background 0.2s;
}

.debug-file-item:hover {
    background: #e8e8e8;
}

.debug-file-item:last-child {
    margin-bottom: 0;
}

.debug-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.debug-file-icon.image {
    background: #e3f2fd;
    color: #1976d2;
}

.debug-file-icon.pdf {
    background: #ffebee;
    color: #c62828;
}

.debug-file-icon.video {
    background: #f3e5f5;
    color: #7b1fa2;
}

.debug-file-icon.bilibili {
    background: #ffebee;
    color: #fb7299;
}

.debug-file-info {
    flex: 1;
    min-width: 0;
}

.debug-file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.debug-file-size {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.debug-file-actions {
    display: flex;
    gap: 8px;
}

.debug-file-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.debug-file-btn.preview {
    background: var(--accent-blue);
    color: #fff;
}

.debug-file-btn.preview:hover {
    background: #2860d8;
}

.debug-file-btn.download {
    background: #e0e0e0;
    color: #333;
}

.debug-file-btn.download:hover {
    background: #d0d0d0;
}

.debug-files-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .form-card {
        padding: 18px 14px 28px;
    }

    .form-title {
        font-size: 16px;
        padding-bottom: 14px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 24px;
    }

    .submit-btn {
        width: 140px;
        height: 40px;
        font-size: 14px;
        margin-top: 32px;
    }

    .device-entry {
        padding: 14px;
        margin-bottom: 12px;
    }

    #camera_area h2,
    #dvr_area h2 {
        font-size: 14px;
    }

    #dvr_area h3 {
        font-size: 13px;
    }
}

/* ========================================
   授权码验证样式
   ======================================== */

/* 授权码验证成功标记（绿色勾） */
.auth-code-success-mark {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* 设备在线验证成功标记（绿色勾） */
.device-online-success-mark {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* 授权码错误弹窗样式 */
.auth-code-error-overlay {
    z-index: 10001;
}

/* 设备错误弹窗样式 */
.device-error-overlay {
    z-index: 10001;
}

.device-error-modal {
    max-width: 400px;
}

.device-error-content {
    padding: 20px 24px;
}

.device-error-serial {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.device-error-serial strong {
    color: var(--accent-blue);
    font-weight: 600;
}

.device-error-msg {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.device-error-tip {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.auth-code-error-modal {
    max-width: 320px;
}

.auth-code-error-content {
    text-align: center;
    padding: 0 10px;
}

.auth-code-error-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.auth-code-error-content .auth-error-code {
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-all;
}

.auth-code-error-content .auth-error-code strong {
    color: var(--text-primary);
    font-weight: 600;
}

.auth-code-error-content .auth-error-msg {
    font-size: 15px;
    color: var(--error-red);
    font-weight: 500;
}

.auth-code-error-content .auth-error-device {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-gray);
    padding: 10px 12px;
    border-radius: 6px;
    text-align: left;
}

.auth-code-error-content .auth-error-device-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-code-error-content .auth-error-device p {
    margin-bottom: 4px;
}

.auth-code-error-content .auth-error-device p:last-child {
    margin-bottom: 0;
}

.auth-code-error-content .auth-error-tip {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 16px;
}
