/* 
 * H5网页源码查看器 - 样式文件
 * 增强版本，包含资源分类、设备模式、自动换行等样式
 */

/* ==================== 重置和基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 10px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
}

/* ==================== 头部样式 ==================== */
header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}

header h1 i {
    font-size: 2rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ==================== 主要内容区域 ==================== */
.main-content {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #eaeaea;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* ==================== 表单样式 ==================== */
.input-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-button {
    display: flex;
    gap: 12px;
}

#url-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

#url-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

#url-input:invalid {
    border-color: #e74c3c;
}

.form-hint {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 8px;
    line-height: 1.4;
}

/* ==================== 按钮样式 ==================== */
.btn-primary, .btn-secondary, .btn-small {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(to right, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, #2980b9, #2575a7);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #34495e;
    border: 1px solid #dcdde1;
}

.btn-secondary:hover {
    background-color: #dde4e6;
    border-color: #bdc3c7;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-small:hover {
    transform: translateY(-1px);
}

/* ==================== 分类按钮样式 ==================== */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-btn:hover {
    background-color: #f1f2f6;
    border-color: #3498db;
}

.category-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

.category-btn i {
    font-size: 12px;
}

.category-stats {
    margin: 10px 0;
    padding: 10px 15px;
    background-color: #e8f4fc;
    border-radius: 6px;
    font-size: 14px;
    color: #2c3e50;
}

/* ==================== 错误消息 ==================== */
.error-message {
    background-color: #ffeaea;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 标签页样式 ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.tab-buttons {
    display: flex;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 5px;
    flex-wrap: wrap;
    gap: 5px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s;
    font-family: inherit;
    white-space: nowrap;
}

.tab-btn:hover:not(.active) {
    background-color: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background-color: #3498db;
    color: white;
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
}

.tab-content {
    margin-top: 20px;
}

.tab-pane {
    display: none;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.tab-pane.active {
    display: block;
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 预览控制栏 ==================== */
.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.preview-mode, .device-mode {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-mode-btn, .device-mode-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-mode-btn:hover, .device-mode-btn:hover {
    background-color: #f1f2f6;
    border-color: #3498db;
}

.preview-mode-btn.active, .device-mode-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

/* ==================== iframe容器 ==================== */
.iframe-container {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    height: 600px;
    background-color: #f8f9fa;
    transition: all 0.3s;
}

.iframe-container.mobile-mode {
    max-width: 375px;
    height: 667px;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 10px solid #222;
    position: relative;
}

.iframe-container.mobile-mode:before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    z-index: 1;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

.iframe-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(2px);
}

/* ==================== 代码容器 ==================== */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.code-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.code-container {
    background-color: #2c3e50;
    border-radius: 8px;
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.code-container.wrap-enabled #html-source {
    white-space: pre-wrap;
    word-break: break-word;
}

#html-source {
    color: #ecf0f1;
    padding: 20px;
    margin: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    tab-size: 4;
    white-space: pre;
    word-break: normal;
}

.code-line {
    display: flex;
    min-height: 20px;
    transition: background-color 0.2s;
}

.code-line:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.line-number {
    display: inline-block;
    width: 50px;
    color: #7f8c8d;
    text-align: right;
    padding-right: 15px;
    user-select: none;
    border-right: 1px solid #3d4f65;
    margin-right: 15px;
    flex-shrink: 0;
}

/* ==================== 统计卡片 ==================== */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon i {
    color: white;
}

.stat-card:nth-child(1) .stat-icon { background-color: #e74c3c; }
.stat-card:nth-child(2) .stat-icon { background-color: #3498db; }
.stat-card:nth-child(3) .stat-icon { background-color: #2ecc71; }
.stat-card:nth-child(4) .stat-icon { background-color: #9b59b6; }
.stat-card:nth-child(5) .stat-icon { background-color: #f39c12; }

.stat-info h3 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-count {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

/* ==================== 表格样式（增强版） ==================== */
.resources-table-container, .url-list-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.resources-table-container h3, .url-list-container h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.resources-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

.resources-table th {
    background-color: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.resources-table td {
    padding: 12px;
    border-bottom: 1px solid #eaeaea;
    vertical-align: middle;
}

.resources-table tr:last-child td {
    border-bottom: none;
}

.resources-table tr:hover {
    background-color: #f8f9fa;
}

.resources-table tr.failed-resource {
    background-color: #fff5f5;
}

.resources-table tr.failed-resource:hover {
    background-color: #ffeaea;
}

.resource-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.resource-type.image {
    background-color: #ffeaa7;
    color: #d35400;
}

.resource-type.script {
    background-color: #a29bfe;
    color: #2d3436;
}

.resource-type.stylesheet {
    background-color: #81ecec;
    color: #006266;
}

.resource-type.css_resource {
    background-color: #fd79a8;
    color: white;
}

.resource-url a {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-url a:hover {
    text-decoration: underline;
    color: #2980b9;
}

.resource-size, .resource-time {
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: #666;
}

.resource-size.small { color: #2ecc71; }
.resource-size.medium { color: #f39c12; }
.resource-size.large { color: #e74c3c; }

.resource-time.fast { color: #2ecc71; }
.resource-time.normal { color: #f39c12; }
.resource-time.slow { color: #e74c3c; }

/* ==================== URL列表样式 ==================== */
.url-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    width: 300px;
}

#url-search {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#url-search:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.url-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #fafafa;
}

.url-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    background-color: white;
}

.url-item:hover {
    background-color: #f8f9fa;
}

.url-item:last-child {
    border-bottom: none;
}

.url-index {
    width: 40px;
    color: #7f8c8d;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.url-content {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.url-link {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
    display: block;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.url-link:hover {
    text-decoration: underline;
}

.url-actions {
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

/* ==================== Ping检测样式（增强版） ==================== */
.ping-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
}

.ping-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.ping-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#ping-count {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-family: inherit;
    cursor: pointer;
}

#ping-count:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.ping-results {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    min-height: 200px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.ping-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: #95a5a6;
    text-align: center;
}

.ping-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.ping-progress {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.ping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: white;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
    transition: transform 0.2s;
}

.ping-item:hover {
    transform: translateX(5px);
}

.ping-item.success {
    border-left-color: #2ecc71;
}

.ping-item.failed {
    border-left-color: #e74c3c;
}

.ping-time {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 4px;
}

.ping-result-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ping-status {
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.ping-status.success {
    background-color: #d5f4e6;
    color: #27ae60;
}

.ping-status.failed {
    background-color: #fde8e8;
    color: #e74c3c;
}

.ping-duration {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
}

.ping-http {
    background-color: #f3e5f5;
    color: #7b1fa2;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Ping统计信息（增强版） */
.ping-stats {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s;
}

.ping-stats.hidden {
    display: none;
}

.server-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.server-info i {
    color: #3498db;
}

.server-ip {
    font-family: 'Consolas', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-box {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
    font-family: 'Consolas', monospace;
}

.url-stat {
    font-size: 1rem !important;
    word-break: break-all;
    white-space: normal;
    line-height: 1.3;
}

.success-stat {
    color: #2ecc71 !important;
}

.failed-stat {
    color: #e74c3c !important;
}

.rate-stat {
    color: #3498db !important;
}

.min-stat {
    color: #2ecc71 !important;
}

.max-stat {
    color: #e74c3c !important;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.ping-timestamp {
    margin-top: 20px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ==================== 模态框样式 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    font-size: 1.8rem;
    cursor: pointer;
    color: #95a5a6;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal:hover {
    color: #e74c3c;
    background-color: rgba(0, 0, 0, 0.05);
}

.modal-body {
    padding: 25px;
}

.modal-body h4 {
    color: #2c3e50;
    margin: 20px 0 10px 0;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body ul, .modal-body ol {
    padding-left: 20px;
    margin: 15px 0;
}

.modal-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.modal-note {
    background-color: #fffde7;
    border-left: 4px solid #f1c40f;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.modal-note i {
    color: #f39c12;
    margin-top: 2px;
}

/* ==================== 页脚样式 ==================== */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #34495e;
    flex-shrink: 0;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #3498db;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 992px) {
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .iframe-container {
        height: 500px;
    }
    
    .iframe-container.mobile-mode {
        max-width: 320px;
        height: 568px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .tab-buttons {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 5px;
    }
    
    .tab-btn {
        min-width: 80px;
        text-align: center;
        padding: 10px 5px;
        font-size: 0.9rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .preview-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .code-header, .url-list-header, .ping-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        width: 100%;
    }
    
    .ping-controls {
        justify-content: flex-start;
    }
    
    .ping-result-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .server-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        border-radius: 0;
        margin: 0;
        min-height: 100vh;
    }
    
    body {
        padding: 0;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .iframe-container {
        height: 300px;
    }
    
    .iframe-container.mobile-mode {
        max-width: 280px;
        height: 480px;
    }
    
    .code-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .category-buttons {
        justify-content: center;
    }
    
    .category-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .tab-buttons,
    .code-actions,
    .url-list-header,
    .ping-controls,
    .footer-links,
    .preview-controls,
    .category-buttons {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        margin: 0;
    }
    
    .tab-pane {
        display: block !important;
        opacity: 1 !important;
    }
    
    .card {
        break-inside: avoid;
    }
}

/* 分析状态样式 */
.analyzing-state {
    background: white;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease-out;
    border: 1px solid #eaeaea;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.analyzing-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.analyzing-spinner {
    display: flex;
    gap: 10px;
    height: 60px;
    align-items: center;
}

.analyzing-spinner.active .spinner-circle {
    animation: pulse 1.5s ease-in-out infinite;
}

.spinner-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    opacity: 0.3;
}

.spinner-circle:nth-child(1) {
    animation-delay: 0s;
}

.spinner-circle:nth-child(2) {
    animation-delay: 0.3s;
}

.spinner-circle:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.analyzing-text h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 24px;
}

.analyzing-text p {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 16px;
}

.analyzing-progress {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.progress-bar {
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
    width: 0%;
    transition: width 1s ease-in-out;
}

.progress-text {
    color: #7f8c8d;
    font-size: 14px;
    text-align: center;
}

/* 分析完成样式 */
.analyzing-complete {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.complete-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.checkmark {
    width: 80px;
    height: 80px;
}

.checkmark-circle {
    stroke: #2ecc71;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
    animation-play-state: paused;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke: #2ecc71;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
    animation-play-state: paused;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.complete-text h3 {
    color: #27ae60;
    margin-bottom: 10px;
    font-size: 24px;
}

.complete-text p {
    color: #7f8c8d;
    font-size: 16px;
}

/* 结果区域入场动画 */
#result-area {
    transition: opacity 0.5s, transform 0.5s;
    display: none; /* 初始隐藏 */
    opacity: 0;
    transform: translateY(20px);
}

#result-area.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 移除原有的分析覆盖层样式（如果需要的话） */
.analyzing-overlay {
    display: none !important;
}