/* 05-chat-app.css · Couture OS Chat Application */

/* ══════════════════════════════════════
   应用窗口
══════════════════════════════════════ */
.chat-app-window {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 430px;
    margin: 0 auto;
    background: #FFFFFF;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.35s ease,
        visibility 0s 0.45s;
}

.chat-app-window.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.35s ease,
        visibility 0s 0s;
}

@media (min-width: 431px) {
    .chat-app-window {
        border-radius: 40px;
        height: 90vh;
        max-height: 850px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) translateY(40px);
        opacity: 0;
        border: 8px solid #FFF;
        box-shadow: 0 40px 100px rgba(0,0,0,0.15);
    }
    .chat-app-window.active {
        transform: translate(-50%, -50%) translateY(0);
        opacity: 1;
    }
}

/* ── Chat App 变量 ── */
.chat-app-window {
    --ca-bg: #FFFFFF;
    --ca-ink: #151515;
    --ca-red: #A63426;
    --ca-line: rgba(21,21,21,0.07);
    --ca-meta: rgba(21,21,21,0.38);
    --ca-hover: rgba(21,21,21,0.03);
    font-family: 'Space Grotesk', sans-serif;
}

/* ── 背景装饰 ── */
.ca-axis-y {
    position: absolute;
    top: 0; bottom: 0; left: 48px;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--ca-line) 15%, var(--ca-line) 85%, transparent);
    z-index: 1;
    pointer-events: none;
}

.ca-bg-typo {
    position: absolute;
    top: 28%; left: -10%;
    font-family: 'Playfair Display', serif;
    font-size: 200px;
    font-style: italic;
    font-weight: 700;
    color: rgba(21,21,21,0.018);
    pointer-events: none;
    z-index: 0;
    line-height: .8;
    transform: rotate(-90deg);
    transform-origin: left top;
    white-space: nowrap;
}

/* ══════════════════════════════════════
   Header
══════════════════════════════════════ */
.ca-header {
    position: relative;
    z-index: 50;
    padding: calc(env(safe-area-inset-top, 44px) + 14px) 16px 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.ca-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    padding-left: 8px;
    padding-right: 8px;
}

.ca-header-hanging {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ca-wire {
    display: flex;
    gap: 3px;
    height: 36px;
}

.ca-wire div {
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, rgba(21,21,21,0.04), var(--ca-ink));
}

.ca-header-plaque {
    background: #F9F9F9;
    border: none;
    padding: 5px 22px 5px 6px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
}

.ca-plaque-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #FFFFFF;
    border: none;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ca-plaque-dot svg {
    width: 16px; height: 16px;
    stroke: var(--ca-ink);
    fill: none;
}

.ca-plaque-text {
    display: flex;
    flex-direction: column;
    margin-left: 10px;
}

.ca-plaque-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--ca-ink);
    text-transform: uppercase;
    line-height: 1.2;
}

.ca-plaque-sub {
    font-size: 8px;
    color: var(--ca-red);
    font-weight: 500;
    margin-top: 1px;
    opacity: 0.8;
}

.ca-plaque-sig {
    position: absolute;
    bottom: -22px; right: -16px;
    font-family: 'Great Vibes', cursive;
    font-size: 28px;
    color: var(--ca-red);
    transform: rotate(-8deg);
    filter: blur(0.3px);
    opacity: 0.7;
}

.ca-hdr-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform .2s cubic-bezier(.25,1,.5,1);
    background: rgba(21,21,21,0.05);
    box-shadow: none;
    border: 1px solid rgba(21,21,21,0.08);
}

.ca-hdr-btn:active {
    transform: scale(.84);
}

