* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', system-ui, sans-serif;
    background: #f5f5f5;
    padding-top: 76px;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 24px;
    color: #00838f;
}

.nav-logo img {
    height: 40px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 0;
    transition: all 0.2s ease;
}

.nav-menu a:hover {
    color: #00838f;
}

.nav-menu a.active {
    color: #00838f;
    border-bottom: 2px solid #00838f;
}

/* ===== 下拉菜单 ===== */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: white;
    border-radius: 10px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: #1e293b;
    font-size: 14px;
    border-radius: 6px;
}

.dropdown-menu a:hover {
    background: rgba(0, 131, 143, 0.08);
    color: #00838f;
}

.dropdown-menu a i {
    width: 20px;
    text-align: center;
    color: #00838f;
}

/* ===== 页面主体 ===== */
.page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 24px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    color: #00838f;
}

.page-header p {
    color: #64748b;
    font-size: 16px;
    margin-top: 8px;
}

/* ===== 筛选面板 ===== */
/* ===== 筛选面板 ===== */
.filter-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

/* 使用 flex 布局替代 grid，更稳定 */
.filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 0 auto;
    min-width: 160px;
    max-width: 220px;
}

/* 让工具组与其他元素对齐 */
#toolGroup {
    flex: 1 0 auto;
    min-width: 150px;
    max-width: 200px;
}

/* 工具筛选控制 */
#toolGroup.tool-filter-hidden {
    display: none !important;
}

#toolGroup.tool-filter-visible {
    display: flex !important;
    animation: fadeInTool 0.3s ease;
}

@keyframes fadeInTool {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.filter-group label i {
    color: #00838f;
    width: 16px;
    flex-shrink: 0;
}

.filter-group select,
.filter-group input {
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    transition: all 0.2s ease;
    color: #1e293b;
    width: 100%;
    min-width: 140px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #00838f;
    box-shadow: 0 0 0 3px rgba(0, 131, 143, 0.1);
}

.filter-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filter-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .filter-group {
        min-width: 150px;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .filter-grid {
        gap: 12px;
    }
    
    .filter-group {
        min-width: calc(50% - 6px);
        max-width: none;
        flex: 1 1 calc(50% - 6px);
    }
    
    #toolGroup {
        min-width: calc(50% - 6px);
        max-width: none;
        flex: 1 1 calc(50% - 6px);
    }
}

@media (max-width: 480px) {
    .filter-group {
        min-width: 100%;
        flex: 1 1 100%;
    }
    
    #toolGroup {
        min-width: 100%;
        flex: 1 1 100%;
    }
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #00838f;
    color: white;
}

.btn-primary:hover {
    background: #006064;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 131, 143, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-success {
    background: #16a34a;
    color: white;
}

.btn-success:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* ===== 结果面板 ===== */
.result-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.result-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.result-header .count {
    font-size: 14px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 14px;
    border-radius: 20px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody td {
    padding: 10px 14px;
    color: #1e293b;
    white-space: nowrap;
}

tbody td code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0f172a;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 8px;
}

.loading-state {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #00838f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== 工具提示 ===== */
.tool-filter-hidden {
    display: none !important;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
    max-width: 400px;
}

.toast-success {
    background: #16a34a;
}

.toast-error {
    background: #dc2626;
}

.toast-info {
    background: #1e293b;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nav-menu {
        gap: 16px;
    }

    .nav-menu a {
        font-size: 14px;
    }

    .result-header {
        flex-direction: column;
        align-items: stretch;
    }

    .result-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}