/**
 * User Agent 分析工具专用样式
 *
 * 注意：本文件仅包含工具特定样式
 * 公共样式（如 info-card）已在 tools-common.css 中定义
 */

/* ==================== 输入区域 ==================== */
.input-section {
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem;
}

.ua-textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    font-size: 0.95rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fff;
    color: #333;
}

.ua-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.ua-textarea::placeholder {
    color: #999;
}

/* ==================== 按钮组 ==================== */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #fff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-outline {
    background: #fff;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #ccc;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== 历史记录区域 ==================== */
.history-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.history-section label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.history-section label i {
    margin-right: 6px;
    color: #007bff;
}

.history-select {
    width: 100%;
    padding: 10px 15px;
    font-size: 0.95rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-select:hover {
    border-color: #007bff;
}

.history-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

/* ==================== 示例库区域 ==================== */
.examples-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
    border: 2px solid #e0e0e0;
}

.examples-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 18px;
    font-weight: 700;
}

.examples-section h3 i {
    margin-right: 8px;
    color: #007bff;
}

.example-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.example-btn {
    padding: 12px 16px;
    background: #fff;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.example-btn:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.example-btn i {
    font-size: 1.1rem;
}

/* ==================== 加载状态 ==================== */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.1rem;
    color: #007bff;
    font-weight: 600;
}

.loading-state i {
    font-size: 2rem;
    margin-right: 10px;
}

/* ==================== 结果区域 ==================== */
.result-section {
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section > h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-section > h3 i {
    color: #28a745;
}

/* ==================== 结果卡片 ==================== */
.result-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.result-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.result-card h4 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
}

.result-card h4 i {
    margin-right: 8px;
    color: #007bff;
}

/* ==================== 结果网格 ==================== */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-item .label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.result-item .value {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    word-break: break-word;
}

/* ==================== 原始 UA 显示框 ==================== */
.raw-ua-box {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}

.raw-ua-box code {
    color: #a9dc76;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    word-break: break-all;
    white-space: pre-wrap;
}

/* ==================== 复制按钮 ==================== */
.copy-btn {
    padding: 6px 14px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.copy-btn:active {
    transform: scale(0.98);
}

.copy-btn.copied {
    background: #28a745;
}

.copy-btn.copied::after {
    content: " 已复制";
}

/* ==================== 响应式设计 ==================== */

/* 平板端（768px - 1024px）*/
@media (max-width: 1024px) {
    .example-buttons {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .result-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* 手机端（< 768px）*/
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .examples-section {
        padding: 20px;
    }

    .example-buttons {
        grid-template-columns: 1fr;
    }

    .example-btn {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    .result-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .result-card {
        padding: 20px;
    }

    .result-section > h3 {
        font-size: 1.2rem;
    }

    .raw-ua-box {
        padding: 15px;
    }

    .raw-ua-box code {
        font-size: 0.85rem;
    }
}

/* 小屏手机（< 480px）*/
@media (max-width: 480px) {
    .input-section label {
        font-size: 0.95rem;
    }

    .ua-textarea {
        min-height: 80px;
        font-size: 0.9rem;
        padding: 12px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    .examples-section h3 {
        font-size: 1rem;
    }

    .result-card h4 {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .copy-btn {
        align-self: flex-start;
    }
}
