/* smw-profile.css —— 前台个人主页样式（美化版 v2）
 * 设计：顶部渐变封面 + 悬浮头像卡 + 信息标签胶囊 + 简介卡 + 文章列表卡
 */

.smw-up-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 10px 0 30px;
    box-sizing: border-box;
    font-size: 14px;
    color: #374151;
}
.smw-up-wrap * { box-sizing: border-box; }

/* ---------- 顶部操作条：返回首页 / 返回我的主页 ---------- */
/* 注意：本页位于主题 .article-content 内，其 .article-content a 会给链接加强制下划线+主题蓝，
   故这里用高特异性 + !important 覆盖。 */
.smw-up-wrap .smw-up-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 16px;
}
.smw-up-wrap .smw-up-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    text-decoration: none !important;
    background: #fff;
    color: #374151 !important;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    transition: all .2s ease;
}
.smw-up-wrap .smw-up-back:hover {
    color: #4f46e5 !important;
    border-color: #c7d2fe;
    background: #f5f3ff;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .18);
}
.smw-up-wrap .smw-up-back-home {
    color: #fff !important;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(79, 70, 229, .3);
}
.smw-up-wrap .smw-up-back-home:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    border-color: transparent;
}
.smw-up-wrap .smw-up-back-ico {
    font-size: 15px;
    line-height: 1;
}

