/* ==========================================================================
   support/intro · 出场人员介绍
   --------------------------------------------------------------------------
   卡片不是 .window —— 这一页要的是首页文章那种"一张一张的卡片"，所以自己画：
     左 头像 / 右 昵称 + 绰号 + 简介 / 右下角排联系方式图标
   两套皮肤靠 <html data-intro-theme="classic|sticker"> 分流，这个属性由
   index.html 头部那段内联脚本按 localStorage.theme 写上。这样就不必跟主题
   抢特异性 —— 本文件的 <link> 排在主题之后，同特异性一定是页面赢。

   ⚠️ 头像框 images/avatarframe.png 是 128×127 的 Vista 用户磁贴框，实测：
        · 相片内腔 = x 15..108、y 14..107（边线在 x=14/109、y=13/108，线宽 1px）
        · 即内腔 94×94，左上角落在 (15,14)
      要让 64×64 的照片正好嵌满内腔，整框按 k = 64/94 ≈ 0.68085 缩放：
        宽 128×k ≈ 87.1    高 127×k ≈ 86.5
        左 -15×k ≈ -10.2   上 -14×k ≈ -9.5
      .intro-portrait 就是"整框的大小"，头像绝对定位到内腔位置，框再反向偏移
      盖回 0,0 —— 于是框的溢出全部被这个盒子吃掉，卡片按常规 padding 排就行，
      不用再为"框探出卡片"留奇怪的余量。改头像尺寸时这几个数要一起按比例改。
   ========================================================================== */

/* ---------- 网格 ---------- */

.intro-grid {
    display: grid;
    /* 外面套一层 min():容器不足 270px 时按容器宽度铺，不会横向溢出。
       270 是这张横版卡片的下限 —— 再窄，右侧就没地方放"昵称 + 绰号"了。
       头像缩到 64 之后卡片矮了一截，旧版主题（正文栏 660 左右）能排两列，
       手账主题更宽，能排三到四列。 */
    grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
    gap: 16px;
    margin: 18px 0 24px;
}

/* ---------- 卡片 ---------- */

.intro-card {
    position: relative;
    display: flex;
    gap: 12px;
    min-width: 0;
}

/* ---------- 头像 ---------- */

.intro-portrait {
    position: relative;
    flex: none;
    width: 87.1px;
    height: 86.5px;
}

.intro-avatar {
    position: absolute;
    left: 10.2px;
    top: 9.5px;
    width: 64px;
    height: 64px;
}

.intro-card .intro-avatar img {
    display: block;
    width: 64px;
    height: 64px;
    /* 相片位是圆角矩形，照片自己也切一点，免得四角探出框线 */
    border-radius: 4px;
    object-fit: cover;
    margin: 0;
}

/* 头像框压在照片**上面** */
.intro-avatar-frame {
    position: absolute;
    left: -10.2px;
    top: -9.5px;
    width: 87.1px;
    height: 86.5px;
    background: url("../../images/avatarframe.png") no-repeat center center;
    background-size: 100% 100%;
    pointer-events: none;
}

/* ---------- 右侧信息 ---------- */

.intro-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.intro-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.intro-name {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.35;
    word-break: break-word;
}

.intro-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.intro-badge {
    display: inline-block;
    padding: 0 7px;
    font-size: 10px;
    font-weight: bold;
    line-height: 16px;
    white-space: nowrap;
    border-radius: 8px;
}

.intro-bio {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.65;
    word-break: break-word;
}

/* ---------- 联系方式（右下角，只放图标） ---------- */

.intro-contacts {
    /* margin-top:auto 把它顶到卡片底部；align-self:flex-end 靠右 */
    margin-top: auto;
    align-self: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding-top: 8px;
}

.intro-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid transparent;
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.intro-contact img,
.intro-contact .xxt-ic {
    width: 16px;
    height: 16px;
    margin: 0;
    vertical-align: middle;
}

/* ==========================================================================
   旧版皮肤：style.css / xpstyle.css
   —— 卡面沿用 .tips 那套白→浅蓝渐变，不用 .window 的玻璃标题栏
   ========================================================================== */

