/* =========================================================
   talks.css — 说说页专属样式
   依赖：style.css（需先引入）
   ========================================================= */

/* ===== 主体：铺满整页 ===== */
.talks-main {
    position: relative;
    z-index: 10;
    max-width: 100%;
    margin: 0 auto;
    padding: 130px 60px 80px;
}

.talks-main h1 {
    font-size: 38px;
    font-weight: 300;
    letter-spacing: 6px;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

.talks-main .subtitle {
    text-align: center;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 2px;
    margin-bottom: 60px;
}

/* ===== 瀑布流容器 ===== */
.talks-wall {
    max-width: 1600px;
    margin: 0 auto;
}

/* ===== 便利贴容器：多列瀑布流 ===== */
.talks-day-items {
    column-count: 3;
    column-gap: 24px;
}

/* ===== 单条说说：便利贴 ===== */
.talk-item {
    position: relative;
    padding: 22px 24px 18px;
    border-radius: 4px;
    color: #2a2a2a;
    box-shadow:
        2px 3px 8px rgba(0, 0, 0, 0.35),
        0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: talkEnter 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    transform-origin: center top;
    transform: rotate(var(--tilt, 0deg));
    box-sizing: border-box;

    /* 多列瀑布流关键属性 */
    break-inside: avoid;
    margin-bottom: 24px;
    display: block;
}

.talk-item:hover {
    transform: rotate(0deg) translateY(-4px) !important;
    box-shadow:
        3px 6px 16px rgba(0, 0, 0, 0.45),
        0 1px 3px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

/* ===== 便利贴颜色池（由 JS 分配 class） ===== */
.note-yellow { background: #fff4a3; --note-color: #e6d600; }
.note-blue   { background: #b8e4ff; --note-color: #4aa8e0; }
.note-pink   { background: #ffc9d4; --note-color: #e87a95; }
.note-green  { background: #c9f5c0; --note-color: #6bbf5a; }
.note-orange { background: #ffd9b3; --note-color: #e89a4a; }
.note-purple { background: #d9c9ff; --note-color: #8b6fd9; }
.note-teal   { background: #b3f0e6; --note-color: #3fb8a5; }
.note-coral  { background: #ffc4a3; --note-color: #e8704a; }

/* ===== 钉住方式：胶带（贴在卡片内侧顶部） ===== */
.talk-item.pin-tape::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 60px;
    height: 22px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    pointer-events: none;

    /* 锯齿底部 */
    clip-path: polygon(
        0% 0%,
        100% 0%,
        100% 75%,
        95% 100%,
        90% 75%,
        85% 100%,
        80% 75%,
        75% 100%,
        70% 75%,
        65% 100%,
        60% 75%,
        55% 100%,
        50% 75%,
        45% 100%,
        40% 75%,
        35% 100%,
        30% 75%,
        25% 100%,
        20% 75%,
        15% 100%,
        10% 75%,
        5% 100%,
        0% 75%
    );
}

/* 胶带：有边框时，贴在彩色框内沿 */
.talk-item.style-border.pin-tape::before {
    top: 6px;
}

/* ===== 钉住方式：图钉（钉在便利贴内部） ===== */
.talk-item.pin-pushpin::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 30%,
        #ff8a8a 0%,
        #e63946 45%,
        #a41e2a 100%
    );
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset -1px -1px 2px rgba(0, 0, 0, 0.3),
        inset 1px 1px 2px rgba(255, 255, 255, 0.5);
    z-index: 3;
    pointer-events: none;
}

/* 图钉的钉尖 */
.talk-item.pin-pushpin::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: linear-gradient(
        to bottom,
        #888 0%,
        #444 100%
    );
    border-radius: 0 0 2px 2px;
    z-index: 2;
    pointer-events: none;
}

/* 图钉：有边框时，钉在彩色框内 */
.talk-item.style-border.pin-pushpin::before {
    top: 30px;
}

.talk-item.style-border.pin-pushpin::after {
    top: 44px;
}

/* ===== 头部：时间 + 心情 ===== */
.talk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.talk-time {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
}

.talk-mood {
    font-size: 18px;
    line-height: 1;
    user-select: none;
}

/* ===== 正文 ===== */
.talk-content {
    font-size: 16px;
    line-height: 1.8;
    color: #2a2a2a;
    letter-spacing: 1px;
    word-break: break-word;
    white-space: pre-wrap;
}

.talk-content a {
    color: #ffcc00;
    text-decoration: none;
}

.talk-content a:hover {
    text-decoration: underline;
}

/* ===== 配图（固定 3 列九宫格） ===== */
.talk-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 14px;
}

.talk-images img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    cursor: zoom-in;
    border: none;
    box-shadow: none;
    transition: transform 0.3s;
}

.talk-images img:hover {
    transform: scale(1.03);
}

/* ===== 纸型：横线纸 ===== */
.talk-item.style-line .talk-content {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 27px,
        rgba(0, 0, 0, 0.12) 27px,
        rgba(0, 0, 0, 0.12) 28px
    );
    background-position: 0 0;
}

/* ===== 纸型：彩色边框 + 白底 ===== */
.talk-item.style-border {
    background: #fff;
    border: 24px solid var(--note-color, #ccc);
    padding: 26px 28px 22px;
    box-shadow:
        2px 3px 8px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ===== 纸型：方格纸 ===== */
.talk-item.style-grid .talk-content {
    background-image:
        repeating-linear-gradient(
            to right,
            rgba(0, 0, 0, 0.25) 0,
            rgba(0, 0, 0, 0.25) 1px,
            transparent 1px,
            transparent 24px
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.25) 0,
            rgba(0, 0, 0, 0.25) 1px,
            transparent 1px,
            transparent 24px
        );
    background-position: 0 0;
}

/* ===== 标签 ===== */
.talk-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.talk-tag {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
    cursor: default;
    transition: filter 0.3s;
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.65);
}

.talk-tag:hover {
    filter: brightness(1.1);
}

/* 标签颜色池 */
.talk-tag.tag-yellow { background: rgba(230, 214, 0, 0.25);  color: #7a6f00; }
.talk-tag.tag-blue   { background: rgba(74, 168, 224, 0.25); color: #1c5f87; }
.talk-tag.tag-pink   { background: rgba(232, 122, 149, 0.25); color: #9b2e4c; }
.talk-tag.tag-green  { background: rgba(107, 191, 90, 0.25);  color: #2f6e23; }
.talk-tag.tag-orange { background: rgba(232, 154, 74, 0.25);  color: #93561a; }
.talk-tag.tag-purple { background: rgba(139, 111, 217, 0.25); color: #4d3a89; }
.talk-tag.tag-teal   { background: rgba(63, 184, 165, 0.25);  color: #1c6b5e; }
.talk-tag.tag-coral  { background: rgba(232, 112, 74, 0.25);  color: #973d1f; }

/* ===== 入场动画 ===== */
@keyframes talkEnter {
    from {
        opacity: 0;
        transform: translateY(16px) rotate(var(--tilt, 0deg));
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(var(--tilt, 0deg));
    }
}

/* ===== 空状态 ===== */
.talks-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 15px;
    letter-spacing: 1px;
}

/* ===== 响应式 ===== */
@media (max-width: 1400px) {
    .talks-day-items {
        column-count: 2;
    }
}

@media (max-width: 900px) {
    .talks-main {
        padding: 100px 20px 60px;
    }

    .talks-main h1 {
        font-size: 28px;
        letter-spacing: 4px;
    }

    .talks-main .subtitle {
        margin-bottom: 40px;
    }

    .talks-day-items {
        column-count: 1;
    }

    .talk-item {
        padding: 16px 18px;
    }

    .talk-content {
        font-size: 15px;
    }

    .talk-images {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== 说说图片放大预览 ===== */
.talk-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    cursor: zoom-out;
}

.talk-lightbox.show {
    opacity: 1;
    visibility: visible;
}

.talk-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
    transition: transform 0.3s;
    cursor: default;
}

.talk-lightbox.show img {
    transform: scale(1);
}

/* 左/右箭头 */
.talk-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, border-color 0.3s, opacity 0.3s;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.talk-lightbox-arrow:hover {
    background: rgba(255, 204, 0, 0.3);
    border-color: #ffcc00;
    color: #ffcc00;
}

.talk-lightbox-arrow.prev {
    left: 24px;
}

.talk-lightbox-arrow.next {
    right: 24px;
}

/* 灰掉（不可点） */
.talk-lightbox-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== 手机适配 ===== */
@media (max-width: 1024px) {
    .talk-lightbox-arrow {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .talk-lightbox-arrow.prev {
        left: 12px;
    }

    .talk-lightbox-arrow.next {
        right: 12px;
    }

    .talk-item {
        transform: none !important;
    }

    .talk-item:hover {
        transform: none !important;
    }
}

