:root {
    --primary-color: #FF69B4;
    --secondary-color: #FFB6C1;
    --background-color: #FFF0F5;
    --card-bg-color: rgba(255, 255, 255, 0.9);
    --text-color: #444;
    --border-color: #FFC0CB;
}
body {
    background-color: var(--background-color);
    font-family: 'Noto Sans SC', sans-serif;
    padding-top: 1.5rem;
}
.card {
    margin-bottom: 1.5rem;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
}
.card-header {
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--primary-color);
    font-weight: bold;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.badge.bg-success {
    background-color: var(--primary-color) !important;
}
.form-control, .form-select {
    border-color: var(--border-color);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 105, 180, 0.25);
}
h1 {
    color: var(--primary-color);
    font-weight: 700;
}
.nav-tabs .nav-link {
    color: var(--secondary-color);
}
.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: var(--card-bg-color);
    border-color: var(--border-color) var(--border-color) var(--card-bg-color);
}

.status-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.stat-chip {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 2px 6px rgba(255, 182, 193, 0.2);
}

.stat-label {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #888;
    text-transform: uppercase;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
}

.current-config-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.6rem 0.85rem;
}

.current-config-chip .chip-label {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.current-config-chip .chip-value {
    flex: 1;
    min-width: 0;
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-overview {
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px dashed var(--border-color);
}

.thread-metrics li {
    margin-bottom: 0.35rem;
}

.thread-metrics li:last-child {
    margin-bottom: 0;
}

.thread-table-wrapper {
    max-height: 260px;
    overflow-y: auto;
}

.thread-table-wrapper table {
    margin-bottom: 0;
}

.thread-status-table {
    table-layout: fixed;
}

.thread-status-table th:first-child,
.thread-status-table td:first-child {
    width: 96px;
}

.thread-status-table th:last-child,
.thread-status-table td:last-child {
    width: 96px;
}

.thread-status-table td:nth-child(2) {
    overflow: hidden;
}

.thread-url {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.thread-status-badge {
    min-width: 72px;
    text-align: right;
}

.url-usage-list {
    font-size: 0.85rem;
    max-height: 240px;
    overflow-y: auto;
}

.usage-url {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-sm {
    height: 6px;
}

.url-usage-entry .progress-bar {
    background-color: var(--primary-color);
}

.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    position: absolute;
    inset: 0;
}

.config-layout {
    --bs-gutter-y: 1.5rem;
}

.config-section {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    height: 100%;
    box-shadow: 0 6px 18px rgba(255, 182, 193, 0.15);
}

.config-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.config-section-header i {
    font-size: 1rem;
}

.config-section-body .form-label-sm {
    font-weight: 600;
    color: #666;
}

.config-section .form-text {
    font-size: 0.75rem;
    color: #999;
}

#notification-area .alert {
    border-radius: 0.75rem;
    box-shadow: 0 8px 20px rgba(255, 182, 193, 0.2);
}

.config-offcanvas {
    --bs-offcanvas-width: clamp(480px, 60vw, 100vw);
    width: clamp(480px, 60vw, 100vw);
    max-width: 100vw;
}

@media (max-width: 991.98px) {
    .stat-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .thread-overview {
        border-bottom: none;
    }

    .thread-table-wrapper {
        max-height: none;
    }

    .current-config-chip {
        flex-direction: column;
        align-items: flex-start;
    }

    .current-config-chip .chip-value {
        width: 100%;
        text-align: left;
    }
}
