* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", "PingFang SC", system-ui;
}

body {
    background-color: #fff9ef;
    padding: 20px;
    color: #443b32;
}
.hidden {
    display: none !important;
}

/* 弹窗遮罩 */
.modal-wrap {
    position: fixed;
    inset:0;
    background-color: rgba(0,0,0,0.35);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:999;
}
.modal {
    background-color: #fffdf8;
    padding:28px;
    border-radius:18px;
    box-shadow: 0 8px 24px #00000022;
    border:1px solid #f3e9da;
    min-width:420px;
}
/* 登录卡 / 确认卡同为 400px 窄卡 */
.login-card,
.confirm-card {
    width:400px;
}
.edit-card {
    width:480px;
}

/* 主容器 */
.container {
    max-width:1200px;
    margin:0 auto;
    padding-bottom:80px; /* 底部留白：列表模式分页条固定在页面最下面，避免遮挡内容 */
}

/* 顶部公共区域（标题/按钮/属性筛选/搜索）：卡片、列表模式下均固定不随内容滚动 */
.top-fixed{
    position:sticky;
    top:0;
    z-index:400;
    background:#fff9ef;
    padding:6px 0 14px;
}
.top-fixed .search-bar{
    margin-bottom:0;
}
.page-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:24px;
}
.page-header h1{
    font-size:26px;
    color:#6b4f3b;
}
.header-right{
    display:flex;
    gap:12px;
}

.btn{
    padding:9px 18px;
    border:none;
    border-radius:12px;
    cursor:pointer;
    font-size:15px;
    transition: 0.2s;
}
.primary{
    background-color:#e6b88c;
    color:#3d2c1e;
}
.add-btn{
    background:#9fc8b4;
    color:#1f382e;
}
/* ===== 个人中心（悬停下拉，替代原"退出"按钮） ===== */
.user-center{
    position:relative;
}
.uc-btn{
    background:#e9d8cc;
    width:40px;
    height:40px;
    padding:0;
    border-radius:50%;  /* 个人中心按钮：圆形 */
    font-size:17px;
    line-height:1;
}
.uc-dropdown{
    position:absolute;
    top:calc(100% + 6px);
    right:0;
    min-width:132px;
    background:#fffdf8;
    border:1px solid #f2e8d9;
    border-radius:12px;
    box-shadow:0 8px 20px rgba(139,104,74,0.15);
    padding:6px;
    opacity:0;
    visibility:hidden;
    transform:translateY(-6px);
    transition:0.2s;
    z-index:900;
}
/* 悬停或 JS 加 open 时展开 */
.user-center:hover .uc-dropdown,
.user-center.open .uc-dropdown{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
}
.uc-item{
    padding:9px 14px;
    border-radius:8px;
    cursor:pointer;
    font-size:14px;
    white-space:nowrap;
}
.uc-item:hover{
    background:#fbf3e4;
}
.uc-item.logout-item{
    color:#b04a3a;
}
.uc-item.uc-version{
    color:#887766;
    cursor:default;
}
.cancel{
    background:#e8e2db;
}
.danger{
    background:#e79c8c;
    color:#4b241b;
}
.btn:hover{
    opacity:0.85;
}

.search-bar{
    margin-bottom:22px;
}
.search-bar input{
    width:100%;
    padding:12px 16px;
    border-radius:14px;
    border:1px solid #e2d5c4;
    background:#fffdf8;
    font-size:15px;
}
/* 搜索框收窄（按账号/名称检索，无需占满整行） */
.search-box{
    position:relative;
    width:260px;
}
.search-box input{
    padding-right:34px;   /* 右侧留出一键清除按钮位置 */
}
/* 输入框内“×”一键清除按钮（搜索框/属性框共用）：有输入时显示，点击清空并恢复全量 */
.search-clear,
.attr-clear{
    position:absolute;
    right:8px;
    top:50%;
    transform:translateY(-50%);
    width:18px;
    height:18px;
    line-height:16px;
    text-align:center;
    border-radius:50%;
    background:#e8e2db;
    color:#5c5044;
    font-size:13px;
    cursor:pointer;
    user-select:none;
    z-index:5;
}
.search-clear{
    right:10px;   /* 搜索框略宽，按钮靠右 10px */
}
.search-clear:hover,
.attr-clear:hover{
    background:#e79c8c;
    color:#fff;
}

