/* =====================================
   按钮基础样式 - Button Base Styles
   ===================================== */

/* 按钮基础类 */
.button-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    min-height: 44px; /* 触摸友好的最小高度 */
    box-sizing: border-box;
}

.button-base:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.button-base:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
}

/* 主要按钮样式 - 橙色渐变 */
.button-primary {
    background: linear-gradient(135deg, #FFAE00 0%, #FF6B35 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.button-primary:hover:not(:disabled) {
    background: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.button-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* 次要按钮样式 - 灰色/半透明 */
.button-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #CCCCCC;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.button-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.button-secondary:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
}

/* 提交按钮样式 */
.button-submit {
    background: var(--primary-color, #FF6B35);
    color: white;
    width: 100%;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.button-submit:hover:not(:disabled) {
    background: var(--primary-dark, #E55A2B);
    transform: translateY(-1px);
}

.button-submit:active:not(:disabled) {
    transform: translateY(0);
}

/* 操作按钮样式 */
.button-action {
    background: var(--bg-tertiary, #3A3A3A);
    color: var(--text-secondary, #CCCCCC);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.button-action:hover:not(:disabled) {
    background: var(--bg-hover, #4A4A4A);
    color: var(--text-primary, white);
}

.button-action:active:not(:disabled) {
    transform: translateY(0);
}

/* 菜单按钮样式 */
.button-menu {
    background: transparent;
    color: var(--text-secondary, #CCCCCC);
    padding: 0.5rem;
    border-radius: 6px;
    min-height: 40px;
    width: 40px;
    height: 40px;
}

.button-menu:hover:not(:disabled) {
    background: var(--bg-hover, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, white);
}

.button-menu.active {
    background: var(--primary-color, #FF6B35);
    color: white;
}

/* 搜索按钮样式 */
.button-search {
    background: #3A3A3A;
    color: white;
    padding: 0.75rem;
    border-radius: 0 8px 8px 0;
    min-width: 50px;
}

.button-search:hover:not(:disabled) {
    background: #FF6B35;
}

/* 分页按钮样式 */
.button-pagination {
    background: var(--bg-card, #2A2A2A);
    color: var(--text-secondary, #CCCCCC);
    padding: 0.5rem 1rem;
    min-width: 40px;
    font-size: 0.9rem;
}

.button-pagination:hover:not(:disabled) {
    background: var(--primary-color, #FF6B35);
    color: white;
}

.button-pagination.active {
    background: #242525;
    color: var(--text-primary, white);
}

/* 尺寸变体 */
.button-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.button-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 52px;
}

.button-full-width {
    width: 100%;
}

/* 特殊状态 */
.button-loading {
    position: relative;
    color: transparent;
}

.button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: button-spin 1s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .button-base {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        min-height: 42px;
    }
    
    .button-small {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
        min-height: 34px;
    }
    
    .button-large {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
        min-height: 48px;
    }
}

/* 深色主题兼容 */
@media (prefers-color-scheme: dark) {
    .button-secondary {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.12);
    }
    
    .button-secondary:hover:not(:disabled) {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* 具体按钮类定义 - 这些类被HTML直接使用 */
.search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    min-height: 50px;
    min-width: 50px;
    box-sizing: border-box;
    background: #3A3A3A;
    color: white;
}

.search-btn:hover:not(:disabled) {
    background: #FF6B35;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #40434C);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    min-height: 36px;
    box-sizing: border-box;
    background: var(--bg-tertiary, #3A3A3A);
    color: var(--text-secondary, #CCCCCC);
}

.sort-btn:hover:not(:disabled),
.sort-btn.active {
    background: #242525;
    color: white;
    border-color: #242525;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border-color, #40434C);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    background: var(--bg-tertiary, #3A3A3A);
    color: var(--text-secondary, #CCCCCC);
}

.view-btn:hover:not(:disabled),
.view-btn.active {
    background: #242525;
    color: white;
    border-color: #242525;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #40434C);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    min-width: 40px;
    min-height: 36px;
    text-align: center;
    box-sizing: border-box;
    background: var(--bg-card, #2A2A2A);
    color: var(--text-secondary, #CCCCCC);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color, #FF6B35);
    color: white;
    border-color: var(--primary-color, #FF6B35);
}

.page-btn.active {
    background: #242525;
    color: var(--text-primary, white);
    border-color: #242525;
}

/* 向后兼容性别名 */
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    min-height: 44px;
    box-sizing: border-box;
    background: var(--primary-color, #FF6B35);
    color: white;
    width: 100%;
    letter-spacing: 0.5px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #40434C);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    min-height: 44px;
    box-sizing: border-box;
    background: var(--bg-tertiary, #3A3A3A);
    color: var(--text-secondary, #CCCCCC);
}

/* mobile-menu-btn 样式已迁移到 ai/assets/css/chat.css 中统一管理 */