/**
 * Components
 * UI 组件样式
 */

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.875rem 1.75rem;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    white-space: nowrap;
}

.btn i {
    width: 18px;
    height: 18px;
}

/* Primary Button */
.btn-primary {
    background: var(--gradient-gold);
    color: var(--color-primary-dark);
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.btn-secondary:hover {
    background: var(--gradient-gold-subtle);
    border-color: var(--color-accent-light);
}

.btn-secondary:active {
    background: var(--color-accent);
    color: var(--color-primary-dark);
}

/* Accent Button */
.btn-accent {
    background: var(--color-accent);
    color: var(--color-primary-dark);
}

.btn-accent:hover {
    background: var(--color-accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
}

.btn-lg {
    padding: 1.125rem 2.25rem;
    font-size: var(--text-base);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ==================== Cards ==================== */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--color-border-accent);
    box-shadow: var(--shadow-gold);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.card-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-lg);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.card-meta i {
    width: 14px;
    height: 14px;
}

/* Feature Card */
.feature-card {
    padding: var(--space-2xl);
    text-align: center;
}

.feature-card .feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-gold-subtle);
    border: 1px solid var(--color-border-accent);
    border-radius: var(--radius-xl);
    color: var(--color-accent);
    transition: all var(--transition-base);
}

.feature-card .feature-icon i {
    width: 36px;
    height: 36px;
}

.feature-card:hover .feature-icon {
    background: var(--gradient-gold);
    color: var(--color-primary-dark);
    transform: scale(1.1);
}

.feature-card .feature-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-md);
}

.feature-card .feature-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

/* Article Card */
.article-card {
    overflow: hidden;
    padding: 0;
}

.article-card .card-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.article-card .card-image {
    width: 100%;
    height: 100%;
    margin: 0;
    transition: transform var(--transition-slow);
}

.article-card:hover .card-image {
    transform: scale(1.05);
}

.article-card .card-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: 0.375rem 0.75rem;
    background: var(--gradient-gold);
    color: var(--color-primary-dark);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-sm);
}

.article-card .card-content {
    padding: var(--space-xl);
}

.article-card .card-title {
    font-size: var(--text-lg);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .card-summary {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.article-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* ==================== Stats Card ==================== */
.stat-card {
    text-align: center;
    padding: var(--space-2xl);
}

.stat-card .stat-number {
    font-family: var(--font-heading);
    font-size: var(--text-5xl);
    font-weight: var(--font-bold);
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: var(--space-md);
}

.stat-card .stat-suffix {
    font-size: var(--text-3xl);
    color: var(--color-accent-light);
}

.stat-card .stat-label {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==================== Partner Card ==================== */
.partner-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    min-height: 100px;
}

.partner-card:hover {
    border-color: var(--color-border-accent);
    box-shadow: var(--shadow-gold);
}

.partner-card img {
    max-width: 120px;
    max-height: 50px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all var(--transition-base);
}

.partner-card:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* ==================== Form Elements ==================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a0a8c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

.form-error {
    font-size: var(--text-sm);
    color: var(--color-danger);
    margin-top: var(--space-xs);
}

/* ==================== Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
}

.badge-primary {
    background: var(--color-accent);
    color: var(--color-primary-dark);
}

.badge-secondary {
    background: var(--color-primary-light);
    color: var(--color-text);
}

.badge-success {
    background: rgba(40, 167, 69, 0.2);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--color-warning);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.2);
    color: var(--color-danger);
}

/* ==================== Modal ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    transform: translateY(-20px);
    transition: transform var(--transition-base);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.modal-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

/* ==================== Toast ==================== */
.toast-container {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 450px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-danger);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-info {
    border-left: 4px solid var(--color-info);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon { color: var(--color-danger); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info .toast-icon { color: var(--color-info); }

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--color-text);
}

.toast-close {
    width: 24px;
    height: 24px;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--color-text);
}
