/* CSS 全局颜色变量定义 */
:root {
    /* 主色调 */
    --primary-bg: #1a1a1a;
    /* 主背景色 */
    --secondary-bg: #2a2a2a;
    /* 次级背景色 */
    --tertiary-bg: #1f1f1f;
    /* 第三级背景色 */
    --container-bg: #252525;
    /* 容器背景色 */
    --card-bg: #333;
    /* 卡片背景色 */

    /* 文本颜色 */
    --primary-text: #f0f0f0;
    /* 主文本色 */
    --secondary-text: #ccc;
    /* 次级文本色 */
    --muted-text: #4a813e;
    /* 弱化文本色 */
    --placeholder-text: #888;
    /* 占位符文本色 */

    /* 强调色 */
    --accent-primary: #00aaff;
    /* 主强调色(蓝色) */
    --accent-hover: #0088cc;
    /* 强调色悬停 */
    --accent-light: #66b3ff;
    /* 浅强调色 */

    /* 状态颜色 */
    --success: #28a745;
    /* 成功色(绿色) */
    --success-light: #2f9c56;
    /* 浅成功色 */
    --warning: #ffc107;
    /* 警告色(黄色) */
    --warning-dark: #fd7e14;
    /* 深警告色 */
    --danger: #dc3545;
    /* 危险色(红色) */
    --danger-light: #ff4d4d;
    /* 浅危险色 */
    --info: #17a2b8;
    /* 信息色(青色) */
    --info-light: #0dcaf0;
    /* 浅信息色 */

    /* 边框颜色 */
    --border-primary: #333;
    /* 主边框色 */
    --border-secondary: #444;
    /* 次级边框色 */
    --border-light: #555;
    /* 浅边框色 */
    --border-muted: #666;
    /* 弱化边框色 */

    /* 按钮颜色 */
    --btn-primary: #007acc;
    /* 主按钮色 */
    --btn-primary-hover: #008fdd;
    /* 主按钮悬停色 */
    --btn-secondary: #555;
    /* 次级按钮色 */
    --btn-secondary-hover: #666;
    /* 次级按钮悬停色 */
    --btn-danger: #cc3333;
    /* 危险按钮色 */
    --btn-danger-hover: #dd4444;
    /* 危险按钮悬停色 */

    /* 客户等级颜色 */
    --level-a: #dc3545;
    /* A级客户(红色) */
    --level-b: #ffc107;
    /* B级客户(黄色) */
    --level-c: #28a745;
    /* C级客户(绿色) */
    --level-d: #007bff;
    /* D级客户(蓝色) */

    /* 客户状态颜色 */
    --status-potential: #fd7e14;
    /* 潜在客户 */
    --status-intent: #0dcaf0;
    /* 意向客户 */
    --status-deal: #198754;
    /* 成交客户 */
    --status-lost: #dc3545;
    /* 流失客户 */
    --status-fake: #6c757d;
    /* 虚假客户 */

    /* 阴影效果 */
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-heavy: 0 6px 20px rgba(0, 170, 255, 0.15);

    /* 渐变背景 */
    --gradient-card: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    --gradient-button: linear-gradient(135deg, #007acc 0%, #0088cc 100%);
}

/* 亮色主题变量 */
[data-theme="light"] {
    /* 主色调 - 亮色版本 */
    --primary-bg: #ffffff;
    /* 白色主背景 */
    --secondary-bg: #f8f9fa;
    /* 浅灰色次级背景 */
    --tertiary-bg: #e9ecef;
    /* 浅灰色第三级背景 */
    --container-bg: #ffffff;
    /* 白色容器背景 */
    --card-bg: #f1f3f4;
    /* 浅灰卡片背景 */

    /* 文本颜色 - 亮色版本 */
    --primary-text: #000000;
    /* 黑色主文本 */
    --secondary-text: #333333;
    /* 深灰次级文本 */
    --muted-text: #609d5a;
    /* 中灰弱化文本 */
    --placeholder-text: #999999;
    /* 浅灰占位符文本 */

    /* 强调色保持不变，但调整对比度 */
    --accent-primary: #0066cc;
    /* 深蓝色强调色 */
    --accent-hover: #0052a3;
    /* 更深的悬停色 */
    --accent-light: #3399ff;
    /* 浅蓝色 */

    /* 边框颜色 - 亮色版本 */
    --border-primary: #dee2e6;
    /* 浅灰边框 */
    --border-secondary: #ced4da;
    /* 中灰边框 */
    --border-light: #adb5bd;
    /* 深灰边框 */
    --border-muted: #6c757d;
    /* 最深边框 */

    /* 按钮颜色适配亮色主题 */
    --btn-secondary: #6c757d;
    /* 灰色次级按钮 */
    --btn-secondary-hover: #5a6268;
    /* 深灰悬停 */

    /* 阴影效果 - 亮色版本 */
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 6px 20px rgba(0, 102, 204, 0.1);

    /* 渐变背景 - 亮色版本 */
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    --gradient-button: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
}

/* 主题切换按钮样式 */
.theme-toggle {
    position: fixed;
    bottom: 50px;
    left: 10px;
    z-index: 1000;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.theme-toggle:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
}

.theme-toggle .icon {
    transition: transform 0.3s ease;
}

.theme-toggle:hover .icon {
    transform: rotate(180deg);
}

/* General Body Styles */
body {
    font-family: 'Menlo', 'Monaco', 'Consolas', "Courier New", monospace;
    background-color: var(--primary-bg);
    color: var(--primary-text);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--container-bg);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
}

