/* ============================================================
   AI评论截流系统 v2.0 - 主样式表
   ============================================================ */

/* === 全局重置 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f0f4f8;
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    color: #1a1a2e;
    min-height: 100vh;
}

/* === 头部导航 === */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 0 40px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .logo .icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header .nav {
    display: flex;
    gap: 5px;
}

.header .nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.header .nav a:hover,
.header .nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.header .nav a.active {
    background: rgba(233,69,96,0.3);
}

.header .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #52c41a;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === 主容器 === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* === 统计卡片行 === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: all 0.3s;
    border: 1px solid rgba(0,0,0,0.03);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.stat-card .info {
    flex: 1;
}

.stat-card .label {
    font-size: 13px;
    color: #8c8c8c;
    margin-bottom: 6px;
}

.stat-card .number {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.stat-card .number small {
    font-size: 14px;
    font-weight: 400;
    color: #8c8c8c;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card .stat-icon.red { background: #fff1f0; color: #e94560; }
.stat-card .stat-icon.blue { background: #e6f7ff; color: #1677ff; }
.stat-card .stat-icon.green { background: #f6ffed; color: #52c41a; }
.stat-card .stat-icon.orange { background: #fff7e6; color: #fa8c16; }
.stat-card .stat-icon.purple { background: #f9f0ff; color: #722ed1; }

/* === 面板容器 === */
.panel {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.panel-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title .badge {
    font-size: 12px;
    background: #f0f0f0;
    color: #666;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 400;
}

.panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #1677ff, #0958d9);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22,119,255,0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-success {
    background: linear-gradient(135deg, #52c41a, #389e0d);
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(82,196,26,0.35);
}

.btn-warning {
    background: linear-gradient(135deg, #fa8c16, #d46b08);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ff4d4f, #cf1322);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-outline:hover {
    color: #1677ff;
    border-color: #1677ff;
    background: #e6f7ff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

/* === 表单控件 === */
.search-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
    padding: 10px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.25s;
    outline: none;
    background: #fff;
    color: #1a1a2e;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 3px rgba(22,119,255,0.1);
}

.search-box input {
    flex: 1;
    min-width: 280px;
}

/* === 过滤器行 === */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.filter-bar select {
    padding: 8px 14px;
    min-width: 120px;
}

.filter-bar .filter-label {
    font-size: 13px;
    color: #8c8c8c;
}

/* === 表格 === */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #f0f0f0;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

thead th:hover {
    background: #f0f5ff;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

tbody tr:hover {
    background: #fafafa;
}

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

/* === 等级标签 === */
.level-tag {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 40px;
}

.level-A { background: #fff1f0; color: #cf1322; }
.level-B { background: #fff7e6; color: #d46b08; }
.level-C { background: #e6f7ff; color: #096dd9; }
.level-D { background: #f5f5f5; color: #8c8c8c; }

/* === 状态标签 === */
.status-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

.status-待跟进 { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; }
.status-已联系 { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }
.status-已成交 { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.status-无效   { background: #f5f5f5; color: #8c8c8c; border: 1px solid #d9d9d9; }

/* === 详情字段 (模态框内) === */
.detail-field {
    margin-bottom: 4px;
}

.detail-field label {
    display: block;
    font-size: 12px;
    color: #8c8c8c;
    margin-bottom: 2px;
    font-weight: 500;
}

.detail-field div {
    font-size: 14px;
    color: #1a1a2e;
    line-height: 1.4;
}
.score-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-bar .bar-bg {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100px;
}

.score-bar .bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.score-bar .bar-fill.high { background: linear-gradient(90deg, #52c41a, #389e0d); }
.score-bar .bar-fill.mid  { background: linear-gradient(90deg, #fa8c16, #d46b08); }
.score-bar .bar-fill.low  { background: linear-gradient(90deg, #ff4d4f, #cf1322); }

/* === 分页 === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.pagination .page-btn {
    padding: 6px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    background: #fff;
    color: #333;
    transition: all 0.2s;
}

.pagination .page-btn:hover {
    border-color: #1677ff;
    color: #1677ff;
}

.pagination .page-btn.active {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: #8c8c8c;
    margin: 0 10px;
}

/* === 模态框 === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #ff4d4f;
    color: #fff;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body .field {
    margin-bottom: 16px;
}

.modal-body .field label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.modal-body .field textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* === Toast 通知 === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 24px;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
}

.toast.success { background: linear-gradient(135deg, #52c41a, #389e0d); }
.toast.error   { background: linear-gradient(135deg, #ff4d4f, #cf1322); }
.toast.info    { background: linear-gradient(135deg, #1677ff, #0958d9); }
.toast.warning { background: linear-gradient(135deg, #fa8c16, #d46b08); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === 加载状态 === */
.loading {
    text-align: center;
    padding: 40px;
    color: #8c8c8c;
}

.loading .spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bfbfbf;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 15px;
}

/* === 评论内容截断 === */
.cell-content {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-content.expand {
    white-space: normal;
    max-width: none;
}

/* === 步骤流程 === */
.steps {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 180px;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s;
}

.step:hover {
    border-color: #1677ff;
    box-shadow: 0 4px 16px rgba(22,119,255,0.08);
}

.step .step-num {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #1677ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.step .step-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step .step-desc {
    font-size: 13px;
    color: #8c8c8c;
    margin-bottom: 12px;
}

.step .step-stat {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

/* === 进度追踪 === */
.progress-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.progress-bar .progress-track {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1677ff, #52c41a);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* === 选项卡 === */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.tab {
    padding: 10px 24px;
    cursor: pointer;
    font-size: 14px;
    color: #8c8c8c;
    border-bottom: 2px solid transparent;
    transition: all 0.25s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab:hover {
    color: #1677ff;
}

.tab.active {
    color: #1677ff;
    border-bottom-color: #1677ff;
    font-weight: 600;
}

/* === 响应式 === */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    .header .nav a {
        padding: 6px 12px;
        font-size: 13px;
    }
    .container {
        padding: 12px;
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .search-box input {
        min-width: 200px;
    }
    .steps {
        flex-direction: column;
    }
}

/* === 复选框 === */
.checkbox-cell {
    width: 40px;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1677ff;
}

/* === 提示气泡 === */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

/* === 滚动条美化 === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bfbfbf;
}
