/* =========================================================
   showcase.css — Gallery / Showcase / Dashboard 通用样式
   视觉关键词：无硬边框、柔和光晕、卡片化
   ========================================================= */

/* ========== 0. 布局基础 ========== */

.showcase-wrapper {
    padding-top: 25px;
    padding-bottom: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

/* 标题 */
.section-title {
    font-size: 2em;
    font-weight: 800;
    color: var(--minori-deep);
    margin-bottom: 20px;
}

/* ========== 1. Hero 区域（相册 / 展示页头部） ========== */

.hero-display {
    text-align: center;
    position: relative;
    margin-bottom: 40px;
}

.hero-stage {
    width: 100%;
    height: 550px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    background: #000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    transition: height 0.3s ease;
}

.hero-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-media.active {
    opacity: 1;
}

.hero-info {
    margin-top: 15px;
}

.hero-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
}

/* ========== 2. Album Grid（相册封面列表） ========== */

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 10px;
}

/* Album 卡片容器：有透视 + 悬浮 */
.album-card-container {
    perspective: 1000px;
    height: 300px;
    cursor: pointer;
}

.card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.album-card-container:hover .card-flipper {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 171, 118, 0.3);
}

/* 翻面状态（用于后背文案） */
.album-card-container.flipped .card-flipper {
    transform: rotateY(180deg) scale(1.05);
}

/* 正反面公共样式 */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
}

/* 正面：封面图 + 底部信息条 */
.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.album-name {
    display: block;
    font-weight: 800;
    font-size: 1.1em;
    color: var(--text-main, #333);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-count {
    font-size: 0.85em;
    color: #888;
    font-family: "Quicksand", sans-serif;
    font-weight: 600;
}

/* 背面：进入按钮 / 说明 */
.card-back {
    background: linear-gradient(135deg, #fff, #FFF0E0);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border: 4px solid #fff;
}

.card-back h4 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--minori-deep);
    text-align: center;
}

.btn-enter {
    display: inline-block;
    padding: 10px 25px;
    background: var(--minori-orange);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 171, 118, 0.4);
    transition: transform 0.2s;
}

.btn-enter:hover {
    transform: scale(1.1);
    background: var(--minori-deep);
}

/* ========== 3. Detail Grid（某一相册的缩略图瀑布流） ========== */

.back-link {
    text-decoration: none;
    color: #666;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 20px;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main, #333);
}

.item-count-badge {
    font-family: "Quicksand", sans-serif;
    font-weight: 700;
    color: var(--mmj-green);
    background: rgba(136, 221, 136, 0.1);
    padding: 5px 12px;
    border-radius: 10px;
}

/* 通用瀑布流网格（gallery / showcase_detail / user_dashboard 都会用到） */
.detail-grid,
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* 单张缩略图卡片 */
.media-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    background: #eee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-item:hover {
    transform: translateY(-4px);
    z-index: 2;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

/* 缩略图媒体 */
.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 视频角标 */
.video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

/* hover 叠加层（例如“点击查看”） */
.media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 171, 118, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: white;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.media-item:hover .media-overlay {
    opacity: 1;
}

/* ========== 4. Lightbox Modal（统一的“无边框 + 流动光晕”风格） ========== */

/*
  结构约定（由 gallery.js 生成）：
  <div class="showcase-modal">
    <div class="modal-content-wrapper">
       <img class="modal-thumb">   <-- 低清模糊背景
       <img class="modal-media">   <-- 高清主图（loaded 后淡入）
       <div class="fixed-close-btn">×</div>
    </div>
  </div>
*/

/* 整体遮罩层 */
.showcase-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.showcase-modal.active {
    display: flex;
    opacity: 1;
}

/* 内容容器：不画硬边框，只做柔和光晕，保留 FLIP 动画 */
.modal-content-wrapper {
    position: fixed; /* 方便 JS 用 top/left/width/height 做 FLIP */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;          /* 允许光晕溢出 */
    border-radius: 20px;
    background: transparent;    /* 不再用实心背景当边框 */
    transform-origin: top left;
    will-change: transform, width, height, top, left;
    transition: all 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
}

/* 光晕：使用 conic-gradient + blur 做“流动边缘” */
.modal-content-wrapper::before {
    content: "";
    position: absolute;
    inset: -26px;                /* 比图片略大一圈 */
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        rgba(255, 171, 118, 0.8),
        rgba(136, 221, 136, 0.75),
        rgba(255, 255, 255, 0.65),
        rgba(255, 171, 118, 0.8)
    );
    filter: blur(32px);
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
    
}


/* 缩略图层：模糊背景，不要描边 */
.modal-thumb {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    border-radius: 16px;
    filter: blur(12px);
    opacity: 0.8;
    z-index: 1;
    pointer-events: none;
}

