/* =================================================================
 * 界址点坐标智能转换工具 - style.css
 * 版本：v8.7
 * 最后修改：2026-09-16
 * 状态：[已修改] 移除叠加图层样式
 * 作者：msyg
 * ================================================================= */

:root { 
    --primary: #2563eb; 
    --bg: #f8fafc; 
    --card: #ffffff; 
    --text: #1e293b; 
    --border: #cbd5e1; 
    --danger: #ef4444;
}
* { box-sizing: border-box; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-color: var(--bg); 
    color: var(--text); 
    margin: 0; 
    padding: 20px; 
    display: flex; 
    justify-content: center; 
}
.container { 
    background: var(--card); 
    border-radius: 12px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    width: 100%; 
    max-width: 960px; 
    padding: 24px; 
}

/* ===== Header ===== */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-bottom: 5px; 
}
h1 { font-size: 20px; margin: 0; color: var(--primary); }
.version-badge { 
    font-size: 12px; 
    background: #e0e7ff; 
    color: #3730a3; 
    padding: 3px 10px; 
    border-radius: 20px; 
    font-weight: 600; 
}
.author { font-size: 13px; color: #64748b; margin-top: 4px; }

/* ===== 坐标系信息条 ===== */
.crs-bar { 
    background: linear-gradient(135deg, #eff6ff, #e0e7ff); 
    border: 1px solid #bfdbfe; 
    border-radius: 8px; 
    padding: 10px 14px; 
    margin: 10px 0; 
    font-size: 13px; 
    color: #1e40af; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    align-items: center; 
    min-height: 42px; 
}
.crs-bar .tag { 
    background: #2563eb; 
    color: #fff; 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: 600; 
}
.crs-bar .item { display: flex; align-items: center; gap: 4px; }
.crs-bar.unknown { 
    background: #f1f5f9; 
    border-color: #cbd5e1; 
    color: #64748b; 
}
.crs-bar.unknown .tag { background: #94a3b8; }

.detect-badge { 
    display: inline-block; 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: 600; 
}
.badge-success { background: #10b981; color: white; }
.badge-warn { background: #f59e0b; color: white; }

/* ===== 警告区 ===== */
.warning-area { 
    background: #fef2f2; 
    border: 1px solid #fecaca; 
    border-left: 4px solid var(--danger); 
    padding: 12px; 
    border-radius: 6px; 
    margin-top: 10px; 
    font-size: 13px; 
    color: #991b1b; 
    line-height: 1.5; 
}

/* ===== 配置栏 ===== */
.map-config { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    background: #f1f5f9; 
    padding: 8px 12px; 
    border-radius: 6px; 
    margin: 10px 0; 
    font-size: 13px; 
    flex-wrap: wrap; 
}
.map-config input, .map-config select { 
    border: 1px solid var(--border); 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 13px; 
}

/* ===== 文件导入区 ===== */
.import-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    flex-wrap: wrap;
}
.import-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.import-btn:hover { background: #2563eb; }
.import-hint {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
}

/* ===== 表单 ===== */
label { font-weight: 600; font-size: 14px; display: block; margin: 12px 0 4px; }
textarea { 
    width: 100%; 
    height: 220px; 
    padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    font-family: monospace; 
    font-size: 13px; 
    resize: vertical; 
    box-sizing: border-box; 
    margin-top: 8px; 
}

/* ===== 格式说明折叠面板 ===== */
.format-guide { 
    margin-top: 10px; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    overflow: hidden; 
}
.format-guide-header { 
    background: #f8fafc; 
    padding: 10px 14px; 
    cursor: pointer; 
    font-size: 13px; 
    font-weight: 600; 
    color: #475569; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    user-select: none; 
    transition: 0.2s; 
}
.format-guide-header:hover { background: #eff6ff; color: var(--primary); }
.format-guide-header .arrow { font-size: 10px; transition: transform 0.3s; }
.format-guide-body { 
    padding: 12px 14px; 
    background: #ffffff; 
    border-top: 1px solid var(--border); 
    font-size: 12px; 
    color: #475569; 
    line-height: 1.6; 
}
.format-guide-body table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.format-guide-body th, .format-guide-body td { 
    border: 1px solid #e2e8f0; 
    padding: 6px 8px; 
    text-align: left; 
}
.format-guide-body th { 
    background: #f1f5f9; 
    font-weight: 600; 
    color: #334155; 
}
.format-guide-body code { 
    background: #f1f5f9; 
    padding: 1px 4px; 
    border-radius: 3px; 
    font-family: monospace; 
    color: #b91c1c; 
}

/* ===== 按钮 ===== */
.btn-group { 
    margin-top: 12px; 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
}
button { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 10px 16px; 
    border-radius: 6px; 
    font-size: 14px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: 0.2s; 
}
button:hover { background: #1d4ed8; }
button.secondary { background: #e2e8f0; color: var(--text); }
button.secondary:hover { background: #cbd5e1; }
button.success { background: #10b981; } 
button.success:hover { background: #059669; }
button.geojson-btn { background: #8b5cf6; } 
button.geojson-btn:hover { background: #7c3aed; }
button.csv-btn { background: #f59e0b; } 
button.csv-btn:hover { background: #d97706; }
button.dxf-btn { background: #ef4444; } 
button.dxf-btn:hover { background: #dc2626; }
button.shp-btn { background: #0891b2; } 
button.shp-btn:hover { background: #0e7490; }
button.txt-btn { background: #64748b; } 
button.txt-btn:hover { background: #475569; }

/* ===== 提示框 ===== */
.alert { 
    padding: 12px; 
    background: #fef3c7; 
    color: #92400e; 
    border-radius: 6px; 
    font-size: 13px; 
    margin-top: 10px; 
    line-height: 1.5; 
}
.alert-info { background: #e0f2fe; color: #0369a1; }

/* ===== 数据概览 ===== */
.info-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px; 
    background: #f8fafc; 
    padding: 10px; 
    border-radius: 8px; 
    border: 1px solid var(--border); 
}
.info-item { display: flex; flex-direction: column; }
.info-item .label { 
    font-size: 11px; 
    color: #64748b; 
    font-weight: normal; 
}
.info-item .value { 
    font-size: 13px; 
    font-weight: 600; 
    color: var(--primary); 
    margin-top: 2px; 
}
.info-item .value.coord { 
    font-family: monospace; 
    font-size: 12px; 
    color: #dc2626; 
    user-select: all; 
    cursor: text; 
}

/* ===== 面板标题 ===== */
.panel-title { 
    font-size: 14px; 
    font-weight: 600; 
    margin-bottom: 5px; 
    color: #475569; 
}

/* ===== Footer ===== */
.footer { 
    margin-top: 30px; 
    padding-top: 15px; 
    border-top: 1px solid var(--border); 
    font-size: 12px; 
    color: #94a3b8; 
    text-align: center; 
}

/* =================================================================
 * 弹窗 (Modal)
 * ================================================================= */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.7); 
    display: none; 
    z-index: 1000; 
    align-items: center; 
    justify-content: center; 
}
.modal-overlay.active { display: flex; }
.modal-content { 
    background: #ffffff; 
    border-radius: 12px; 
    width: 90%; 
    max-width: 1100px; 
    height: 88%; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); 
}
.modal-close { 
    position: absolute; 
    top: 15px; 
    right: 20px; 
    font-size: 32px; 
    cursor: pointer; 
    color: #94a3b8; 
    line-height: 1; 
    z-index: 10; 
}
.modal-close:hover { color: #ef4444; }
.modal-header { 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--primary); 
    margin-bottom: 15px; 
}

.modal-body { 
    display: flex; 
    flex: 1; 
    gap: 20px; 
    overflow: hidden; 
}
@media (max-width: 768px) { 
    .modal-body { flex-direction: column; } 
}

/* ===== 弹窗左侧：地图 ===== */
.modal-map-section { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
    gap: 8px;
}
.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}
.basemap-select {
    font-size: 12px;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
}

/* ===== 地图包裹层 ===== */
.map-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 8px;
    overflow: hidden;
}
.modal-map-container { 
    width: 100%; 
    height: 100%; 
    min-height: 300px;
}

/* =================================================================
 * 全屏模式
 * ================================================================= */
.modal-map-section:fullscreen,
.modal-map-section:-webkit-full-screen {
    padding: 15px;
    background: #ffffff;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.modal-map-section:fullscreen > .map-wrapper,
.modal-map-section:-webkit-full-screen > .map-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    position: relative;
}
.modal-map-section:fullscreen .modal-map-container,
.modal-map-section:-webkit-full-screen .modal-map-container {
    width: 100%;
    height: 100%;
    min-height: 0;
}
.modal-map-section:fullscreen > .map-header,
.modal-map-section:fullscreen > #tdtKeyStatus,
.modal-map-section:fullscreen > .offset-control,
.modal-map-section:-webkit-full-screen > .map-header,
.modal-map-section:-webkit-full-screen > #tdtKeyStatus,
.modal-map-section:-webkit-full-screen > .offset-control {
    flex-shrink: 0;
}

/* ===== 全屏按钮 ===== */
.fullscreen-btn {
    position: absolute; 
    top: 10px; 
    right: 10px; 
    z-index: 1001;
    background: rgba(255, 255, 255, 0.95); 
    border: 1px solid #cbd5e1;
    border-radius: 4px; 
    width: 32px; 
    height: 32px; 
    cursor: pointer;
    font-size: 18px; 
    color: #475569; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    padding: 0; 
    transition: 0.2s; 
    font-weight: normal;
}
.fullscreen-btn:hover { 
    background: #eff6ff; 
    color: #2563eb; 
    border-color: #2563eb; 
}

/* ===== 坐标微调面板 ===== */
.offset-control { 
    flex-shrink: 0;
    padding: 10px 12px; 
    background: #f8fafc; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    font-size: 12px; 
}
.offset-title { 
    font-weight: 600; 
    color: #475569; 
    margin-bottom: 8px; 
}
.offset-row { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    flex-wrap: wrap; 
}
.offset-row label { 
    display: inline; 
    font-size: 12px; 
    font-weight: normal; 
    color: #64748b; 
    margin: 0; 
}
.offset-row input { 
    width: 80px; 
    padding: 4px 8px; 
    border: 1px solid var(--border); 
    border-radius: 4px; 
    font-size: 12px; 
    font-family: monospace; 
}
.mini-btn { 
    padding: 5px 12px; 
    font-size: 12px; 
    border-radius: 4px; 
}
.mini-btn.secondary { 
    background: #e2e8f0; 
    color: #475569; 
}
.mini-btn.secondary:hover { background: #cbd5e1; }

/* ===== 弹窗右侧：画板 ===== */
.modal-canvas-section { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
    overflow-y: auto; 
    padding-right: 5px; 
}
.modal-canvas-container { 
    flex: 1; 
    border: 1px solid var(--border); 
    background: #f8fafc; 
    border-radius: 8px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: hidden; 
    min-height: 250px; 
}
.modal-canvas-container canvas { 
    background: #ffffff; 
    max-width: 100%; 
    max-height: 100%; 
}

/* ===== 弹窗底部导出区 ===== */
.modal-footer { 
    flex-shrink: 0; 
    border-top: 1px solid var(--border); 
    padding-top: 15px; 
    margin-top: 15px; 
}

/* ===== 自动闭合选项 ===== */
.auto-close-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.auto-close-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0369a1;
    cursor: pointer;
    margin: 0;
}
.auto-close-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2563eb;
}
.auto-close-hint {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 600;
}
.auto-close-hint.closed { background: #ecfdf5; color: #065f46; }

/* ===== 地图加载状态提示 ===== */
.map-status { 
    position: absolute; 
    top: 10px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: rgba(255, 255, 255, 0.95); 
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 600; 
    color: #475569; 
    z-index: 1000; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.15); 
    pointer-events: none; 
    transition: all 0.3s ease; 
}
.status-dot { 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    background: #f59e0b; 
    animation: pulse 1.5s infinite; 
}
.map-status.success .status-dot { 
    background: #10b981; 
    animation: none; 
}
.map-status.error .status-dot { 
    background: #ef4444; 
    animation: none; 
}
.map-status.error { 
    background: #fef2f2; 
    color: #991b1b; 
    border: 1px solid #fecaca; 
}
@keyframes pulse { 
    0% { opacity: 0.4; } 
    50% { opacity: 1; } 
    100% { opacity: 0.4; } 
}

/* ===== 天地图 Key 状态栏 ===== */
.tdt-key-status { 
    flex-shrink: 0;
    font-size: 12px; 
    padding: 6px 10px; 
    border-radius: 6px; 
    background: #f1f5f9; 
    color: #64748b; 
    line-height: 1.5; 
    word-break: break-all; 
}
.tdt-key-status.success { 
    background: #ecfdf5; 
    color: #065f46; 
    border: 1px solid #a7f3d0; 
}
.tdt-key-status.warn { 
    background: #fffbeb; 
    color: #92400e; 
    border: 1px solid #fde68a; 
}
.tdt-key-status a { 
    color: #2563eb; 
    text-decoration: underline; 
    font-weight: 600; 
    cursor: pointer; 
}

/* =================================================================
 * style.css 结束 | 版本：v8.7 | 最后修改：2026-09-16
 * ================================================================= */