/* ---------- 顶部：渐变封面 + 头像资料 ---------- */
.smw-up-hero {
    position: relative;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 6px 24px rgba(79, 70, 229, .16);
    /* 注意：此处不能 overflow:hidden，否则会裁切头像悬停时的放大旋转 */
}
.smw-up-cover {
    height: 130px;
    background: linear-gradient(120deg, #6366f1 0%, #8b5cf6 45%, #ec4899 100%);
    position: relative;
    border-radius: 16px 16px 0 0;
    overflow: hidden;            /* 仅封面自身裁切，保证圆角与光斑不溢出 */
}
/* 封面上的装饰光斑 */
.smw-up-cover::after {
    content: "";
    position: absolute;
    top: -60px; right: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 70%);
    border-radius: 50%;
}
.smw-up-hero-body {
    background: #fff;
    padding: 0 26px 24px;
    text-align: center;          /* 头像、用户名、信息胶囊整体居中 */
    border-radius: 0 0 16px 16px;
}
.smw-up-avatar {
    width: 104px; height: 104px;
    border-radius: 50%;
    border: 4px solid #fff;
    margin: -56px auto 0;        /* 上移压住封面 + 水平居中 */
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
    position: relative;
    z-index: 2;
    overflow: visible;           /* 不裁切，允许悬停放大旋转 */
    cursor: pointer;
}
.smw-up-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    transform-origin: center center;
    animation: smwUpLight 4s ease-in-out infinite;   /* 与首页一致的彩色呼吸光圈 */
    transition: transform .5s ease, box-shadow .5s ease;
}
/* 悬停：与首页文章列表头像一致 —— 放大 1.15 + 旋转 720° */
.smw-up-avatar:hover img {
    transform: scale(1.15) rotate(720deg);
}
/* 彩色呼吸光圈：红 → 绿 → 蓝 → 绿 → 红 */
@keyframes smwUpLight {
    0%   { box-shadow: 0 0 4px #f00; }
    25%  { box-shadow: 0 0 16px #0f0; }
    50%  { box-shadow: 0 0 4px #00f; }
    75%  { box-shadow: 0 0 16px #0f0; }
    100% { box-shadow: 0 0 4px #f00; }
}
/* 用户名：彩色跑马灯（渐变文字 + 背景位移流动） */
.smw-up-name {
    margin: 14px 0 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
    display: inline-block;
    color: #111827;              /* 兜底：浏览器不支持渐变文字时仍为深色可见 */
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
    .smw-up-name {
        background-image: linear-gradient(90deg, #ff3b30, #ff9500, #ffcc00, #34c759, #007aff, #af52de, #ff3b30);
        background-size: 300% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: smwUpRainbow 4s linear infinite;
    }
}
@keyframes smwUpRainbow {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}
/* 信息胶囊（性别 / QQ / 投稿） */
.smw-up-meta {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;     /* 居中显示 */
    gap: 10px;
}
.smw-up-meta li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4f46e5;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    border-radius: 999px;
    padding: 6px 14px;
    line-height: 1;
}
.smw-up-k { color: #9ca3af; }
.smw-up-v { color: #4f46e5; font-weight: 600; }

/* ---------- 通用卡片 ---------- */
.smw-up-card {
    background: #fff;
    border: 1px solid #f0f0f3;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
}
.smw-up-card > h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    padding-left: 12px;
    border-left: 4px solid #7c3aed;
    border-radius: 2px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
}
.smw-up-card > h3::before {
    content: "";
    display: none;
}

/* ---------- 简介 ---------- */
.smw-up-desc-text {
    font-size: 14px;
    line-height: 1.85;
    color: #4b5563;
    word-break: break-word;
    background: #fafafa;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #f3f4f6;
}
.smw-up-empty {
    color: #9ca3af;
    font-size: 14px;
}

/* ---------- 文章列表 ---------- */
.smw-up-postlist {
    list-style: none;
    margin: 0;
    padding: 0;
}
.smw-up-postitem {
    border-radius: 10px;
    border: 1px solid #f1f2f6;
    margin-bottom: 12px;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}
.smw-up-postitem:last-child {
    margin-bottom: 0;
}
/* 整卡悬停效果：上浮 + 阴影 + 边框高亮（与首页卡片视觉一致） */
.smw-up-postitem:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(79, 70, 229, .14);
    border-color: #c7d2fe;
    background: #fbfbff;
}
/* 注意：个人主页位于主题 .article-content 容器内，DUX 的 .article-content a 会强制给链接
   加下划线+主题蓝，特异性(0,3,1)高于普通类。故此处用 .smw-up-wrap 前缀 + !important 强制覆盖。 */
.smw-up-wrap .smw-up-postlink,
.smw-up-wrap .smw-up-postlink:hover,
.smw-up-wrap .smw-up-postlink:focus {
    display: flex;
    flex-direction: row;             /* 缩略图在左、内容在右 */
    align-items: center;
    gap: 14px;
    padding: 12px;
    text-decoration: none !important;      /* 去掉下划线（压过 .article-content a） */
}
/* 首图缩略图：固定比例自适应，绝不超出卡片 */
.smw-up-wrap .smw-up-thumb {
    flex: 0 0 132px;
    width: 132px;
    height: 88px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    display: block;
}
.smw-up-wrap .smw-up-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;               /* 裁切填充，保持比例不变形 */
    display: block;
    transition: transform .3s ease;
}
.smw-up-postitem:hover .smw-up-thumb img {
    transform: scale(1.06);
}
.smw-up-wrap .smw-up-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.smw-up-wrap .smw-up-posttitle,
.smw-up-wrap .smw-up-postlink .smw-up-posttitle {
    width: 100%;
    color: #1f2937 !important;
    text-decoration: none !important;      /* 去掉下划线 */
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.6;
    /* 标题完整显示、该换行就换行，不截断、不出框 */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    transition: color .2s ease;
}
/* 悬停效果与首页文章标题一致：变主题蓝、无下划线 */
.smw-up-wrap .smw-up-postlink:hover .smw-up-posttitle {
    color: #007bff !important;
    text-decoration: none !important;
}
.smw-up-postmeta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12px;
    color: #9ca3af;
}
.smw-up-posts .smw-up-empty { padding: 6px 0; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
    .smw-up-cover { height: 108px; }
    .smw-up-hero-body { padding: 0 18px 20px; }
    .smw-up-avatar { width: 88px; height: 88px; margin: -48px auto 0; }
    .smw-up-name { font-size: 21px; }
    .smw-up-card { padding: 16px 16px; }
    .smw-up-wrap .smw-up-postlink { padding: 10px; gap: 12px; }
    .smw-up-wrap .smw-up-thumb { flex: 0 0 100px; width: 100px; height: 68px; }
    .smw-up-posttitle { font-size: 15px; }
    .smw-up-postmeta { gap: 6px 12px; }
}
