/**
 * 仪表盘样式 - 统计页面、概览卡片、环形图、系统设置概览
 */

/* 统计页面样式 */
.stats-container {
    margin-top: 20px;
}

/* 筛选组样式 */
.rank-filters,
.spider-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
}

.rank-filters select,
.spider-filters select {
    width: 150px;
}

/* 排名摘要卡片 */
.rank-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* 排名表格 */
.rank-table,
.spider-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rank-header,
.spider-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px 1fr;
    padding: 15px 20px;
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

.spider-header {
    grid-template-columns: 1fr 120px 100px 1fr;
}

.rank-item,
.spider-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px 1fr;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
    transition: background 0.2s;
}

.spider-item {
    grid-template-columns: 1fr 120px 100px 1fr;
}

.rank-item:hover,
.spider-item:hover {
    background: #f8f9fa;
}

.rank-item:last-child,
.spider-item:last-child {
    border-bottom: none;
}

.rank-num {
    font-weight: 600;
    font-size: 16px;
}

.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #e9ecef;
    border-radius: 50%;
    font-size: 12px;
    color: #6c757d;
}

.rank-source {
    font-weight: 500;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-count {
    font-weight: 600;
    color: #007bff;
}

.rank-percent {
    color: #6c757d;
}

/* 进度条 */
.rank-bar,
.spider-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #00bcd4);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.spider-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 蜘蛛统计 */
.spider-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.spider-cards .stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.spider-cards .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #00bfa5;
    margin-bottom: 8px;
}

.spider-cards .stat-label {
    font-size: 14px;
    color: #6c757d;
}

.spider-name {
    font-weight: 500;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spider-count {
    color: #00bfa5;
    font-weight: 600;
}

.spider-percent {
    color: #6c757d;
}

/* 蜘蛛详情标题 */
.spider-detail h3 {
    margin: 25px 0 15px;
    font-size: 18px;
    color: #212529;
}

/* 蜘蛛说明卡片 */
.spider-info {
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.spider-info h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #212529;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.info-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-content strong {
    display: block;
    margin-bottom: 5px;
    color: #212529;
}

.info-content p {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
}

/* 数据统计概览页面 */
.stats-overview {
    padding: 20px 0;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* 数据总览卡片 */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-overview-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

.stats-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.stats-overview-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    border-radius: 12px;
    flex-shrink: 0;
}

.stats-overview-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.stats-overview-label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.stats-shortcuts h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.shortcut-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
}

.shortcut-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #00bfa5;
}

.shortcut-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.shortcut-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.shortcut-desc {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 16px;
}

.shortcut-action {
    font-size: 14px;
    color: #00bfa5;
    font-weight: 500;
}

/* 系统设置概览页面 */
.settings-overview {
    padding: 20px 0;
}

.settings-header {
    margin-bottom: 30px;
}

.settings-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.settings-desc {
    font-size: 14px;
    color: #6c757d;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
}

.settings-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: #00bfa5;
}

.settings-card-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9f7;
    border-radius: 12px;
    flex-shrink: 0;
}

.settings-card-content {
    flex: 1;
}

.settings-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.settings-card-desc {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.settings-card-arrow {
    font-size: 20px;
    color: #adb5bd;
    transition: color 0.3s ease;
}

.settings-card:hover .settings-card-arrow {
    color: #00bfa5;
}

/* 系统信息卡片 */
.system-info-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-top: 30px;
}

.system-info-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 13px;
    color: #6c757d;
}

.info-value {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}
}

/* 蜘蛛统计页面样式 - 参考图风格 */
.spider-page-container {
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
}

.spider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.spider-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spider-title .spider-icon {
    font-size: 24px;
}

.spider-title h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.spider-tabs-nav {
    display: flex;
    gap: 0;
}

