/* ---------------------------------------------------------------------------
   爱情小屋 · 管理后台样式
   设计基调：奶油白底 + 品牌玫瑰粉 #FF6B81，白色卡片 + 柔粉投影，
   与小程序端同一套配色（#FFF9FA / #FF6B81），桌面优先、窄屏可用
   --------------------------------------------------------------------------- */

:root {
    --bg: #FFF9FA;
    --bg-soft: #FFF2F5;
    --panel: #FFFFFF;
    --panel-2: #FDF3F5;
    --line: #F6E6EB;
    --text: #2B2A33;
    --text-dim: #6F6C78;
    --text-mute: #8E8691;
    --pink: #FF6B81;
    --pink-soft: rgba(255, 107, 129, 0.08);
    --pink-line: rgba(255, 107, 129, 0.26);
    --blue: #3F86D8;
    --green: #23A277;
    --amber: #C4861B;
    --red: #DE5A5A;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(224, 122, 145, 0.10);
    --shadow-card: 0 6px 20px rgba(224, 122, 145, 0.07);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: radial-gradient(1100px 520px at 12% -8%, rgba(255, 107, 129, 0.10), transparent 62%),
        radial-gradient(900px 460px at 108% 6%, rgba(255, 178, 150, 0.10), transparent 58%),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: 14px;
    color: inherit;
}

/* ------------------------------- 登录页 ------------------------------- */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 34px 30px 30px;
    box-shadow: 0 18px 44px rgba(224, 122, 145, 0.14);
}

.login-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--pink), #ff9a6b);
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 18px;
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 21px;
    letter-spacing: 0.5px;
}

.login-card .sub {
    margin: 0 0 24px;
    color: var(--text-mute);
    font-size: 13px;
}

/* ------------------------------- 布局 ------------------------------- */
.layout {
    display: grid;
    grid-template-columns: 216px 1fr;
    min-height: 100vh;
}

.sidebar {
    border-right: 1px solid var(--line);
    background: rgba(255, 251, 252, 0.86);
    backdrop-filter: blur(10px);
    padding: 22px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--pink), #ff9a6b);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    font-size: 15px;
}

.brand-text strong {
    display: block;
    font-size: 14px;
    letter-spacing: 0.4px;
}

.brand-text span {
    font-size: 11px;
    color: var(--text-mute);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.16s ease;
    user-select: none;
}

.nav-item:hover {
    background: rgba(255, 107, 129, 0.06);
    color: var(--text);
}

.nav-item.active {
    background: var(--pink-soft);
    border-color: var(--pink-line);
    color: var(--pink);
}

.nav-item .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.main {
    min-width: 0;
    padding: 22px 26px 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.topbar h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.3px;
}

.topbar .hint {
    color: var(--text-mute);
    font-size: 12px;
    margin-top: 2px;
}

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

.avatar-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #FFFFFF;
    font-size: 13px;
}

.avatar-chip .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), #ff9a6b);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
}

/* ------------------------------- 通用组件 ------------------------------- */
.card {
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-card);
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-title h3 {
    margin: 0;
    font-size: 15px;
}

.card-title .more {
    font-size: 12px;
    color: var(--text-mute);
}

.grid {
    display: grid;
    gap: 14px;
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.stat {
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.stat::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--pink-soft);
}

.stat .label {
    font-size: 12px;
    color: var(--text-mute);
    margin-bottom: 6px;
}

.stat .value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}

.stat .foot {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-mute);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #FFFFFF;
    color: var(--text);
    cursor: pointer;
    transition: all 0.16s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-soft);
    border-color: var(--pink-line);
}

.btn.primary {
    background: linear-gradient(135deg, var(--pink), #ff8b7a);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.25);
}

.btn.primary:hover {
    filter: brightness(1.05);
}

.btn.ghost {
    background: transparent;
}

.btn.danger {
    color: var(--red);
    border-color: rgba(222, 90, 90, 0.3);
    background: rgba(222, 90, 90, 0.06);
}

.btn.sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 8px;
}

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

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    background: #FFFCFD;
    border: 1px solid #F1DEE4;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease;
}

.field textarea {
    min-height: 96px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--pink-line);
    box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.10);
}

