* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #eef1f5;
    font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
    color: #333;
}

/* 全屏地图 */
.map-full {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: #dde6ee;
}

.hidden {
    display: none !important;
}

/* 地图加载失败 / 未配置 key 时显示的提示层 */
.map-msg {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #5b6672;
    font-size: 13px;
    line-height: 2;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
}
.map-msg b {
    color: #c62828;
}

/* ============ 顶部单行 ============ */
.topbar {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 460px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.93);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 7px 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.tb-label {
    font-size: 13px;
    color: #1f6feb;
    font-weight: 700;
    white-space: nowrap;
}
.tb-input {
    flex: 1;
    min-width: 0;
    padding: 7px 9px;
    font-size: 14px;
    border: 1px solid #c9d2dd;
    border-radius: 8px;
    background: #fafbfc;
    outline: none;
    color: #333;
}
.tb-input:focus {
    border-color: #1f6feb;
    background: #fff;
}
.tb-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 15px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    outline: none;
    display: flex;
    align-items: center;
    -webkit-user-select: none;
    user-select: none;
}
.tb-create {
    background: #1f6feb;
}
.tb-del {
    background: #fff;
    color: #c62828;
    border: 1px solid #eec5c5;
}

/* ============ 定位状态文字（在底部工具条内） ============ */
.gps-state {
    color: #9aa0a6;
    font-weight: 700;
    white-space: nowrap;
}
.gps-state.on {
    color: #16a34a;
}
.gps-state.err {
    color: #c62828;
}

/* ============ 左侧方形按钮列 ============ */
.ctrl {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* 白底方块：emoji 图标保持自身颜色清晰可见 */
.sq {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    background: #fff;
    color: #333;
    font-size: 23px;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    text-decoration: none;
    outline: none;
    touch-action: manipulation;
}
.sq:active {
    transform: scale(0.92);
}
.sq:disabled {
    opacity: 0.35;
    pointer-events: none;
}
/* 创建模式可用时的 ➕/✔️ 给个淡彩底，一眼知道“可添加/可完成” */
.sq.ready-add {
    background: #fdecea;
    border-color: #f3b8b3;
}
.sq.ready-fin {
    background: #e9f8ee;
    border-color: #a9e3bd;
}

/* ============ 打卡面板（右下） ============ */
.check-card {
    position: fixed;
    right: 10px;
    bottom: 56px;
    width: min(300px, calc(100vw - 84px));
    max-height: 46vh;
    z-index: 25;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    background: #f0f4f9;
    border-bottom: 1px solid #e6ebf1;
}
.cc-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f6feb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cc-x {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #e8edf3;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}
.cc-my {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    font-size: 11.5px;
    color: #666;
    border-bottom: 1px solid #f0f3f6;
}
.cc-my b {
    color: #1f6feb;
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc-list {
    overflow-y: auto;
    padding: 2px 10px 10px;
}
.empty-list {
    text-align: center;
    color: #9aa0a6;
    font-size: 12px;
    padding: 14px 0;
}

/* 打卡列表里的标记点行 */
.cpt {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 0;
    border-bottom: 1px dashed #e9edf2;
    font-size: 12px;
}
.cpt:last-child {
    border-bottom: none;
}
.dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e53935;
    border: 1px solid #b71c1c;
}
.dot.done {
    background: #16a34a;
    border-color: #0f7a37;
}
.cpt .info {
    flex: 1;
    min-width: 0;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cpt .info b {
    color: #e53935;
}
.cpt .info b.done {
    color: #16a34a;
}
.cpt .dist {
    flex-shrink: 0;
    font-size: 11px;
    color: #16a34a;
    font-weight: 600;
    min-width: 52px;
    text-align: right;
}
.cpt .ck {
    flex-shrink: 0;
    min-width: 54px;
    padding: 5px 8px;
    border: none;
    border-radius: 12px;
    background: #1f6feb;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}
.cpt .ck.done {
    background: #16a34a;
}
.cpt .ck.cancel {
    background: #e8edf3;
    color: #888;
}

/* 地图信息窗内按钮 */
.iw-btn {
    display: inline-block;
    margin-top: 6px;
    margin-right: 8px;
    padding: 6px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    outline: none;
}
.iw-btn.primary {
    background: #16a34a;
}
.iw-btn.warn {
    background: #e53935;
}

/* ============ 采样提示（toast，屏幕中上部） ============ */
.toast {
    position: fixed;
    left: 50%;
    top: 26%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 88%;
    padding: 13px 20px;
    border-radius: 14px;
    background: rgba(24, 28, 36, 0.9);
    color: #fff;
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.toast.ok {
    background: rgba(22, 163, 74, 0.95);
}
.toast.warn {
    background: rgba(255, 158, 31, 0.96);
    color: #3a2a05;
}
.toast.err {
    background: rgba(198, 40, 40, 0.95);
}

/* ============ 底部一行工具条 ============ */
.bottombar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 30;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 5px 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
/* 定位开关 / 移到这里 */
.bb {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 9px;
    border: none;
    border-radius: 10px;
    background: #f0f3f7;
    color: #333;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}
.bb:active {
    transform: scale(0.95);
}
.bb-blue {
    background: #e9f1fe;
    min-width: 0;
}
.bb-ico {
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
}
.bb-coord {
    font-family: Consolas, Monaco, monospace;
    color: #1f6feb;
    font-size: 11px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bb-tag {
    flex-shrink: 0;
    font-size: 11px;
    color: #6b7280;
    font-weight: 700;
}
.bb-divider {
    flex-shrink: 0;
    width: 1px;
    height: 22px;
    background: #e3e8ee;
}
/* 图例区：剩余宽度内排一行，放不下可横向轻滑 */
.bb-legend {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding-left: 2px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.bb-legend::-webkit-scrollbar {
    display: none;
}
.bb-legend .lg {
    flex-shrink: 0;
}
.lg {
    display: flex;
    align-items: center;
    gap: 4px;
}
.lg-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.lg-dot.red {
    background: #e53935;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e53935;
}
.lg-dot.green {
    background: #16a34a;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #16a34a;
}
.lg-dot.blue {
    background: #1f6feb;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #1f6feb;
}
.lg-line {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    background: #ff5b45;
    display: inline-block;
}
