/* ========================================
   OpenClaw Hub - Component Styles
   可复用组件样式
   ======================================== */

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 18px;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
}

/* 卡片 */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* 统计卡片 */
.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.1); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.1); }
.stat-icon.red { background: rgba(239, 68, 68, 0.1); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-change {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* 内容卡片（用于文章列表） */
.content-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.content-card-image {
    width: 100%;
    height: 160px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.content-card-body {
    padding: 20px;
}

.content-card-tag {
    display: inline-block;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--primary-light);
    color: white;
    margin-bottom: 12px;
}

.content-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.content-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 表格 */
.table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: var(--bg-secondary);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:hover td {
    background: var(--bg-secondary);
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.tag-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.tag-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.tag-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 警告框 */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.alert-info { background: rgba(59, 130, 246, 0.1); border-left: 4px solid var(--info); }
.alert-success { background: rgba(16, 185, 129, 0.1); border-left: 4px solid var(--success); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-left: 4px solid var(--warning); }
.alert-danger { background: rgba(239, 68, 68, 0.1); border-left: 4px solid var(--danger); }

/* 页面标题 */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

/* 搜索框 */
.search-box {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-tertiary);
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    background: var(--bg-tertiary);
}

.page-btn.active {
    background: var(--primary);
    color: white;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 文章阅读样式 */
.article-container {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.article-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.article-content {
    font-size: 16px;
    line-height: 1.9;
}

.article-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 32px 0 16px;
}

.article-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.article-content blockquote {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-content blockquote p {
    margin: 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-content table {
    margin: 24px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.article-content th {
    background: var(--bg-tertiary);
    padding: 14px 16px;
    font-weight: 600;
}

.article-content td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.article-content ul, .article-content ol {
    margin: 20px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 12px;
}

.article-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-content .highlight {
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    background-repeat: no-repeat;
    background-size: 100% 40%;
    background-position: 0 88%;
    padding: 0 4px;
}

.article-divider {
    text-align: center;
    margin: 40px 0;
    color: var(--text-tertiary);
    font-size: 18px;
    letter-spacing: 8px;
}