/* IP查询工具专用样式 */

/* 当前IP显示iframe */
.current-ip-display {
    margin-bottom: 20px;
}

/* 查询区域 */
.query-section {
    margin-bottom: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 输入组样式 */
.input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.input-group .form-input {
    flex: 1;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* 当前IP信息样式 */
.current-ip {
    margin-bottom: 25px;
    background: linear-gradient(135deg, #e9f5ff 0%, #d4ebff 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.current-ip h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.ip-info-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.ip-label {
    font-weight: 500;
    color: #555;
    font-size: 1rem;
}

.ip-address {
    font-weight: 700;
    color: #667eea;
    font-size: 1.2rem;
}

.ip-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.detail-item span {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

/* 查询结果样式 */
.query-result {
    margin-bottom: 25px;
}

.query-result h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.result-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
}

.result-ip {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
}

.result-status {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
}

.result-status.loading {
    background-color: #fff3cd;
    color: #856404;
}

.result-status.success {
    background-color: #d4edda;
    color: #155724;
}

.result-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.result-content {
    padding: 25px;
}

.data-sources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.source-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.source-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.source-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid #dee2e6;
}

.source-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #495057;
    font-weight: 600;
}

.source-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 15px;
}

.source-status.loading {
    background-color: #fff3cd;
    color: #856404;
}

.source-status.success {
    background-color: #d4edda;
    color: #155724;
}

.source-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.source-content {
    padding: 16px;
    min-height: 100px;
    background: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table tr:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.data-table td {
    padding: 8px 0;
}

.key-cell {
    font-weight: 500;
    color: #555;
    width: 40%;
}

.value-cell {
    color: #333;
    font-weight: 500;
}

.no-data, .loading-message, .error-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px 0;
}

.error-message {
    color: #dc3545;
}

/* 查询历史样式 */
.query-history {
    margin-bottom: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.query-history h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.history-container {
    margin-bottom: 15px;
    max-height: 350px;
    overflow-y: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.history-list {
    padding: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.history-item:hover {
    background: #f8f9fa;
}

.history-item:last-child {
    border-bottom: none;
}

.history-ip-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 5px;
}

.history-ip {
    font-weight: 700;
    color: #333;
    font-size: 1rem;
}

.history-location {
    font-size: 0.875rem;
    color: #666;
}

.history-time {
    font-size: 0.75rem;
    color: #999;
    margin: 0 15px;
    white-space: nowrap;
}

.history-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.no-history {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    font-size: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 12px 20px;
    }

    .data-sources {
        grid-template-columns: 1fr;
    }

    .ip-details {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .history-time {
        margin: 0;
    }

    .query-section,
    .current-ip,
    .query-history {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .history-actions {
        flex-direction: column;
    }

    .history-actions .btn {
        width: 100%;
    }
}