/* 手账卡片列表 */
.card-container{
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(340px,1fr));
    gap:18px;
    margin-bottom:24px;
}
/* 空态 / 加载态提示（占满整个网格宽度） */
.empty-tip{
    grid-column:1 / -1;
    padding:48px 0;
    text-align:center;
    color:#9c8b78;
    font-size:14px;
}
.item-card{
    background:#fffdf8;
    border-radius:16px;
    padding:20px;
    border:1px solid #f2e8d9;
    box-shadow:0 4px 12px rgba(139,104,74,0.08);
}
.item-card .tag{
    display:inline-block;
    padding:3px 10px;
    border-radius:20px;
    font-size:12px;
}
.tag.personal{
    background:#ffe9d4;
}
.tag.work{
    background:#d8e9f7;
}
.tag.other{
    background:#e8e2ec;
}
.item-card h4{
    font-size:18px;
    text-align:center;   /* 名称与属性标签同行：标签之后居中展示 */
    margin:8px 0 12px;
}
.item-card p{
    font-size:14px;
    line-height:1.65;
    margin:4px 0;
    color:#5c5044;
}
.card-actions{
    margin-top:14px;
    display:flex;
    gap:10px;
}
.card-actions button{
    padding:5px 12px;
    border-radius:8px;
    border:none;
    cursor:pointer;
    font-size:13px;
}

/* 表单 */
.form-item{
    margin-bottom:14px;
}
.form-item label{
    display:block;
    margin-bottom:5px;
    font-weight:500;
}
.form-item input,.form-item select{
    width:100%;
    padding:10px 12px;
    border-radius:10px;
    border:1px solid #e2d5c4;
    background:#fff;
}
.btn-group{
    display:flex;
    gap:12px;
    justify-content:flex-end;
    margin-top:20px;
}

/* 分页（列表模式）：固定在页面最下面；卡片模式下整条隐藏，改为下滑加载 */
.pagination{
    position:fixed;
    left:50%;
    bottom:16px;
    transform:translateX(-50%);
    display:flex;
    gap:14px;
    align-items:center;
    background:#fffdf8;
    border:1px solid #f2e8d9;
    border-radius:14px;
    box-shadow:0 6px 18px rgba(139,104,74,0.18);
    padding:10px 18px;
    z-index:500;
}
.pagination button{
    padding:7px 14px;
    border-radius:10px;
    border:1px solid #ddcebc;
    background:#fff;
    cursor:pointer;
}

.tip{
    margin-top:12px;
    font-size:13px;
    color:#887766;
}

/* ========== 功能扩展样式 ========== */
/* 编辑弹窗：密码查看图标 */
.pwd-wrap{
    position:relative;
}
.pwd-wrap input{
    padding-right:38px;
}
/* 密码眼睛按钮（iconfont 方案，全局统一：登录页/编辑弹窗/删除弹窗一致）：
   密文=icon-yanjing_yincang 闭眼（点击查看）；明文=icon-yanjing_xianshi 睁眼（点击隐藏） */
.eye-btn{
    position:absolute;
    right:10px;
    top:50%;
    transform:translateY(-50%);
    width:20px;
    height:20px;
    cursor:pointer;
    user-select:none;
    opacity:0.7;
    transition:opacity 0.2s;
}
.eye-btn:hover{
    opacity:1;
}

/* 复制模式 */
.copy-icon{
    cursor:pointer;
    margin-left:6px;
    user-select:none;
}
.item-card.copying{
    border-color:#e6b88c;
    box-shadow:0 0 0 2px rgba(230,184,140,0.45);
}
.copy-btn{
    background:#f7e6c9;
    color:#5c4321;
}

/* 视图切换按钮 */
.view-btn{
    background:#d8e9f7;
    color:#1f382e;
}

