/* ============================================
   包管理器国内源大全 - 工具专用样式
   依赖: tools-common.css (公共样式)
   ⚠️ 不要重复定义 .tool-header、.info-card 等公共类
   ============================================ */

/* 辅助类 - 无障碍隐藏 */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
}

/* ========== 镜像概览区域 ========== */
.mirror-overview {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 36px;
}

/* 概览卡片（蓝色渐变卡片） */
.overview-card {
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    color: #fff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
}

.overview-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.overview-card h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.overview-card p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.overview-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.overview-card li {
    background: rgba(255, 255, 255, 0.12);
    padding: 10px 14px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.overview-card li i {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
}

/* ========== 筛选和搜索操作区域 ========== */
.overview-actions {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 30px rgba(15, 23, 42, 0.08);
}

/* 筛选按钮组 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-button {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1f2937;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.filter-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
    color: #1d4ed8;
}

.filter-button.active {
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
}

/* 搜索框 */
.search-field {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    border: 1px solid #dbe3f2;
    padding: 4px 16px 4px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(15, 23, 42, 0.08);
}

.search-icon {
    font-size: 1.1rem;
    margin-right: 8px;
    color: #2563eb;
}

#mirrorSearch {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 10px 0;
    color: #1f2937;
}

#mirrorSearch::placeholder {
    color: #9ca3af;
}

#clearMirrorSearch {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s ease;
    visibility: hidden;
}

#clearMirrorSearch:hover {
    color: #2563eb;
}

/* 搜索反馈信息 */
.search-feedback {
    font-size: 0.9rem;
    color: #6b7280;
    min-height: 1.2em;
}

/* ========== 镜像源章节 ========== */
.mirror-section {
    margin-bottom: 42px;
}

.mirror-section.is-hidden {
    display: none;
}

.mirror-section-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.mirror-section-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
}

.mirror-section-header p {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========== 镜像卡片网格 ========== */
.mirror-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* 单个镜像卡片 */
.mirror-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mirror-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.18);
}

/* 卡片头部 */
.mirror-card-header {
    padding: 20px 22px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mirror-card-header h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin: 0;
}

.mirror-provider {
    font-size: 0.9rem;
    color: #6b7280;
    word-break: break-all;
}

.mirror-tag {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* 卡片主体内容 */
.mirror-card-body {
    padding: 0 22px 18px;
    display: grid;
    gap: 14px;
}

.mirror-row {
    display: grid;
    gap: 8px;
}

.row-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d4ed8;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* 可复制区域 */
.copyable {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 14px;
    padding: 12px 14px;
    position: relative;
}

.copyable code,
.copyable pre {
    margin: 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9rem;
    color: #111827;
    overflow-x: auto;
}

.copyable code {
    word-break: break-all;
}

.copyable pre {
    white-space: pre-wrap;
}

/* 命令项 */
.command-item {
    border-top: 1px dashed #e5e7eb;
    padding-top: 12px;
    margin-top: 12px;
}

.command-item:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.command-group {
    display: grid;
    gap: 12px;
}

.command-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* 复制按钮 */
.copy-button {
    border: none;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-button:hover {
    background: rgba(37, 99, 235, 0.18);
    color: #1e40af;
}

.copy-button.is-copied {
    background: #22c55e;
    color: #fff;
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.32);
}

/* 卡片底部注释 */
.mirror-card-footer {
    padding: 16px 22px;
    background: rgba(37, 99, 235, 0.07);
    color: #1f2937;
    font-size: 0.92rem;
    border-top: 1px solid rgba(37, 99, 235, 0.15);
}

/* ============================================
   响应式设计
   ============================================ */

/* 平板端 */
@media (max-width: 1024px) {
    .mirror-overview {
        grid-template-columns: 1fr;
    }

    .overview-card {
        order: 2;
    }

    .overview-actions {
        order: 1;
    }
}

/* 手机端 */
@media (max-width: 768px) {
    .mirror-grid {
        grid-template-columns: 1fr;
    }

    .copyable {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-button {
        align-self: flex-end;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .overview-actions {
        padding: 18px;
    }

    .filter-bar {
        gap: 8px;
    }

    .filter-button {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}
