* {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 渐变配色 */
.gradient-red {
    background: linear-gradient(135deg, #e63946 0%, #f1faee 100%);
}

.gradient-orange {
    background: linear-gradient(135deg, #f4a261 0%, #e9c46a 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #2a9d8f 0%, #8ab17d 100%);
}

.card-content {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #93c5fd 100%);
}

/* 标签样式 */
.tag-a {
    background: linear-gradient(135deg, #2d6a4f 0%, #40916c 100%);
}

.tag-b {
    background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
}

.tag-c {
    background: linear-gradient(135deg, #e9c46a 0%, #f4a261 100%);
}

.tag-d {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
}

.tag-paid {
    background: #22c55e;
}

.tag-unpaid {
    background: #f97316;
}

.tag-claimed {
    background: #6b7280;
}

.tag-available {
    background: #d1d5db;
    color: #374151;
}

/* 通用样式 */
.tab-active {
    border-bottom: 3px solid #e63946;
    color: #e63946;
    font-weight: 600;
}

.modal {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 10000 !important;
}

.card-shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.btn-shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.deal-card {
    border: 2px solid #fbbf24;
}

/* 表单样式 */
.form-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    outline: none;
}

.form-input:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5);
}

.form-textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    outline: none;
    resize: vertical;
}

.form-textarea:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5);
}

.form-select {
    width: 100%;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    outline: none;
    background-color: white;
}

.form-select:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: filter 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(0.95);
}

.btn-secondary {
    width: 100%;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #374151;
    background-color: #e5e7eb;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.btn-small {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    border: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-small:hover {
    filter: brightness(0.95);
}

.btn-icon {
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* 页面容器 */
.page-container {
    min-height: calc(100vh - 80px);
    padding-top: 16px;
    padding-bottom: 100px !important;
    display: none;
}

.page-container.active {
    display: block;
}

.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    background: white !important;
    border-top: 1px solid #e5e7eb !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
}

/* 快捷回复按钮 */
.quick-reply-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quick-reply-btn:hover {
    background-color: #e5e7eb;
}

/* 倒计时样式 */
.countdown {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
    margin-top: 0.5rem;
}

/* 冲突处理弹窗样式 */
.conflict-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.conflict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.conflict-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.conflict-col {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.conflict-actions {
    display: flex;
    gap: 0.5rem;
}

/* 管理后台标签页样式 */
.admin-tabs-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.admin-tabs-container::-webkit-scrollbar {
    display: none;
}

.admin-tabs {
    display: flex;
    min-width: max-content;
}

.admin-tab {
    padding: 1rem 1.25rem;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 1rem;
    text-align: center;
    min-width: 80px;
}

.admin-tab.active {
    border-bottom-color: #e63946;
    color: #e63946;
    font-weight: 600;
}

.admin-tab-content {
    display: none;
    padding-top: 1rem;
}

.admin-tab-content.active {
    display: block;
}

/* 客户调配样式 */
.user-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.customer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

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

.customer-actions {
    display: flex;
    gap: 0.5rem;
}

/* 角标样式（优化版：顶部居中，点击穿透） */
.owner-badge {
    position: absolute;
    top: 0.4rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(107, 114, 128, 0.85);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
    z-index: 2;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    pointer-events: none;
    white-space: nowrap;
}

.owner-badge.admin {
    background: rgba(239, 68, 68, 0.9);
}

/* 头像悬浮遮罩（编辑个人资料用） */
.avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.avatar-preview:hover .avatar-overlay {
    opacity: 1;
}


/* 预警卡片优化 */
#followAlertCard {
    padding: 1.25rem 1.5rem;
    /* 更宽敞的内边距 */
    margin-bottom: 1.5rem;
    /* 与下方元素拉开距离 */
    border-radius: 1rem;
    /* 圆角加大 */
}

#followAlertCard .alert-title {
    font-size: 1.1rem;
    /* 主标题放大 */
    margin-bottom: 0.5rem;
}

#followAlertCard .alert-desc {
    font-size: 0.95rem;
    /* 说明文字稍大 */
    line-height: 1.5;
}

#followAlertCard button {
    padding: 0.5rem 1.5rem;
    /* 按钮更宽 */
    font-size: 0.95rem;
    white-space: nowrap;
}

/* 图表柱子样式 */
.chart-bar {
    transition: height 0.5s ease, background 0.3s;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
    position: relative;
}

.chart-bar:hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.chart-bar.gray-bar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background: #e5e7eb;
}

/* 柱子数值气泡 */
.chart-bar .bar-value {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    opacity: 0;
    transition: opacity 0.2s;
}

.chart-bar:hover .bar-value {
    opacity: 1;
}