/* OpenClaw Skills Hub - 样式表 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部 */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--primary-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9rem;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

/* 主内容区 */
.main {
    min-height: calc(100vh - 200px);
    padding: 20px 0;
}

/* 搜索区域 */
.search-section {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.search-section h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.search-section .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.search-form button {
    padding: 15px 30px;
}

/* 筛选区域 */
.filter-section {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.categories, .sort {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.categories a, .sort a {
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.categories a:hover, .sort a:hover {
    background: var(--primary-color);
    color: white;
}

.categories a.active, .sort a.active {
    background: var(--primary-color);
    color: white;
}

/* 技能网格 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.skill-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

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

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.skill-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
}

.skill-header h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.skill-header h3 a:hover {
    color: var(--primary-color);
}

.category {
    background: var(--bg-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.skill-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.skill-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.rating {
    color: var(--warning-color);
}

.stars {
    color: #fbbf24;
}

.forks {
    color: #64748b;
}

.downloads {
    color: #3b82f6;
}

.heat {
    font-weight: 600;
}

.heat-hot {
    color: #ef4444;
}

.heat-warm {
    color: #f59e0b;
}

.heat-cool {
    color: #64748b;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: var(--bg-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.skill-actions {
    display: flex;
    gap: 10px;
}

.skill-actions .btn {
    flex: 1;
    text-align: center;
}

/* 技能详情页 */
.breadcrumb {
    padding: 15px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.skill-detail {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.skill-main {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.skill-title-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.skill-title-section h1 {
    font-size: 2rem;
    margin: 0;
}

.category-badge {
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.skill-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.skill-description, .skill-author {
    margin-bottom: 30px;
}

.skill-description h2, .skill-author h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.skill-description p {
    color: var(--text-muted);
    line-height: 1.8;
}

.tags-section {
    margin-bottom: 30px;
}

.tags-section h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.skill-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

/* 评分区域 */
.ratings-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.ratings-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-summary {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
}

.rating-summary .average {
    font-size: 3rem;
    font-weight: bold;
    color: #d97706;
}

.rating-summary .stars-display {
    font-size: 1.5rem;
    color: #d97706;
    margin: 10px 0;
}

.rating-summary .count {
    color: #92400e;
    font-size: 0.9rem;
}

.rating-form {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
}

.rating-form h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.rating-input {
    margin-bottom: 20px;
}

.rating-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.stars {
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
    justify-content: flex-start;
}

.stars input {
    display: none;
}

.stars label {
    font-size: 2.5rem;
    color: var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.stars label:hover {
    transform: scale(1.1);
}

.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
    color: var(--warning-color);
    text-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.comment-input {
    margin-bottom: 20px;
}

.comment-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.comment-input textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.comment-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.rated-notice, .login-notice {
    background: var(--bg-color);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.login-notice a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.ratings-list {
    margin-top: 25px;
}

.rating-item {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.rating-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.rating-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.rating-item:hover {
    background: var(--bg-color);
}

.rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.username {
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.username::before {
    content: '👤';
    font-size: 1.2rem;
}

.rating-value {
    color: var(--warning-color);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.rating-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 4px 10px;
    border-radius: 20px;
}

.rating-comment {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 10px;
}

.no-ratings {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--bg-color);
    border-radius: 8px;
}

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

.page-info {
    color: var(--text-muted);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* 页脚 */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 5px;
}

/* 响应式 */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 15px;
    }
    
    .search-section h1 {
        font-size: 1.8rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .skill-detail {
        grid-template-columns: 1fr;
    }
    
    .skill-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skill-title-section {
        flex-direction: column;
        align-items: flex-start;
    }
}