/* ===== 弹窗风格全局统一 ===== */
/* 弹窗标题/正文：登录、新增编辑、删除、退出所有弹窗共用同一套字色与间距 */
.modal h3{
    font-size:20px;
    color:#6b4f3b;
    margin-bottom:14px;
}
.modal p{
    font-size:14px;
    color:#5c5044;
    line-height:1.7;
}
/* 确认类弹窗（删除/退出）：按钮组统一居中 */
.confirm-card .btn-group{
    justify-content:center;
    margin-top:22px;
}
/* 退出弹窗沿用 .confirm-card 宽度，内容（标题/正文/按钮）居中 */
.logout-card{
    text-align:center;
}

/* 删除弹窗：居中与遮罩沿用 .modal-wrap，仅提高层级（避免被其他弹窗覆盖） */
#delModal.modal-wrap{
    z-index:1200;
}

/* 列表（表格）视图 */
.table-box{
    grid-column:1 / -1;
    width:100%;
    background:#fffdf8;
    border:1px solid #f2e8d9;
    border-radius:14px;
    overflow:auto;
    box-shadow:0 4px 12px rgba(139,104,74,0.08);
}
.table-box table{
    width:100%;
    border-collapse:collapse;
    font-size:14px;
}
.table-box th,.table-box td{
    padding:10px 12px;
    border-bottom:1px solid #f2e8d9;
    text-align:left;
    white-space:nowrap;
}
.table-box th{
    background:#fbf3e4;
    color:#6b4f3b;
    font-weight:600;
}
.table-box tr:last-child td{
    border-bottom:none;
}
.table-box tr:hover td{
    background:#fdf8ee;
}
.table-box .card-actions{
    margin-top:0;
}

/* 分页：每页条数选择 */
.pagination select{
    padding:7px 10px;
    border-radius:10px;
    border:1px solid #ddcebc;
    background:#fff;
    cursor:pointer;
    margin-left:10px;
}

/* ========== 本轮扩展样式 ========== */
/* 卡片头部：序号 + 名称在左、属性标签在最右，三者同一水平线且底端对齐 */
.card-head{
    display:flex;
    align-items:flex-end;
    gap:8px;
    margin-bottom:10px;
}
.card-head h4{
    flex:1;
    margin:0;
    line-height:1.2;
}
/* 卡片序号：圆圈背景色数字，位于名称前面、与名称/属性标签同行底端对齐 */
.seq-badge{
    min-width:24px;
    height:24px;
    padding:0 5px;
    border-radius:50%;
    background:#e6b88c;
    color:#3d2c1e;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:13px;
    font-weight:600;
    flex-shrink:0;
}

/* 属性筛选下拉（可搜索/可新增） */
.attr-filter{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;      /* 一行放不下时自动换行（属性/管理/搜索/新增） */
    row-gap:10px;
    margin-bottom:14px;
}
.attr-select{
    position:relative;
    width:200px;   /* 缩短属性搜索框 */
}
.attr-select input{
    width:100%;
    padding:9px 28px 9px 12px;  /* 右侧留出清除按钮位置 */
    border-radius:10px;
    border:1px solid #e2d5c4;
    background:#fffdf8;
    font-size:14px;
}
.attr-dropdown{
    position:absolute;
    top:calc(100% + 4px);
    left:0;
    width:100%;
    max-height:220px;
    overflow:auto;
    background:#fffdf8;
    border:1px solid #e2d5c4;
    border-radius:10px;
    box-shadow:0 8px 20px rgba(139,104,74,0.15);
    z-index:600;
}
.attr-option{
    padding:9px 12px;
    cursor:pointer;
    font-size:14px;
}
.attr-option:hover{
    background:#fbf3e4;
}
.attr-option.active{
    background:#f7e6c9;
    color:#5c4321;
}
.attr-option.add-new{
    background:#eef7f1;   /* 搜索无结果时的"是否新增"提示条 */
    color:#1f382e;
    font-weight:500;
}
.attr-option.add-new:hover{
    background:#d9ede2;
}
.attr-empty{
    padding:9px 12px;
    font-size:13px;
    color:#887766;
}