.tab-nav-item {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-nav-item:hover {
    color: #1890ff;
}

.tab-nav-item.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

.filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.time-btn-group {
    display: flex;
    gap: 0;
}

.time-btn {
    padding: 6px 16px;
    border: 1px solid #d9d9d9;
    background: white;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.time-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.time-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.time-btn:not(:first-child) {
    margin-left: -1px;
}

.time-btn.active {
    background: #1890ff;
    border-color: #1890ff;
    color: white;
    z-index: 1;
}

.spider-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spider-filter label {
    font-size: 14px;
    color: #666;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

.export-btn {
    padding: 8px 16px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-btn:hover {
    background: #40a9ff;
}

.dropdown-arrow {
    font-size: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.stats-card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.chart-card {
    display: flex;
    flex-direction: column;
}

.chart-legend-box {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 60px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.legend-label {
    flex: 1;
    color: #666;
}

.legend-value {
    color: #333;
    font-weight: 500;
}

.pie-chart-area {
    padding: 24px;
    text-align: center;
    flex: 1;
}

.pie-chart-area h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
}

#spiderPieChart {
    max-width: 100%;
    height: auto;
}

.rank-card .simple-table {
    width: 100%;
    border-collapse: collapse;
}

.rank-card .simple-table th,
.rank-card .simple-table td {
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.rank-card .simple-table th {
    background: #fafafa;
    color: #666;
    font-weight: 500;
}

.rank-card .simple-table td a {
    color: #1890ff;
    text-decoration: none;
}

.rank-card .simple-table td a:hover {
    text-decoration: underline;
}

.text-right {
    text-align: right;
}

.card-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid #f0f0f0;
}

.page-btn {
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

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

.page-indicator {
    padding: 4px 8px;
    font-size: 14px;
    color: #666;
}

.page-indicator.active {
    color: #1890ff;
    font-weight: 500;
}

.detail-card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 访问明细 - 表格优化 */
.detail-time {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.detail-ip {
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    color: #555;
}

.detail-count {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    padding: 2px 8px;
    background: #e8f4fd;
    color: #1890ff;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.detail-card .data-table td {
    vertical-align: middle;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table th,
.detail-table td {
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.detail-table th {
    background: #fafafa;
    color: #666;
    font-weight: 500;
}

.detail-table td a {
    color: #1890ff;
    text-decoration: none;
}

.detail-table td a:hover {
    text-decoration: underline;
}

.col-num {
    width: 80px;
}

.col-spider {
    width: 120px;
}

.col-url {
    flex: 1;
}

.col-ip {
    width: 150px;
}

.col-time {
    width: 180px;
}

.settings-panel,
.cleanup-panel {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 24px;
}

.settings-panel h3,
.cleanup-panel h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #333;
}

.cleanup-stats {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.cleanup-stats strong {
    color: #333;
    font-size: 15px;
}

.settings-form {
    max-width: 600px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.save-btn {
    padding: 8px 24px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.save-btn:hover {
    background: #40a9ff;
}

/* 统计设置 - 排除规则 */
.settings-desc {
    font-size: 13px;
    color: #999;
    margin: -8px 0 20px 0;
}

.settings-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.rule-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #fafbfc;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
}

.rule-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.rule-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.rule-hint {
    font-size: 12px;
    color: #999;
}

.rule-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 28px;
    margin-bottom: 12px;
}

.rule-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e8f4fd;
    color: #1890ff;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.4;
}

.rule-tag .tag-remove {
    cursor: pointer;
    font-size: 14px;
    color: #91d5ff;
    margin-left: 2px;
    line-height: 1;
    transition: color 0.2s;
}

.rule-tag .tag-remove:hover {
    color: #ff4d4f;
}

.rule-tags-empty {
    font-size: 12px;
    color: #bbb;
    padding: 4px 0;
}

.rule-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rule-input {
    flex: 1;
    max-width: 320px;
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.rule-input:focus {
    border-color: #1890ff;
}

.cleanup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.cleanup-item {
    padding: 24px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
}

.cleanup-item h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

.cleanup-item p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
}

.danger-btn {
    padding: 8px 16px;
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.danger-btn:hover {
    background: #ff7875;
}

.cleanup-item-full {
    grid-column: 1 / -1;
    border-color: #ffccc7;
    background: #fff2f0;
}

.cleanup-item-full h4 {
    color: #cf1322;
}

.loading-text {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

