html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

#app-container {
    height: 100vh;
    width: 100vw;
    position: relative;
}

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

#auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-image: url('img/oldmap.jpg');
    background-size: cover;
    background-position: center;
}

.auth-form {
    padding: 40px;
    width: 350px;
    text-align: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.25);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    border-radius: 50%;
}

.auth-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #3D2B1F;
    font-weight: 600;
}

.auth-form input {
    width: 95%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(61, 43, 31, 0.3);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(245, 245, 220, 0.6);
    color: #3D2B1F;
}

.auth-form input::placeholder {
    color: #6a4f4b;
}

.auth-form .button-group {
    display: flex;
    justify-content: space-between;
}

.auth-form button {
    width: 31%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
}

.auth-form button:active {
    transform: scale(0.98);
}

.auth-form button:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#btn-login {
    background-color: #5a3e2b;
    color: #f5f5dc;
}

#btn-signup {
    background-color: rgba(245, 245, 220, 0.678);
    color: #1a1611;
    border: 2px solid #8c7853;
}

#btn-guest {
    background-color: #778899;
    color: white;
}

/* --- 通用地图控件样式 --- */
.leaflet-control-container .leaflet-bar,
.leaflet-control-container select,
.leaflet-control-container button {
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65) !important;
    border-radius: 4px !important;
    border: 2px solid rgba(0, 0, 0, 0.2) !important;
}

.leaflet-top,
.leaflet-bottom,
.leaflet-left,
.leaflet-right {
    padding: 10px;
}

.leaflet-top.leaflet-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.leaflet-top.leaflet-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.leaflet-control-container .dropdown-menu {
    position: relative;
}

#map-style-selector {
    width: auto;
    padding: 0 10px;
    height: 40px;
}

#locate-button {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50% !important;
}

#add-marker-button,
#locate-button {
    font-size: 24px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50% !important;
}

#add-marker-button.active {
    background-color: #007bff;
    color: white;
}

#locate-button {
    background-color: #f8f9fa;
    color: #343a40;
}

#logout-button,
#import-button,
#export-button,
#image-import-button {
    font-size: 14px;
    padding: 8px 12px;
    height: 40px;
}

.leaflet-control-zoom {
    border-radius: 4px !important;
}

/* --- 搜索栏样式 --- */
.leaflet-bottom.leaflet-left {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    width: calc(100% - 40px);
    max-width: 500px;
    z-index: 1000;
}

.leaflet-control-search {
    width: 100%;
    background-color: white;
    padding: 8px;
    border-radius: 25px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    position: relative;
}

.leaflet-control-search input {
    border: none;
    padding: 8px;
    outline: none;
    flex-grow: 1;
    font-size: 16px;
    background: transparent;
}

.leaflet-control-search button {
    background-color: #302e31;
    color: white;
    cursor: pointer;
    border-radius: 50% !important;
    ;
    border: none;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#search-results {
    position: absolute;
    bottom: 110%;
    left: 0;
    width: 100%;
    background-color: white;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

#search-results div {
    padding: 10px;
    cursor: pointer;
}

#search-results div:hover {
    background-color: #f4f4f4;
}

#search-results h5 {
    margin: 0;
    padding: 8px 10px;
    background-color: #eee;
    font-size: 12px;
    color: #555;
}

/* --- 弹窗样式 --- */
.popup-content {
    width: 250px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    padding-bottom: 50px;
}

.popup-content .edit-form-container {
    margin-top: 15px;
}

.popup-content .edit-form-container input[type="text"],
.popup-content .edit-form-container textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: inherit;
}

.popup-content .edit-form-container textarea {
    resize: vertical;
    min-height: 60px;
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 15px;
}

.popup-bottom-actions {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: flex-end;
}

.popup-content button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
}

.popup-content button:active {
    transform: scale(0.98);
}

.popup-content button:hover {
    background-color: #218838;
}


.popup-content .save-button {
    background-color: #28a745;
    color: white;
}

.popup-content .save-button:hover {
    background-color: #218838;
}

.popup-content .cancel-button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.popup-content .cancel-button:hover {
    background-color: #e0e0e0;
}

.popup-content .edit-button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.popup-content .edit-button:hover {
    background-color: #e0e0e0;
}