.field .tip {
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 4px;
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 表格 */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #FFFFFF;
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-mute);
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #FFFBFB;
    white-space: nowrap;
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #FFFBFB;
}

.cell-main {
    font-weight: 500;
}

.cell-sub {
    font-size: 12px;
    color: var(--text-mute);
    margin-top: 2px;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.thumb {
    width: 46px;
    height: 46px;
    border-radius: 9px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #F7EFF2;
}

.thumbs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid var(--line);
    color: var(--text-dim);
    background: #FFF6F8;
}

.badge.green {
    color: var(--green);
    border-color: rgba(35, 162, 119, 0.26);
    background: rgba(35, 162, 119, 0.08);
}

.badge.red {
    color: var(--red);
    border-color: rgba(222, 90, 90, 0.26);
    background: rgba(222, 90, 90, 0.08);
}

.badge.pink {
    color: var(--pink);
    border-color: var(--pink-line);
    background: var(--pink-soft);
}

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

.toolbar .search {
    flex: 1;
    min-width: 180px;
    max-width: 300px;
    position: relative;
}

.toolbar .search input {
    width: 100%;
    padding: 9px 12px;
    background: #FFFCFD;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
}

.toolbar select {
    padding: 9px 12px;
    background: #FFFCFD;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
}

.toolbar .spacer {
    flex: 1;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-mute);
}

/* 只有相册页用常驻分页条：一页 15 张时内容刚好一屏，
   分页条贴住视口底部，翻页不用先滚到底。
   负 margin 用来抵消 .main 的内边距，让这条横跨整个内容区 */
.pager.sticky {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 14px -26px -40px;
    padding: 10px 26px;
    background: rgba(255, 249, 250, 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
}

.empty {
    padding: 46px 10px;
    text-align: center;
    color: var(--text-mute);
    font-size: 13px;
}

/* 心情趋势柱状图 */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 150px;
    padding-top: 10px;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar .bar {
    width: 100%;
    max-width: 42px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--pink), rgba(255, 107, 129, 0.22));
    min-height: 4px;
    transition: height 0.3s ease;
    position: relative;
}

.chart-bar .bar span {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-dim);
}

.chart-bar .day {
    font-size: 11px;
    color: var(--text-mute);
    white-space: nowrap;
}

/* 列表条目 */
.list-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
    align-items: center;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item .grow {
    flex: 1;
    min-width: 0;
}

.list-item .t {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item .s {
    font-size: 11px;
    color: var(--text-mute);
}

/* 弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(70, 45, 55, 0.32);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    padding: 22px;
    z-index: 60;
}

.modal {
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    animation: pop 0.18s ease;
}

.modal.wide {
    max-width: 720px;
}

@keyframes pop {
    from {
        transform: translateY(10px) scale(0.985);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 1;
}

.modal-head h3 {
    margin: 0;
    font-size: 16px;
}

.modal-head .close {
    background: none;
    border: none;
    color: var(--text-mute);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 8px;
}

.modal-head .close:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.modal-body {
    padding: 18px 20px;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 20px;
}

/* 修改密码弹窗顶部的账号条 */
.pwd-intro {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    padding: 9px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-dim);
}

.pwd-intro strong {
    font-weight: 600;
    color: var(--text);
}

.pwd-intro span {
    color: var(--text-mute);
}

/* 图片上传区 */
.upload-box {
    border: 1px dashed var(--pink-line);
    border-radius: 12px;
    padding: 12px;
    background: #FFFCFD;
}

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

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.upload-preview .item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.upload-preview .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview .item .del {
    position: absolute;
    right: 2px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: grid;
    place-items: center;
}

/* 表情选择 */
.emoji-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.emoji-row button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #FFFFFF;
    cursor: pointer;
    font-size: 17px;
    display: grid;
    place-items: center;
}

.emoji-row button.active {
    border-color: var(--pink-line);
    background: var(--pink-soft);
}

/* 相册网格 */
/* 固定 5 列：每页 15 张正好排成 3 行，不会出现最后一行只有 1~2 张的零头 */
.media-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 900px) {
    .media-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.media-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #FFFFFF;
    box-shadow: var(--shadow-card);
}

