/* 应用哥 - 移动端APP/PWA样式 */
/* 品牌色板 */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --bg-light: #f0f4ff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e5e5e5;
    --card-bg: #ffffff;
    --shadow: 0 2px 12px rgba(99, 102, 241, 0.12);
    --shadow-hover: 0 8px 24px rgba(99, 102, 241, 0.2);
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --font-size-xl: 2rem;
    --font-size-lg: 1.25rem;
    --font-size-md: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-xs: 0.75rem;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    max-width: 450px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 状态栏 */
.status-bar {
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 主内容区 */
.main-content {
    padding-bottom: 80px;
    min-height: calc(100vh - 44px);
}

/* Hero区域 */
.hero {
    position: relative;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: heroPulse 6s ease-in-out infinite;
}

@keyframes heroPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-logo {
    width: 120px;
    height: auto;
    margin-bottom: 12px;
}

.hero-slogan {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: var(--font-size-sm);
    color: rgba(255,255,255,0.85);
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    max-width: 360px;
    margin: 0 auto;
}

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

.search-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: none;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.95);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    outline: none;
    transition: box-shadow 0.3s;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* 分类标签 */
.categories {
    padding: 16px 20px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-tabs {
    display: flex;
    gap: 10px;
    padding-bottom: 8px;
}

.category-tab {
    flex-shrink: 0;
    padding: 8px 20px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.category-tab:active {
    transform: scale(0.95);
}

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

/* 应用列表 */
.app-list {
    padding: 8px 20px 20px;
}

.app-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    transition: all 0.3s;
    cursor: pointer;
    gap: 14px;
}

.app-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-hover);
}

.app-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.app-icon-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.app-category {
    font-size: var(--font-size-xs);
    color: var(--primary);
    font-weight: 500;
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.app-description {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.app-rating {
    font-size: var(--font-size-sm);
    color: #f59e0b;
    font-weight: 600;
}

.favorite-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: var(--font-size-md);
}

.favorite-btn:active {
    transform: scale(0.9);
}

.favorite-btn.active {
    color: #ef4444;
    background: #fef2f2;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
}

.load-more-btn {
    padding: 12px 32px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    background: transparent;
    color: var(--primary);
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
}

.load-more-btn:active {
    background: var(--primary);
    color: #fff;
}

/* 页面通用 */
.page-header {
    padding: 20px 20px 16px;
    text-align: center;
}

.page-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 20px;
    margin-bottom: 16px;
}

/* 发现页 */
.discover-section {
    padding: 20px 0;
}

.hot-apps, .new-apps, .editor-picks {
    padding: 0 20px;
}

/* 收藏页 */
.favorites-list {
    padding: 0 20px 20px;
}

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

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--border);
}

.empty-hint {
    font-size: var(--font-size-sm);
    margin-top: 8px;
}

/* 个人中心 */
.profile-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--card-bg);
    margin: 0 20px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.avatar {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.username {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: 4px;
}

.user-bio {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary);
}

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

.menu-list {
    padding: 0 20px 20px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    min-height: 44px;
}

.menu-item:active {
    transform: scale(0.98);
}

.menu-item i:first-child {
    width: 24px;
    color: var(--primary);
    margin-right: 12px;
}

.menu-item span {
    flex: 1;
    font-size: var(--font-size-md);
}

.menu-item i:last-child {
    color: var(--text-muted);
}

/* 页脚 */
.app-footer {
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-logo {
    width: 100px;
    height: auto;
    margin-bottom: 12px;
}

.footer-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    transition: color 0.3s;
}

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

.footer-copyright {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 450px;
    margin: 0 auto;
    height: 64px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    transition: color 0.3s;
    padding: 6px 12px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:active {
    opacity: 0.7;
}

/* 后台管理 */
.admin-page {
    padding-bottom: 80px;
}

.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 124px);
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    padding: 32px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-logo {
    width: 100px;
    margin-bottom: 16px;
}

.login-card h2 {
    font-size: var(--font-size-lg);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    background: var(--card-bg);
    outline: none;
    transition: border-color 0.3s;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-secondary {
    padding: 12px 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
}

.btn-secondary:active {
    background: var(--bg-light);
}

.btn-add {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.btn-add:active {
    opacity: 0.9;
}

.btn-logout {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: #ef4444;
    color: #fff;
    font-size: var(--font-size-sm);
    cursor: pointer;
    min-height: 44px;
}

.error-msg {
    color: #ef4444;
    font-size: var(--font-size-sm);
    margin-top: 12px;
}

.admin-section {
    padding: 20px;
}

.admin-section .section-title {
    padding: 0;
    margin-bottom: 16px;
}

.config-form {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.app-form {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.app-form h3 {
    font-size: var(--font-size-md);
    margin-bottom: 16px;
    color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 1;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-item {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    gap: 12px;
}

.admin-item .app-icon {
    width: 40px;
    height: 40px;
}

.admin-item .app-info {
    flex: 1;
}

.admin-item .app-name {
    font-size: var(--font-size-sm);
}

.admin-item .app-category {
    font-size: var(--font-size-xs);
}

.admin-item-actions {
    display: flex;
    gap: 8px;
}

.admin-item-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--font-size-xs);
    min-height: 36px;
}

.btn-edit {
    background: var(--bg-light);
    color: var(--primary);
}

.btn-delete {
    background: #fef2f2;
    color: #ef4444;
}

.btn-toggle {
    background: #f0fdf4;
    color: #22c55e;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    z-index: 9999;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 响应式 */
@media (min-width: 451px) {
    body {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        box-shadow: 0 0 30px rgba(0,0,0,0.1);
    }
}

@media (max-width: 374px) {
    .hero-slogan { font-size: 1.1rem; }
    .app-card { padding: 12px; }
    .app-icon { width: 44px; height: 44px; }
}