.emoji-marker {
    background: transparent;
    border: none;
    text-align: center;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.popup-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.upload-status {
    font-size: 12px;
    color: #007bff;
    min-height: 1em;
}

.popup-date {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.emoji-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.emoji-input-wrapper select {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.popup-delete-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    color: #888;
    transition: color 0.2s;
}

.popup-delete-button:hover {
    color: #d9534f;
}


/* --- 时间轴控件样式 --- */
#time-slider-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: center;
}

#time-slider {
    width: 100%;
}

.slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#time-slider {
    flex-grow: 1;
    margin: 0;
}

.slider-controls button {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

.slider-controls button:hover {
    background-color: #f0f0f0;
}

#year-display {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}


/* --- Dropdown Menu 样式 --- */
.dropdown-menu {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.85);
    color: #333;
    padding: 10px 15px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-toggle:hover {
    background-color: rgba(240, 240, 240, 0.9);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.dropdown-toggle .menu-icon {
    transition: transform 0.3s ease-in-out;
}

.dropdown-menu.active .menu-icon {
    transform: rotate(90deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 220px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 1001;
    border-radius: 12px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    top: 100%;
    margin-top: 10px;
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.dropdown-menu.active .dropdown-content {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.dropdown-content button,
.dropdown-content .select-wrapper {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    color: #333;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-content button:hover {
    background-color: #f1f1f1;
}

.dropdown-content button.active {
    background-color: #e8f4fc;
    font-weight: bold;
}

.dropdown-content button.active::before {
    content: "✓";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #007bff;
}

.dropdown-content button#import-button svg {
    color: #28a745;
}

.dropdown-content button#export-button svg {
    color: #ffc107;
}

.dropdown-content button#image-import-button svg {
    color: #17a2b8;
}

.dropdown-content hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 10px 0;
}

.dropdown-content .map-style-selector-wrapper {
    padding: 8px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-content #menu-map-style-selector {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: transparent;
}

.service-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:checked+.slider:before {
    transform: translateX(16px);
}

.map-add-marker-mode {
    cursor: crosshair !important;
}

/* --- 新增：SVG标记点样式 --- */
.svg-marker {
    background: none;
    border: none;
    text-align: center;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.svg-marker svg {
    width: 100%;
    height: 100%;
}

/* --- 新增：Logo 样式 --- */
#my-logo {
    position: fixed;
    bottom: 10px;
    left: 10px;
    width: 50px;
    height: 50px;
    opacity: 0.7;
    z-index: 1000;
    pointer-events: none;
    border-radius: 50%;
}

/* 旅行家旅程控件样式 */
#journey-container {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    text-align: center;
    min-width: 300px;
}

#journey-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

#traveler-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    min-width: 180px;
}

#clear-journey {
    padding: 8px 12px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#clear-journey:hover {
    background-color: #5a6268;
}

/* 旅程标题样式 */
#journey-title {
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
}

/* 旅程路径样式 */
.journey-path {
    stroke: #ff6b6b;
    stroke-width: 3;
    stroke-dasharray: 10, 5;
    fill: none;
    animation: journeyFlow 3s infinite linear;
}

@keyframes journeyFlow {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -15;
    }
}

.journey-marker {
    background: none;
    border: none;
}

.journey-popup {
    font-size: 12px;
    max-width: 200px;
}

.journey-popup h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.journey-popup p {
    margin: 4px 0;
    color: #666;
}

/* 旅程时代信息样式 */
#journey-era-info {
    position: absolute;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 998;
    text-align: center;
    font-size: 14px;
    max-width: 400px;
    border-left: 4px solid #ff6b6b;
}

/* 调整旅程容器位置以避免重叠 */
#journey-container {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    text-align: center;
    min-width: 300px;
}

/* 新增： geocoder的样式 */
.leaflet-control-geocoder {
    border-radius: 25px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    padding: 8px;
    background-color: white !important;
}

.leaflet-control-geocoder .leaflet-control-geocoder-form input {
    border: none !important;
    padding: 8px !important;
    outline: none !important;
    flex-grow: 1 !important;
    font-size: 16px !important;
    background: transparent !important;
}

.leaflet-control-geocoder-form button {
    display: none;
}