/* =====================================================
   旅途笔记 - 主样式表
   ===================================================== */

:root {
    --travel-primary: #0d6efd;
    --travel-primary-dark: #0b5ed7;
    --travel-accent: #fd7e14;
    --travel-accent-light: #fff3e0;
    --travel-bg: #f8f9fa;
    --travel-card-radius: 12px;
    --travel-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --travel-shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.15);
}

body {
    background-color: var(--travel-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* ===== 导航栏 ===== */
.main-navbar {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #0d47a1 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.main-navbar .navbar-brand {
    font-size: 1.35rem;
    color: #fff !important;
}

.main-navbar .navbar-brand .text-warning {
    color: #ffc107 !important;
}

.main-navbar .nav-link {
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 8px;
    padding: 0.5rem 0.85rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.main-navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.main-navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

.main-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.main-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.main-navbar .btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

.main-navbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff;
}

.main-navbar .form-control {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.main-navbar .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.main-navbar .form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
}

/* ===== Hero 区域 ===== */
.hero-section {
    background: linear-gradient(135deg, #1a237e 0%, #283593 40%, #3949ab 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
    background-size: 40px 40px;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

/* ===== 卡片 ===== */
.trip-card {
    background: white;
    border-radius: var(--travel-card-radius);
    overflow: hidden;
    box-shadow: var(--travel-shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.trip-card:hover {
    box-shadow: var(--travel-shadow-hover);
    transform: translateY(-4px);
}

.trip-card .card-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e9ecef;
}

.trip-card .card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.trip-card:hover .card-cover img {
    transform: scale(1.08);
}

.trip-card .card-visibility {
    position: absolute;
    top: 10px;
    right: 10px;
}

.trip-card .card-body {
    padding: 1rem 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.trip-card .card-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trip-card .card-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.trip-card .card-stats {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.82rem;
    color: #6c757d;
}

.trip-card .card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== 标签 ===== */
.tag-pill {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
    border-radius: 20px;
    background: var(--travel-accent-light);
    color: var(--travel-accent);
    text-decoration: none;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: var(--travel-accent);
    color: white;
}

/* ===== 通用 ===== */
.section-title {
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 14px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 24px;
    background: var(--travel-primary);
    border-radius: 3px;
}

/* ===== 时间线 ===== */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--travel-primary), #e9ecef);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-left: 55px;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 8px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--travel-primary);
    border: 4px solid white;
    box-shadow: 0 0 0 2px var(--travel-primary);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--travel-primary);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

/* ===== 地图 ===== */
#mapContainer {
    border-radius: var(--travel-card-radius);
    overflow: hidden;
    box-shadow: var(--travel-shadow);
}

#mapCanvas {
    width: 100%;
    height: 600px;
}

.map-info-window {
    padding: 8px;
    min-width: 200px;
}

/* ===== 表单 ===== */
.form-card {
    background: white;
    border-radius: var(--travel-card-radius);
    box-shadow: var(--travel-shadow);
    padding: 2rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--travel-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ===== 照片上传 ===== */
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #e9ecef;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--travel-primary);
    background: rgba(13, 110, 253, 0.05);
}

/* ===== 用户页 ===== */
.profile-header {
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: white;
    border-radius: var(--travel-card-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
}

/* ===== 评论 ===== */
.comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* ===== 费用条 ===== */
.expense-bar {
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== 统计卡片 ===== */
.stat-card {
    background: white;
    border-radius: var(--travel-card-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--travel-shadow);
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--travel-primary);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ===== 后台 ===== */
.admin-sidebar {
    background: #1a237e;
    min-height: calc(100vh - 56px);
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    margin: 2px 8px;
}

.admin-sidebar .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ===== 移动端 ===== */
@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 0;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .form-card {
        padding: 1.25rem;
    }

    #mapCanvas {
        height: 400px;
    }

    .timeline-item {
        padding-left: 45px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-item::before {
        left: 7px;
    }
}

/* ===== 动画 ===== */
.fade-in {
    animation: fadeIn 0.4s ease;
}

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

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

/* 只作用于第一个装饰图标，不影响按钮内的图标 */
.empty-state > i:first-child {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
    display: block;
}

.empty-state .btn i {
    font-size: 1rem;
    margin-right: 2px;
}

/* ===== 可见性标签 ===== */
.visibility-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.visibility-public {
    background: rgba(25, 135, 84, 0.85);
    color: white;
}

.visibility-friends {
    background: rgba(255, 193, 7, 0.85);
    color: #333;
}

.visibility-private {
    background: rgba(108, 117, 125, 0.85);
    color: white;
}

/* ===== 旅行快记 - 动态流 ===== */
.moment-item {
    margin-bottom: 1.25rem;
}

.moment-bubble {
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
}

.moment-bubble.cursor-pointer {
    cursor: pointer;
    transition: background 0.15s;
}

.moment-bubble.cursor-pointer:hover {
    background: #eef2ff !important;
}

.moment-photo {
    max-width: 100%;
    max-height: 280px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.moment-photo:hover {
    opacity: 0.9;
}

.moment-date-divider {
    text-align: center;
    margin: 1.5rem 0 1rem;
    position: relative;
}

.moment-date-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e0e0e0;
    z-index: 0;
}

.moment-date-divider span {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    padding: 0.25rem 0.75rem;
}

/* ===== 悬浮快捷栏 ===== */
.moment-fab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 1030;
    padding: 10px 0;
}

.moment-fab-bar .fab-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 680px;
    margin: 0 auto;
}

.fab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    padding: 6px 12px;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 12px;
}

.fab-btn i {
    font-size: 22px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.fab-btn:hover i {
    transform: scale(1.1);
}

.fab-text i { background: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.fab-text:hover { color: #0d6efd; }

.fab-photo i { background: rgba(25, 135, 84, 0.1); color: #198754; }
.fab-photo:hover { color: #198754; }

.fab-expense i { background: rgba(255, 193, 7, 0.15); color: #e0a800; }
.fab-expense:hover { color: #e0a800; }

.fab-location i { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.fab-location:hover { color: #dc3545; }

/* 记账分类按钮 */
.expense-cat-btn.active {
    background: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}

/* 旅行进行中状态徽章 */
.trip-status-ongoing {
    display: inline-block;
    background: #fd7e14;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.trip-status-ongoing::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    margin-right: 4px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* 继续记录按钮 */
.nav-continue-btn {
    position: relative;
}

.nav-continue-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    background: #fd7e14;
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 700;
    line-height: 1;
}

/* 继续记录弹窗 */
.ongoing-trip-list .trip-item {
    transition: background 0.15s;
}

.ongoing-trip-list .trip-item:hover {
    background: rgba(13, 110, 253, 0.05);
}

/* 详情页动态流区域 */
.trip-moments-section {
    max-width: 680px;
    margin: 0 auto;
}
