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

:root {
    --primary: #ff8c42;
    --primary-dark: #e6732f;
    --secondary: #4ecdc4;
    --danger: #ff6b6b;
    --success: #51cf66;
    --warning: #ffd43b;
    --dark: #2d3436;
    --gray: #636e72;
    --light-gray: #b2bec3;
    --bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    color: var(--dark);
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

/* ===== 页面容器 ===== */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 登录/注册页面 ===== */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 72px;
    line-height: 1;
    margin-bottom: 8px;
}

.logo-icon.small {
    font-size: 28px;
    margin-bottom: 0;
}

.logo h1 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 4px;
}

.logo p {
    color: var(--gray);
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    width: 100%;
    margin-bottom: 24px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--primary);
    color: var(--white);
}

.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.server-config {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

.server-config-title {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 8px;
}

.server-status-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.server-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffd43b;
    display: inline-block;
}

.server-status-dot.online {
    background: #51cf66;
    box-shadow: 0 0 6px rgba(81, 207, 102, 0.5);
}

.server-status-dot.offline {
    background: #ff6b6b;
}

.server-status-text {
    font-size: 14px;
    color: var(--dark);
    font-weight: 600;
}

.server-config-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.server-config-actions .btn {
    flex: 1;
}

.server-config-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.server-config-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select {
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark);
}

.btn-follow {
    background: #ff8c42;
    color: white;
    border: none;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
    background: #ee5a5a;
}

.profile-edit-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-delete-btn {
    width: 100%;
    margin-top: 20px;
}

.btn-guest {
    margin-top: 16px;
    background: transparent;
    color: var(--gray);
    border: 2px dashed var(--light-gray);
    font-size: 14px;
    padding: 12px 24px;
}

.btn-guest:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.guest-tag {
    background: var(--light-gray);
    color: var(--gray);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.guest-badge {
    background: var(--bg);
    color: var(--gray);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--light-gray);
}

.guest-tip {
    background: #fff3cd;
    color: #856404;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
    margin-top: 8px;
    border: 1px solid #ffc107;
}

/* ===== 主应用页面 ===== */
#app-page {
    padding-top: 56px;
    padding-bottom: 64px;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s, transform 0.15s;
}

.icon-btn:hover {
    background: var(--bg);
    transform: scale(1.1);
}

/* 消息按钮 - 鲜亮蓝色背景 */
.icon-btn-message {
    background: linear-gradient(135deg, #4ecdc4, #3bb5ad);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
}
.icon-btn-message:hover {
    background: linear-gradient(135deg, #3bb5ad, #2fa8a0);
}

/* 个人资料按钮 - 鲜亮橙色背景 */
.icon-btn-profile {
    background: linear-gradient(135deg, #ff9a56, #ff8c42);
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.4);
}
.icon-btn-profile:hover {
    background: linear-gradient(135deg, #ff8c42, #e6732f);
}

/* 退出按钮 - 鲜亮红色背景 */
.icon-btn-logout {
    background: linear-gradient(135deg, #ff8a8a, #ff6b6b);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}
.icon-btn-logout:hover {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.app-main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== 地图视图 ===== */
#map-view {
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 120px);
}

.map-legend {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--white);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 500;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-online-toggle {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.online {
    background: #51cf66;
}

.legend-dot.offline {
    background: #ff6b6b;
}

.legend-dot.legend-self {
    background: #ffd43b;
}

.legend-dot.stealth {
    background: #845ef7;
}

.legend-count {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    background: var(--bg);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
}

.locate-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--white);
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.locate-btn:hover {
    background: var(--bg);
}

/* ===== 列表视图 ===== */
.view-header {
    padding: 20px 16px 12px;
    background: var(--white);
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ===== 搜索筛选栏 ===== */
.search-filter-bar {
    padding: 12px 16px;
    background: var(--white);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-row {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid #e9ecef;
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.search-input:focus {
    border-color: var(--primary);
}

.search-select {
    padding: 10px 8px;
    border: 1.5px solid #e9ecef;
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    background: var(--white);
    min-width: 80px;
}

.search-select:focus {
    border-color: var(--primary);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.online-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray);
    user-select: none;
}

.online-toggle input {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 22px;
    background: var(--light-gray);
    border-radius: 11px;
    position: relative;
    transition: background 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--white);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.online-toggle input:checked + .toggle-slider {
    background: var(--success);
}

.online-toggle input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 13px;
    color: var(--gray);
}

.view-header h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.view-header p {
    font-size: 14px;
    color: var(--gray);
}

.dog-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-count {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--gray);
}

.dog-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: transform 0.2s;
}

.dog-card:hover {
    transform: translateY(-2px);
}

/* 心动狗狗卡片 */
.dog-card-heart {
    border: 2px solid #ff6b6b;
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.3);
}

.dog-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.heart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 22px;
    animation: heartbeat 1.2s ease-in-out infinite;
    filter: drop-shadow(0 1px 3px rgba(255, 107, 107, 0.6));
    z-index: 5;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.3);
    }
    30% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.25);
    }
    60% {
        transform: scale(1);
    }
}