.media-card .thumb-wrap {
    position: relative;
}

.media-card .pic {
    width: 100%;
    height: clamp(96px, calc(33vh - 136px), 148px);
    object-fit: cover;
    display: block;
    background: #F7EFF2;
    cursor: zoom-in;
}

/* 编辑/删除：平时藏起来，鼠标移到卡片上才浮出图片底部，避免和日期挤一行 */
.media-card .pic-ops {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 10px 8px;
    background: linear-gradient(to top, rgba(38, 24, 30, 0.8), rgba(38, 24, 30, 0.42) 55%, rgba(38, 24, 30, 0));
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.media-card:hover .pic-ops,
.media-card:focus-within .pic-ops {
    opacity: 1;
    pointer-events: auto;
}

/* 触屏设备没有 hover，操作按钮常驻显示 */
@media (hover: none) {
    .media-card .pic-ops {
        opacity: 1;
        pointer-events: auto;
    }
}

/* 图片上的小操作按钮：先把浏览器默认按钮外观清干净，再做成半透明胶囊 */
.link-btn {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    line-height: 1.5;
    cursor: pointer;
    white-space: nowrap;
}

.media-card .pic-ops .link-btn {
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 2px 8px;
    backdrop-filter: blur(2px);
}

.media-card .pic-ops .link-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

.media-card .pic-ops .link-btn.danger {
    color: #FFD8D8;
}

.media-card .meta {
    padding: 7px 10px 8px;
}

.media-card .meta .t {
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 分类 + 日期，独占一行，不跟按钮抢宽度 */
.media-card .meta .s {
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 2px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkbox {
    width: 16px;
    height: 16px;
    accent-color: #FF6B81;
    cursor: pointer;
}

/* 提示条 */
.toast {
    position: fixed;
    left: 50%;
    top: 22px;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(224, 122, 145, 0.18);
    font-size: 13px;
    z-index: 90;
    animation: drop 0.18s ease;
}

.toast.ok {
    border-color: rgba(35, 162, 119, 0.35);
    color: var(--green);
    background: #F4FBF8;
}

.toast.err {
    border-color: rgba(222, 90, 90, 0.35);
    color: var(--red);
    background: #FFF6F6;
}

@keyframes drop {
    from {
        opacity: 0;
        transform: translate(-50%, -8px);
    }
}

.skeleton {
    padding: 40px;
    text-align: center;
    color: var(--text-mute);
    font-size: 13px;
}

/* 响应式 */
@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        align-items: center;
        gap: 4px;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .brand {
        padding: 0 12px 0 4px;
    }

    .brand-text {
        display: none;
    }

    .nav-item {
        white-space: nowrap;
        padding: 8px 10px;
    }

    .main {
        padding: 16px;
    }

    .pager.sticky {
        margin: 12px -16px -16px;
        padding: 10px 16px;
    }

    .grid.cols-2,
    .grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .row-2 {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------------------
   情侣资料页
   左栏身份区（头像 + 在一起天数），右栏表单按主题分组，
   头像采用圆形虚线框 + 悬浮「更换」遮罩，点击即选图上传
   --------------------------------------------------------------------------- */

/* 限宽并居中：太宽输入框会拉到一千多像素，太窄右侧会空出一列 */
.couple-card {
    max-width: 1180px;
    margin: 0 auto;
}

.couple-layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 26px;
    align-items: stretch;
}

/* 左栏跟右栏等高，内容垂直居中，避免"一张小卡悬在左上角"的空缺感 */
.couple-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg, #FFF6F8, #FFFBFB);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 14px 18px;
    text-align: center;
}

.couple-avatar-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
}

.couple-avatar {
    cursor: pointer;
    text-align: center;
    min-width: 0;
}

.avatar-frame {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    background: var(--panel-2);
    border: 2px dashed var(--pink-line);
    display: grid;
    place-items: center;
    transition: border-color 0.2s, transform 0.2s;
}

.couple-avatar:hover .avatar-frame {
    border-color: var(--pink);
    transform: translateY(-2px);
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-plus {
    font-size: 26px;
    color: var(--text-mute);
    line-height: 1;
}

.avatar-mask {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.2s;
}

.couple-avatar:hover .avatar-mask {
    opacity: 1;
}

.avatar-label {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-dim);
    max-width: 90px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 中间那个心形跟头像垂直居中对齐，不是跟整列顶部对齐 */
.couple-heart {
    font-size: 20px;
    line-height: 78px;
    flex: none;
}

.couple-stat {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-top: 18px;
    color: var(--pink);
}

.couple-stat-num {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

.couple-stat-unit {
    font-size: 13px;
}

.couple-stat-label {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-mute);
    letter-spacing: 0.5px;
}

.couple-hint {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-size: 11px;
    color: var(--text-mute);
}

/* ---- 右栏表单 ---- */
/* 组与组之间留够呼吸，页面只有几行字段时不至于挤成一小块 */
.couple-form .form-section + .form-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
}

/* 日期框不需要跟输入框一样长，缩到能放下 2026/10/28 就够了；
   右侧跟一句说明，避免这一行只有左边一个窄框、右边一大片空 */
.couple-form input[type="date"] {
    max-width: 240px;
}

.date-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.date-row input[type="date"] {
    flex: 0 0 240px;
}

.date-note {
    font-size: 12px;
    color: var(--text-mute);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 11px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
}

.form-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--pink);
}

