:root {
    --primary: #1e80ff;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "PingFang SC","Microsoft YaHei",sans-serif;
    background: var(--bg);
    color: var(--text);
}

header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;

    position: sticky;
    top: 0;
    z-index: 1000;
}


.nav {
    max-width: 1200px;
    margin: auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
}

.logo a {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin-right: 60px;
}

.menu {
    display: flex;
    gap: 28px;
    align-items: center;
}

.menu a {
    text-decoration: none;
    font-size: 14px;
    color: #374151;
    position: relative;
}

.menu a.active {
    color: var(--primary);
    font-weight: 600;
}

.menu a.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* 右侧功能区 */
.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 图标按钮（可点击） */
.icon-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: #374151;
    padding: 6px;
    border-radius: 10px;
    transition: color .2s, background .2s, transform .2s;
}

.icon-btn:hover {
    color: var(--primary);
    background: #eef4ff;
    transform: scale(1.06);
}

.avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    transition: transform .2s;
}

.avatar-mini:hover {
    transform: scale(1.06);
}

/* 主体 */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 24px;
}

/* 轮播 */
.carousel {
    position: relative;
    height: 260px;
    border-radius: var(--radius);
    overflow: hidden;
}

.carousel img {
    position: absolute;        /* 关键：图片叠加 */
    top: 0;
    left: 0;
    width: 100%;
    height: 260px;
    object-fit: cover;

    opacity: 0;
    transition: opacity 0.8s ease;   /* 淡入淡出 */
    pointer-events: none;
}

.carousel img.active {
    opacity: 1;
    z-index: 1;
}

.carousel button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.35);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.prev { left: 12px; }
.next { right: 12px; }

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    margin: 18px 0;
}

.tab {
    padding: 6px 14px;
    border-radius: 20px;
    background: #e5e7eb;
    font-size: 13px;
    cursor: pointer;
}

.tab.active {
    background: var(--primary);
    color: #fff;
}

/* 文章 */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.card img {
    width: 110px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.content h3 {
    margin: 0;
    font-size: 16px;
}

.summary {
    font-size: 13px;
    color: var(--muted);
    margin: 6px 0;
    line-height: 1.6;
}

.meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 12px;
}

.like { cursor: pointer; }

/* 侧边栏 */
.sidebar .box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.profile { text-align: center; }

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 12px;
    font-size: 12px;
}

.stats span {
    display: block;
    color: var(--muted);
}

@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
}

/* 搜索容器 */
.search-box {
    display: flex;
    align-items: center;
    position: relative;
}

/* 输入框默认收起 */
.search-box input {
    width: 0;
    opacity: 0;
    padding: 6px 0;
    border: none;
    border-radius: 20px;
    outline: none;
    font-size: 13px;
    transition: all 0.3s ease;
    background: #f3f4f6;
}

/* 展开状态 */
.search-box.active input {
    width: 160px;
    opacity: 1;
    padding: 6px 12px;
    margin-right: 6px;
    border: 1px solid #e5e7eb;
}

/* 轮播指示器（小圆点） */
.carousel-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.carousel-dots span.active {
    background: #fff;
    transform: scale(1.4);
}

/* 侧边栏头像可点击 */
.profile-avatar {
    display: inline-block;
    cursor: pointer;
}

/* stats 交互 */
.stat-item {
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.stat-item:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.stat-item b {
    display: block;
    font-size: 16px;
}

/* 文章可点击 */
.card-link {
    display: flex;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

/* 时间轴美化 */
.timeline-item {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-text {
    font-size: 14px;
    line-height: 1.6;
}

.timeline-date {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.fav {
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s, transform 0.2s;
}

.fav.active {
    color: #f59e0b;
    transform: scale(1.2);
}

.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.meta {
    align-items: center;
}

.meta .like,
.meta .fav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== 文章详情内容 ===== */
#content {
    font-size: 15px;
    line-height: 1.9;
    color: #374151;
}

#content p {
    margin: 12px 0;
}

#content h2,
#content h3 {
    margin: 24px 0 12px;
    font-weight: 600;
}

#content ul {
    padding-left: 20px;
    margin: 12px 0;
}

#content li {
    margin: 6px 0;
}

#favBtn.active {
    color: #f59e0b;
}

/* ===== Profile Page ===== */

.profile-page {
    padding: 24px;
}

.profile-header {
    display: flex;
    gap: 20px;
    align-items: center;
}

.avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.profile-stats {
    display: flex;
    gap: 24px;
    margin: 20px 0;
    font-size: 14px;
}

.profile-stats div {
    text-align: center;
}

.profile-tabs {
    display: flex;
    gap: 16px;
    margin: 24px 0;
}

.profile-content-list .card {
    cursor: pointer;
}

.setting-item {
    margin-bottom: 16px;
}
.setting-item input {
    padding: 6px 10px;
    width: 240px;
}