/* Header Styles */
header {
    background-color: var(--tertiary-bg);
    padding: 10px 10px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--accent-primary);
}

header h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: 1px;
}

header .user-info {
    font-size: 16px;
}

header .user-info a {
    color: var(--danger-light);
    text-decoration: none;
    margin-left: 15px;
}

header .user-info a:hover {
    text-decoration: underline;
}

/* Navigation Sidebar */
.sidebar {
    width: 60px;
    background-color: var(--tertiary-bg);
    padding: 0px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid var(--border-primary);
    overflow-y: auto;
    font-size: 16px;
}

.sidebar h2 {
    color: var(--accent-primary);
    font-size: 20px;
    text-align: center;
    margin-bottom: 30px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li a {
    color: var(--primary-text);
    text-decoration: none;
    display: block;
    padding: 10px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background-color: var(--accent-primary);
    color: var(--primary-bg);
}

/* Main Content Area */
.main-content {
    margin-left: 70px;
    /* Sidebar width + padding */
    padding: 0px;
}

/* Flash Messages */
.flash-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.flash {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid;
    text-align: center;
}

.flash.success {
    background-color: var(--success);
    border-color: var(--success-light);
    color: var(--primary-text);
}

.flash.error {
    background-color: var(--danger);
    border-color: var(--danger-light);
    color: var(--primary-text);
}

.flash.info {
    background-color: var(--info);
    border-color: var(--info-light);
    color: var(--primary-text);
}


/* Form Styles */
form {
    background-color: var(--secondary-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.form-group {
    margin-bottom: 20px;
    margin: 0;
    padding: 0;
}

form label {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-text);
    font-weight: 500;
    font-size: 14px;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="tel"],
form input[type="datetime-local"],
form select,
form textarea {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--primary-text);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.3);
}

form textarea {
    min-height: 120px;
    resize: vertical;
}





/* Dashboard page styles */
.dashboard-layout {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.dashboard-filter-form {
    min-width: 120px;
    max-width: 180px;
    flex-shrink: 0;
    background-color: var(--secondary-bg);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 0;
    border: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}

.dashboard-grid-wrapper {
    flex: 1;
    min-width: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 5px;
}

.stat-card {
    background-color: var(--secondary-bg);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    text-align: center;
    min-width: 50px;
    flex: 1;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 170, 255, 0.15);
}

.stat-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--accent-primary);
    font-size: 16px;
    font-weight: 600;
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-text);
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-card.bg-red {
    background-color: var(--danger);
    color: var(--primary-text);
}

/* Customer Management Styles */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: end;
    margin-bottom: 0;
    padding: 0;
    background: none;
    border: none;
}

.toolbar .form-group {
    flex: 1;
    min-width: 60px;
    margin: 0;
}

.toolbar .form-group label {
    margin: 0px;
    font-size: 13px;
}

.toolbar .form-group input,
.toolbar .form-group select {
    padding: 5px 5px;
    font-size: 13px;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    margin-bottom: 0;
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
}

/* Edit Customer specific form actions */
.edit-card .form-actions {
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.form-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
}

/* Badge and Tag Styles */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.badge:hover {
    transform: scale(1.05);
    opacity: 0.9;
    text-decoration: none;
}

