/* 苹果风格样式文件 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
}

/* 滚动条隐藏 */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 容器样式 */
main {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #f5f5f7;
}

/* 顶部分类筛选栏 */
.filter-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 20;
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    pointer-events: none;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: auto;
}

.filter-button {
    padding: 0.375rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
    border: none;
}

.filter-button.active {
    background-color: #0071e3;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.filter-button:not(.active) {
    color: #6e6e73;
}

.filter-button:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 加载动画 */
.loading {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #f5f5f7, #e8e8ed);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 3rem;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.loading-spinner {
    width: 3.5rem;
    height: 3.5rem;
    border: 3px solid rgba(0, 113, 227, 0.2);
    border-top-color: #0071e3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.loading-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: 0.02em;
}

.loading-subtitle {
    font-size: 0.875rem;
    color: #6e6e73;
}

/* 地图容器 */
#map-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* 表单容器 */
.form-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding-bottom: 3rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.form-card {
    width: 100%;
    max-width: 28rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.form-content {
    padding: 1.5rem;
}

.form-header {
    margin-bottom: 1.5rem;
}

.form-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.form-status {
    font-size: 0.875rem;
    color: #6e6e73;
}

/* 按钮样式 */
.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #0071e3;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.btn-primary:hover {
    background: #0077ed;
}

.btn-secondary {
    background-color: #f2f2f7;
    color: #1d1d1f;
}

.btn-secondary:hover {
    background-color: #e5e5ea;
}

/* 气泡表单 */
.bubble-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    font-size: 0.9375rem;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
    background-color: white;
}

/* 分类按钮 */
.category-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.category-button {
    flex: 1;
    padding: 0.875rem;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    background-color: #f9f9f9;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-button.active {
    background-color: #0071e3;
    color: white;
    border-color: #0071e3;
}

.category-button:hover:not(.active) {
    background-color: #f2f2f7;
}

/* 滑块样式 */
.slider-container {
    margin-bottom: 1.25rem;
}

.slider {
    width: 100%;
    height: 6px;
    background-color: #e5e5ea;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background-color: #0071e3;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background-color: #0071e3;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.slider-value {
    font-size: 0.875rem;
    color: #6e6e73;
    text-align: center;
    margin-top: 0.5rem;
}

/* 聊天室 */
.chat-container {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 40;
    background-color: rgba(0, 0, 0, 0.5);
}

.chat-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e5ea;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d1d1f;
}

.chat-actions {
    display: flex;
    gap: 0.75rem;
}

.chat-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.message.own {
    align-self: flex-end;
    background-color: #0071e3;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.other {
    align-self: flex-start;
    background-color: #f2f2f7;
    color: #1d1d1f;
    border-bottom-left-radius: 4px;
}

.message-system {
    align-self: center;
    background-color: #e8e8ed;
    color: #6e6e73;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.chat-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e5ea;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid #d2d2d7;
    border-radius: 20px;
    font-size: 0.9375rem;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
    background-color: white;
}

.send-button {
    background-color: #0071e3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:hover {
    background-color: #0077ed;
}

/* 气泡标记样式 */
.bubble-marker {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bubble-marker:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.bubble-marker-content {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    background-color: white;
}

.bubble-marker-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bubble-marker-icon {
    font-size: 1.5rem;
}

.bubble-marker-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1d1d1f;
}

.bubble-marker-time {
    font-size: 0.75rem;
    color: #34c759;
    font-weight: 600;
    margin-top: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.2);
    align-self: flex-start;
}

.bubble-marker-people {
    font-size: 0.75rem;
    color: #0071e3;
    font-weight: 600;
    margin-top: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: rgba(0, 113, 227, 0.1);
    border: 1px solid rgba(0, 113, 227, 0.2);
    align-self: flex-start;
}

.bubble-marker-people.full {
    color: #8e8e93;
    background-color: rgba(142, 142, 147, 0.1);
    border-color: rgba(142, 142, 147, 0.2);
}

/* 响应式设计 */
@media (max-width: 640px) {
    .form-card {
        max-width: 100%;
    }
    
    .chat-body {
        padding: 1rem;
    }
    
    .chat-footer {
        padding: 0.75rem 1rem;
    }
}

/* 禁用状态 */
.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 倒计时样式 */
.countdown {
    font-size: 0.75rem;
    color: #ff3b30;
    font-weight: 500;
}

/* 错误提示 */
.error-message {
    color: #ff3b30;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* 成功提示 */
.success-message {
    color: #34c759;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* 苹果风格的开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

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

.slider-switch:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked + .slider-switch {
    background-color: #0071e3;
}

input:checked + .slider-switch:before {
    transform: translateX(26px);
}

/* 苹果风格的卡片阴影 */
.apple-card {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 苹果风格的动画 */
.apple-animation {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 苹果风格的分割线 */
.apple-divider {
    height: 1px;
    background-color: #e5e5ea;
    margin: 1rem 0;
}

/* 苹果风格的标题 */
.apple-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
}

/* 苹果风格的副标题 */
.apple-subtitle {
    font-size: 0.875rem;
    color: #6e6e73;
    margin-bottom: 1rem;
}