/* 管理属性按钮：属性搜索框后面，打开属性管理弹窗 */
.attr-manage-btn{
    padding:9px 14px;
    border:none;
    border-radius:10px;
    background:#9fc8b4;
    color:#1f382e;
    cursor:pointer;
    font-size:14px;
    white-space:nowrap;
    transition:0.2s;
}
.attr-manage-btn:hover{
    opacity:0.85;
}

/* 属性管理弹窗（与全局弹窗风格一致；position:relative 作为右上角×定位基准） */
.attr-manage-card{
    width:480px;
    position:relative;
}
.manage-tip{
    margin-bottom:12px;
}
.attr-manage-list{
    border:1px solid #f2e8d9;
    border-radius:12px;
    background:#fffdf8;
    overflow:hidden;
}
.attr-manage-scroll{
    max-height:200px;
    overflow:auto;
}
.attr-manage-item{
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    font-size:14px;
    cursor:pointer;
    border-bottom:1px dashed #f2e8d9;
}
.attr-manage-item:hover{
    background:#fbf3e4;
}
.attr-manage-item:last-child{
    border-bottom:none;
}
.attr-manage-item.master-row{
    background:#fbf3e4;
    font-weight:600;
    border-bottom:1px solid #f2e8d9;
}
.attr-manage-item input[type="checkbox"]{
    accent-color:#e6b88c;
    width:15px;
    height:15px;
    cursor:pointer;
    flex-shrink:0;
}
.attr-manage-item input[type="checkbox"]:disabled{
    cursor:not-allowed;
}
/* 属性管理：右侧展示接口返回的 value（value=内置 → 系统内置属性，不可修改/删除） */
.attr-value{
    margin-left:auto;
    font-size:11px;
    padding:1px 6px;
    border-radius:8px;
    background:#eee7dc;
    color:#887766;
    flex-shrink:0;
    white-space:nowrap;
}
/* 弹窗右上角"×"关闭按钮（全局通用，属性管理弹窗使用） */
.modal-close-x{
    position:absolute;
    top:10px;
    right:16px;
    font-size:26px;
    line-height:1;
    color:#a89a88;
    cursor:pointer;
    user-select:none;
    transition:0.2s;
}
.modal-close-x:hover{
    color:#5d4f42;
}
/* 确认类弹窗：内容全部居中（如"新增属性"确认弹窗） */
.center-card{
    text-align:center;
}
/* 属性管理弹窗底部操作行：删除与新增并列 */
.attr-manage-foot{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-top:14px;
}
/* 新增区域：点"新增"后出现 输入框+确认按钮 */
.attr-add-area{
    display:flex;
    gap:8px;
    align-items:center;
    flex:1;
    min-width:0;
}
.attr-add-area input{
    flex:1;
    min-width:0;
    padding:9px 12px;
    border-radius:10px;
    border:1px solid #e2d5c4;
    background:#fff;
}
.attr-add-area .btn{
    white-space:nowrap;
}

/* 属性管理弹窗底部操作组：更新 / 删除所选 并排 */
.attr-manage-actions{
    display:flex;
    gap:8px;
    align-items:center;
    flex-shrink:0;
}
/* 按钮禁用态全局统一：未选择属性时"更新/删除所选"置灰且不可点击 */
.btn:disabled{
    opacity:0.5;
    cursor:not-allowed;
}
.btn:disabled:hover{
    opacity:0.5;
}
/* 修改属性 / 个人中心弹窗：同为 420px 窄卡，position:relative 作为右上角“×”定位基准 */
.attr-edit-card,
.profile-card{
    width:420px;
    position:relative;
}
.attr-edit-card .manage-tip{
    margin-bottom:14px;
}
.attr-edit-card .manage-tip b{
    color:#6b4f3b;
    word-break:break-all;
}

/* 网址链接 */
.site-link{
    color:#7a5c3e;
    word-break:break-all;
}
.site-link:hover{
    color:#e6b88c;
}