html[data-intro-theme="classic"] .intro-card {
    padding: 16px 16px 14px;
    background: linear-gradient(to bottom, #FFFFFF 0%, #CADAEF 100%);
    border: 1px solid #767676;
    border-radius: 4px;
    box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.16);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html[data-intro-theme="classic"] .intro-card:hover {
    border-color: #2F6FD6;
    box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.22);
}

html[data-intro-theme="classic"] .intro-name {
    color: #0B3F73;
}

/* 绰号做成 Vista 蓝色胶囊：和站内 .cat-btn.active 同一组渐变值 */
html[data-intro-theme="classic"] .intro-badge {
    color: #FFFFFF;
    background: linear-gradient(to bottom, #4A77A9 0%, #225E9E 50%, #164686 51%, #2F7AB3 100%);
    border: 1px solid #7FA6C9;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

html[data-intro-theme="classic"] .intro-bio {
    color: #33414F;
}

html[data-intro-theme="classic"] .intro-contact:hover {
    background: linear-gradient(to bottom, #FFFFFF 0%, #D9E5F4 100%);
    border-color: #9DB4D0;
}

html[data-intro-theme="classic"] .intro-contact:active {
    background: linear-gradient(to bottom, #C8DCF3 0%, #EAF2FC 100%);
}

/* ==========================================================================
   手账皮肤：modern-sticker.css
   —— 白卡 + 细描边（同首页 #articleList li.xxt-card 的做法），头像换宝丽来
   ========================================================================== */

html[data-intro-theme="sticker"] .intro-card {
    padding: 16px 16px 14px;
    background: #FFFFFF;
    border: 1px solid var(--rule-2);
    border-radius: var(--r-md);
    transition: border-color var(--t-fast) ease;
}

html[data-intro-theme="sticker"] .intro-card:hover {
    border-color: var(--mint);
}

/* 相纸是 64 + 四周各 6 的白边 = 76，所以这个盒子也得跟着改尺寸 */
html[data-intro-theme="sticker"] .intro-portrait {
    width: 76px;
    height: 76px;
}

html[data-intro-theme="sticker"] .intro-avatar-frame {
    display: none;
}

html[data-intro-theme="sticker"] .intro-avatar {
    position: static;
    /* content-box 才能让照片仍是 64×64，多出来的是相纸白边 */
    box-sizing: content-box;
    width: 64px;
    height: 64px;
    padding: 6px;
    background: #FFFFFF;
    border-radius: 7px;
    box-shadow: var(--sh-2);
    transform: rotate(-2deg);
    transition: transform var(--t-mid) var(--ease-pop);
}

html[data-intro-theme="sticker"] .intro-card:hover .intro-avatar {
    transform: rotate(0deg) translateY(-2px);
}

html[data-intro-theme="sticker"] .intro-card .intro-avatar img {
    border-radius: 4px;
}

html[data-intro-theme="sticker"] .intro-name {
    color: var(--ink);
    font-weight: 500;
}

html[data-intro-theme="sticker"] .intro-badge {
    padding: 0 8px;
    line-height: 17px;
    color: var(--ink);
    background: var(--cream);
    border: 1px solid rgba(61, 58, 56, 0.10);
    border-radius: var(--r-pill);
    transform: rotate(-1.5deg);
}

/* 多个绰号时轮着换贴纸色，刻意的不整齐 */
html[data-intro-theme="sticker"] .intro-tags .intro-badge:nth-child(2n) {
    background: var(--mint);
    transform: rotate(1.5deg);
}

html[data-intro-theme="sticker"] .intro-tags .intro-badge:nth-child(3n) {
    background: var(--lilac);
}

html[data-intro-theme="sticker"] .intro-bio {
    color: var(--ink-2);
}

html[data-intro-theme="sticker"] .intro-contact {
    border-radius: var(--r-sm);
}

html[data-intro-theme="sticker"] .intro-contact:hover {
    background: var(--paper-2);
    border-color: var(--rule);
}

/* ---------- 窄屏 ---------- */

@media screen and (max-width: 420px) {
    .intro-card {
        gap: 10px;
    }

    html[data-intro-theme="classic"] .intro-card,
    html[data-intro-theme="sticker"] .intro-card {
        padding: 14px 12px 12px;
    }
}