/* 每组最后一个字段去掉底部外边距，避免和分割线之间空一块 */
.couple-form .field {
    margin-bottom: 14px;
}

.couple-form .form-section > .field:last-child,
.couple-form .form-section > .row-2:last-child .field {
    margin-bottom: 0;
}

/* ---- 概览条（各页内容数量 + 快捷入口） ---- */
.couple-glance {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
}

.glance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    text-align: left;
    cursor: pointer;
    background: #FFFBFC;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: inherit;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.glance:hover {
    border-color: var(--pink-line);
    box-shadow: var(--shadow-card);
    transform: translateY(-1px);
}

.glance .g-main {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.glance .g-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.glance .g-value small {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-mute);
    margin-left: 3px;
}

.glance .g-label {
    font-size: 12px;
    color: var(--text-mute);
}

/* 右下角的小箭头，平时淡一点，悬停变粉——比写"查看"两个字更轻 */
.glance .g-go {
    font-size: 18px;
    line-height: 1;
    color: var(--pink);
    opacity: 0.35;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.glance:hover .g-go {
    opacity: 1;
    transform: translateX(2px);
}

/* ---- 底部操作条 ---- */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.form-actions-tip {
    font-size: 12px;
    color: var(--text-mute);
}

/* 资料卡下方两块内容，跟上面那张卡同宽、同边距 */
.couple-extra {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-width: 1180px;
    margin: 14px auto 0;
}

/* 心情条目的表情：看板里用的是行内样式，这里给一个类名复用 */
.couple-extra .mood-emoji {
    font-size: 19px;
    line-height: 1.2;
}

@media (max-width: 860px) {
    .couple-layout {
        grid-template-columns: 1fr;
    }

    /* 窄屏时身份区变成横向一条，不再占掉一整屏高度。
       基础样式里是 column，这里必须显式改回 row，否则 flex 项还是竖着排 */
    .couple-aside {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 20px;
        padding: 14px;
    }

    .couple-stat {
        margin-top: 0;
    }

    .couple-stat-num {
        font-size: 26px;
    }

    .couple-stat-label {
        display: none;
    }

    .couple-hint {
        display: none;
    }

    .couple-avatar-row {
        gap: 8px;
    }

    .avatar-frame {
        width: 64px;
        height: 64px;
    }

    .couple-heart {
        line-height: 64px;
    }

    /* 窄屏概览条两列，四个格子挤一行会窄到放不下数字 + 单位 */
    .couple-glance {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .couple-extra {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------------------
   操作确认 / 结果提示弹窗
   后台所有增删改的反馈都走这两个弹窗：确认弹窗负责"要不要做"，
   结果弹窗展示接口返回的 message，避免前端写死提示语。
   --------------------------------------------------------------------------- */
.modal.dialog {
    max-width: 430px;
}

.dialog-body {
    padding: 26px 24px 6px;
    text-align: center;
}

.dialog-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
}

.dialog-icon.ok {
    background: rgba(35, 162, 119, 0.1);
    border: 1px solid rgba(35, 162, 119, 0.28);
    color: var(--green);
}

.dialog-icon.err,
.dialog-icon.danger {
    background: rgba(222, 90, 90, 0.1);
    border: 1px solid rgba(222, 90, 90, 0.28);
    color: var(--red);
}

.dialog-icon.ask {
    background: var(--pink-soft);
    border: 1px solid var(--pink-line);
    color: var(--pink);
}

.dialog-title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.5;
    word-break: break-word;
}

.dialog-msg {
    margin: 0;
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-dim);
    white-space: pre-wrap;
    word-break: break-word;
}

.dialog-detail {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.dialog-line {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-mute);
}

/* 上传框里的即时压缩反馈 */
.upload-hint {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-mute);
}