/* 个人中心资料弹窗（用户名/账号/昵称/电话/邮箱/注册时间） */
.profile-list{
    margin-top:4px;
}
.profile-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:10px 4px;
    border-bottom:1px dashed #f2e8d9;
    font-size:14px;
    color:#443b32;
}
.profile-row:last-child{
    border-bottom:none;
}
.profile-label{
    color:#887766;
}
/* 电话/邮箱行：右侧显示当前值 + “修改”按钮 */
.profile-value{
    flex:1;
    text-align:right;
    margin-right:10px;
    word-break:break-all;
}
/* 行内小按钮（修改 / 获取验证码） */
.btn-mini{
    padding:4px 10px;
    border:none;
    border-radius:8px;
    background:#eee7dc;
    color:#6b5a48;
    font-size:13px;
    cursor:pointer;
    white-space:nowrap;
    transition:0.2s;
}
.btn-mini:hover{
    background:#e6b88c;
    color:#3d2c1e;
}
.btn-mini:disabled{
    opacity:0.55;
    cursor:not-allowed;
}
/* 电话/邮箱编辑区（点“修改”后展开在原行下方） */
.bind-form{
    padding:10px 4px 12px 4px;
    border-bottom:1px dashed #f2e8d9;
    background:#fffdf8;
    border-radius:10px;
}
.bind-line{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:8px;
}
.bind-line input{
    flex:1;
    min-width:0;
    padding:8px 10px;
    border-radius:10px;
    border:1px solid #e2d5c4;
    background:#fff;
    font-size:14px;
}
.bind-line .code-input{
    letter-spacing:2px;
}
.bind-ops{
    display:flex;
    justify-content:flex-end;
    gap:8px;
}
.bind-ops .btn{
    padding:6px 14px;
    font-size:14px;
}

/* ========== 登录方式 / 验证方式「二选一」标签（登录页与修改密码弹窗共用） ========== */
.login-tabs{
    display:flex;
    gap:8px;
    margin-bottom:16px;
}
.login-tab{
    flex:1;
    padding:9px 0;
    border:1px solid #e2d5c4;
    border-radius:12px;
    background:#fffdf8;
    color:#887766;
    font-size:14px;
    cursor:pointer;
    transition:0.2s;
}
.login-tab:hover{
    background:#fbf3e4;
}
.login-tab.active{
    background:#e6b88c;
    border-color:#e6b88c;
    color:#3d2c1e;
    font-weight:600;
}
/* 修改密码弹窗：作为右上角“×”的定位基准（宽度沿用 .modal / .confirm-card） */
.pwd-card{
    position:relative;
}

/* ========== 问候语（GET /servers/user/hello）与公告弹窗（GET /servers/user/announcements） ========== */
/* 标题右侧问候语：后端返回“早上好，小账本”这类整句 */
.header-hello{
    margin-left:10px;
    font-size:14px;
    font-weight:400;
    color:#8a7554;
}
.header-hello.error{
    color:#b0453a;
}
/* ========== 公告（登录后 GET /servers/user/notice）与公告弹窗 ========== */
/* 公告轮播条：通用轮播风格（无边框、无底色，不做成一个“方框”）：
   “公告”胶囊标签 + 中间无缝横向轮播 + 两端渐隐 + 右侧关闭；装得下时居中静态展示 */
