/* ===== 快捷键提示 ===== */
.shortcut-tips {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tips-icon {
    font-size: 18px;
}

.tips-text {
    color: #1976d2;
    font-weight: 600;
    font-size: 14px;
}

.shortcut-tips kbd {
    background: #fff;
    padding: 4px 8px;
    border-radius: 5px;
    margin: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    font-weight: 600;
    color: #333;
    border: 1px solid #e1e8ed;
    font-family: 'Courier New', monospace;
}

/* ===== Tab按钮样式 ===== */
.tab-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 24px;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.tab-button.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 16px rgba(245, 87, 108, 0.4);
}

.tab-button:active {
    transform: translateY(0);
}

/* ===== Tab内容区域 ===== */
.tab-content {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 圆周率显示区域 ===== */
.pi-display {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 24px;
    border-radius: 12px;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 16px;
    word-wrap: break-word;
    line-height: 1.9;
    margin: 20px 0;
    border: 2px solid #e1e8ed;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.pi-display::before {
    content: 'π';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 60px;
    color: rgba(102, 126, 234, 0.08);
    font-weight: bold;
    pointer-events: none;
}

.pi-integer {
    font-weight: bold;
    color: #667eea;
    font-size: 20px;
}

.pi-decimals {
    color: #2d3748;
    letter-spacing: 0.5px;
}

/* ===== 上下文显示 ===== */
.context-display {
    font-family: 'Courier New', 'Consolas', monospace;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 8px 14px;
    border-radius: 6px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(253, 203, 110, 0.3);
    line-height: 1.8;
}

.context-display .highlight {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    font-weight: bold;
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
}

/* ===== 错误消息 ===== */
.error-message {
    color: #e74c3c;
    font-weight: 600;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border-left: 4px solid #e74c3c;
    border-radius: 6px;
    animation: shake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ===== AI结果 ===== */
.ai-result {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #4caf50;
    white-space: pre-wrap;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15);
    line-height: 1.8;
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== 表单样式 ===== */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.label-icon {
    margin-right: 6px;
    font-size: 16px;
}

.input-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #718096;
    font-style: italic;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== 输入框样式 ===== */
.query-input {
    width: 100%;
    max-width: 500px;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.query-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.query-input:hover {
    border-color: #cbd5e0;
}

/* ===== 按钮增强样式 ===== */
.button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 8px;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.button-icon {
    font-size: 16px;
}

.button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

.button-secondary {
    background: linear-gradient(135deg, #48c6ef 0%, #6f86d6 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(72, 198, 239, 0.3);
}

.button-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(72, 198, 239, 0.5);
}

.button-ai {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.3);
}

.button-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(240, 147, 251, 0.5);
}

.button:active {
    transform: translateY(0);
}

/* ===== Toast提示框 ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 350px;
    cursor: pointer;
    transition: transform 0.2s;
}

.toast:hover {
    transform: translateX(-5px);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast.success {
    border-left: 4px solid #4caf50;
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.info {
    border-left: 4px solid #667eea;
}

.toast.fade-out {
    animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ===== 查询结果区域 ===== */
.query-result {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e1e8ed;
}

.result-title {
    color: #2d3748;
    margin-bottom: 18px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    font-size: 20px;
}

.highlight-number {
    color: #667eea;
    font-size: 20px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 6px;
}

.highlight-text {
    color: #f5576c;
    font-weight: 700;
}

.result-hint {
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-radius: 8px;
    font-size: 13px;
    color: #f57c00;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint-icon {
    font-size: 16px;
}

.result-hint kbd {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 11px;
    border: 1px solid #e1e8ed;
}

.result-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e1e8ed;
    line-height: 1.8;
}

.result-list li:last-child {
    border-bottom: none;
}

.list-label {
    color: #718096;
    font-weight: 600;
    font-size: 13px;
}

.not-found-message {
    text-align: center;
    padding: 20px;
}

.not-found-message p {
    margin: 10px 0;
    color: #4a5568;
}

.hint-text {
    font-size: 13px;
    color: #718096;
    font-style: italic;
}

.error-result {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border-left: 4px solid #e74c3c;
}

.ai-result-wrapper {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #667eea;
}

.query-result h3 {
    color: #2d3748;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 700;
}

.query-result ul {
    list-style: none;
    padding: 0;
}

.query-result ul li {
    padding: 10px 0;
    border-bottom: 1px solid #e1e8ed;
    line-height: 1.8;
}

.query-result ul li:last-child {
    border-bottom: none;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .shortcut-tips {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .tab-buttons {
        gap: 10px;
    }
    
    .tab-button {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .pi-display {
        padding: 20px;
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .shortcut-tips {
        flex-wrap: wrap;
        font-size: 12px;
    }
    
    .shortcut-tips kbd {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    .tab-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-button {
        width: 100%;
        text-align: center;
    }
    
    .query-input {
        max-width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
        margin: 5px 0;
        justify-content: center;
    }
    
    .pi-display {
        padding: 16px;
        font-size: 14px;
    }
    
    .toast {
        right: 12px;
        left: 12px;
        max-width: none;
    }
    
    .result-hint {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .shortcut-tips {
        padding: 10px 14px;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .pi-display {
        padding: 12px;
        font-size: 13px;
    }
    
    .pi-display::before {
        font-size: 40px;
    }
    
    .query-result {
        padding: 16px;
    }
    
    .ai-result {
        padding: 16px;
        font-size: 13px;
    }
    
    .result-title {
        font-size: 16px;
    }
    
    .highlight-number {
        font-size: 18px;
    }
}