.upload-hint:empty {
    display: none;
}

/* 分类编辑弹窗里的图标快捷选择：固定 8 列，16 个正好两行 */
.emoji-row {
    display: grid;
    grid-template-columns: repeat(8, 38px);
    gap: 6px;
}

.emoji-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}

.emoji-btn:hover {
    border-color: #E8769B;
    background: #FFF4F7;
    transform: translateY(-1px);
}

/* ------------------------------ 头像裁剪 ------------------------------ */
.crop-modal {
    max-width: 420px;
}

.crop-modal .modal-body {
    padding: 16px 20px 2px;
}

.crop-stage {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: #0a0810;
    border: 1px solid var(--line);
    cursor: grab;
    /* 拖动时交给 JS 处理，别让浏览器把手势当成页面滚动 */
    touch-action: none;
    user-select: none;
}

.crop-stage:active {
    cursor: grabbing;
}

.crop-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 三分线：帮助把人脸放在交叉点上，避免顶到边缘 */
.crop-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
    background-size: 33.333% 33.333%;
}

/* 圆形虚线：头像在小程序里按圆形展示（内切圆），圆外四角会被遮住，这里提前示意 */
.crop-ring {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 999px rgba(6, 5, 10, 0.42);
    pointer-events: none;
}

.crop-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}

.crop-preview {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #0a0810;
}

.crop-preview canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.crop-zoom {
    flex: 1;
    min-width: 0;
}

.crop-zoom-head {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-mute);
    margin-bottom: 2px;
}

.crop-zoom input[type="range"] {
    width: 100%;
    accent-color: var(--pink);
}

.crop-tip {
    margin: 12px 0 10px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-mute);
}

/* ---------------------------------------------------------------------------
   相册：分组标签 + 大图预览弹层
   预览用深色遮罩是图片查看器的惯例（浅色遮罩会把照片衬得发灰），
   其余界面仍是奶油白主题。
   --------------------------------------------------------------------------- */

/* 缩略图右上角的分组名，最多显示一行，超长省略 */
.series-tag {
    position: absolute;
    right: 8px;
    top: 8px;
    max-width: calc(100% - 46px);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.6;
    color: var(--pink);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--pink-line);
    backdrop-filter: blur(4px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: grid;
    place-items: center;
    background: rgba(30, 20, 25, 0.84);
    backdrop-filter: blur(6px);
    animation: fade 0.16s ease;
}

/* 舞台只负责定位；pointer-events 关掉，点空白处才能落到遮罩上触发关闭 */
.lb-stage {
    display: grid;
    place-items: center;
    pointer-events: none;
    max-width: 92vw;
    max-height: 86vh;
}

.lb-stage img,
.lb-stage video {
    pointer-events: auto;
    max-width: 92vw;
    max-height: 82vh;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.lb-btn {
    position: fixed;
    border: none;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.lb-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.lb-close {
    top: 18px;
    right: 22px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
}

.lb-prev,
.lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    font-size: 30px;
    line-height: 1;
    font-family: Georgia, serif;
}

.lb-prev:hover,
.lb-next:hover {
    transform: translateY(-50%) scale(1.06);
}

.lb-prev {
    left: 22px;
}

.lb-next {
    right: 22px;
}

/* 只有一张图时不需要左右箭头 */
.lightbox.single .lb-prev,
.lightbox.single .lb-next {
    display: none;
}

.lb-cap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 18px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 12px;
    padding: 0 24px;
    color: #fff;
    pointer-events: none;
}

