/* 素材领取中心 - 共用样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: #f4f6f9;
    color: #2c3345;
    line-height: 1.6;
}
a { color: #3b6fe0; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== 前台 UI ===================== */
body {
    background:
        radial-gradient(800px 320px at 85% -60px, rgba(122, 92, 255, 0.14), transparent 70%),
        radial-gradient(700px 300px at 10% -80px, rgba(79, 125, 255, 0.16), transparent 70%),
        #f3f5fa;
    min-height: 100vh;
}

.m-topbar {
    background: linear-gradient(135deg, #4f7dff 0%, #7a5cff 100%);
    color: #fff;
    padding: 26px 18px 58px;
    text-align: center;
}
.m-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 1px;
}
.m-logo-ico {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 11px;
    font-size: 20px;
}
.m-tip {
    margin-top: 10px;
    font-size: 13px;
    opacity: 0.92;
}
.m-tip b { color: #ffe66d; font-weight: 700; }

.feed {
    max-width: 500px;
    margin: -40px auto 0;
    padding: 0 14px 46px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 素材卡片 */
.mat {
    background: #fff;
    border-radius: 20px;
    padding: 18px 16px 16px;
    box-shadow: 0 10px 34px rgba(76, 92, 160, 0.13);
}
.mat-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 2px;
}
.mat-tag {
    font-size: 15px;
    font-weight: 700;
    color: #1f2a44;
}
.mat-sub { font-size: 12px; color: #a3abc0; }

/* 图片九宫格（3 列正方形小图，紧凑） */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.gitem {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f2f8;
    cursor: zoom-in;
    box-shadow: 0 2px 6px rgba(76, 92, 160, 0.10);
}
.gitem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
    -webkit-touch-callout: default; /* 长按可保存 */
}
.gitem:hover img { transform: scale(1.04); }
.gdl {
    position: absolute;
    right: 5px;
    bottom: 5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    background: rgba(20, 26, 44, 0.62);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    border-radius: 999px;
    transition: background 0.2s;
}
.gdl:hover {
    background: rgba(20, 26, 44, 0.85);
    text-decoration: none;
}

/* 文案卡片 */
.copy-quote {
    position: relative;
    background: #f8f9ff;
    border: 1px solid #e4e9ff;
    border-radius: 14px;
    padding: 16px 16px 16px 20px;
    font-size: 15px;
    color: #333d55;
    white-space: pre-wrap;
    word-break: break-all;
    user-select: text;
    -webkit-user-select: text;
    margin-bottom: 14px;
    max-height: 170px;      /* 固定高度上限：长文案框内滚动，不把按钮顶下去 */
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c3cdf5 transparent;
}
.copy-quote::-webkit-scrollbar { width: 5px; }
.copy-quote::-webkit-scrollbar-thumb { background: #c3cdf5; border-radius: 999px; }
.copy-quote::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #4f7dff, #7a5cff);
}
.btn-cp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 0;
    border: none;
    border-radius: 13px;
    background: linear-gradient(135deg, #4f7dff 0%, #7a5cff 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(98, 108, 255, 0.35);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn-cp:hover { filter: brightness(1.06); }
.btn-cp:active { transform: scale(0.98); }
.btn-cp.ok {
    background: linear-gradient(135deg, #23b56b 0%, #1e9e5a 100%);
    box-shadow: 0 6px 18px rgba(35, 160, 105, 0.3);
}

/* 换一组 */
.btn-ghost {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 44px;
    background: #fff;
    color: #4f6aff;
    border: 1px solid #ccd8ff;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(76, 92, 160, 0.10);
    transition: background 0.2s, transform 0.15s;
}
.btn-ghost:hover { background: #eef2ff; text-decoration: none; }
.btn-ghost:active { transform: scale(0.97); }

/* 图片放大层 */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(12, 16, 30, 0.88);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 99;
}
.lightbox.show { display: flex; }
.lightbox img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
    -webkit-touch-callout: default;
}
.lb-cap { color: #dfe6ff; font-size: 14px; margin-top: 14px; }
.lb-tip { color: rgba(223, 230, 255, 0.55); font-size: 12px; margin-top: 6px; }

/* 空状态 */
.empty {
    background: #fff;
    border-radius: 20px;
    padding: 52px 0;
    text-align: center;
    color: #8a93a6;
    font-size: 15px;
    box-shadow: 0 10px 34px rgba(76, 92, 160, 0.10);
}
.empty-ico { font-size: 40px; margin-bottom: 10px; }

.m-footer {
    text-align: center;
    color: #b3bac9;
    font-size: 12px;
    padding-top: 4px;
}

/* ===================== 后台 ===================== */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e9f0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar h1 { font-size: 18px; color: #1f2a44; }
.topbar .sub { font-size: 13px; color: #8a93a6; }

.wrap { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

/* 后台表单 */
.panel {
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.panel h2 { font-size: 17px; margin-bottom: 16px; color: #1f2a44; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; color: #55607a; margin-bottom: 6px; }
.field input[type=text],
.field input[type=password],
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d8dfe9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input[type=file] { font-size: 14px; }
.submitbtn {
    padding: 10px 28px;
    background: #3b6fe0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.submitbtn.danger { background: #e05656; }

/* 后台：文案多框批量添加 */
.trow { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.trow textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d8dfe9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}
.trow textarea:focus { outline: none; border-color: #3b6fe0; box-shadow: 0 0 0 2px rgba(59, 111, 224, 0.12); }
.tbtns { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.tadd {
    width: 46px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #3b6fe0;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.tadd:hover { background: #2f5cc4; }
.tdel {
    width: 46px;
    height: 38px;
    border: 1px solid #f2c1c1;
    border-radius: 8px;
    background: #fff5f5;
    color: #e05656;
    font-size: 14px;
    cursor: pointer;
}
.tdel:hover { background: #fdeaea; }

/* 后台列表 */
.admlist { width: 100%; border-collapse: collapse; font-size: 14px; }
.admlist th, .admlist td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f6;
    text-align: left;
    vertical-align: middle;
}
.admlist th { color: #8a93a6; font-weight: 500; font-size: 13px; }
.admlist td img { max-height: 60px; max-width: 100px; border-radius: 6px; }
.oplink { margin-right: 10px; }
.oplink.del { color: #e05656; }

.notice {
    background: #e6f7ec;
    border: 1px solid #b5e3c8;
    color: #1e9e5a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}
.loginbox {
    max-width: 360px;
    margin: 80px auto;
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 12px;
    padding: 32px;
}
.loginbox h1 { font-size: 20px; text-align: center; margin-bottom: 24px; color: #1f2a44; }
.hint { font-size: 12px; color: #a0a8b8; margin-top: 14px; text-align: center; }
