/*
 * 记事本
 *
 * 卡片照 mtab 的 note 卡片（蓝头 + 4 行标题），窗口照 /noteApp 那一页
 * （左列表 250px + 右编辑区，data-v-128c7091）。mtab 的编辑区是 wangEditor，
 * 这里换成 contenteditable + 一排工具按钮，位置和配色跟它对齐。
 */

/* ---------- 卡片 ---------- */

.app-card--note {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* 1x1：骨架用链接图标的 .app-icon，图标满铺 */
.app-icon.note-mini {
    border: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .5),
        inset 0 -1px 1px rgba(15, 23, 42, .1),
        0 6px 14px rgba(15, 23, 42, .16),
        0 1px 3px rgba(15, 23, 42, .12);
    transition: transform .18s cubic-bezier(.2, .7, .3, 1), box-shadow .18s ease;
}

.app-icon.note-mini:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .55),
        0 12px 22px rgba(15, 23, 42, .22);
}

.app-icon.note-mini img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* 2x2：蓝头 + 4 行标题 */
/*
 * 2x2 卡片：橙色书脊 + 白纸。
 * 书脊上四个装订孔，纸上是标题和四条横线（横线位置显示最近四条笔记）。
 */
.note {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    border-radius: var(--icon-radius);
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .3),
        0 6px 14px rgba(15, 23, 42, .16),
        0 1px 3px rgba(15, 23, 42, .12);
    transition: transform .18s cubic-bezier(.2, .7, .3, 1), box-shadow .18s ease;
}

.app-card--note .note:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .34),
        0 14px 26px rgba(15, 23, 42, .22);
}

/* 书脊：橙色一条，四个浅色孔 */
.note-spine {
    flex: none;
    width: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 14px 0;
    background: linear-gradient(180deg, #F4A961 0%, #EE9A4D 100%);
}

.note-spine i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #FCE3C6;
    box-shadow: inset 0 1px 1px rgba(170, 100, 40, .2);
}

.note-sheet {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 13px 11px;
}

.note-top {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin-bottom: 4px;
}

.note-title {
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .2px;
    color: #1f2329;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 眼睛：就地切换标题打码，不打开窗口 */
.note-eye {
    margin-left: auto;
    flex: none;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: #b3bac5;
    background: transparent;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.note-eye:hover {
    color: #6b7481;
    background: rgba(17, 24, 39, .05);
}

.note-eye .note-eye-shut {
    display: none;
}

.app-card--note.is-hidden-title .note-eye .note-eye-open {
    display: none;
}

.app-card--note.is-hidden-title .note-eye .note-eye-shut {
    display: block;
}

/* 四条横线：等分剩余高度，标题压在线上 */
.note-lines {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.note-line {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(17, 24, 39, .12);
}

.note-line:first-child {
    border-top: 1px solid rgba(17, 24, 39, .12);
}

.note-row-text {
    width: 100%;
    font-size: 13.5px;
    line-height: 1.2;
    color: #1f2329;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 窗口 ---------- */

/*
 * 版式照用户给的参考图：白窗 + 顶栏（左标题 / 右红点）、
 * 左栏「搜索 + 蓝色加号 + 笔记卡片 + 清除所有内容」、右栏「标题 + 内容 + 取消/保存」。
 * 唯一多出来的是富文本工具栏（我们这边本来就有这功能，收成很淡的一行，不抢视线）。
 */

.nt-root {
    position: relative;
    width: min(1080px, 100%);
    height: min(700px, 100%);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 30px 80px rgba(8, 12, 22, .34);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #1a1a1a;
    /* 浮层里别继承壁纸模式的白字 */
    --nt-text: #1a1a1a;
    --nt-sub: #8b93a1;
    --nt-line: #e8eaed;
    --nt-fill: #f4f5f7;
    --nt-blue: #3080fc;
    /*
     * 窗口里的按钮用 2x2 卡片那条橙色书脊（#F4A961 → #EE9A4D），
     * 蓝按钮跟橙书脊不是一套，看着像两个应用拼起来的。
     */
    --nt-accent: linear-gradient(180deg, #F4A961 0%, #EE9A4D 100%);
    --nt-accent-flat: #EE9A4D;
    --nt-accent-deep: #E2833A;
    --nt-accent-tint: #FFF8F1;
}

/* 顶栏：标题 + 红点关闭 */
.nt-top {
    flex: none;
    height: 58px;
    display: flex;
    align-items: center;
    /* 左右分开写：只收右边，标题离左边的距离照旧 */
    padding: 0 16px 0 22px;
    /* 配色保持原来这套（白纸 + 蓝按钮），顶栏只做一条极淡的分隔 */
    background: linear-gradient(180deg, #fdfdfd 0%, #ffffff 100%);
    border-bottom: 1px solid var(--nt-line);
}

.nt-top-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
    color: #1a1a1a;
}

/* 窗口按钮：Windows 风（34x30 圆角 6、透明底、hover 变红），不再是 mac 小红点 */
.nt-close {
    margin-left: auto;
    --cs-x-focus: #e81123;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: #4b4b4b;
    background: transparent;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.nt-close:hover {
    background: #e81123;
    color: #ffffff;
}

.noteApp {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 0;
    position: relative;
}

/* ---------- 左栏 ---------- */

.noteApp-left {
    flex: none;
    width: 268px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* 上 12：跟顶栏拉开一点，不然搜索框直接贴着顶栏（截图里就是这个问题） */
    padding: 14px 0 14px;
    border-right: 1px solid var(--nt-line);
}

.noteApp-left-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px 12px;
}

.noteApp-input-box {
    flex: 1;
    min-width: 0;
}

.noteApp-input {
    width: 100%;
    height: 38px;
    padding: 0 13px;
    border: 0;
    border-radius: 8px;
    background: var(--nt-fill);
    font-size: 13.5px;
    font-family: inherit;
    color: #1a1a1a;
    outline: none;
    transition: box-shadow .15s ease, background .15s ease;
}

.noteApp-input::placeholder {
    color: #a3aab6;
}

.noteApp-input:focus {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--nt-accent-flat);
}

.createMessage {
    flex: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--nt-accent);
    color: #fff;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
}

.createMessage:hover {
    filter: brightness(.96);
    transform: translateY(-1px);
}

.noteApp-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
}

.noteApp-list::-webkit-scrollbar {
    width: 6px;
}

.noteApp-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .12);
    border-radius: 3px;
}