.lb-title {
    font-size: 15px;
    font-weight: 600;
}

.lb-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.66);
}

@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===========================================================================
   手机端适配（≤768px）
   侧栏从「顶部横向滚动条」改成「左侧抽屉」，顶栏加汉堡按钮；
   栅格、表单一律单列，表格保留横向滑动，弹窗接近全宽。
   桌面端这些规则都不生效（汉堡与遮罩默认 display:none）。
   =========================================================================== */

/* 汉堡按钮与抽屉遮罩：桌面端不存在 */
.nav-toggle {
    display: none;
}

.nav-mask {
    display: none;
}

@media (max-width: 768px) {

    /* ---- 布局骨架 ---- */
    .layout {
        display: block;
    }

    /* 侧栏脱离文档流，靠 transform 平移进出。
       用 translateX 而不是 left，避免触发重排，滑动更顺 */
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 236px;
        height: 100%;
        z-index: 70;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
        padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        /* 抽屉内容比屏幕长时自己滚，且不带动背景 */
        -webkit-overflow-scrolling: touch;
        background: #FFFCFD;
        border-right: 1px solid var(--line);
        border-bottom: none;
        box-shadow: 0 10px 40px rgba(70, 45, 55, 0.18);
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* 抽屉有整列宽度，恢复品牌文字和正常换行 */
    .brand {
        padding: 4px 6px 14px;
    }

    .brand-text {
        display: block;
    }

    .nav-item {
        white-space: normal;
        padding: 11px 12px;
    }

    /* 遮罩：透明度 + pointer-events 切换，和抽屉动画同步 */
    .nav-mask {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(70, 45, 55, 0.34);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }

    .nav-mask.show {
        opacity: 1;
        pointer-events: auto;
    }

    /* 抽屉打开时锁住背景滚动 */
    body.drawer-open {
        overflow: hidden;
    }

    /* ---- 主区域与顶栏 ---- */
    .main {
        padding: 12px 14px calc(28px + env(safe-area-inset-bottom));
    }

    .topbar {
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
    }

    /* 三条横线用背景渐变画出来，不额外加图标资源 */
    .nav-toggle {
        display: block;
        flex: none;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 11px;
        background-color: #FFFFFF;
        background-image: linear-gradient(var(--text-dim), var(--text-dim)),
            linear-gradient(var(--text-dim), var(--text-dim)),
            linear-gradient(var(--text-dim), var(--text-dim));
        background-size: 16px 2px;
        background-repeat: no-repeat;
        background-position: center calc(50% - 6px), center 50%, center calc(50% + 6px);
        box-shadow: var(--shadow-card);
        cursor: pointer;
    }

    /* 标题区占满剩余宽度，过长省略；副标题在手机上省掉，把空间让给标题 */
    .topbar-title {
        flex: 1;
        min-width: 0;
    }

    .topbar h2 {
        font-size: 17px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar .hint {
        display: none;
    }

    .topbar-actions {
        flex: none;
        gap: 6px;
    }

    /* 账号胶囊只留圆形头像，名字省掉 */
    .avatar-chip {
        padding: 3px;
        border-radius: 50%;
    }

    .avatar-chip > span:last-child {
        display: none;
    }

    .topbar-actions .btn.sm {
        padding: 6px 9px;
        font-size: 12px;
    }

    /* ---- 卡片与栅格：全部单列 ---- */
    /* 必须用 minmax(0, 1fr) 而不是 1fr：1fr 的最小值是 min-content，
       卡片里的长标题会把列宽顶大，整页横向溢出 */
    .grid.cols-2,
    .grid.cols-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    /* 资料页下方那两块是独立的 .couple-extra 栅格，同样收成单列 */
    .couple-extra {
        grid-template-columns: minmax(0, 1fr);
    }

    /* grid 子项默认 min-width:auto，等于让内容（长标题、柱状图）决定宽度，
       这里压成 0，让卡片严格跟列宽走 */
    .grid > *,
    .couple-extra > * {
        min-width: 0;
    }

    /* 列表条目的副标题在手机上单行省略，避免长文案把卡片撑开 */
    .list-item .t,
    .list-item .s {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat {
        padding: 12px 14px;
    }

    .stat .value {
        font-size: 22px;
    }

    .card {
        padding: 14px;
        border-radius: 12px;
    }

    /* 柱状图横向压缩，日期文字缩小，7 天正好放得下 */
    .chart {
        gap: 4px;
        height: 120px;
    }

    .chart-bar .day {
        font-size: 10px;
    }

    /* ---- 表单 ---- */
    .row-2 {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* 输入框 16px：iOS Safari 聚焦时不会自动放大整页 */
    .field input,
    .field select,
    .field textarea {
        font-size: 16px;
    }

    /* ---- 弹窗：几乎全宽，按钮等分 ---- */
    .modal-mask {
        padding: 12px;
    }

    .modal {
        max-width: none;
        max-height: 92vh;
        border-radius: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-foot {
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    }

    .modal-foot .btn {
        flex: 1;
    }

    /* ---- 表格：横向滑动，单元格收窄 ---- */
    table {
        min-width: 560px;
    }

    thead th,
    tbody td {
        padding: 10px 12px;
    }

    /* 操作列固定在右侧：手机上横向滑动看前面几列时，编辑/删除不会跟着滑走。
       用 :has 挑出真正有操作按钮的表格，日志表（只有 IP 那列）不动。
       浏览器不支持 :has 时这条规则整体失效，只是不吸右，不影响可用性。
       分类表单独排除：它有 4 个操作按钮，固定住会把「分类名称」挤没 */
    table:not(.table-cats):has(tbody td .btn) thead th:last-child,
    table:not(.table-cats):has(tbody td .btn) tbody td:last-child {
        position: sticky;
        right: 0;
        z-index: 1;
        background: #FFFFFF;
        box-shadow: -10px 0 12px -10px rgba(70, 45, 55, 0.28);
    }

    table:not(.table-cats):has(tbody td .btn) thead th:last-child {
        background: #FFFBFB;
        z-index: 2;
    }

    /* 分类表：5 列在手机上放不下，藏掉两列冗余信息 ——
       「顺序」名称下方已有「排序值 N」，「照片数」在相册页按分类筛选时也能看到。
       剩下图标 + 名称 + 操作，同时放开 table 的 560px 最小宽度，
       否则多出来的空间会全被操作列吃掉，按钮被挤出屏幕 */
    .table-cats {
        min-width: 0;
    }

    .table-cats thead th:nth-child(1),
    .table-cats tbody td:nth-child(1),
    .table-cats thead th:nth-child(4),
    .table-cats tbody td:nth-child(4) {
        display: none;
    }

    .table-cats thead th:last-child {
        width: auto !important;
    }

    .table-cats tbody td:last-child .btn {
        padding: 4px 7px;
        font-size: 11px;
        margin-left: 4px;
    }

    /* ---- 相册：两列，缩略图按正方形裁 ---- */
    .media-card .pic {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    /* 分页条在手机上不吸底：吸底会盖住最后一排照片 */
    .pager.sticky {
        position: static;
        margin: 12px 0 0;
        padding: 0;
        background: none;
        backdrop-filter: none;
        border-top: none;
    }

    /* ---- 图片预览 ---- */
    .lb-stage img,
    .lb-stage video {
        max-width: 100%;
        max-height: 74vh;
    }

    .lb-prev,
    .lb-next {
        width: 36px;
        height: 36px;
    }

    .lb-prev {
        left: 8px;
    }

    .lb-next {
        right: 8px;
    }

    .lb-cap {
        bottom: calc(12px + env(safe-area-inset-bottom));
        padding: 0 16px;
    }

    .lb-title {
        font-size: 13px;
    }

    /* ---- 登录页 ---- */
    .login-wrap {
        padding: 16px;
    }

    .login-card {
        padding: 26px 20px 22px;
        border-radius: 16px;
    }

    /* ---- 情侣资料页：左栏在手机上横排，头像缩小 ---- */
    .couple-card {
        min-height: 0;
    }
}

