* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f0f2f5; color: #333; line-height: 1.5; }
a { color: #1677ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

.topbar { background: #001529; color: #fff; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.topbar .brand { font-size: 18px; font-weight: 600; color: #fff; }
.topbar nav a { color: rgba(255,255,255,.75); margin-left: 20px; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.active { color: #fff; text-decoration: none; }
.topbar .user-info { font-size: 13px; color: rgba(255,255,255,.65); }
.topbar .user-info a { color: rgba(255,255,255,.85); margin-left: 12px; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.1); width: 400px; max-width: 90%; }
.login-box h1 { text-align: center; margin-bottom: 8px; font-size: 22px; }
.login-box .version { text-align: center; color: #999; font-size: 12px; margin-bottom: 24px; }

.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card h3 { margin-bottom: 16px; font-size: 16px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); text-align: center; }
.stat-card .num { font-size: 32px; font-weight: 700; color: #1677ff; }
.stat-card .label { color: #666; font-size: 13px; margin-top: 4px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #555; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }

.filter-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.filter-bar input, .filter-bar select { padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }

.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; transition: all .2s; }
.btn-primary { background: #1677ff; color: #fff; }
.btn-primary:hover { background: #4096ff; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #73d13d; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #ff7875; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-link { background: none; color: #1677ff; padding: 0; border: none; cursor: pointer; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }
.btn-block { width: 100%; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; table-layout: fixed; }
table th, table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; text-align: left; white-space: nowrap; }
table th { background: #fafafa; font-weight: 600; color: #555; position: sticky; top: 0; }
table tr:hover { background: #fafafa; }

/* 紧凑客户表格 - 无横向滚动 */
.card-table { padding: 12px; overflow: hidden; }
.table-compact { table-layout: auto; width: 100%; }
.table-compact th, .table-compact td { padding: 6px 8px; white-space: normal; vertical-align: top; font-size: 12px; line-height: 1.4; }
.customer-table .col-id { width: 50px; white-space: nowrap; }
.customer-table .col-seq { width: 44px; white-space: nowrap; text-align: center; color: #999; }
.customer-table .col-info { min-width: 120px; max-width: 180px; }
.customer-table .col-product { min-width: 100px; max-width: 160px; }
.customer-table .col-time { width: 130px; white-space: nowrap; font-size: 11px; }
.customer-table .col-sub { width: 60px; white-space: nowrap; text-align: right; }
.customer-table .col-name { width: 10em; min-width: 10em; max-width: 10em; }
.customer-table .col-phone { width: 118px; min-width: 118px; max-width: 118px; white-space: nowrap; }
.customer-table .col-assign-time { width: 120px; white-space: nowrap; font-size: 11px; }
.customer-table td.col-phone { position: relative; overflow: hidden; }
.phone-cell { display: block; font-family: monospace; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-cell-fixed { display: block; font-family: monospace; white-space: nowrap; }
.phone-copyable { cursor: pointer; color: #1677ff; }
.phone-copyable:hover { text-decoration: underline; }
.customer-table td.col-phone .copy-tip { display: none; }

.copy-toast {
    position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,.75); color: #fff; padding: 10px 20px; border-radius: 6px;
    font-size: 14px; z-index: 9999; opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff; border-radius: 8px; padding: 24px; width: 400px; max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.modal-box h3 { margin-bottom: 8px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.customer-table th.cell-highlight,
.customer-table td.cell-highlight { background: #f6f8fc; }
.customer-table thead th.cell-highlight { background: #eef2f8; }

.phone-toggle-btn {
    display: inline-block; margin-left: 4px; padding: 0 4px; border: none;
    background: none; color: #1677ff; font-size: 11px; font-weight: normal; cursor: pointer;
}
.phone-toggle-btn:hover { text-decoration: underline; }

.stats-inline {
    display: flex; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 16px;
    padding: 12px 16px; background: #fff; border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06); font-size: 14px;
}
.stats-inline .stats-item { color: #666; }
.stats-inline .rate-num { color: #1677ff; font-size: 16px; }
.customer-table .col-addr { min-width: 100px; max-width: 180px; }
.customer-table .col-status { width: 60px; white-space: nowrap; }

.info-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.info-name { font-weight: 500; word-break: break-all; }
.info-tags { display: flex; flex-wrap: wrap; gap: 3px; flex-shrink: 0; }
.info-tags .badge { font-size: 10px; padding: 1px 5px; white-space: nowrap; }

.sub-text { color: #999; font-size: 11px; margin-top: 2px; word-break: break-all; line-height: 1.3; }
.addr-text { font-size: 11px; color: #666; word-break: break-all; line-height: 1.35; display: block; }

.count-link { color: #1677ff; text-decoration: none; }
.count-link:hover { text-decoration: underline; }

.alert { padding: 10px 16px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.alert-info { background: #e6f4ff; border: 1px solid #91caff; color: #0958d9; }

.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; color: #333; }
.pagination a:hover { border-color: #1677ff; color: #1677ff; text-decoration: none; }
.pagination .current { background: #1677ff; color: #fff; border-color: #1677ff; }
.pagination .ellipsis { padding: 6px 8px; border: none; color: #999; }

.pagination-wrap { margin-top: 16px; }
.pagination-jump { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; }
.pagination-jump .jump-input { width: 70px; padding: 6px 8px; border: 1px solid #d9d9d9; border-radius: 4px; text-align: center; }
.pagination-jump .page-info { color: #999; margin-left: 8px; }

.sort-link { color: #333; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: #1677ff; }
.sort-arrow { color: #1677ff; font-size: 12px; margin-left: 2px; }

.mark-tag { display: inline-block; padding: 4px 12px; border-radius: 4px; font-size: 12px; user-select: none; }
.mark-tag-pending { background: #e6f4ff; color: #1677ff; border: 1px solid #91caff; cursor: pointer; }
.mark-tag-pending:hover { background: #1677ff; color: #fff; }
.mark-tag-done { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; cursor: pointer; }
.mark-tag-done:hover { background: #52c41a; color: #fff; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge-green { background: #f6ffed; color: #52c41a; }
.badge-orange { background: #fff7e6; color: #fa8c16; }
.badge-gray { background: #f5f5f5; color: #999; }

.text-muted { color: #999; font-size: 13px; }
.text-center { text-align: center; }
.mb-16 { margin-bottom: 16px; }
.mt-16 { margin-top: 16px; }

.phone-btn { color: #1677ff; cursor: pointer; border: none; background: none; font-size: 13px; padding: 0; }
.phone-btn:hover { text-decoration: underline; }
.phone-number { color: #1677ff; cursor: pointer; font-weight: 500; }
.copy-tip { color: #52c41a; font-size: 12px; margin-left: 6px; animation: fadeOut 2s forwards; }
@keyframes fadeOut { 0%,70% { opacity:1; } 100% { opacity:0; } }

.action-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.checkbox-col { width: 40px; }

@media (max-width: 768px) {
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .topbar { flex-direction: column; height: auto; padding: 10px; }
    .topbar nav { margin-top: 8px; }
}