/* 列表项：参考图那种「白卡 + 细边」，选中是蓝边 */
.noteApp-item {
    position: relative;
    flex: none;
    padding: 11px 12px 10px;
    border: 1px solid var(--nt-line);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.noteApp-item:hover {
    border-color: #cfd5df;
}

.noteApp-listSelect,
.noteApp-item.is-on {
    border-color: var(--nt-accent-flat);
    background: var(--nt-accent-tint);
}

.noteApp-title {
    padding-right: 26px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.noteApp-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    min-height: 14px;
}

.noteApp-time {
    font-size: 12.5px;
    line-height: 1;
    color: var(--nt-sub);
}

/* 删除按钮：默认藏着，hover / 选中时露出来（参考图是常显的红色小图标） */
.delNote {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: transparent;
    color: #fc5f57;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, background .15s ease;
}

.noteApp-item:hover .delNote,
.noteApp-listSelect .delNote {
    opacity: 1;
}

.delNote:hover {
    background: rgba(252, 95, 87, .12);
}

/* 小圆点：笔记的颜色标记 */
.note-weight {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c8ced9;
}

.note-weight.weight-1 { background: #fc5f57; }
.note-weight.weight-2 { background: #ff9f43; }
.note-weight.weight-3 { background: #ffd43b; }
.note-weight.weight-4 { background: #46c37b; }
.note-weight.weight-5 { background: #3080fc; }
.note-weight.weight-6 { background: #9b6bff; }

/* 左栏底部：清除所有内容 + 提示 */
.nt-left-foot {
    flex: none;
    padding: 12px 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.nt-clear {
    width: 100%;
    height: 36px;
    border: 1px solid rgba(252, 95, 87, .55);
    border-radius: 7px;
    background: #fff;
    color: #e8453c;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.nt-clear:hover {
    background: #fff2f1;
    border-color: #e8453c;
}

.nt-clear:disabled {
    opacity: .45;
    cursor: default;
}

.nt-foot-hint {
    font-size: 12px;
    line-height: 1;
    color: #a3aab6;
}

/* ---------- 右栏 ---------- */

.noteApp-context {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px 22px 16px;
}

#noteAppTitle {
    flex: none;
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--nt-fill);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: #1a1a1a;
    outline: none;
    transition: background .15s ease, box-shadow .15s ease;
}

#noteAppTitle::placeholder {
    font-weight: 500;
    color: #a3aab6;
}

#noteAppTitle:focus {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--nt-accent-flat);
}

/* 工具栏：收成一排很淡的小按钮 */
.nt-toolbar {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 8px 0 9px;
}

.nt-toolbar button {
    height: 26px;
    min-width: 26px;
    padding: 0 7px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font-size: 12px;
    font-family: inherit;
    color: #6b7481;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.nt-toolbar button:hover {
    background: var(--nt-fill);
    color: #1a1a1a;
}

.nt-tb-sep {
    width: 1px;
    height: 13px;
    margin: 0 4px;
    background: var(--nt-line);
}

/* 编辑区：浅灰底，撑满剩余高 */
.nt-editor {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px;
    border-radius: 10px;
    background: var(--nt-fill);
    font-size: 14.5px;
    line-height: 1.7;
    color: #1f2329;
    outline: none;
    word-break: break-word;
}

.nt-editor:focus {
    background: #fbfcfd;
    box-shadow: inset 0 0 0 1px #dfe3e9;
}

.nt-editor:empty::before {
    content: attr(data-ph);
    color: #a3aab6;
    pointer-events: none;
}

/* 底部：颜色点 + 字数 + 取消/保存 */
.noteApp-edit-footer {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
}

.nt-weights {
    display: flex;
    gap: 6px;
}

.nt-weights button {
    width: 15px;
    height: 15px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #dfe3e9;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}

.nt-weights button:hover {
    transform: scale(1.12);
}

.nt-weights button.is-on {
    box-shadow: 0 0 0 1.6px #9aa2b1;
}

.nt-weights button[data-weight="0"] { background: #dfe3e9; }
.nt-weights button[data-weight="1"] { background: #fc5f57; }
.nt-weights button[data-weight="2"] { background: #ff9f43; }
.nt-weights button[data-weight="3"] { background: #ffd43b; }
.nt-weights button[data-weight="4"] { background: #46c37b; }
.nt-weights button[data-weight="5"] { background: #3080fc; }
.nt-weights button[data-weight="6"] { background: #9b6bff; }

.nt-count {
    font-size: 12px;
    color: var(--nt-sub);
}

.nt-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.nt-cancel,
.nt-save {
    height: 34px;
    padding: 0 20px;
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.nt-cancel {
    border: 1px solid var(--nt-line);
    background: #fff;
    color: #4b5563;
}

.nt-cancel:hover {
    border-color: #c9cfd8;
    background: #fafbfc;
}

.nt-save {
    border: 1px solid var(--nt-accent-flat);
    background: var(--nt-accent);
    color: #fff;
    font-weight: 600;
}

.nt-save:hover {
    filter: brightness(.96);
}

.nt-save:disabled {
    opacity: .6;
    cursor: default;
}

/* ---------- 空状态 ---------- */

.content-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    z-index: 2;
}

.content-empty[hidden] {
    display: none;
}

.nt-empty-title {
    margin: 8px 0 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.nt-empty-desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: #8b93a1;
    text-align: center;
}

.nt-empty-btn {
    margin-top: 14px;
    height: 36px;
    padding: 0 22px;
    border: 0;
    border-radius: 7px;
    background: var(--nt-accent);
    color: #fff;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
}

.nt-empty-btn:hover {
    filter: brightness(.96);
}

@media (max-width: 860px) {
    .noteApp-left {
        width: 220px;
    }

    .nt-toolbar {
        display: none;
    }
}


/* 返回按钮默认不出现，只有手机单栏模式才用 */
.nt-back {
    display: none;
}

/*
 * 手机端：左右两栏改成「列表 ↔ 编辑」切换。
 * 268px 的左栏在 390 屏上要占七成，右栏只剩一百多像素 ——
 * 标题被截、底部「保存」只露出半个字。
 */
@media (max-width: 720px) {
    .noteApp {
        position: relative;
    }

    .noteApp-left {
        width: 100%;
        border-right: 0;
    }

    .noteApp-context {
        display: none;
    }

    .noteApp.is-editing .noteApp-left {
        display: none;
    }

    .noteApp.is-editing .noteApp-context {
        display: flex;
        width: 100%;
        padding: 12px 14px 14px;
    }

    .nt-back {
        position: absolute;
        top: 12px;
        left: 14px;
        z-index: 3;
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 9px;
        background: #f2f2f7;
        color: #1d1d1f;
        cursor: pointer;
    }

    /* 给返回箭头让出位置 */
    #noteAppTitle {
        padding-left: 46px;
    }
}
