* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    color: #1f2933;
    background-color: #f5f7fa;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header,
footer {
    padding: 1rem 1.5rem;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

header h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}

header p {
    margin: 0;
    color: #52606d;
}

header .control-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

header .control-group label {
    font-weight: 600;
    color: #1f2933;
}

.session-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.session-indicator {
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
    background-color: #e2e8f0;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
}

.session-indicator.developer {
    color: #78350f;
    background-color: #fef3c7;
}

.session-button {
    border: 1px solid #94a3b8;
    background-color: #ffffff;
    color: #0f172a;
    padding: 0.3rem 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.session-button:hover,
.session-button:focus-visible {
    border-color: #2563eb;
    color: #1d4ed8;
}

.session-button.primary {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.session-button.primary:hover,
.session-button.primary:focus-visible {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.session-button.ghost {
    background-color: transparent;
}

.session-button.full-width {
    width: 100%;
}

header .control-group select {
    min-width: 160px;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #cbd2d9;
    background-color: #f8fafc;
    font-size: 0.95rem;
    color: #1f2933;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

header .control-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    background-color: #ffffff;
}

main {
    flex: 1 1 auto;
    display: flex;
    min-height: calc(100vh - 220px);
}

#map {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 220px);
}

.map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #c81e1e;
    font-size: 1.1rem;
    text-align: center;
    padding: 2rem;
}

a {
    color: #1d70b8;
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

.login-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 2000;
}

.login-overlay.active {
    display: flex;
}

.login-panel {
    width: 100%;
    max-width: 360px;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-panel h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.login-description {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: #0f172a;
}

.login-field input {
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-error {
    min-height: 1rem;
    font-size: 0.85rem;
    color: #dc2626;
}

.popup-content {
    min-width: 200px;
    font-size: 13px;
    color: #1f2933;
}

.popup-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.popup-info {
    font-size: 12px;
    color: #52606d;
    line-height: 1.4;
}

.popup-info.secondary {
    color: #6b7280;
}

.popup-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

.popup-button {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    background-color: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.popup-button:hover {
    background-color: #1d4ed8;
}

.popup-button.cancel {
    background-color: #6b7280;
}

.popup-button.cancel:hover {
    background-color: #4b5563;
}

.popup-label {
    font-size: 12px;
    color: #047857;
    font-weight: 600;
    display: none;
}
