/* 本工具仅定义 common.css 未提供的样式，公共类（卡片/搜索/空状态/按钮等）复用 common.css */

/* 卡片头部右侧计数 */
.header-count {
    font-size: 12px;
    color: #6b7280;
    margin-right: 2px;
}

/* 顶部工具条：搜索框，整体居中 */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* 覆盖 common.css 中 .search-box 的 flex:1 + margin-right，使搜索框定宽居中 */
.toolbar .search-box {
    flex: 0 1 460px;
    max-width: 460px;
    margin-right: 0;
}

/* 放大镜图标垂直居中（emoji 字形基线易偏上） */
.toolbar .search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 搜索框清除按钮 */
.search-clear {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    line-height: 1;
    padding: 0 4px;
}

.search-clear:hover { color: #6b7280; }

/* 分类筛选 chips：整体居中 */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-chip {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: #8b5cf6;
    color: #6d28d9;
}

.filter-chip.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff;
}

/* 电话网格：整块全宽，自适应多列 */
.phone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.phone-category {
    background: #fafafa;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 12px 14px;
}

.phone-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e5e7eb;
}

.pc-icon { font-size: 16px; }
.pc-name { font-size: 14px; font-weight: 600; color: #1f2937; }
.pc-count { margin-left: auto; font-size: 11px; color: #9ca3af; }

.phone-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.phone-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 8px;
}

.phone-info {
    min-width: 0;
}

.phone-name {
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phone-number {
    font-size: 13px;
    font-weight: 600;
    color: #6d28d9;
    font-family: Consolas, Monaco, "Courier New", monospace;
}

.copy-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s;
}

.copy-btn:hover {
    background: #f5f3ff;
    border-color: #8b5cf6;
}

/* 号码拨号链接 */
.tel-link {
    color: inherit;
    text-decoration: none;
}

.tel-link:hover {
    text-decoration: underline;
}

/* 紧急电话高亮 */
.phone-row.is-emergency {
    border-left: 3px solid #ef4444;
    background: #fef2f2;
}

.phone-row.is-emergency .phone-name {
    color: #b91c1c;
    font-weight: 600;
}

.phone-row.is-emergency .phone-number {
    color: #dc2626;
}

/* ============ 深色模式适配 ============ */
body.dark .phone-category {
    background: #212529;
    border-color: #495057;
}

body.dark .phone-category-header {
    border-bottom-color: #495057;
}

body.dark .pc-name { color: #e0e0e0; }
body.dark .pc-count { color: #9aa0a6; }

body.dark .phone-row {
    background: #1a1d20;
    border-color: #495057;
}

body.dark .phone-name { color: #d0d0d0; }
body.dark .phone-number { color: #c4b5fd; }

body.dark .copy-btn {
    background: #212529;
    border-color: #495057;
    color: #cfcfcf;
}

body.dark .copy-btn:hover {
    background: #2d2d3a;
    border-color: #8b5cf6;
}

body.dark .filter-chip {
    background: #212529;
    border-color: #495057;
    color: #cfcfcf;
}

body.dark .filter-chip:hover {
    border-color: #8b5cf6;
    color: #c4b5fd;
}

body.dark .filter-chip.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff;
}

body.dark .search-clear { color: #9aa0a6; }
body.dark .search-clear:hover { color: #e0e0e0; }

body.dark .header-count { color: #9aa0a6; }

body.dark .phone-row.is-emergency {
    background: rgba(239, 68, 68, 0.12);
}

body.dark .phone-row.is-emergency .phone-name,
body.dark .phone-row.is-emergency .phone-number {
    color: #fca5a5;
}
