/* ============================================================
   WedLink 婚链名片系统 - 全局样式 (Bootstrap 5 + 移动端H5)
   ============================================================ */

:root {
    --wl-primary: #D4A574;
    --wl-primary-dark: #B8895A;
    --wl-accent: #E8C4A0;
    --wl-bg: #F5F5F5;
    --wl-text: #333333;
    --wl-text-light: #999999;
    --wl-border: #EEEEEE;
    --wl-danger: #E8575A;
    --wl-success: #4CAF50;
    --bottom-nav-height: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--wl-bg);
    color: var(--wl-text);
    -webkit-font-smoothing: antialiased;
    max-width: 100vw;
    overflow-x: hidden;
}

.page-content {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
    min-height: 100vh;
}

/* ========== Bottom Navigation ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #FFFFFF;
    border-top: 1px solid var(--wl-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* 名片页分享栏（固定底部，始终可见） */
.card-share-bar {
    position: fixed;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 16px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 1000;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--wl-text-light);
    font-size: 11px;
    flex: 1;
    padding: 6px 0;
    transition: color 0.2s;
}

.bottom-nav .nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

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

/* ========== Card Styles ========== */
.provider-card {
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.provider-card:active {
    transform: scale(0.98);
}

.provider-card .card-cover {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.provider-card .card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #FFF;
    position: absolute;
    bottom: -20px;
    left: 16px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.provider-card .card-body {
    padding: 24px 16px 12px;
}

.provider-card .vip-badge {
    display: inline-block;
    background: linear-gradient(135deg, #D4A574, #C9965A);
    color: #FFF;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

/* ========== Work Grid ========== */
.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
}

.work-card {
    background: #FFF;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.work-card .work-image {
    width: 100%;
    height: 0;
    padding-bottom: 75%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.work-card .work-info {
    padding: 10px;
}

.work-card .work-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.work-card .work-meta {
    font-size: 12px;
    color: var(--wl-text-light);
    margin-top: 6px;
}

/* ========== Search Bar ========== */
.search-bar {
    background: #FFF;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-bar .search-input-wrap {
    flex: 1;
    position: relative;
}

.search-bar .search-input-wrap input {
    width: 100%;
    height: 38px;
    border-radius: 19px;
    border: 1px solid var(--wl-border);
    background: var(--wl-bg);
    padding: 0 16px 0 36px;
    font-size: 14px;
    outline: none;
}

.search-bar .search-input-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wl-text-light);
    font-size: 16px;
}

/* ========== Location Label ========== */
.search-bar .location-label {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--wl-primary-dark);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 16px;
    background: rgba(212,165,116,0.1);
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-bar .location-label i { font-size: 14px; }
.search-bar .location-label.locating { pointer-events: none; }

.search-bar .btn-filter {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--wl-border);
    background: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--wl-text-light);
}

/* ========== Category Tabs ========== */
.category-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0;
    background: #FFF;
    padding: 8px 0;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    user-select: none;
    -webkit-user-select: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tabs .cat-tab {
    flex: 0 0 auto;
    padding: 6px 16px;
    font-size: 14px;
    color: var(--wl-text);
    text-decoration: none;
    border-radius: 20px;
    margin: 0 4px;
    transition: all 0.2s;
}

.category-tabs .cat-tab:first-child { margin-left: 12px; }
.category-tabs .cat-tab:last-child { margin-right: 12px; }

.category-tabs .cat-tab.active {
    background: var(--wl-primary);
    color: #FFF;
}

/* ========== Sort Bar ========== */
.sort-bar {
    display: flex;
    padding: 8px 16px;
    background: #FFF;
    border-bottom: 1px solid var(--wl-border);
    gap: 16px;
    font-size: 13px;
}

.sort-bar .sort-item {
    color: var(--wl-text-light);
    text-decoration: none;
    padding: 4px 0;
}

.sort-bar .sort-item.active {
    color: var(--wl-primary-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--wl-primary-dark);
}

/* ========== Business Card Page ========== */
.card-page-header {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(0,0,0,0.3));
}

.card-page-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid #FFF;
    margin-top: -36px;
    position: relative;
    z-index: 2;
    object-fit: cover;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.card-page-body {
    background: #FFF;
    border-radius: 16px 16px 0 0;
    margin-top: -16px;
    position: relative;
    z-index: 1;
    padding: 20px 16px;
}

.card-page-name {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin: 10px 0 4px;
}

.card-page-title {
    font-size: 13px;
    color: var(--wl-text-light);
    text-align: center;
    margin-bottom: 16px;
}

.card-contact-row {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    border-top: 1px solid var(--wl-border);
    border-bottom: 1px solid var(--wl-border);
    margin-bottom: 16px;
}

.card-contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--wl-text);
    font-size: 12px;
}

.card-contact-item .contact-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.card-contact-item .contact-icon.wechat { background: #E8F5E9; color: #4CAF50; }
.card-contact-item .contact-icon.phone { background: #E3F2FD; color: #2196F3; }
.card-contact-item .contact-icon.location { background: #FFF3E0; color: #FF9800; }
.card-contact-item .contact-icon.qrcode { background: #F3E5F5; color: #9C27B0; }

/* ========== Section Title ========== */
.section-title {
    font-size: 16px;
    font-weight: 600;
    padding: 16px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--wl-primary-dark);
    border-radius: 2px;
}

/* ========== Price List ========== */
.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--wl-border);
}

.price-item:last-child { border-bottom: none; }

.price-item .price-name {
    font-size: 14px;
    font-weight: 500;
}

.price-item .price-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--wl-danger);
}

.price-item .price-unit {
    font-size: 12px;
    color: var(--wl-text-light);
}

/* ========== VIP Badge ========== */
.vip-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #D4A574, #C9965A);
    color: #FFF;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* ========== Form Styles (Mobile) ========== */
.form-section {
    background: #FFF;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 16px;
}

.form-section .form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--wl-text);
    margin-bottom: 4px;
}

.form-control, .form-select {
    font-size: 14px;
    border-color: var(--wl-border);
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--wl-primary);
    box-shadow: 0 0 0 0.2rem rgba(212, 165, 116, 0.25);
}

/* ========== Buttons ========== */
.btn-wl-primary {
    background: var(--wl-primary);
    color: #FFF;
    border: none;
    border-radius: 22px;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: 500;
}

.btn-wl-primary:hover { background: var(--wl-primary-dark); color: #FFF; }

.btn-wl-outline {
    background: transparent;
    color: var(--wl-primary-dark);
    border: 1px solid var(--wl-primary);
    border-radius: 22px;
    padding: 10px 32px;
    font-size: 15px;
}

/* ========== Avatar Upload ========== */
.avatar-upload {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px dashed var(--wl-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
}

.avatar-upload.has-image {
    border-style: solid;
    border-color: var(--wl-primary);
}

/* ========== Error Pages ========== */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.error-page .error-icon {
    font-size: 64px;
    color: var(--wl-text-light);
    margin-bottom: 20px;
}

/* ========== Admin Layout ========== */
.admin-sidebar {
    background: #2C3E50;
    color: #ECF0F1;
    min-height: 100vh;
}

/* ========== Responsive ========== */
@media (min-width: 768px) {
    .work-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .work-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== iOS 输入/粘贴修复 ========== */
textarea, input {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}
