/* journals-preview.css - v2 (add/remove input groups) */
.j-up {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .5rem 0;
    flex-wrap: wrap
}

.j-up input[type="file"] {
    padding: .25rem .5rem;
    border: 1px solid #ccd1d7;
    border-radius: .5rem;
    background: #fff
}

.j-imgs {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap
}

.j-img {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #f8fafc;
    border: 1px dashed #d8dee6;
    border-radius: .5rem;
    padding: .4rem .6rem
}

.j-img .name {
    font-size: .9rem;
    color: #334155;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.j-img .thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: .375rem;
    border: 1px solid #e5e7eb;
    cursor: zoom-in
}

.j-img .del {
    border: 0;
    background: #ef4444;
    color: #fff;
    border-radius: .4rem;
    padding: .25rem .5rem;
    cursor: pointer
}

.j-img .del:hover {
    opacity: .9
}
/* modal */
.jpv-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.jpv-mask.on {
    display: flex
}

.jpv-modal {
    position: relative;
    max-width: min(92vw, 1080px);
    max-height: 92vh
}

.jpv-modal img {
    max-width: 100%;
    max-height: 92vh;
    border-rsadius: .5rem;
    background: #fff
}

.jpv-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #111827;
    color: #fff;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    line-height: 32px
}
/* responsive tidy */
@media (max-width: 768px){ .j-img .name{max-width:10rem} }
:root {
    --bg: #f7f7fb;
    --card: #fff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --secondary: #64748b;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Inter, "Helvetica Neue", Arial
}

.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 12px
}

h2 {
    margin: 0 0 12px 0;
    font-size: 20px
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    padding: 16px;
    margin-bottom: 18px
}

.col {
    flex: 1 1 320px
}

label {
    display: block;
    font-weight: 600;
    margin: 10px 0 6px
}

input[type=text], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff
}

textarea {
    min-height: 140px;
    resize: vertical
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed
}

.btn-primary {
    background: var(--primary);
    color: #fff
}

.btn-success {
    background: var(--success);
    color: #fff
}

.btn-secondary {
    background: var(--secondary);
    color: #fff
}

.btn-danger {
    background: var(--danger);
    color: #fff
}

.btn-light {
    background: #fff;
    border-color: var(--border);
    color: var(--text)
}