.ca-hdr-btn svg {
    width: 15px; height: 15px;
    stroke: var(--ca-ink);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ca-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ── 悬浮胶囊搜索区 ── */
.ca-header-card {
    margin: 0 0 18px;
    padding: 0 16px;
    overflow: visible;
}

.ca-capsule {
    background: #F9F9F9;
    border: none;
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    height: 42px;
    box-sizing: border-box;
}

.ca-capsule-search {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 12px;
}

.ca-capsule-search svg {
    width: 14px; height: 14px;
    stroke: var(--ca-meta);
    fill: none;
    stroke-width: 2;
    margin-right: 8px;
}

.ca-capsule-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
    color: var(--ca-ink);
}

.ca-tab-pill {
    display: flex;
    background: rgba(21,21,21,0.04);
    border-radius: 50px;
    padding: 2px;
    gap: 2px;
}

.ca-tab {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 9px;
    font-weight: 700;
    color: var(--ca-meta);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ca-tab.active {
    background: #fff;
    color: var(--ca-ink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ca-tab:active {
    transform: scale(0.92);
}

.ca-hdr-btn svg {
    width: 15px; height: 15px;
    stroke: var(--ca-ink);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ca-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ── 悬浮胶囊搜索区 (Concept 3) ── */
.ca-header-card {
    margin: 0 0 18px;
    padding: 0 16px;
    overflow: visible;
}

.ca-capsule {
    background: #fff;
    border: 1px solid var(--ca-ink);
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    height: 42px;
    box-sizing: border-box;
}

.ca-capsule-search {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 12px;
    position: relative;
}

.ca-capsule-search svg {
    width: 14px; height: 14px;
    stroke: var(--ca-meta);
    fill: none;
    stroke-width: 2;
    margin-right: 8px;
}

.ca-capsule-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
    color: var(--ca-ink);
}

.ca-capsule-search input::placeholder {
    color: var(--ca-meta);
}

.ca-tab-pill {
    display: flex;
    background: rgba(21,21,21,0.04);
    border-radius: 50px;
    padding: 2px;
    gap: 2px;
}

.ca-tab {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 9px;
    font-weight: 700;
    color: var(--ca-meta);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ca-tab.active {
    background: #fff;
    color: var(--ca-ink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ca-tab:active {
    transform: scale(0.92);
}

/* ══════════════════════════════════════
   页面容器
══════════════════════════════════════ */
.ca-pages-wrap {
    position: relative;
    z-index: 5;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ca-page {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 100px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
    transition:
        opacity .35s cubic-bezier(.4,0,.2,1),
        transform .35s cubic-bezier(.4,0,.2,1);
}

.ca-page::-webkit-scrollbar {
    display: none;
}

.ca-page.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ── Section 标题 ── */
.ca-section-label {
    padding: 18px 24px 8px 68px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-section-label-text {
    font-family: 'Playfair Display', serif;
    font-size: 11px;
    font-style: italic;
    color: rgba(21,21,21,0.2);
    letter-spacing: 1px;
}

.ca-section-label-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(21,21,21,0.06), transparent);
}

.ca-section-num {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(21,21,21,0.15);
}

/* ── 空状态 ── */
.ca-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.ca-empty-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(21,21,21,0.03);
    border: 1px solid rgba(21,21,21,0.06);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.ca-empty-icon svg {
    width: 32px; height: 32px;
    stroke: rgba(21,21,21,0.15);
    fill: none;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ca-empty-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-style: italic;
    font-weight: 700;
    color: rgba(21,21,21,0.15);
    margin-bottom: 8px;
}

.ca-empty-sub {
    font-size: 11px;
    color: rgba(21,21,21,0.2);
    line-height: 1.6;
}

/* ── 置顶 ── */
.ca-pinned-scroll {
    padding: 0 24px 4px;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}

.ca-pinned-scroll::-webkit-scrollbar {
    display: none;
}

.ca-pinned-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform .2s cubic-bezier(.25,1,.5,1);
}

.ca-pinned-item:active {
    transform: scale(.88);
}

.ca-pinned-ring {
    width: 52px; height: 52px;
    border-radius: 50%;
    padding: 2px;
    position: relative;
    background: rgba(21,21,21,0.08);
}

.ca-pinned-ring.has-story {
    background: conic-gradient(var(--ca-red) 0%, var(--ca-red) 70%, rgba(21,21,21,0.1) 70%);
}

.ca-pinned-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    overflow: hidden;
}

.ca-pinned-inner .ca-pinned-fallback {
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.ca-pinned-badge {
    position: absolute;
    bottom: 0; right: 0;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--ca-red);
    border: 2px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 7px;
    font-weight: 900;
    color: #fff;
    z-index: 2;
}

.ca-pinned-name {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--ca-ink);
    max-width: 52px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── 聊天行 ── */
.ca-chat-row {
    position: relative;
    display: flex;
    align-items: center;
    padding: 13px 24px 13px 68px;
    cursor: pointer;
    transition: background .15s;
}

.ca-chat-row::before {
    content: '';
    position: absolute;
    left: 68px; bottom: 0; right: 24px;
    height: 1px;
    background: var(--ca-line);
}

.ca-chat-row:active {
    background: var(--ca-hover);
}

.ca-chat-avatar {
    position: absolute;
    left: 16px;
    width: 44px; height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(21,21,21,0.06);
}

.ca-av-fallback {
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0;
}

.ca-unread-dot {
    position: absolute;
    left: 52px; top: 12px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ca-red);
    border: 1.5px solid #fff;
    z-index: 2;
}

.ca-chat-content {
    flex: 1;
    min-width: 0;
}

.ca-chat-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.ca-chat-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ca-ink);
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.ca-chat-name.unread {
    color: #000;
}

.ca-chat-time {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--ca-meta);
    flex-shrink: 0;
    margin-left: 8px;
}

.ca-chat-time.unread {
    color: var(--ca-red);
}

.ca-chat-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ca-chat-preview {
    font-size: 11px;
    color: var(--ca-meta);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.ca-chat-preview.unread {
    color: rgba(21,21,21,0.65);
    font-weight: 500;
}

.ca-unread-count {
    flex-shrink: 0;
    margin-left: 8px;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    background: var(--ca-red);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 9px;
    font-weight: 900;
    color: #fff;
    padding: 0 5px;
}

/* ── 联系人 ── */
.ca-contact-group-label {
    padding: 14px 24px 6px 68px;
    font-family: 'Playfair Display', serif;
    font-size: 11px;
    font-style: italic;
    color: rgba(21,21,21,0.2);
    letter-spacing: 1px;
    border-bottom: 1px solid var(--ca-line);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-contact-group-letter {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--ca-red);
}

.ca-contact-row {
    position: relative;
    display: flex;
    align-items: center;
    padding: 11px 24px 11px 68px;
    cursor: pointer;
    transition: background .15s;
}

.ca-contact-row::before {
    content: '';
    position: absolute;
    left: 68px; bottom: 0; right: 24px;
    height: 1px;
    background: var(--ca-line);
}

.ca-contact-row:active {
    background: var(--ca-hover);
}

.ca-contact-avatar {
    position: absolute;
    left: 16px;
    width: 42px; height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(21,21,21,0.06);
}

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

.ca-contact-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ca-ink);
}