.badge-a {
    background-color: var(--level-a);
    color: #fff;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.badge-b {
    background-color: var(--level-b);
    color: #000;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.badge-c {
    background-color: var(--level-c);
    color: #fff;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.badge-d {
    background-color: var(--level-d);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.tag {
    display: inline-block;
    background-color: var(--success);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 6px;
    margin-bottom: 4px;
    transition: background-color 0.2s;
    text-decoration: none;
}

.tags-container {
    min-width: 300px;
    overflow: visible;
}

/* Table Tags Column Styling - 统一admin和user视图 */
.table .tags-container {
    min-width: 200px;
    max-width: 350px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* 统一标签列样式 - 无论admin还是user视图 */
.table td.col-tags {
    width: 10%;
    min-width: 200px;
    max-width: 350px;
}

.table .tag {
    font-size: 12px;
    padding: 3px 6px;
    margin: 0;
    white-space: nowrap;
}

.tag-more,
.tag-collapse {
    background-color: var(--muted-text);
    cursor: pointer;
}

.tag-more:hover,
.tag-collapse:hover {
    background-color: var(--secondary-text);
}

.tag:hover {
    background-color: var(--accent-primary);
    color: white;
    text-decoration: none;
}

/* Status Colors */
.status-潜在客户 {
    color: var(--status-potential);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.status-意向客户 {
    color: var(--status-intent);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.status-成交客户 {
    color: var(--status-deal);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.status-流失客户 {
    color: var(--status-lost);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.status-虚假客户 {
    color: var(--status-fake);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.status-潜在客户:hover,
.status-意向客户:hover,
.status-成交客户:hover,
.status-流失客户:hover,
.status-虚假客户:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.company-link {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

.company-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* 新增筛选链接样式 */
.title-link,
.stage-link,
.tier-link,
.address-link {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
    padding: 2px 4px;
    border-radius: 3px;
}

.title-link:hover,
.stage-link:hover,
.tier-link:hover,
.address-link:hover {
    color: var(--accent-primary);
    background: var(--tertiary-bg);
    text-decoration: none;
}

.status-sent {
    color: var(--success);
    font-weight: 600;
}

.status-failed {
    color: var(--danger);
    font-weight: 600;
}

.status-draft {
    color: var(--warning-dark);
    font-weight: 600;
}

/* Enhanced Table Styles - 统一admin和user视图 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background-color: var(--tertiary-bg);
    color: var(--accent-primary);
    font-weight: 600;
    padding: 16px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border-primary);
    font-size: 14px;
}

.table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-primary);
    vertical-align: middle;
}

/* 统一各列的基本样式 */
.table .col-name {
    min-width: 120px;
    max-width: 200px;
}

.table .col-title {
    min-width: 80px;
    max-width: 120px;
}

.table .col-email {
    min-width: 40px;
    max-width: 60px;
    text-align: center;
}

.table .col-phone {
    min-width: 100px;
    max-width: 140px;
}

.table .col-company {
    min-width: 120px;
    max-width: 200px;
}

.table .col-country {
    min-width: 60px;
    max-width: 80px;
    text-align: center;
}

.table .col-address {
    min-width: 120px;
    max-width: 180px;
}

.table .col-platform {
    min-width: 80px;
    max-width: 120px;
}

.table .col-status {
    min-width: 80px;
    max-width: 100px;
}

.table .col-stage {
    min-width: 100px;
    max-width: 140px;
}

.table .col-level {
    min-width: 60px;
    max-width: 80px;
    text-align: center;
}

.table .col-customer_tier {
    min-width: 60px;
    max-width: 80px;
    text-align: center;
}

.table .col-assigned {
    min-width: 80px;
    max-width: 120px;
}

.assigned-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.assigned-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.unassigned {
    color: #6c757d;
    font-style: italic;
}

.table .col-created {
    min-width: 80px;
    max-width: 100px;
}

.table .col-follow {
    min-width: 80px;
    max-width: 100px;
}



.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background-color: var(--card-bg);
}

.table a {
    color: var(--primary-text);
    text-decoration: none;
    transition: color 0.2s;
}

.table a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.table .btn {
    padding: 8px 12px;
    font-size: 12px;
    margin-right: 4px;
}

/* Sortable Table Header Styles */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    position: relative;
}

.sortable-header:hover {
    background-color: var(--card-bg);
}

.sort-indicator {
    display: inline-block;
    margin-left: 5px;
    font-weight: bold;
    color: var(--accent-primary);
    font-size: 12px;
}

.sortable-header:not(:hover) .sort-indicator:empty::after {
    content: '⇅';
    color: var(--muted-text);
    font-size: 10px;
}

.sortable-header:hover .sort-indicator:empty::after {
    content: '⇅';
    color: var(--accent-primary);
    font-size: 10px;
}

/* Time Display Styles */
.created-time {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--muted-text);
    font-weight: 500;
}

.next-follow-time {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 500;
}



.form-group label {
    display: block;
    margin-bottom: 0px;
    color: var(--secondary-text);
    font-weight: 500;
    font-size: 14px;
}

.dashboard-filter-form .form-group {
    margin-bottom: 0;
    text-align: center;
    width: 100%;
}

.dashboard-filter-form .form-group label {
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--accent-primary);
    font-weight: 600;
    display: block;
}

.dashboard-filter-form select {
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    background-color: var(--primary-bg);
    color: var(--primary-text);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    text-align: center;
}

/* Enhanced Card Styles */
.card {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 5px;
    box-shadow: var(--shadow-medium);
}

.card-header {
    font-size: 20px;
    color: var(--accent-primary);
    border-bottom: 2px solid var(--border-primary);
    padding-bottom: 5px;
    margin-bottom: 5px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Enhanced Button Styles */
.btn {
    display: inline-block;
    padding: 12px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
    min-width: 12px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-primary {
    background-color: var(--btn-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
}

.btn-primary:hover {
    background-color: var(--btn-primary-hover);
    box-shadow: 0 4px 16px rgba(0, 122, 204, 0.4);
}

.btn-secondary {
    background-color: var(--btn-secondary);
    color: #fff;
    box-shadow: 0 2px 5px rgba(85, 85, 85, 0.3);
    min-width: 5px;
    width: auto;
}

.btn-secondary:hover {
    background-color: var(--btn-secondary-hover);
}

.btn-danger {
    background-color: var(--btn-danger);
    color: #fff;
    box-shadow: 0 2px 8px rgba(204, 51, 51, 0.3);
}

.btn-danger:hover {
    background-color: var(--btn-danger-hover);
    box-shadow: 0 4px 5px rgba(204, 51, 51, 0.4);
}

/* Edit Customer Page Styles */
.edit-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
}

.edit-card {
    background: var(--gradient-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.edit-card .card-header {
    color: var(--accent-primary);
    font-size: 22px;
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.current-avatar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-bg);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-secondary);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 5px;
}

/* Responsive Design - 统一admin和user视图 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 10px;
    }

    .sidebar h2 {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .sidebar ul li a {
        padding: 8px 5px;
        font-size: 12px;
    }

    .main-content {
        margin: 0px;
        padding: 0px;
    }

    .dashboard-layout {
        flex-direction: column;
        gap: 5px;
        align-items: stretch;
    }

    .dashboard-filter-form {
        min-width: 100%;
        max-width: none;
        height: auto;
    }

    .dashboard-grid {
        flex-direction: column;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar .form-group {
        min-width: 100%;
    }

    .form-actions {
        justify-content: center;
        margin-top: 15px;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
    }

    /* 移动端时所有列都使用相同的最小宽度 */
    .table .col-name,
    .table .col-title,
    .table .col-email,
    .table .col-phone,
    .table .col-company,
    .table .col-country,
    .table .col-address,
    .table .col-platform,
    .table .col-status,
    .table .col-stage,
    .table .col-level,
    .table .col-customer_tier,
    .table .col-tags,
    .table .col-assigned,
    .table .col-created,
    .table .col-follow {
        min-width: 80px;
        max-width: none;
    }

    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 50px;
    }

    .main-content {
        margin-left: 60px;
        padding: 5px;
    }

    .card {
        padding: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card .stat-number {
        font-size: 24px;
    }

    .toolbar {
        gap: 10px;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* 自动完成输入框样式 */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--secondary-bg);
    border: 1px solid var(--border-secondary);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
}

.autocomplete-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-secondary);
    display: flex;
    align-items: center;
}

.autocomplete-suggestion:hover {
    background: var(--card-bg);
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion .flag {
    width: 20px;
    height: 14px;
    margin-right: 8px;
    border: 1px solid var(--border-muted);
    border-radius: 2px;
}

.autocomplete-suggestion .country-info {
    flex: 1;
}

.autocomplete-suggestion .country-name {
    font-weight: bold;
}

.autocomplete-suggestion .country-details {
    font-size: 12px;
    color: var(--placeholder-text);
}

/* Autocomplete Item (alias for autocomplete-suggestion) */
.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-secondary);
    display: flex;
    align-items: center;
}

.autocomplete-item:hover {
    background: var(--card-bg);
}

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

.autocomplete-item .country-flag {
    width: 20px;
    height: 14px;
    margin-right: 8px;
    border: 1px solid var(--border-muted);
    border-radius: 2px;
}

.autocomplete-item span {
    font-weight: bold;
    color: var(--primary-text);
}

/* Form Row Layout and File Upload - Combined Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 25px;
}

.form-col {
    flex: 1;
}

.form-col label {
    display: block;
    color: var(--secondary-text);
    margin-bottom: 8px;
    font-weight: 600;
}

.form-col input,
.form-col select,
.form-col textarea {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--primary-text);
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-col input:focus,
.form-col select:focus,
.form-col textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
    outline: none;
}

.form-col textarea {
    resize: vertical;
    min-height: 120px;
}

.file-upload-area {
    border: 2px dashed var(--border-secondary);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    background: var(--primary-bg);
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--accent-primary);
    background-color: rgba(0, 170, 255, 0.1);
}

.file-upload-area input[type="file"] {
    display: none;
}

.upload-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
}

.upload-text {
    margin-bottom: 10px;
    color: var(--muted-text);
}

.notes-textarea {
    white-space: pre-wrap;
    word-wrap: break-word;
    resize: vertical;
}

/* Customer Avatar Styles */

/* 合并：全局小头像样式 */

/* 合并 .customer-avatar：全局小头像和详情页大头像 */
.customer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    vertical-align: middle;
    border: 2px solid var(--border-primary);
}

.customer-header .customer-avatar {
    width: 80px;
    height: 80px;
    border: 3px solid var(--accent-primary);
    margin-right: 0;
}

/* Next Follow Time Styles */
.next-follow-time {
    font-size: 12px;
    color: var(--secondary-text);
}

/* File Upload Styles - Removed duplicate */
.file-upload-area {
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: var(--secondary-bg);
    margin: 10px 0;
    transition: border-color 0.3s ease;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--accent-primary);
    background-color: var(--card-bg);
}