.muted {
    color: var(--muted);
    font-size: 12px
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

.upload-list {
    margin-top: 10px
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0
}

.upload-item input[type=file] {
    flex: 1
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    border: 1px solid #e0e7ff
}
/* journal list */
.j-item {
    padding: 14px;
    border-top: 1px dashed var(--border)
}

.j-title {
    font-weight: 700;
    margin-bottom: 6px
}

.j-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

@media ( max-width :600px) {
    .toolbar {
        gap: 8px
    }
    .btn {
        padding: 8px 12px
    }
}
/* container behaves like a table */
.journal-list.table-like {
    display: table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px; /* gap between rows */
}
/* row behaves like table-row */
.journal-list.table-like .journal-item {
    display: table-row;
}
/* cells */
.journal-list.table-like .journal-item>.cell-title, .journal-list.table-like .journal-item>.cell-date,
    .journal-list.table-like .journal-item>.cell-actions {
    display: table-cell;
    vertical-align: middle;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(16, 24, 40, .04), 0 1px 2px
        rgba(16, 24, 40, .06);
    padding: 18px 20px;
}

/* create a single rounded card feel using adjacent cells */
.journal-list.table-like .journal-item>.cell-title {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.journal-list.table-like .journal-item>.cell-date {
    border-radius: 0;
    min-width: 180px;
    white-space: nowrap;
}

.journal-list.table-like .journal-item>.cell-actions {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    width: 220px;
    white-space: nowrap;
}

/* title grows */
.journal-list.table-like .journal-item>.cell-title {
    width: 100%;
    font-weight: 700;
    font-size: 16px;
}

/* date look */
.journal-list.table-like .journal-item>.cell-date {
    color: #667085;
    font-size: 13px;
    text-align: left;
}

/* actions aligned right */
.journal-list.table-like .journal-item>.cell-actions {
    text-align: right;
}

.journal-list.table-like .journal-item>.cell-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #EAECF0;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}

.journal-list.table-like .journal-item>.cell-actions .btn+.btn {
    margin-left: 10px;
}

.journal-list.table-like .journal-item>.cell-actions .btn-primary {
    background: #1D4ED8;
    color: #fff;
    border-color: #1D4ED8;
}

.journal-list.table-like .journal-item>.cell-actions .btn-danger {
    background: #EF4444;
    color: #fff;
    border-color: #EF4444;
}

.journal-list.table-like .journal-item>.cell-actions .btn:hover {
    filter: brightness(0.95);
}

/* Responsive: on small screens, stack cells but keep tight alignments */
@media ( max-width : 640px) {
    .journal-list.table-like {
        display: block;
        border-spacing: 0;
    }
    .journal-list.table-like .journal-item {
        display: block;
        margin-bottom: 12px;
    }
    .journal-list.table-like .journal-item>.cell-title, .journal-list.table-like .journal-item>.cell-date,
        .journal-list.table-like .journal-item>.cell-actions {
        display: block;
        border-radius: 12px;
        box-shadow: 0 1px 0 rgba(16, 24, 40, .04), 0 1px 2px
            rgba(16, 24, 40, .06);
    }
    .journal-list.table-like .journal-item>.cell-title {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    .journal-list.table-like .journal-item>.cell-date {
        border-radius: 0;
    }
    .journal-list.table-like .journal-item>.cell-actions {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        text-align: left;
    }
}

.title-link {
    color: inherit;
    text-decoration: none;
}

.title-link:hover {
    text-decoration: underline;
}

.j-imgs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.j-img {
    display: flex;
    align-items: center;
    gap: 8px;
}

.j-img .name {
    font-size: 12px;
    color: #666;
}

.j-img .thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

.j-img .del {
    margin-left: auto;
}

/* 分页start */
.pager{
  display:flex;
  justify-content: center;
  gap:8px;
  align-items:center;
  margin:12px 0;
}
.pager .pg-btn{
  min-width:34px;
  height:34px;
  padding:0 10px;
  border:1px solid #d0d7de;
  background:#fff;
  border-radius:8px;
  cursor:pointer;
  font-size:14px;
}
.pager .pg-btn[disabled]{ opacity:.5; cursor:not-allowed; }
.pager .pg-btn.active{
  background:#1677ff; color:#fff; border-color:#1677ff;
}
@media (max-width: 600px){
  .pager{ justify-content:center; }
}
/* 分页end */

.card{background:#fff;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.06);padding:12px;margin:12px 0;}
.journal-list.table-like{display:flex;flex-direction:column;gap:10px;}
.journal-item{display:grid;grid-template-columns:1fr auto 120px;align-items:center;padding:12px;border-radius:10px;background:#fafafa;border:1px solid #eee;}
.journal-item .title-link{font-weight:600;text-decoration:none;}
.journal-item .cell-date{color:#666;font-size:14px;}
.journal-item .cell-actions{visibility:hidden;}
.pager{display:flex;gap:6px;justify-content:center;margin:12px 0;}
.pg-btn{display:inline-block;padding:6px 10px;border:1px solid #ddd;border-radius:8px;text-decoration:none}
.pg-btn[disabled]{pointer-events:none;opacity:.4}
.pg-btn.active{background:#111;color:#fff;border-color:#111}
@media (max-width:640px){
  .journal-item{grid-template-columns:1fr;row-gap:6px}
  .journal-item .cell-actions{display:none}
  .journal-item .cell-date{font-size:13px}
}
/* 缩略图排版 */
.cell-photos .thumbs{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.cell-photos img.thumb{ width:48px; height:48px; object-fit:cover; border-radius:6px; cursor:pointer; border:1px solid #eee; }
.cell-photos .more{ font-size:12px; color:#666; padding:0 4px; }

/* 预览遮罩 */
.jpv-mask{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.7); z-index:9999; padding:24px;
}
.jpv-mask img{ max-width:90vw; max-height:90vh; border-radius:8px; box-shadow:0 8px 30px rgba(0,0,0,.4); background:#fff; }
.jpv-mask .jpv-close{
  position:absolute; top:16px; right:20px; font-size:28px; color:#fff; cursor:pointer; user-select:none;
}
/* 预览导航按钮 */
.jpv-mask .jpv-nav{
  position:absolute; top:50%; transform:translateY(-50%);
  border:none; outline:none; cursor:pointer;
  width:44px; height:44px; border-radius:50%;
  background:rgba(255,255,255,.9);
  box-shadow:0 4px 16px rgba(0,0,0,.25);
  font-size:28px; line-height:44px; text-align:center;
  user-select:none;
}
.jpv-mask .jpv-nav:hover{ background:#fff; }
.jpv-mask .jpv-nav.prev{ left:16px; }
.jpv-mask .jpv-nav.next{ right:16px; }

/* 计数器 */
.jpv-mask .jpv-counter{
  position:absolute; bottom:16px; left:50%; transform:translateX(-50%);
  background:rgba(0,0,0,.55); color:#fff; padding:4px 10px;
  border-radius:16px; font-size:12px;
}