* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: #1f2937;
    background: #f3f6fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.app-shell {
    min-height: 100vh;
    padding: 20px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 30px;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-entry-btn {
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-entry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.3);
}

.auth-entry-btn.is-logged-in {
    background: linear-gradient(135deg, #0f766e, #2563eb);
}

.logout-btn {
    padding: 9px 13px;
    border: 0;
    border-radius: 999px;
    color: #b91c1c;
    background: #fee2e2;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.logout-btn:hover {
    color: #ffffff;
    background: #dc2626;
    box-shadow: 0 10px 22px rgba(220, 38, 38, 0.22);
    transform: translateY(-1px);
}

.main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    height: calc(100vh - 118px);
    min-height: 560px;
}

.map-panel,
.landmark-panel {
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.map-panel {
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.map-status {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 10;
    max-width: calc(100% - 36px);
    padding: 10px 14px;
    border-radius: 999px;
    color: #334155;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    font-size: 14px;
}

.landmark-panel {
    display: flex;
    flex-direction: column;
}

.toolbox {
    overflow-y: auto;
    max-height: 52%;
    padding: 14px;
    border-bottom: 1px solid #e5edf6;
    background: #f8fbff;
}

.tool-card {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
}

.tool-card:last-child {
    margin-bottom: 0;
}

.tool-card h2,
.tool-card h3 {
    margin: 0 0 12px;
    color: #0f172a;
}

.tool-card h2 {
    font-size: 18px;
}

.tool-card h3,
.add-card summary {
    font-size: 15px;
    font-weight: 700;
}

.tool-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tool-title h2 {
    margin-bottom: 0;
}

.field-label,
.tool-card label {
    display: block;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.keyword-label {
    margin-top: 12px;
}

.tool-card input,
.tool-card select,
.tool-card textarea {
    width: 100%;
    margin-top: 6px;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    background: #ffffff;
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card input:focus,
.tool-card select:focus,
.tool-card textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.form-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.primary-btn,
.ghost-btn,
.secondary-btn,
.danger-btn {
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
    width: 100%;
    padding: 10px 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.ghost-btn {
    padding: 7px 12px;
    color: #2563eb;
    background: #dbeafe;
}

.secondary-btn {
    padding: 9px 12px;
    color: #ffffff;
    background: #0f766e;
}

.danger-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 14px;
    color: #b91c1c;
    background: #fee2e2;
}

.primary-btn:hover,
.ghost-btn:hover,
.secondary-btn:hover,
.danger-btn:hover {
    transform: translateY(-1px);
}

.primary-btn:active,
.ghost-btn:active,
.secondary-btn:active,
.danger-btn:active {
    transform: translateY(0);
}

.secondary-btn:hover {
    background: #0d9488;
    box-shadow: 0 10px 22px rgba(13, 148, 136, 0.22);
}

.danger-btn:hover {
    color: #ffffff;
    background: #dc2626;
    box-shadow: 0 10px 22px rgba(220, 38, 38, 0.22);
}

.data-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.data-actions .secondary-btn,
.import-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 39px;
    min-height: 39px;
    margin: 0;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.import-file-btn {
    border: 0;
    color: #1d4ed8;
    background: #dbeafe;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.import-file-btn:hover {
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.hidden-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.result-box {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #1e3a8a;
    background: #eff6ff;
    font-size: 13px;
    line-height: 1.6;
}

.add-card summary {
    color: #0f172a;
    cursor: pointer;
}

.add-card.is-editing {
    border-color: #f59e0b;
    background: #fffbeb;
}

.add-card.is-editing summary {
    color: #b45309;
}

.add-card.is-flashing {
    animation: editPulse 1.2s ease;
}

@keyframes editPulse {
    0%,
    100% {
        box-shadow: none;
    }

    40% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28), 0 14px 30px rgba(245, 158, 11, 0.18);
    }
}

.add-form {
    margin-top: 12px;
}

.add-form label {
    margin-bottom: 10px;
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.form-actions .primary-btn {
    width: 100%;
}

.hidden {
    display: none !important;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 12px;
    border-bottom: 1px solid #e5edf6;
}

.panel-title h2 {
    margin-bottom: 0;
    font-size: 20px;
}

.panel-title span {
    color: #2563eb;
    font-weight: 700;
}

.landmark-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.landmark-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 10px;
    padding: 13px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: inherit;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.landmark-card:hover {
    border-color: #60a5fa;
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.landmark-card.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.16);
}

.landmark-card.is-highlighted {
    border-color: #f59e0b;
    background: #fffbeb;
}

.landmark-card.is-selected.is-highlighted {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #fffbeb);
}

.card-main {
    min-width: 0;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.edit-btn,
.delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 999px;
    color: #b91c1c;
    background: #fee2e2;
    font-size: 12px;
    font-weight: 700;
}

.edit-btn {
    color: #1d4ed8;
    background: #dbeafe;
}

.edit-btn:hover {
    color: #ffffff;
    background: #2563eb;
}

.delete-btn:hover {
    color: #ffffff;
    background: #dc2626;
}

.landmark-card strong {
    display: block;
    margin-bottom: 7px;
    font-size: 16px;
}

.tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 12px;
}

.address {
    margin-bottom: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.distance {
    margin: 7px 0 0;
    color: #b45309;
    font-size: 13px;
    font-weight: 700;
}

.empty-tip {
    padding: 24px 12px;
    color: #64748b;
    text-align: center;
}

.info-window {
    max-width: 300px;
    line-height: 1.6;
}

.info-window h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 17px;
}

.info-window p {
    margin-bottom: 6px;
    color: #475569;
}

.coordinate-text {
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-weight: 700;
}

.info-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.info-edit-btn,
.info-copy-btn,
.info-delete-btn,
.info-amap-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 10px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: #2563eb;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.info-edit-btn:hover,
.info-copy-btn:hover,
.info-delete-btn:hover,
.info-amap-link:hover {
    transform: translateY(-1px);
}

.info-edit-btn:hover,
.info-copy-btn:hover {
    background: #1d4ed8;
}

.info-copy-btn {
    background: #4f46e5;
}

.info-delete-btn.danger {
    background: #dc2626;
}

.info-delete-btn.danger:hover {
    background: #b91c1c;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.22);
}

.info-amap-link {
    background: #16a34a;
}

.info-amap-link:hover {
    background: #15803d;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.22);
}

.marker-label {
    padding: 4px 8px;
    border-radius: 999px;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.marker-label.selected {
    background: #2563eb;
}

.marker-label.highlighted {
    background: #f59e0b;
}

.search-center-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    color: #ffffff;
    background: #ef4444;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.34);
    font-size: 14px;
    font-weight: 800;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    max-width: min(360px, calc(100vw - 44px));
    padding: 13px 16px;
    border-radius: 14px;
    color: #ffffff;
    background: #0f172a;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

.toast.info {
    background: #2563eb;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
}

.auth-modal {
    width: min(430px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-eyebrow {
    margin: 0 0 4px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.modal-header h2 {
    margin-bottom: 0;
    color: #0f172a;
    font-size: 22px;
}

.modal-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: #475569;
    background: #f1f5f9;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.modal-close-btn:hover {
    color: #ffffff;
    background: #dc2626;
    transform: rotate(90deg);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    padding: 5px;
    border-radius: 999px;
    background: #f1f5f9;
}

.auth-tab {
    border: 0;
    border-radius: 999px;
    padding: 9px 12px;
    color: #475569;
    background: transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-tab.active {
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.auth-form label {
    display: block;
    margin-bottom: 12px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    margin-top: 6px;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #0f172a;
    background: #ffffff;
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.auth-placeholder {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #1e3a8a;
    background: #eff6ff;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .page-header {
        align-items: center;
        gap: 8px;
    }

    .header-actions {
        max-width: 100%;
    }

    .auth-entry-btn,
    .logout-btn {
        padding: 9px 13px;
        font-size: 14px;
    }

    .main-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .map-panel {
        height: 58vh;
        min-height: 420px;
    }

    .landmark-panel {
        max-height: 420px;
    }

    .toolbox {
        max-height: 220px;
    }

    .toast {
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 520px) {
    .app-shell {
        padding: 12px;
    }

    h1 {
        font-size: 24px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .auth-entry-btn {
        max-width: calc(100% - 72px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .two-columns {
        grid-template-columns: 1fr;
    }

    .data-actions,
    .info-actions {
        grid-template-columns: 1fr;
    }
}