/* 高清图层：完全覆盖，负责显示内容 */
.modal-media {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;        /* 保证图片完整显示，不裁切 */
    border-radius: 16px;
    background: #000;           /* 避免透明 PNG 时看到下面的模糊 */
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* 图片加载完毕后淡入 */
.modal-media.loaded {
    opacity: 1;
}

/* 注意：不再给 modal-thumb / modal-media 加 box-shadow，避免“重影边框” */

/* 关闭按钮 */
.fixed-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    font-size: 26px;
    font-weight: bold;
    line-height: 42px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
    transition: 0.3s;
    backdrop-filter: blur(6px);
}

.showcase-modal.active .fixed-close-btn {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.25s;
}

.fixed-close-btn:hover {
    background: var(--minori-orange);
    border-color: transparent;
    transform: scale(1.1) rotate(90deg);
}

/* ========== 5. 移动端适配 ========== */

@media (max-width: 768px) {
    .showcase-wrapper {
        padding-top: 70px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .hero-stage {
        height: 380px;
    }

    .album-card-container {
        height: 240px;
    }

    .section-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .collection-grid,
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 5px;
    }

    /* 手机上光晕弱一点避免太炸 */
    .modal-content-wrapper::before {
        inset: -18px;
        filter: blur(24px);
        opacity: 0.85;
    }

    .fixed-close-btn {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        line-height: 36px;
        font-size: 22px;
    }
}

/* =========================================
   4. 通用表单与上传按钮样式（Minori 风格 Patch）
   直接贴在 showcase.css 底部即可生效
   ========================================= */

/* === 4.1 通用输入框样式 === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--minori-deep); /* 深橙色标签 */
    font-size: 0.9em;
    padding-left: 5px;
}

/* 统一输入框外观：虚线边框 + 大圆角 + Quicksand 字体 */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 48px;
    padding: 0 20px;

    /* 默认状态：半透明白底 + 橙色虚线边框 */
    background: rgba(255, 255, 255, 0.85);
    border: 2px dashed var(--minori-orange);
    border-radius: 16px;

    /* 文字样式 */
    color: var(--minori-deep);
    font-family: "Quicksand", sans-serif;
    font-weight: 700;
    font-size: 0.95em;

    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    appearance: none; /* 去除系统默认外观 */
}

/* 下拉框：稍微多留一些右边距给箭头 */
.form-select {
    padding-right: 40px;
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 10px 6px;
    /* 简单的小尖角箭头 */
    background-image:
        linear-gradient(45deg, transparent 50%, #FFAB76 50%),
        linear-gradient(135deg, #FFAB76 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 14px) 50%;
    background-size: 6px 6px, 6px 6px;
}

/* 文本域：高度拉高 + 顶部内边距 */
.form-textarea {
    height: 100px;
    padding-top: 12px;
    resize: none;
}

/* 只针对这套表单控件的占位符着色，避免污染全站 */
.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 171, 118, 0.6);
    font-weight: 500;
}

/* 聚焦时：白底 + 渐变光流边框 + 外部光晕 */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    background: #ffffff;
    color: #333;

    /* 用双层背景模拟渐变边框 */
    border: 2px solid transparent;
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
    background-image:
        linear-gradient(#ffffff, #ffffff),
        linear-gradient(135deg, var(--minori-orange), var(--mmj-green), var(--minori-orange));

    background-size: 100% 100%, 200% 200%;
    animation: borderFlow 3s linear infinite;

    box-shadow: 0 10px 25px rgba(255, 171, 118, 0.18);
}

/* 边框渐变流动动画 */
@keyframes borderFlow {
    0%   { background-position: 0% 50%, 0% 50%; }
    50%  { background-position: 0% 50%, 100% 50%; }
    100% { background-position: 0% 50%, 0% 50%; }
}

/* === 4.2 自定义上传按钮（磁吸四叶草版） === */
.custom-file-group {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

/* 原生 input 隐藏，但保持可用性（配合 label for 属性） */
.custom-file-input {
    display: none;
}

/* 按钮主体：与其他输入框保持同风格 */
.custom-file-label {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 48px;
    padding: 0 20px;

    background: rgba(255, 255, 255, 0.85);
    border: 2px dashed var(--minori-orange);
    border-radius: 16px;
    color: var(--minori-orange);

    font-family: "Quicksand", sans-serif;
    font-weight: 700;
    font-size: 0.95em;

    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Hover 效果：轻微抬起 + 阴影 */
.custom-file-label:hover {
    background: rgba(255, 171, 118, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 171, 118, 0.25);
}

/* 选中文件后的状态：变为绿色实线块 */
.custom-file-label.has-file {
    background: var(--mmj-green);
    border: 2px solid var(--mmj-green);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(136, 221, 136, 0.4);
}

/* 四叶草图标：挂在 group 的右上角，允许“探出”圆角矩形 */
.custom-file-group .upload-clover-icon {
    position: absolute;
    top: -10px;
    right: -10px;

    width: 32px;
    height: 32px;

    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
    animation: rotateClover 8s linear infinite; /* rotateClover 已在全局定义，可复用 */
    pointer-events: none;
    z-index: 5;
    opacity: 0.9;
}

/* 上传按钮里的文字：单行省略 */
.upload-text {
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85%;
}