.file-upload-area input[type="file"] {
    display: none;
}

.upload-text {
    color: var(--secondary-text);
    font-size: 14px;
    margin-bottom: 10px;
}

.upload-button {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.upload-button:hover {
    background-color: var(--accent-hover);
}

/* Attachment List Styles */
.attachment-list {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.attachment-list a {
    color: var(--primary-text);
}


.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--secondary-bg);
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid var(--border-secondary);
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-weight: bold;
    color: var(--accent-primary);
}

.attachment-meta {
    font-size: 12px;
    color: var(--muted-text);
}

.attachment-actions a {
    margin-left: 10px;
    color: var(--danger-light);
    text-decoration: none;
    font-size: 12px;
}

.attachment-actions a:hover {
    color: var(--danger);
}

/* Notes Textarea Auto-resize */
.notes-textarea {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 100px;
    resize: vertical;
}

/* Form improvements for new fields - Removed duplicate */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-col {
    flex: 1;
}

.form-col label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Dashboard new customer stat card */
.stat-card.bg-red {
    background-color: #e53935;
    color: #ffffff;
}

.stat-card.bg-red .stat-number {
    color: #ffffff;
}

/* Customer Detail Page Styles */
.detail-container {
    max-width: 2000px;
    margin: 0 auto;
    padding: 20px;
}

