/* ============================================
   GZIP 压缩检测工具 - 专用样式
   ============================================ */

/* 输入区域样式 */
.input-section {
    margin-bottom: 25px;
}

.input-section textarea {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
}

.input-section textarea:focus {
    outline: none;
    border-color: #4285f4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.input-section textarea::placeholder {
    color: #9e9e9e;
    font-style: italic;
}

/* 按钮组样式 */
.control-panel {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.control-panel button {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.control-panel .primary-btn {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.control-panel .primary-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3367d6 0%, #2d9348 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.4);
}

.control-panel .primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.control-panel .secondary-btn {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.control-panel .secondary-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.control-panel .example-btn {
    background: #fff3e0;
    color: #f57c00;
    border: 2px solid #ffb74d;
}

.control-panel .example-btn:hover {
    background: #ffe0b2;
    border-color: #ffa726;
}

.control-panel .export-btn {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #66bb6a;
}

.control-panel .export-btn:hover {
    background: #c8e6c9;
    border-color: #4caf50;
}

/* 进度条样式 */
.progress-section {
    margin: 20px 0;
    display: none;
}

.progress-section.active {
    display: block;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4285f4 0%, #34a853 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

/* 表格样式优化 */
.results-section {
    margin-top: 30px;
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.results-table thead {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
}

.results-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

.results-table th:hover {
    background: rgba(255, 255, 255, 0.1);
}

.results-table th.sortable::after {
    content: ' ⇅';
    font-size: 12px;
    opacity: 0.5;
}

.results-table th.sorted-asc::after {
    content: ' ▲';
    opacity: 1;
}

.results-table th.sorted-desc::after {
    content: ' ▼';
    opacity: 1;
}

.results-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.results-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.results-table tbody tr:hover {
    background: #f5f9ff;
    transform: scale(1.01);
}

.results-table td {
    padding: 14px 12px;
    font-size: 14px;
    color: #333;
}

.results-table td:first-child {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #1a73e8;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.status-enabled {
    background: #d4edda;
    color: #155724;
}

.status-disabled {
    background: #fff3cd;
    color: #856404;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-loading {
    background: #d1ecf1;
    color: #0c5460;
}

/* HTTP 状态码颜色 */
.status-code-2xx {
    color: #28a745;
    font-weight: 600;
}

.status-code-3xx {
    color: #17a2b8;
    font-weight: 600;
}

.status-code-4xx {
    color: #ffc107;
    font-weight: 600;
}

.status-code-5xx {
    color: #dc3545;
    font-weight: 600;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #4285f4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    min-width: 280px;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #666;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 768px) {
    .input-section textarea {
        min-height: 150px;
        font-size: 13px;
        padding: 12px;
    }

    .control-panel {
        flex-direction: column;
    }

    .control-panel button {
        width: 100%;
        justify-content: center;
    }

    .results-table {
        font-size: 12px;
    }

    .results-table th,
    .results-table td {
        padding: 10px 8px;
    }

    .results-table td:first-child {
        max-width: 150px;
    }

    /* 移动端表格横向滚动 */
    .results-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .results-table {
        font-size: 11px;
    }

    .results-table th,
    .results-table td {
        padding: 8px 6px;
    }

    .status-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* 打印样式 */
@media print {
    .control-panel,
    .progress-section,
    .toast {
        display: none !important;
    }

    .results-table {
        box-shadow: none;
    }
}