.ca-contact-handle {
    font-size: 10px;
    color: var(--ca-meta);
    margin-top: 2px;
}

.ca-contact-actions {
    display: flex;
    gap: 10px;
}

.ca-contact-act-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(21,21,21,0.04);
    border: 1px solid rgba(21,21,21,0.06);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform .2s;
}

.ca-contact-act-btn:active {
    transform: scale(.85);
}

.ca-contact-act-btn svg {
    width: 14px; height: 14px;
    stroke: var(--ca-ink);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Entity Dossier 表单 ── */
.ca-dossier-wrap {
    padding: 24px 24px 10px;
}

.ca-dossier {
    border: 1px solid var(--ca-ink);
    padding: 20px;
    background: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 10px 10px 0 rgba(21,21,21,0.03);
}

.ca-dossier-tag {
    position: absolute;
    top: 0; right: 0;
    background: var(--ca-ink);
    color: #fff;
    font-size: 7px;
    padding: 3px 8px;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.ca-dossier-stamp {
    position: absolute;
    top: 40px; right: -25px;
    border: 1px solid var(--ca-red);
    color: var(--ca-red);
    font-size: 8px;
    padding: 2px 30px;
    transform: rotate(45deg);
    font-weight: 900;
    letter-spacing: 1px;
    opacity: 0.6;
}

.ca-dossier h2 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-style: italic;
    margin-bottom: 24px;
    color: var(--ca-ink);
    border-bottom: 1px solid var(--ca-line);
    padding-bottom: 12px;
}

.ca-dossier-field {
    margin-bottom: 20px;
}

.ca-dossier-field label {
    display: block;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--ca-meta);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ca-dossier-field input[type="text"] {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--ca-ink);
    padding: 8px 0;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    background: transparent;
    color: var(--ca-ink);
}

