@charset "utf-8";

/* ==========================================================================
   组件样式系统 - Components System
   ========================================================================== */

/* 按钮组件 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0;
    border: none;
    border-radius: 4px;
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #333333);
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color, #00053F);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color, #C27D3D);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color, #00053F);
    color: var(--primary-color, #00053F);
}

.btn-outline:hover {
    background: var(--primary-color, #00053F);
    color: white;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* 输入框组件 */
.input {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color, #cccccc);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: var(--primary-color, #00053F);
    box-shadow: 0 0 0 3px rgba(0, 5, 63, 0.1);
}

.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-primary, #333333);
}

/* 导航组件 */
.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-horizontal {
    flex-direction: row;
    gap: 1rem;
}

.nav-vertical {
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-primary, #333333);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--bg-hover, #f5f5f5);
    color: var(--primary-color, #00053F);
}

.nav-link.active {
    background: var(--primary-color, #00053F);
    color: white;
}

/* 徽章组件 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 12px;
    background: var(--secondary-color, #C27D3D);
    color: white;
}

.badge-small {
    padding: 0.125rem 0.25rem;
    font-size: 0.625rem;
}

.badge-primary {
    background: var(--primary-color, #00053F);
}

.badge-success {
    background: #28a745;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

.badge-error {
    background: #dc3545;
}

/* 提示框组件 */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-info {
    background: #e7f3ff;
    border-color: #0066cc;
    color: #004499;
}

.alert-success {
    background: #e8f5e8;
    border-color: #28a745;
    color: #155724;
}

.alert-warning {
    background: #fff8e1;
    border-color: #ffc107;
    color: #856404;
}

.alert-error {
    background: #f8e8e8;
    border-color: #dc3545;
    color: #721c24;
}

/* 分隔线组件 */
.divider {
    height: 1px;
    background: var(--border-color, #e0e0e0);
    margin: 1rem 0;
    border: none;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--border-color, #e0e0e0);
    margin: 0 1rem;
}

/* 标签组件 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    background: var(--bg-light, #f5f5f5);
    color: var(--text-primary, #333333);
    border-radius: 4px;
    margin: 0.125rem;
}

.tag-clickable {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tag-clickable:hover {
    background: var(--bg-hover, #e0e0e0);
}

/* 加载组件 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color, #e0e0e0);
    border-top: 2px solid var(--primary-color, #00053F);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* 响应式组件调整 */
@media screen and (max-width: 640px) {
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .nav-horizontal {
        flex-direction: column;
        gap: 0;
    }
    
    .alert {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
}