.customer-header {
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.customer-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 24px;
    font-weight: bold;
    border: 3px solid var(--accent-primary);
}

.customer-info {
    flex: 1;
}

.customer-name {
    font-size: 24px;
    color: var(--accent-primary);
    margin: 0 0 10px 0;
}

.customer-name-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.customer-name-container .customer-name {
    margin: 0;
}

.tier-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
    white-space: nowrap;
    display: inline-block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .customer-name-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .customer-name-container .customer-name {
        font-size: 20px;
    }

    .tier-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
}

.customer-company {
    font-size: 16px;
    color: var(--secondary-text);
    margin: 0 0 10px 0;
}

.customer-meta {
    display: flex;
    gap: 20px;
    align-items: center;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-potential {
    background: #ffc107;
    color: #000;
}

.status-intent {
    background: #17a2b8;
    color: #fff;
}

.status-deal {
    background: #28a745;
    color: #fff;
}

.status-lost {
    background: #dc3545;
    color: #fff;
}

.status-fake {
    background: #6c757d;
    color: #fff;
}

.level-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.level-A {
    background: #dc3545;
    color: #fff;
}

.level-B {
    background: #ffc107;
    color: #000;
}

.level-C {
    background: #28a745;
    color: #fff;
}

.level-D {
    background: #007bff;
    color: #fff;
}

.country-info {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* 合并：国旗样式 */
.country-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.country-badge {
    background-color: var(--muted-text);
    color: var(--primary-text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 10px;
}

.detail-card,
.records-card {
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.detail-card h3,
.records-card h3 {
    color: #00aaff;
    border-bottom: 2px solid #00aaff;
    padding-bottom: 12px;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
}

.detail-item {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

.detail-item strong {
    color: var(--accent-primary);
    width: 120px;
    flex-shrink: 0;
    font-weight: 600;
}

.detail-value {
    flex: 1;
    color: var(--primary-text);
    word-wrap: break-word;
}

.notes-section {
    /* grid-column: 1 / -1; */
    width: auto;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333;
    margin-bottom: 30px;
}

.notes-section h3 {
    color: var(--accent-primary);
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 12px;
    margin-top: 0;
    margin-bottom: 20px;
}

.notes-content {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    color: var(--primary-text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%;
    overflow-wrap: break-word;
}

.action-buttons {
    display: flex;
    gap: 5px;
    margin-top: 20px;
}

.record-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.record-item {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--secondary-bg) 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-primary);
}

.record-item .meta {
    font-size: 0.85em;
    color: var(--muted-text);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-secondary);
}


/* 合并：邮箱图标样式 */
.email-icon {
    color: var(--accent-primary);
    text-decoration: none;
}

.email-icon:hover {
    color: var(--accent-hover);
}

/* Customer Detail Page Attachment Styles - Override existing attachment styles for this page */
.detail-container .attachment-list {
    margin-top: 5px;
}

.detail-container .attachment-item {
    background: var(--primary-bg);
    padding: 8px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    /* Override existing border */
}

.detail-container .attachment-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.detail-container .attachment-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.detail-container .attachment-meta {
    color: var(--muted-text);
    font-size: 0.9em;
}

/* Form Section Styles - Modular Design */
.form-section {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-title {
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-primary);
    border-bottom: 2px solid var(--border-secondary);
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background-color: var(--accent-primary);
    border-radius: 2px;
    margin-right: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: start;
}

.form-group-full {
    grid-column: 1 / -1;
}

/* 跟进管理模块特殊布局 */
.form-section .form-grid:has(.tag-container) {
    grid-template-columns: 1fr 2fr;
    gap: 25px;
}

.form-section .form-grid:has(.tag-container) .form-group:nth-child(1) {
    grid-column: 1;
}

.form-section .form-grid:has(.tag-container) .form-group:nth-child(2) {
    grid-column: 2;
}

.form-section .form-grid:has(.tag-container) .form-group-full {
    grid-column: 1 / -1;
    margin-top: 15px;
}

/* File Management Styles */
.file-management {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.upload-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-group label {
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 5px;
}

.file-upload-area.compact {
    padding: 15px;
    text-align: center;
    border: 2px dashed var(--border-light);
    border-radius: 6px;
    background-color: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-area.compact:hover {
    border-color: var(--accent-primary);
    background-color: var(--card-bg);
}

.file-upload-area.compact .upload-text {
    font-size: 14px;
    color: var(--secondary-text);
    font-weight: 500;
}

.current-avatar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 10px;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.avatar-actions span {
    font-size: 12px;
    color: var(--muted-text);
}

.attachment-list.compact {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    background-color: var(--card-bg);
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-secondary);
}

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

.attachment-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.attachment-meta {
    color: var(--muted-text);
    font-size: 11px;
    white-space: nowrap;
}

.btn-xs {
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 3px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Edit Customer Page - 标签管理特殊样式 */
.edit-card .form-group:has(.tag-container) {
    min-width: 100%;
}

.edit-card .form-group:has(.tag-container) label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.edit-card .form-group:has(.tag-container) input[type="text"] {
    margin-bottom: 8px;
}

.edit-card .tag-container {
    min-height: 50px;
    max-height: 150px;
    padding: 15px;
    border: 2px solid var(--border-secondary);
    border-radius: 8px;
    background: var(--card-bg);
}

.edit-card .tag-container:empty::before {
    content: "输入标签后按Enter添加，或用逗号分隔...";
    color: var(--muted-text);
    font-style: italic;
    font-size: 14px;
}

/* 美化跟进时间和付款相关输入框 */
.form-section input[type="date"],
.form-section input[type="number"] {
    position: relative;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--card-bg) 100%);
    border: 2px solid var(--border-secondary);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-text);
    transition: all 0.3s ease;
}

.form-section input[type="date"]:focus,
.form-section input[type="number"]:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
    background: var(--primary-bg);
    transform: translateY(-1px);
}

/* 特殊样式 - 跟进时间 */
.form-section input[name="next_follow_time"] {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    border-color: var(--accent-primary);
    color: var(--accent-light);
    font-weight: 600;
}

.form-section input[name="next_follow_time"]:focus {
    background: linear-gradient(135deg, #1a3a5c 0%, #0f2a4c 100%);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.3), 0 2px 8px rgba(0, 170, 255, 0.2);
}

/* 特殊样式 - 付款金额 */
.form-section input[name="payment_amount"] {
    background: linear-gradient(135deg, #1a4a1a 0%, #2a5a2a 100%);
    width: 85%;
    border-color: var(--success);
    color: var(--success-light);
    font-weight: 600;
    font-size: 16px;
    margin: 5px 0px;
}

.form-section input[name="payment_amount"]:focus {
    background: linear-gradient(135deg, #1a4a1a 0%, #0f3a0f 100%);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3), 0 2px 8px rgba(40, 167, 69, 0.2);
}

.form-section input[name="payment_amount"]::placeholder {
    color: var(--success);
    opacity: 0.7;
}

/* 特殊样式 - 付款日期 */
.form-section input[name="payment_date"] {
    background: linear-gradient(135deg, #4a3a1a 0%, #5a4a2a 100%);
    border-color: var(--warning);
    color: var(--warning);
    font-weight: 600;
    width: 85%;
    margin: 5px 0px;
}

.form-section input[name="payment_date"]:focus {
    background: linear-gradient(135deg, #4a3a1a 0%, #3a2a0f 100%);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3), 0 2px 8px rgba(255, 193, 7, 0.2);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(100%) sepia(100%) saturate(1000%) hue-rotate(30deg);
    cursor: pointer;
}


/* 输入框图标增强 */
.form-section .form-group:has(input[name="next_follow_time"]) label::before {
    content: "📅 ";
    font-size: 16px;
    margin-right: 4px;
}

.form-section .form-group:has(input[name="payment_amount"]) label::before {
    content: "💰 ";
    font-size: 16px;
    margin-right: 4px;
}

.form-section .form-group:has(input[name="payment_date"]) label::before {
    content: "🗓️ ";
    font-size: 16px;
    margin-right: 4px;
}

.form-section .form-group:has(input[name="tags"]) label::before {
    content: "🏷️ ";
    font-size: 16px;
    margin-right: 4px;
}

/* 响应式调整跟进管理布局 */
@media (max-width: 1024px) {
    .form-section .form-grid:has(.tag-container) {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-section .form-grid:has(.tag-container) .form-group:nth-child(1),
    .form-section .form-grid:has(.tag-container) .form-group:nth-child(2) {
        grid-column: 1;
    }
}

/* Responsive design for customer detail page */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .customer-header {
        flex-direction: column;
        text-align: center;
    }

    .customer-meta {
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .upload-section {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 15px;
    }
}

/* 新的标签系统样式 - 横向布局优化 */
.tag-container {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    background: var(--primary-bg);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tag-badge {
    display: inline-block;
    position: relative;
    padding: 6px 28px 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    position: relative;
    cursor: default;
    transition: all 0.2s ease;
    gap: 6px;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 2px;
}

.tag-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.tag-remove {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-weight: bold;
    z-index: 1;
}

.tag-badge:hover .tag-remove {
    opacity: 1;
}

.tag-remove:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
}

/* 标签预览样式 */
.tag-badge.preview {
    background: var(--muted-text) !important;
    opacity: 0.7;
    border: 2px dashed var(--border-secondary);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

/* 输入框获得焦点时的动画 */
@keyframes inputFocus {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0px rgba(0, 170, 255, 0);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
    }
}

.form-section input[type="date"]:focus,
.form-section input[type="number"]:focus,
.form-section input[type="text"]:focus {
    animation: inputFocus 0.3s ease-out;
}

/* 付款记录添加动画 */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.payment-record {
    animation: slideInFromLeft 0.3s ease-out;
}

/* 标签添加动画 */
@keyframes tagAddition {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tag-badge:not(.preview) {
    animation: tagAddition 0.3s ease-out;
}

/* 国家autocomplete样式改进 */
.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-primary);
    transition: background-color 0.2s;
}

.autocomplete-item:hover {
    background-color: var(--card-bg);
}

.autocomplete-item .country-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.autocomplete-item .country-name {
    flex: 1;
    font-weight: 500;
}

.autocomplete-item .country-code {
    font-size: 11px;
    color: var(--placeholder-text);
    font-weight: normal;
}

/* 付款管理样式 */
.payment-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, var(--success) 0%, #1e7e34 100%);
    border-radius: 8px;
    border: 1px solid var(--success);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.payment-summary .amount {
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.payment-summary .tier {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 付款记录美化 */
.payment-history {
    margin-top: 25px;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-secondary);
}

.payment-history h5 {
    margin-bottom: 20px;
    color: var(--accent-primary);
    font-size: 16px;
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
}

.payment-history h5::before {
    content: "💳 ";
    font-size: 18px;
    margin-right: 8px;
}

.payment-record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--card-bg) 100%);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.payment-record::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--success);
}

.payment-record:hover {
    background: var(--tertiary-bg);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.payment-amount {
    font-weight: bold;
    color: var(--success-light);
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.payment-date {
    color: var(--accent-primary);
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.payment-notes {
    flex: 1;
    text-align: right;
    color: var(--secondary-text);
    margin-left: 15px;
    font-style: italic;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-payments {
    text-align: center;
    color: var(--muted-text);
    font-style: italic;
    padding: 40px;
    background: var(--primary-bg);
    border-radius: 8px;
    border: 2px dashed var(--border-secondary);
}

.no-payments::before {
    content: "💸";
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 客户等级样式 */
.tier-青铜 {
    background-color: #cd7f32;
    color: white;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

.tier-白银 {
    background-color: #c0c0c0;
    color: #333;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3);
}

.tier-黄金 {
    background-color: #ffd700;
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.tier-铂金 {
    background-color: #e5e4e2;
    color: #333;
    box-shadow: 0 2px 8px rgba(229, 228, 226, 0.3);
}

.tier-钻石 {
    background-color: #b9f2ff;
    color: #333;
    box-shadow: 0 2px 8px rgba(185, 242, 255, 0.3);
}

.tier-星耀 {
    background-color: #ff6b6b;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.tier-王者 {
    background-color: #8b5cf6;
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* 列可见性控制器样式 */
.column-selector {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
    max-width: 100%;
}

.column-selector-header {
    background: var(--secondary-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-selector-header h4 {
    margin: 0;
    color: var(--primary-text);
    font-size: 16px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--danger);
    color: white;
}

.column-selector-body {
    padding: 20px;
}

.column-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.column-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    user-select: none;
    min-height: 40px;
    border: 1px solid transparent;
}

.column-option:hover {
    background: var(--secondary-bg);
    border-color: var(--accent-primary);
}

.column-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.column-option input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.column-option span {
    color: var(--primary-text);
    font-size: 14px;
}

.column-option input[type="checkbox"]:disabled+span {
    color: var(--muted-text);
}

.column-selector-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

.column-selector-actions .btn {
    flex: 1;
    min-width: 80px;
}

/* 隐藏列的样式 */
.table th[style*="display: none"],
.table td[style*="display: none"] {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .column-options {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }

    .column-option {
        padding: 8px 10px;
        min-height: 36px;
    }

    .column-option span {
        font-size: 13px;
    }

    .column-selector-header {
        padding: 12px 15px;
    }

    .column-selector-body {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .column-options {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }

    .column-option {
        padding: 6px 8px;
        min-height: 32px;
    }

    .column-option input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
}

/* 列设置按钮特殊样式 */
.btn.column-settings-btn {
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 170, 255, 0.3);
}

.btn.column-settings-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 170, 255, 0.4);
}

.btn.column-settings-btn svg {
    margin-right: 6px;
}

/* 确保card-header按钮布局正常 */
.card-header .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* 列设置按钮特殊样式 */
.btn.column-settings-btn {
    background: var(--accent-primary);
    color: white;
    border: 1px solid var(--accent-primary);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 170, 255, 0.3);
}

.btn.column-settings-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 170, 255, 0.4);
}

.btn.column-settings-btn svg {
    margin: 0px;
}

/* 齿轮图标按钮样式 */
.btn.btn-icon {
    width: 24px;
    height: 24px;
    padding: 0px;
    border-radius: 50%;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn.btn-icon:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.4);
}

.btn.btn-icon svg {
    transition: transform 0.3s ease;
}

.btn.btn-icon:active {
    transform: scale(0.95) rotate(90deg);
}

/* 确保card-header按钮布局正常 */
.card-header .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Autocomplete 样式 */
.autocomplete-container {
    position: relative;
    width: auto;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-primary);
    transition: background-color 0.2s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: var(--secondary-bg);
}

.autocomplete-item .flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.autocomplete-item .country-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.autocomplete-item .country-name {
    color: var(--primary-text);
    font-weight: 500;
    font-size: 14px;
}

.autocomplete-item .country-details {
    color: var(--muted-text);
    font-size: 12px;
}

.autocomplete-item .country-code {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

/* 国家筛选输入框样式 */
#country-input {
    position: relative;
}

.filter-country .autocomplete-container {
    min-width: 30px;
}

/* 跟进管理左右分栏和3列masonry布局 */
.follow-management-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.follow-left-panel {
    flex: 0 0 33.333%;
    min-width: 280px;
}

.follow-right-panel {
    flex: 1 1 66.667%;
}

.follow-actions-center {
    text-align: center;
    margin: 16px 0 8px 0;
}

.follow-hint {
    margin-top: 8px;
    text-align: center;
}

.tags-section {
    margin-bottom: 24px;
}

.follow-history-section h6 {
    color: var(--secondary-text);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.follow-history-section h6::before {
    content: "📋";
    font-size: 16px;
}

.follow-records-masonry {
    display: flex;
    gap: 12px;
}

.follow-records-masonry-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 跟进记录小卡片样式 - 紧凑版 */
.follow-record-item {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 10px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.follow-record-item:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 6px rgba(0, 170, 255, 0.1);
}

.follow-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.follow-type-badge {
    background: var(--accent-primary);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.follow-type-badge.电话 {
    background: #28a745;
}

.follow-type-badge.WhatsApp {
    background: #25d366;
}

.follow-type-badge.邮件 {
    background: #007bff;
}

.follow-type-badge.Alibaba {
    background: #ff6a00;
}

.follow-type-badge.其他 {
    background: #6c757d;
}

.follow-time {
    color: var(--muted-text);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.follow-time::before {
    content: "🕒";
    font-size: 12px;
}

.follow-content {
    display: inline;
    color: var(--primary-text);
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 6px;
    word-wrap: break-word;
}

.follow-record-actions {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.btn-delete-follow {
    display: flex;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-delete-follow:hover {
    background: var(--danger-light);
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .follow-management-layout {
        flex-direction: column;
        gap: 16px;
    }

    .follow-left-panel {
        flex: 1 1 auto;
        min-width: auto;
    }

    .follow-right-panel {
        flex: 1 1 auto;
    }
}

@media (max-width: 768px) {
    .follow-records-masonry {
        gap: 8px;
    }

    .follow-record-item {
        padding: 8px;
        font-size: 12px;
    }
}

/* 付款管理左右分栏和2列masonry布局 */
.payment-management-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.payment-left-panel {
    flex: 0 0 16.667%;
    min-width: 200px;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 16px;
}

.payment-right-panel {
    flex: 1 1 83.333%;
}

.payment-actions-center {
    text-align: center;
    margin: 16px 0 8px 0;
}

.payment-history-section h6 {
    color: var(--secondary-text);
    font-size: 14px;
    font-weight: 600;
    margin: 0px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}

.payment-history-section h6::before {
    content: "💰";
    font-size: 16px;
}

.payment-records-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-items: start;
}

.payment-records-masonry-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.payment-record-item {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 12px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.payment-record-item:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.1);
}

.payment-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.payment-amount-badge {
    background: var(--success);
    color: white;
    padding: 4px 4px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.payment-time {
    color: var(--muted-text);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.payment-time::before {
    content: "📅";
}

.payment-method-badge {
    background: var(--accent-primary);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    display: inline-block;
}

.payment-method-badge.Paypal {
    background: #0070ba;
}

.payment-method-badge.Alipay {
    background: #1677ff;
}

.payment-method-badge.T\\/T {
    background: #52c41a;
}

.payment-method-badge.L\\/C {
    background: #722ed1;
}

.payment-method-badge.Alibaba {
    background: #ff6a00;
}

.payment-record-notes {
    color: var(--primary-text);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 6px;
    font-style: italic;
}

.no-payment-records {
    text-align: center;
    color: var(--muted-text);
    font-style: italic;
    padding: 40px 20px;
    background: var(--secondary-bg);
    border-radius: 6px;
    border: 1px dashed var(--border-primary);
    grid-column: 1 / -1;
}

/* 付款管理响应式调整 */
@media (max-width: 1024px) {
    .payment-management-layout {
        flex-direction: column;
        gap: 16px;
    }

    .payment-left-panel {
        flex: 1 1 auto;
        min-width: auto;
    }

    .payment-right-panel {
        flex: 1 1 auto;
    }
}

@media (max-width: 768px) {
    .payment-records-masonry {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .payment-record-item {
        display: flex;
        padding: 10px;
        font-size: 12px;
    }
}

.payment-record-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
}

.follow-record-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}