.ca-dossier-field textarea {
    width: 100%;
    border: 1px solid var(--ca-line);
    padding: 12px;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.6;
    outline: none;
    background: rgba(21,21,21,0.02);
    min-height: 110px;
    resize: none;
    color: var(--ca-ink);
    border-left: 3px solid var(--ca-ink);
}

.ca-dossier-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.ca-dossier-brand {
    font-family: 'Great Vibes', cursive;
    font-size: 26px;
    color: var(--ca-red);
    opacity: 0.5;
    transform: translateY(8px);
}

.ca-dossier-btn {
    background: var(--ca-ink);
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(166,52,38,0.2);
    transition: all .2s;
    font-family: inherit;
}

.ca-dossier-btn:active {
    transform: scale(.95);
}

/* ── 发现页 ── */
.ca-discover-banner {
    margin: 20px 24px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(21,21,21,0.06);
    position: relative;
    cursor: pointer;
    background: var(--ca-ink);
    padding: 28px 24px;
    transition: transform .2s;
}

.ca-discover-banner:active {
    transform: scale(.98);
}

.ca-banner-label {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ca-banner-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-style: italic;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ca-banner-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
}

.ca-banner-sig {
    position: absolute;
    bottom: -10px; right: 10px;
    font-family: 'Great Vibes', cursive;
    font-size: 52px;
    color: rgba(255,255,255,0.06);
}

.ca-banner-arrow {
    position: absolute;
    top: 50%; right: 20px;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ca-banner-arrow svg {
    width: 14px; height: 14px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
}

.ca-discover-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 24px 0;
}

.ca-disc-card {
    border-radius: 14px;
    padding: 18px 16px;
    border: 1px solid rgba(21,21,21,0.06);
    cursor: pointer;
    transition: transform .2s;
    position: relative;
    overflow: hidden;
}

.ca-disc-card:active {
    transform: scale(.96);
}

.ca-disc-card.dark {
    background: var(--ca-ink);
}

.ca-disc-card.light {
    background: rgba(21,21,21,0.03);
}

.ca-disc-card-label {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ca-disc-card.dark .ca-disc-card-label {
    color: rgba(255,255,255,0.35);
}

.ca-disc-card.light .ca-disc-card-label {
    color: var(--ca-meta);
}

.ca-disc-card-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.ca-disc-card.dark .ca-disc-card-title {
    color: #fff;
}

.ca-disc-card.light .ca-disc-card-title {
    color: var(--ca-ink);
}

.ca-disc-card-num {
    position: absolute;
    bottom: 14px; right: 14px;
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-style: italic;
    font-weight: 700;
    opacity: .08;
}

.ca-disc-card.dark .ca-disc-card-num {
    color: #fff;
}

.ca-disc-card.light .ca-disc-card-num {
    color: var(--ca-ink);
}

.ca-discover-list-label {
    padding: 20px 24px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-dl-title {
    font-family: 'Playfair Display', serif;
    font-size: 11px;
    font-style: italic;
    color: rgba(21,21,21,0.2);
    letter-spacing: 1px;
}

.ca-dl-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(21,21,21,0.06), transparent);
}

