/* Linglong Hub 样式 */

:root {
    --primary-color: #4a90e2;
    --secondary-color: #357abd;
    --text-color: #333;
    --light-text: #666;
    --border-color: #e0e0e0;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
}

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

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

/* 导航栏 */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    color: var(--text-color);
}

.btn-login, .user-info a {
    background: var(--primary-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-login:hover, .user-info a:hover {
    background: var(--secondary-color);
    color: #fff;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 搜索部分 */
.search-section {
    text-align: center;
    margin-bottom: 3rem;
}

.search-section h1 {
    margin-bottom: 2rem;
    color: var(--text-color);
}

.search-box {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box input[type="text"] {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-box select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    min-width: 150px;
}

.search-box button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--secondary-color);
}

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

.app-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s;
}

.app-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.app-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.app-id {
    color: var(--light-text);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.app-description {
    color: var(--light-text);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.app-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--light-text);
}

.app-kind {
    background: #e3f2fd;
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.app-owner {
    font-size: 0.75rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    color: var(--light-text);
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--light-text);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input[type="text"],
    .search-box select {
        width: 100%;
    }
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--text-color);
}

/* 按钮样式 */
.btn-primary {
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--secondary-color);
    color: #fff;
}

.btn-small {
    background: var(--primary-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-small:hover {
    background: var(--secondary-color);
    color: #fff;
}

.btn-delete {
    background: #dc3545;
    color: #fff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #c82333;
}

/* 登录提示 */
.login-prompt {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.login-prompt p {
    margin-bottom: 1.5rem;
    color: var(--light-text);
    font-size: 1.125rem;
}

/* 应用详情页 */
.app-detail-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.app-detail-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.app-detail-header .app-id {
    color: var(--light-text);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.app-detail-header .app-description {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.app-detail-header .app-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.app-detail-header .app-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-small-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.app-base {
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.app-owner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--light-text);
}

/* 版本列表 */
.versions-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

.versions-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.versions-table {
    width: 100%;
    border-collapse: collapse;
}

.versions-table th,
.versions-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.versions-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: var(--text-color);
}

.versions-table tr:hover {
    background: #f9f9f9;
}

.channel-badge {
    background: #e3f2fd;
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* 应用卡片操作 */
.app-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* 错误状态 */
.error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #fff5f5;
    border: 1px solid #ffcccc;
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--light-text);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
