/**
 * 短网址生成器 - 工具专用样式
 * 注意：不要重复定义 tools-common.css 中的样式（如 info-card）
 */

/* ========== 选项卡样式 ========== */
.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.tab-btn i {
    margin-right: 6px;
}

.tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #4285f4;
    background: transparent;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #4285f4;
    border-radius: 3px 3px 0 0;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 表单样式 ========== */
.url-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.form-group label i {
    color: #4285f4;
    margin-right: 6px;
}

.tooltip-icon {
    display: inline-block;
    cursor: help;
    margin-left: 6px;
    color: #999;
}

.tooltip-icon:hover {
    color: #4285f4;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6c757d;
}

.input-with-button {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.input-with-button .form-input {
    flex: 1;
}

.input-status {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
}

.input-status.valid {
    color: #28a745;
}

.input-status.invalid {
    color: #dc3545;
}

/* ========== 按钮样式 ========== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn i {
    margin-right: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* ========== 结果显示样式 ========== */
.result-section {
    margin-top: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-header label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.result-header label i {
    color: #28a745;
    margin-right: 8px;
}

.result-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

.result-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.url-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4285f4;
}

.url-label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 6px;
    font-weight: 500;
}

.url-text {
    font-size: 14px;
    color: #333;
    word-break: break-all;
    line-height: 1.6;
}

.url-text.short {
    font-weight: 600;
    color: #4285f4;
    font-size: 16px;
}

/* ========== 二维码样式 ========== */
.result-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.qrcode-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.qrcode-label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 12px;
    font-weight: 500;
}

#qrcode-canvas {
    display: block;
    margin: 0 auto 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
}

/* ========== 复制消息 ========== */
.copy-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-message.show {
    opacity: 1;
}

.copy-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.copy-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========== 批量生成结果 ========== */
.batch-result {
    margin-top: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.batch-result-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.batch-result-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    border-left: 4px solid #e9ecef;
}

.batch-result-item:has(.batch-result-status.success) {
    border-left-color: #28a745;
}

.batch-result-item:has(.batch-result-status.error) {
    border-left-color: #dc3545;
}

.batch-result-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.batch-result-status.success {
    background: #d4edda;
    color: #155724;
}

.batch-result-status.error {
    background: #f8d7da;
    color: #721c24;
}

.batch-result-urls {
    flex: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
}

.batch-url-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.batch-url-value {
    font-size: 13px;
    color: #333;
    word-break: break-all;
}

.batch-url-value.short {
    font-weight: 600;
    color: #4285f4;
}

.batch-url-value.error {
    color: #dc3545;
}

/* ========== 短链反查结果 ========== */
.lookup-result {
    margin-top: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.lookup-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lookup-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    border-left: 4px solid #4285f4;
}

.lookup-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.lookup-text {
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

/* ========== 历史记录样式 ========== */
.history-section {
    margin-top: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.history-header h3 i {
    color: #4285f4;
    margin-right: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-history {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-size: 14px;
}

.history-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #4285f4;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-item-time {
    font-size: 12px;
    color: #6c757d;
}

.history-item-actions {
    display: flex;
    gap: 8px;
}

.history-item-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e9ecef;
    color: #495057;
}

.history-item-actions button:hover {
    background: #dee2e6;
}

.history-item-actions button.delete-btn {
    background: #f8d7da;
    color: #721c24;
}

.history-item-actions button.delete-btn:hover {
    background: #f5c6cb;
}

.history-item-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-url {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 8px;
}

.history-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.history-value {
    font-size: 13px;
    color: #333;
    word-break: break-all;
}

.history-value.short {
    font-weight: 600;
    color: #4285f4;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .result-content {
        grid-template-columns: 1fr;
    }

    .result-right {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .tab-container {
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
    }

    .url-form {
        padding: 20px;
    }

    .input-with-button {
        flex-direction: column;
    }

    .input-with-button .form-input {
        width: 100%;
    }

    .result-section,
    .batch-result,
    .lookup-result,
    .history-section {
        padding: 20px;
    }

    .result-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .batch-result-item {
        flex-direction: column;
    }

    .batch-result-urls {
        grid-template-columns: 1fr;
    }

    .batch-url-label {
        font-weight: 600;
    }

    .lookup-info {
        grid-template-columns: 1fr;
    }

    .lookup-label {
        font-weight: 600;
    }

    .history-url {
        grid-template-columns: 1fr;
    }

    .history-label {
        font-weight: 600;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .history-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