.ca-disc-row {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 1px solid var(--ca-line);
    transition: background .15s;
    gap: 14px;
}

.ca-disc-row:active {
    background: var(--ca-hover);
}

.ca-disc-row-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
    background: rgba(21,21,21,0.04);
    border: 1px solid rgba(21,21,21,0.06);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ca-disc-row-icon svg {
    width: 18px; height: 18px;
    stroke: var(--ca-ink);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ca-disc-row-info {
    flex: 1;
}

.ca-disc-row-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--ca-ink);
}

.ca-disc-row-sub {
    font-size: 10px;
    color: var(--ca-meta);
    margin-top: 2px;
}

.ca-disc-row-arrow svg {
    width: 14px; height: 14px;
    stroke: var(--ca-meta);
    fill: none;
    stroke-width: 1.8;
}

/* ── Me 页 ── */
.ca-me-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 24px 24px;
    border-bottom: 1px solid var(--ca-line);
}

.ca-me-avatar-wrap {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 2px solid var(--ca-ink);
    padding: 3px;
    position: relative;
    cursor: pointer;
}

.ca-me-avatar-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--ca-ink);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.ca-me-edit-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--ca-red);
    border: 2px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ca-me-edit-dot svg {
    width: 10px; height: 10px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
}

.ca-me-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--ca-ink);
    margin-top: 14px;
    letter-spacing: .3px;
}

.ca-me-id {
    font-size: 11px;
    color: var(--ca-meta);
    margin-top: 4px;
}

.ca-me-sig {
    font-family: 'Great Vibes', cursive;
    font-size: 26px;
    color: rgba(21,21,21,0.12);
    margin-top: 6px;
}

.ca-me-stats {
    display: flex;
    gap: 0;
    width: 100%;
    border-bottom: 1px solid var(--ca-line);
}

.ca-me-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0;
    cursor: pointer;
    border-right: 1px solid var(--ca-line);
    transition: background .15s;
}

.ca-me-stat:last-child {
    border-right: none;
}

.ca-me-stat:active {
    background: var(--ca-hover);
}

.ca-me-stat-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--ca-ink);
}

.ca-me-stat-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--ca-meta);
    margin-top: 3px;
    text-transform: uppercase;
}

.ca-me-section-title {
    padding: 20px 24px 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(21,21,21,0.25);
    text-transform: uppercase;
}

.ca-me-row {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    cursor: pointer;
    border-bottom: 1px solid var(--ca-line);
    transition: background .15s;
    gap: 14px;
}

.ca-me-row:active {
    background: var(--ca-hover);
}

.ca-me-row-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ca-me-row-icon svg {
    width: 18px; height: 18px;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ca-me-row-text {
    flex: 1;
}

.ca-me-row-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ca-ink);
}

.ca-me-row-sub {
    font-size: 10px;
    color: var(--ca-meta);
    margin-top: 2px;
}

.ca-me-row-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ca-me-row-arrow svg {
    width: 14px; height: 14px;
    stroke: var(--ca-meta);
    fill: none;
    stroke-width: 1.8;
}

.ca-me-row-badge {
    min-width: 18px; height: 18px;
    border-radius: 9px;
    background: var(--ca-red);
    padding: 0 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 9px;
    font-weight: 900;
    color: #fff;
}

/* ══════════════════════════════════════
   胶囊底部导航
══════════════════════════════════════ */
.ca-bottom-nav {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 16px) + 14px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--ca-ink);
    border-radius: 50px;
    padding: 6px 6px;
    box-shadow:
        0 20px 50px rgba(0,0,0,0.28),
        0 8px 18px rgba(0,0,0,0.18),
        inset 0 1px 0 rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.08);
}

