/* ===== 读者地图 - 后台样式 ===== */

/* 主容器 */
.rm-admin { padding: 0 0 20px 0; }

/* 统计卡片 */
.rm-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.rm-stat-card {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.2s;
}
.rm-stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.rm-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.rm-icon-user { background: linear-gradient(135deg, #667eea, #764ba2); }
.rm-icon-eye  { background: linear-gradient(135deg, #f093fb, #f5576c); }
.rm-icon-pin  { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.rm-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}
.rm-stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

/* 地图区域 */
.rm-map-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    margin-bottom: 20px;
}
.rm-map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 10px;
}
.rm-map-title { display: flex; align-items: center; gap: 10px; }
.rm-map-title-text { font-size: 16px; font-weight: 600; color: #1a1a2e; }
.rm-map-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e8f4fd;
    color: #1890ff;
    text-transform: uppercase;
}
.rm-map-actions { display: flex; gap: 8px; }

/* 按钮 */
.rm-btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.5;
}
.rm-btn:hover { border-color: #bbb; background: #f9f9f9; }
.rm-btn-sm { padding: 4px 12px; font-size: 12px; }
.rm-btn-active { background: #1890ff; border-color: #1890ff; color: #fff; }
.rm-btn-active:hover { background: #40a9ff; border-color: #40a9ff; }
.rm-btn-danger { color: #ff4d4f; border-color: #ffa39e; }
.rm-btn-danger:hover { background: #fff1f0; border-color: #ff7875; }

/* 地图画布 */
.rm-map-wrapper { padding: 20px; }
.rm-map-canvas-box {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #f8fbff 0%, #f0f5ff 100%);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}
.rm-map-canvas-box svg,
.rm-map-canvas-box canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
#readerMapSvg { z-index: 1; }
#readerMapCanvas { z-index: 2; pointer-events: none; }

/* 加载状态 */
.rm-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(255,255,255,0.85);
    color: #888;
    gap: 12px;
}
.rm-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: rm-spin 0.8s linear infinite;
}
@keyframes rm-spin { to { transform: rotate(360deg); } }

/* 空状态 */
.rm-empty {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #bbb;
    gap: 8px;
}
.rm-empty p { margin: 0; font-size: 14px; }
.rm-empty-sub { font-size: 12px !important; color: #ccc; }

/* 工具提示 */
.rm-tooltip {
    position: absolute;
    z-index: 20;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, -130%);
    line-height: 1.6;
}
.rm-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.8);
}
.rm-tooltip-city { font-weight: 600; font-size: 13px; }
.rm-tooltip-count { color: #ffd666; }

/* 图例 */
.rm-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}
.rm-legend-label { font-size: 12px; color: #888; }
.rm-legend-bar {
    width: 180px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, rgba(0,100,255,0.5), rgba(0,200,100,0.6), rgba(255,200,0,0.7), rgba(255,50,50,0.8));
}
.rm-legend-text { display: flex; gap: 120px; font-size: 11px; color: #aaa; }

/* 城市排行 */
.rm-cities-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}
.rm-cities-title {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    border-bottom: 1px solid #f0f0f0;
}
.rm-table-wrap { overflow-x: auto; }
.rm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.rm-table th {
    background: #fafafa;
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
.rm-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
}
.rm-table tr:last-child td { border-bottom: none; }
.rm-table tr:hover td { background: #fafcff; }

/* 排名徽章 */
.rm-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: #f0f0f0;
    color: #888;
}
.rm-rank-1 { background: #ffd700; color: #fff; }
.rm-rank-2 { background: #c0c0c0; color: #fff; }
.rm-rank-3 { background: #cd7f32; color: #fff; }

/* 访问次数徽章 */
.rm-count-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: #e6f7ff;
    color: #1890ff;
    font-weight: 600;
    font-size: 12px;
}

/* ===== 设置页面 ===== */
.rm-setting-wrap { padding: 20px; }
.rm-setting-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 24px;
}
.rm-form-item {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 500px;
}
.rm-form-item label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
.rm-form-item input,
.rm-form-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.rm-form-item input:focus,
.rm-form-item select:focus { border-color: #1890ff; }
.rm-form-tip { font-size: 12px; color: #999; margin: 0; }
.rm-btn-primary {
    padding: 8px 24px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.rm-btn-primary:hover { background: #40a9ff; }
.rm-btn-link {
    display: inline-block;
    margin-left: 12px;
    color: #1890ff;
    text-decoration: none;
    font-size: 14px;
    line-height: 2;
}

/* 响应式 */
@media (max-width: 768px) {
    .rm-stats-row { flex-direction: column; }
    .rm-stat-card { min-width: auto; }
    .rm-map-toolbar { flex-direction: column; align-items: flex-start; }
    .rm-map-actions { flex-wrap: wrap; }
    .rm-legend-text { gap: 60px; }
    .rm-legend-bar { width: 120px; }
}