.heart-tag {
    font-size: 11px;
    background: #ff6b6b;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 4px;
    animation: pulse 2s infinite;
}

.dog-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--warning));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.dog-info {
    flex: 1;
    min-width: 0;
}

.dog-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.dog-name {
    font-size: 17px;
    font-weight: 700;
}

.dog-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dog-status.online {
    background: #51cf66;
    box-shadow: 0 0 6px #51cf66;
}

.dog-status.offline {
    background: #ffd43b;
}

.dog-status.stealth {
    background: #845ef7;
    box-shadow: 0 0 6px #845ef7;
}

.profile-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
}

.dog-meta {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.6;
}

.dog-meta span {
    margin-right: 10px;
}

.dog-distance {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
}

.dog-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 20px;
}

/* ===== 消息视图 ===== */
.conversations-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: var(--shadow);
}

.conversation-item:hover {
    background: #f1f3f5;
}

.conv-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.conv-avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-name {
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.conv-preview {
    font-size: 14px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.conv-time {
    font-size: 12px;
    color: var(--light-gray);
}

.conv-unread {
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* ===== 聊天视图 ===== */
#chat-view {
    display: flex;
    flex-direction: column;
}

.chat-header {
    flex-shrink: 0;
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e9ecef;
    z-index: 10;
}

.back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: var(--bg);
}

.chat-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#chat-dog-name {
    font-weight: 700;
    font-size: 16px;
}

#chat-dog-status {
    font-size: 13px;
    color: var(--gray);
}

#chat-dog-status.online {
    color: #51cf66;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #f1f3f5;
}

.chat-load-more {
    text-align: center;
    padding: 4px 0;
}

.chat-load-more-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}

.chat-load-more-btn:active {
    background: var(--bg);
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--white);
    color: var(--dark);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    flex-shrink: 0;
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e9ecef;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
}

#chat-input:focus {
    border-color: var(--primary);
}

/* ===== 个人资料视图 ===== */
.profile-content {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--warning));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: var(--shadow-lg);
}

.dog-avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.profile-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-change-avatar-btn {
    font-size: 13px;
    background: linear-gradient(135deg, #ff9a56, #ff8c42);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.4);
    font-weight: 600;
}

.avatar-upload-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px dashed var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg);
}

.avatar-placeholder {
    font-size: 28px;
    color: var(--gray);
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
}

.profile-details {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.profile-detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 14px;
    color: var(--gray);
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
}

/* ===== 心动指标设置 ===== */
.heartbeat-section {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 16px;
}

.heartbeat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.heartbeat-title {
    font-size: 16px;
    font-weight: 700;
}

.heartbeat-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.heartbeat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hb-label {
    font-size: 14px;
    color: var(--gray);
    flex-shrink: 0;
    min-width: 70px;
}

.hb-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    max-width: 180px;
}

.hb-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    max-width: 180px;
    background: white;
}

.hb-age-range {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.hb-age-input {
    max-width: 70px;
    text-align: center;
}

.hb-age-sep {
    color: var(--gray);
}

.hb-age-unit {
    font-size: 13px;
    color: var(--gray);
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    position: relative;
    color: #7c8a99;
    transition: color 0.2s, transform 0.15s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:active {
    transform: scale(0.9);
}

.nav-icon {
    font-size: 22px;
    line-height: 1;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== Leaflet 自定义标记 ===== */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.marker-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.leaflet-popup-content {
    margin: 10px 14px;
    font-size: 14px;
}

.popup-dog-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.popup-dog-info {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 8px;
}

.popup-actions {
    display: flex;
    gap: 8px;
}

.popup-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}

.popup-btn-chat {
    background: var(--primary);
    color: var(--white);
}

.popup-btn-locate {
    background: var(--bg);
    color: var(--dark);
}

.popup-btn-follow {
    background: #ff8c42;
    color: var(--white);
}

.popup-btn-following {
    background: var(--bg);
    color: #ff8c42;
    border: 1px solid #ff8c42;
}

/* ===== 公告模块 ===== */
.announcements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.announcements-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.announcements-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.announcements-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.announcements-filter select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: var(--dark);
}

.announcement-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.ann-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ann-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.ann-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ann-card-info {
    flex: 1;
    min-width: 0;
}

.ann-card-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.ann-card-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--gray);
    flex-wrap: wrap;
}

.ann-mine-tag {
    font-size: 11px;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.ann-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}

.ann-card-content {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
    word-break: break-word;
}

.ann-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.ann-radius {
    font-size: 12px;
    color: var(--gray);
}

.ann-actions {
    display: flex;
    gap: 8px;
}

.ann-chat-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.ann-delete-btn {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.loading-text {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 14px;
}

.announcement-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.announcement-form {
    padding: 20px;
}

.announcement-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

.announcement-form small {
    display: block;
    color: var(--gray);
    font-size: 12px;
    margin-top: 4px;
}

/* ===== 响应式 ===== */
@media (max-width: 380px) {
    .dog-card {
        padding: 12px;
        gap: 10px;
    }
    
    .dog-avatar {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .dog-name {
        font-size: 15px;
    }
    
    .dog-meta {
        font-size: 12px;
    }
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
}