.ca-bottom-nav::before {
    content: '';
    position: absolute;
    top: 1px; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(to right,
        transparent,
        rgba(255,255,255,0.25) 30%,
        rgba(255,255,255,0.35) 50%,
        rgba(255,255,255,0.25) 70%,
        transparent);
    border-radius: 50%;
    pointer-events: none;
}

.ca-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    cursor: pointer;
    transition: transform .2s cubic-bezier(.25,1,.5,1);
    position: relative;
    border-radius: 50px;
    padding: 0 4px;
}

.ca-nav-item:active {
    transform: scale(.88);
}

.ca-nav-icon-wrap {
    width: 52px; height: 36px;
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    transition: background .25s;
    position: relative;
}

.ca-nav-item.active .ca-nav-icon-wrap {
    background: rgba(255,255,255,0.14);
}

.ca-nav-icon-wrap svg {
    width: 18px; height: 18px;
    stroke: rgba(255,255,255,0.45);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke .25s;
}

.ca-nav-item.active .ca-nav-icon-wrap svg {
    stroke: #fff;
}

.ca-nav-badge {
    position: absolute;
    top: 1px; right: 4px;
    min-width: 14px; height: 14px;
    border-radius: 7px;
    background: var(--ca-red);
    border: 1.5px solid var(--ca-ink);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 7px;
    font-weight: 900;
    color: #fff;
    padding: 0 3px;
}

.ca-nav-sep {
    width: 1px; height: 22px;
    flex-shrink: 0;
    background: linear-gradient(to bottom,
        transparent,
        rgba(255,255,255,0.12) 30%,
        rgba(255,255,255,0.12) 70%,
        transparent);
}

/* ── 撰写按钮 ── */
.ca-compose-btn {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 16px) + 80px);
    right: 20px;
    z-index: 60;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--ca-ink);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 28px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform .2s cubic-bezier(.25,1,.5,1);
}

.ca-compose-btn:active {
    transform: scale(.86);
}

.ca-compose-btn svg {
    width: 18px; height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Compose 覆盖层 ── */
.ca-compose-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 24px;
    opacity: 0;
    pointer-events: none;
    transition: all .35s cubic-bezier(.4,0,.2,1);
}

.ca-compose-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ca-compose-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 44px) + 10px);
    right: 20px;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(21,21,21,0.05);
    border: 1px solid rgba(0,0,0,.05);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.ca-compose-close svg {
    width: 17px; height: 17px;
    stroke: var(--ca-ink);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── 菜单覆盖层 ── */
.ca-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 120px 44px 60px 52px;
    opacity: 0;
    pointer-events: none;
    transition: all .45s cubic-bezier(.4,0,.2,1);
}

.ca-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ca-menu-exit {
    position: absolute;
    top: calc(env(safe-area-inset-top, 44px) + 10px);
    right: 20px;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(21,21,21,0.05);
    border: 1px solid rgba(0,0,0,.05);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.ca-menu-exit svg {
    width: 17px; height: 17px;
    stroke: var(--ca-ink);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ca-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.ca-menu-num {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 20px;
    color: var(--ca-red);
    margin-right: 14px;
}

.ca-menu-label {
    font-family: 'Great Vibes', cursive;
    font-size: 26px;
    color: var(--ca-ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.ca-menu-cn {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    opacity: .18;
    margin-left: 10px;
    transform: translateY(4px);
}

/* ══════════════════════════════════════
   聊天详情页
══════════════════════════════════════ */
.ca-chat-detail {
    position: absolute;
    inset: 0;
    background: #FFFFFF;
    z-index: 150;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.2,.8,.2,1);
}

.ca-chat-detail.active {
    transform: translateX(0);
}

.ca-detail-header {
    display: flex;
    align-items: center;
    padding: calc(env(safe-area-inset-top, 44px) + 10px) 16px 14px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--ca-line);
    gap: 12px;
    z-index: 10;
}

.ca-detail-back {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(21,21,21,0.05);
    border: 1px solid rgba(21,21,21,0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .2s;
}

.ca-detail-back:active {
    transform: scale(.84);
}

.ca-detail-back svg {
    width: 15px; height: 15px;
    stroke: var(--ca-ink);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ca-detail-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(21,21,21,0.06);
}

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

.ca-detail-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ca-ink);
}

.ca-detail-status {
    font-size: 9px;
    color: var(--ca-meta);
    font-weight: 500;
    letter-spacing: .5px;
}

/* ── 消息区域 ── */
.ca-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ca-messages-area::-webkit-scrollbar {
    display: none;
}

.ca-msg-row {
    display: flex;
    max-width: 82%;
    gap: 8px;
}

.ca-msg-row.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ca-msg-row.received {
    align-self: flex-start;
}

.ca-msg-avatar-small {
    width: 28px; height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    align-self: flex-end;
}

.ca-msg-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
}