.notice-bar{
    display:flex;
    align-items:center;
    gap:8px;
    max-width:420px;
    min-width:0;
    padding:0;
    border:0;
    background:none;
    font-size:12px;
    line-height:18px;
    color:#8a7554;
    cursor:pointer;
}
.notice-bar.hidden{
    display:none;
}
.notice-bar:hover{
    color:#6b4f3b;
}
/* 左侧标签：市面常见的“公告”胶囊徽标（只有标签本身有底色，整条不构成方框） */
.notice-tag{
    flex:none;
    padding:0 7px;
    border-radius:999px;
    background:linear-gradient(135deg,#ffe2bc,#f6c78c);
    color:#8a5a20;
    font-size:11px;
    font-weight:600;
    letter-spacing:.5px;
}
/* 轮播视口：两端渐隐（进出屏的文字自然淡出），只在这里裁剪 */
.notice-viewport{
    flex:1;
    min-width:0;
    overflow:hidden;
    white-space:nowrap;
    text-align:center;
    -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 16px,#000 calc(100% - 16px),transparent 100%);
    mask-image:linear-gradient(90deg,transparent 0,#000 16px,#000 calc(100% - 16px),transparent 100%);
}
/* 轮播轨道：两份相同文本首尾相接（inline-flex 便于“静态居中”与“按自身宽度平移”） */
.notice-marquee{
    display:inline-flex;
    flex:none;
    will-change:transform;
}
.notice-copy{
    flex:none;
}
/* 需要滚动时（JS 判定文本装不下）才补上第二遍文本与接缝间距，并启动动画 */
.notice-viewport.is-scrolling .notice-copy{
    padding-right:48px;
}
.notice-viewport.is-scrolling .notice-marquee{
    animation:notice-scroll 20s linear infinite;   /* 时长由 JS 按文本宽度折算（约 42px/秒） */
}
/* hover 暂停：方便看清这条公告 */
.notice-bar:hover .notice-marquee{
    animation-play-state:paused;
}
@keyframes notice-scroll{
    from{ transform:translateX(0); }
    to{ transform:translateX(-50%); }   /* 平移“一份文本 + 接缝”的距离，循环处无缝衔接 */
}
/* 关闭按钮：用户可关闭这条公告（关闭后同一条不再自动出现） */
.notice-close{
    flex:none;
    padding:0 2px;
    font-size:14px;
    line-height:1;
    color:#b09b86;
    cursor:pointer;
}
.notice-close:hover{
    color:#b0453a;
}
/* 公告弹窗：比常规确认弹窗宽，内容超长时内部滚动 */
.ann-card{
    position:relative;
    width:560px;
    min-width:560px;
    max-height:86vh;
    overflow-y:auto;
}
.ann-card h3{
    margin-bottom:12px;
    color:#6b4f3b;
}
.ann-empty,
.ann-loading{
    padding:20px 0;
    text-align:center;
    font-size:13px;
    color:#a99580;
}
.ann-detail h4{
    margin:0 0 10px;
    font-size:17px;
    color:#5d4534;
}
.ann-detail .ann-content{
    font-size:14px;
    line-height:1.8;
    color:#6b5744;
    white-space:pre-wrap;
    word-break:break-word;
}
/* 降低动效偏好：只做静态展示（不滚动） */
@media (prefers-reduced-motion: reduce){
    .notice-viewport.is-scrolling .notice-marquee{
        animation:none;
    }
}
/* 公告弹窗按钮组居中（通用 .btn-group 为右对齐） */
.ann-card .btn-group{
    justify-content:center;
}
@media (max-width:620px){
    .ann-card{
        width:92vw;
        min-width:0;
    }
    /* 窄屏：公告条可伸缩，避免把标题/按钮挤出行 */
    .notice-bar{
        max-width:none;
        flex:1 1 140px;
        font-size:11px;
    }
}

/* ===== 联系我们弹窗（个人中心下拉 → “退出”上方）：居中展示 images/ 目录里的二维码图片 ===== */
.contact-card{
    position:relative;   /* 右上角“×”的定位基准 */
    width:400px;
    text-align:center;
}
.contact-card .manage-tip{
    margin-bottom:14px;
}
/* 图片区：虚线框提示“这里放二维码”，图片按 220×220 等比缩放（png/jpg/svg 通用） */
.qr-box{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:12px;
    border:1px dashed #e6d3b8;
    border-radius:14px;
    background:#fffaf2;
}
.qr-img{
    width:220px;
    height:220px;
    object-fit:contain;
    border-radius:10px;
    background:#fff;
}
/* 目录内没有任何图片时的提示（仅在候选图片全部探测失败时出现） */
.qr-tip{
    margin-top:12px;
    font-size:13px;
    color:#b0453a;
    word-break:break-all;
}
.contact-card .btn-group{
    justify-content:center;   /* 通用 .btn-group 为右对齐 */
    margin-top:20px;
}
@media (max-width:620px){
    .contact-card{
        width:92vw;
        min-width:0;          /* 覆盖 .modal 的 min-width:420px，窄屏不溢出 */
    }
    .qr-img{
        width:180px;
        height:180px;
    }
}

