/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    border: 0;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-primary: #fff;
    --bg-secondary: #f7f9fc;
    --border-color: #e8ecf3;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 70px;
    min-height: 100vh;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 0;
    cursor: pointer;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 24px 16px;
    margin-bottom: 20px;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-desc {
    font-size: 14px;
    opacity: 0.9;
}

/* 分类按钮 */
.categories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 16px;
    background: var(--bg-primary);
    margin-bottom: 16px;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    white-space: nowrap;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 文章卡片 */
.article-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tag {
    padding: 4px 10px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.article-content {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 13px;
}

.refresh-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.refresh-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* 搜索页面 */
.search-header {
    background: var(--bg-primary);
    padding: 16px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    margin-top: 0;
}

.search-box {
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    opacity: 0.9;
}

/* 列表项 */
.list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.list-item:hover {
    background: var(--bg-secondary);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.list-item-meta {
    font-size: 13px;
    color: var(--text-light);
}

/* 浏览量图标样式 */
.view-icon {
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-icon svg {
    width: 14px;
    height: 14px;
}

/* 我的页面 */
.user-section {
    background: var(--bg-primary);
    padding: 32px 16px;
    text-align: center;
    margin-bottom: 16px;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.user-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-email {
    color: var(--text-light);
    font-size: 14px;
}

.menu-list {
    background: var(--bg-primary);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.menu-item:hover {
    background: var(--bg-secondary);
}

.menu-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    color: var(--primary-color);
}

.menu-text {
    flex: 1;
    font-size: 15px;
}

.menu-arrow {
    color: var(--text-light);
}

/* 登录/注册页面 */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 0 16px;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: flex;
    gap: 12px;
}

.code-input {
    flex: 1;
}

.send-code-btn {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.send-code-btn:hover {
    background: var(--primary-color);
    color: white;
}

.send-code-btn.disabled {
    color: var(--text-light);
    cursor: not-allowed;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 24px;
}

.auth-btn:hover {
    opacity: 0.9;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 文章详情页 */
.article-detail {
    background: var(--bg-primary);
    padding: 24px 16px;
    min-height: 100vh;
    user-select: none;
    position: relative;
}

.article-detail::before {
    content: "主播才艺系统";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 48px;
    color: rgba(0, 0, 0, 0.03);
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
}

.article-detail-header {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.article-detail-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-detail-info {
    display: flex;
    gap: 16px;
    color: var(--text-light);
    font-size: 14px;
}

.article-detail-content {
    position: relative;
    z-index: 1;
    font-size: 16px;
    line-height: 2;
    color: var(--text-primary);
}

.back-btn {
    position: sticky;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: none;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    z-index: 100;
}

.search-header .back-btn {
    position: static;
    width: 36px;
    height: 36px;
    margin-bottom: 0;
    color: var(--text-secondary);
    background: transparent;
    box-shadow: none;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 0;
}

.pagination-btn {
    padding: 10px 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 分类页面 */
.category-header {
    background: var(--bg-primary);
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.category-filter {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-item {
    padding: 8px 16px;
    border-radius: 16px;
    background: var(--bg-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-item.active {
    background: var(--primary-color);
    color: white;
}

/* 搜索结果样式 */
.search-summary {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.result-count {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 18px;
}

.search-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-item {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.search-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.3);
}

.search-item-header {
    margin-bottom: 12px;
}

.search-item-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

.search-item-preview {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-left: 12px;
    border-left: 3px solid var(--border-color);
}

.search-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.view-count {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
}

.create-date {
    color: var(--text-light);
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
}

/* 热门文案样式 */
.hot-section {
    margin-top: 16px;
}

.hot-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-left: 4px;
}

.hot-articles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 提示 */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-data-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* 响应式设计 */
@media (min-width: 768px) {
    body {
        padding-bottom: 80px;
    }

    .bottom-nav {
        height: 70px;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.08);
    }

    .nav-item svg {
        width: 28px;
        height: 28px;
        margin-bottom: 6px;
    }

    .nav-item span {
        font-size: 14px;
    }

    .container {
        max-width: 1000px;
        padding-top: 20px;
    }

    .header {
        margin-top: 0;
        border-radius: var(--radius-lg);
        margin-bottom: 24px;
    }

    .articles-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .article-card {
        margin-bottom: 0;
        border-radius: var(--radius-lg);
    }
}

@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .search-page .container,
    .search-result-page .container {
        padding-top: 16px;
    }
}