.ca-msg-row.received .ca-msg-bubble {
    background: rgba(21,21,21,0.05);
    color: var(--ca-ink);
    border-bottom-left-radius: 4px;
}

.ca-msg-row.sent .ca-msg-bubble {
    background: var(--ca-ink);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ca-msg-time {
    font-size: 8px;
    color: var(--ca-meta);
    margin-top: 4px;
    padding: 0 4px;
}

.ca-msg-row.sent .ca-msg-time {
    text-align: right;
}

/* ── 打字指示器 ── */
.ca-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(21,21,21,0.05);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.ca-typing-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(21,21,21,0.25);
    animation: ca-typing-bounce 1.4s infinite;
}

.ca-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ca-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ca-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ── 输入栏 ── */
.ca-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px calc(env(safe-area-inset-bottom, 16px) + 12px);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--ca-line);
}

.ca-input-field {
    flex: 1;
    min-height: 38px;
    max-height: 120px;
    background: rgba(21,21,21,0.04);
    border: 1px solid rgba(21,21,21,0.08);
    border-radius: 20px;
    padding: 9px 16px;
    font-family: inherit;
    font-size: 13px;
    color: var(--ca-ink);
    outline: none;
    resize: none;
    line-height: 1.4;
    overflow-y: auto;
}

.ca-input-field::-webkit-scrollbar {
    display: none;
}

.ca-input-field::placeholder {
    color: var(--ca-meta);
}

.ca-send-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--ca-ink);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .2s;
    border: none;
    outline: none;
}

.ca-send-btn:active {
    transform: scale(.85);
}

.ca-send-btn svg {
    width: 16px; height: 16px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── 系统消息 ── */
.ca-system-msg {
    text-align: center;
    font-size: 9px;
    color: var(--ca-meta);
    padding: 8px 0;
    font-weight: 500;
    letter-spacing: .5px;
}
/* ── Pinned 横滑区 ── */
.ca-pinned-scroll {
    padding: 0 24px 4px;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.ca-pinned-scroll::-webkit-scrollbar { display: none; }
.ca-pinned-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform .2s cubic-bezier(.25,1,.5,1);
}
.ca-pinned-item:active { transform: scale(.88); }
.ca-pinned-ring {
    width: 52px; height: 52px;
    border-radius: 50%;
    padding: 2px;
    position: relative;
}
.ca-pinned-ring.has-story {
    background: conic-gradient(#A63426 0%, #A63426 70%, rgba(21,21,21,0.1) 70%);
}
.ca-pinned-ring.no-story {
    background: rgba(21,21,21,0.08);
}
.ca-pinned-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    overflow: hidden;
}
.ca-pinned-fallback {
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.ca-pinned-badge {
    position: absolute;
    bottom: 0; right: 0;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #A63426;
    border: 2px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 7px;
    font-weight: 900;
    color: #fff;
    z-index: 2;
}
.ca-pinned-name {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #151515;
    max-width: 52px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
