/* ==========================================================================
   随手记 · 样式表
   ========================================================================== */

:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --text: #1f2637;
    --text-soft: #4b5568;
    --muted: #8a93a6;
    --line: #e8ebf3;
    --line-strong: #d9dfeb;
    --primary: #4f6ef7;
    --primary-dark: #3d5ae0;
    --primary-soft: #eef1ff;
    --danger: #e5484d;
    --danger-soft: #fdeeee;
    --ok: #15803d;
    --ok-soft: #e9f9ef;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(23, 33, 56, .05);
    --shadow-md: 0 10px 30px rgba(23, 33, 56, .08);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -.01em;
}

p {
    margin: 0 0 10px;
}

code {
    background: #eef1f8;
    border-radius: 5px;
    padding: 1px 5px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.dot {
    color: #c8ceda;
    margin: 0 6px;
}

/* --------------------------------------------------------------------------
   顶部导航
   -------------------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, #6d86ff, #4f6ef7 55%, #3a53d6);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(79, 110, 247, .28);
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav a {
    color: var(--text-soft);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 14.5px;
    transition: background .16s, color .16s;
}

.nav a:hover {
    background: #f2f4fa;
    color: var(--text);
}

.nav a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 500;
}

/* 用户菜单 */

.user-menu {
    position: relative;
    margin-left: auto;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: linear-gradient(150deg, #ffffff, #eef1ff);
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.avatar:hover {
    border-color: var(--primary);
}

.user-drop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 196px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all .16s ease;
}

.user-menu:hover .user-drop,
.user-menu:focus-within .user-drop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-drop-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
}

.user-drop-head strong {
    font-size: 14px;
}

.user-drop-head span {
    color: var(--muted);
    font-size: 12px;
}

.user-drop a,
.user-drop button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 0;
    background: none;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-soft);
    cursor: pointer;
    font-family: inherit;
}

.user-drop a:hover,
.user-drop button:hover {
    background: #f4f6fb;
    color: var(--text);
}

.link-danger {
    color: var(--danger) !important;
}

/* --------------------------------------------------------------------------
   页面骨架
   -------------------------------------------------------------------------- */

.page {
    padding: 26px 0 48px;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
}

.narrow {
    max-width: 880px;
    margin: 0 auto;
}

.narrow-sm {
    max-width: 560px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 286px;
    gap: 22px;
    align-items: start;
}

.layout-narrow {
    grid-template-columns: minmax(0, 1fr) 280px;
}

.main-col {
    min-width: 0;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-head .muted {
    margin: 4px 0 0;
}

.site-foot {
    padding: 22px 20px 34px;
    text-align: center;
    color: #a2aabb;
    font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   卡片 / 通用块
   -------------------------------------------------------------------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.side-card {
    padding: 16px;
    margin-bottom: 16px;
}

.side-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.side-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
}

.side-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: center;
}

.side-stats strong {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

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

.side-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 9px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 14px;
}

.side-list a:hover {
    background: #f4f6fb;
}

.side-list a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 500;
}

.side-list em {
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
}

.dot-color {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: 1px;
}

.stat-list div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-soft);
    border-bottom: 1px dashed var(--line);
}

.stat-list div:last-child {
    border-bottom: 0;
}

.stat-list strong {
    color: var(--text);
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: #f2f4fa;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
    white-space: nowrap;
}

.btn:hover {
    background: #e9ecf5;
    color: var(--text);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 110, 247, .22);
}

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

.btn-ghost {
    background: #fff;
    border-color: var(--line-strong);
    color: var(--text-soft);
}

.btn-ghost:hover {
    border-color: #b9c3d6;
    background: #fafbff;
    color: var(--text);
}

.btn-danger {
    background: var(--danger-soft);
    color: #c22a2f;
    border-color: #f6d7d8;
}

.btn-danger:hover {
    background: #fbdcdd;
    color: #a71d22;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn-disabled,
.btn:disabled {
    background: #f4f5f9;
    color: #b9c0cf;
    border-color: var(--line);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-disabled:hover,
.btn:disabled:hover {
    background: #f4f5f9;
    color: #b9c0cf;
}

/* --------------------------------------------------------------------------
   表单
   -------------------------------------------------------------------------- */

.field {
    display: block;
    margin-bottom: 16px;
}

.field > span {
    display: block;
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 6px;
    font-weight: 500;
}

.field .hint {
    color: var(--muted);
    font-weight: 400;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="color"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-size: 14.5px;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color .16s, box-shadow .16s;
}

input[type="color"] {
    padding: 3px;
    height: 38px;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.8;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .14);
}

input::placeholder,
textarea::placeholder {
    color: #b3bacb;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field-row-3 {
    grid-template-columns: 1fr 96px auto;
    align-items: end;
}

.field-row-3 .field {
    margin-bottom: 0;
}

.field-row-3 .field-submit {
    padding-bottom: 1px;
}

.field-color {
    max-width: 92px;
}

.field-submit > span {
    visibility: hidden;
}

.form-card {
    padding: 22px;
    margin-bottom: 18px;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 4px;
}

.form-actions .btn {
    min-width: 108px;
}

/* 筛选区 */

.filters {
    padding: 16px 16px 6px;
    margin-bottom: 18px;
}

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

.filter-grid-2 {
    grid-template-columns: 1fr 220px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    padding-top: 2px;
}

/* --------------------------------------------------------------------------
   徽章 / 标签
   -------------------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12.5px;
    line-height: 1.7;
    white-space: nowrap;
    font-weight: 500;
}

.badge-lg {
    font-size: 14px;
    padding: 2px 12px;
}

.badge-sm {
    font-size: 11.5px;
    padding: 1px 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f2f4fa;
    color: #5b6478;
    font-size: 12.5px;
    line-height: 1.8;
    transition: background .16s, color .16s;
}

.tag:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.tag-on {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.tag-count {
    font-size: 11px;
    color: var(--muted);
}

.tag-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.tag-lg {
    color: var(--primary-dark);
}

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

.tag-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: -6px 0 16px;
}

/* 标签输入框 */

.tag-input {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    min-height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: text;
}

.tag-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .14);
}

.tag-input input[type="text"] {
    flex: 1;
    min-width: 110px;
    border: 0;
    padding: 2px 4px;
    box-shadow: none;
    background: transparent;
}

.tag-input input[type="text"]:focus {
    box-shadow: none;
}

.tag-chips {
    display: contents;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px 2px 9px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12.5px;
    line-height: 1.8;
}

.chip button {
    border: 0;
    background: none;
    color: #8f9bd8;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 4px;
    border-radius: 50%;
}

.chip button:hover {
    color: var(--primary-dark);
}

/* --------------------------------------------------------------------------
   日记列表
   -------------------------------------------------------------------------- */

.entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-card {
    padding: 16px 18px;
    transition: border-color .16s, box-shadow .16s, transform .16s;
}

.entry-card:hover {
    border-color: #cdd6ea;
    box-shadow: 0 6px 20px rgba(23, 33, 56, .06);
}

.entry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.entry-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
}

.entry-title a {
    color: var(--text);
}

.entry-title a:hover {
    color: var(--primary-dark);
}

.entry-excerpt {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.8;
    margin: 0 0 10px;
    word-break: break-word;
}

.entry-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.entry-meta {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

/* 详情 */

.entry-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.back-link {
    font-size: 14px;
    color: var(--muted);
}

.back-link:hover {
    color: var(--primary);
}

.entry-detail-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.entry-detail {
    padding: 26px 28px;
}

.entry-detail-title {
    font-size: 25px;
    line-height: 1.4;
    margin-bottom: 0;
}

.entry-detail-meta {
    margin: 10px 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.entry-content {
    font-size: 15.5px;
    line-height: 1.95;
    color: #333c4e;
    word-break: break-word;
}

.entry-detail-tags {
    justify-content: flex-start;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.related {
    margin-top: 16px;
    padding: 16px 18px;
}

.related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
}

.related-list li:last-child {
    border-bottom: 0;
}

.related-list a {
    color: var(--text);
    font-size: 14.5px;
}

.related-list a:hover {
    color: var(--primary-dark);
}

.related-list em {
    margin-left: auto;
    font-style: normal;
}

/* --------------------------------------------------------------------------
   分页 / 空状态
   -------------------------------------------------------------------------- */

.pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.pager-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text-soft);
    font-size: 14px;
}

.pager-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.empty {
    padding: 44px 24px;
    text-align: center;
    color: var(--text-soft);
}

.empty-icon {
    font-size: 34px;
    margin: 0 0 6px;
    opacity: .65;
}

.empty .btn {
    margin-top: 10px;
}

.empty-line {
    padding: 26px;
    text-align: center;
    color: var(--muted);
    margin: 0;
}

/* --------------------------------------------------------------------------
   分类管理
   -------------------------------------------------------------------------- */

.cat-head,
.cat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px 84px;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
}

.cat-head {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .04em;
    border-bottom: 1px solid var(--line);
    padding-top: 14px;
    padding-bottom: 10px;
}

.cat-row {
    border-bottom: 1px solid var(--line);
}

.cat-row:last-child {
    border-bottom: 0;
}

.cat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cat-form input[type="color"] {
    width: 38px;
    flex: 0 0 38px;
    height: 34px;
}

.cat-form input[type="text"] {
    max-width: 260px;
    padding: 6px 10px;
    font-size: 14.5px;
}

.cat-count {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.cat-actions {
    text-align: right;
}

.cat-actions form {
    display: inline;
}

/* 标签索引 */

.tag-table {
    padding: 6px 8px;
}

.tag-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 130px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
}

.tag-row:hover {
    background: #f7f9fe;
}

.tag-row-name {
    font-weight: 500;
    color: var(--primary-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-row-count {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.tag-row-time {
    text-align: right;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   提示条
   -------------------------------------------------------------------------- */

.flash {
    padding: 11px 15px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    transition: opacity .5s, transform .5s;
}

.flash-success {
    background: var(--ok-soft);
    border-color: #cdefd9;
    color: #14683a;
}

.flash-error {
    background: var(--danger-soft);
    border-color: #f9d9da;
    color: #b0282d;
}

.flash-info {
    background: var(--primary-soft);
    border-color: #dbe1ff;
    color: var(--primary-dark);
}

.flash-out {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */

body.auth {
    background:
        radial-gradient(1000px 520px at 12% -8%, #e7ecff 0%, rgba(231, 236, 255, 0) 62%),
        radial-gradient(820px 480px at 92% 8%, #e6f5ff 0%, rgba(230, 245, 255, 0) 58%),
        var(--bg);
}

body.auth .page {
    min-height: calc(100vh - 96px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

body.auth .container {
    width: 100%;
    max-width: 400px;
    margin: 0;
    padding: 0;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    padding: 32px 30px 26px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 20px;
}

.auth-brand .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 20px;
    margin-bottom: 12px;
}

.auth-brand h1 {
    font-size: 21px;
    margin-bottom: 4px;
}

.auth-brand p {
    font-size: 13px;
    margin: 0;
}

.auth-form .field {
    margin-bottom: 14px;
}

.auth-form .btn {
    margin-top: 6px;
    padding: 11px 16px;
    font-size: 15px;
}

.auth-foot {
    margin: 18px 0 0;
    text-align: center;
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   安装页
   -------------------------------------------------------------------------- */

body.install .page {
    padding: 40px 0 60px;
}

.install-wrap {
    max-width: 660px;
    margin: 0 auto;
}

.install-card {
    padding: 28px 30px;
}

.install-title {
    font-size: 21px;
    margin-bottom: 16px;
}

.install-log {
    margin: 12px 0;
    padding-left: 20px;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.9;
}

.install-account {
    background: #f7f9fe;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 14px 0;
}

.install-account p {
    margin: 0 0 4px;
    font-size: 14px;
}

.kv-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 18px;
    font-size: 14px;
}

.kv-table th,
.kv-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}

.kv-table th {
    width: 120px;
    color: var(--muted);
    font-weight: 500;
    background: #fafbfe;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

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

    .side-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        align-items: start;
    }

    .side-card {
        margin-bottom: 0;
    }
}

@media (max-width: 680px) {
    .topbar-inner {
        height: auto;
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 10px 14px;
    }

	.brand-text{
		display:none;
		/*visibility: hidden;*/
	}

    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        gap: 2px;
        padding-bottom: 2px;
    }

    .nav a {
        padding: 6px 10px;
        font-size: 14px;
        white-space: nowrap;
    }

    .page {
        padding: 18px 0 40px;
    }

    .container {
        padding: 0 14px;
    }

    .page-title {
        font-size: 21px;
    }

    .side-col {
        grid-template-columns: 1fr;
    }

    .field-row,
    .field-row-3,
    .filter-grid-2 {
        grid-template-columns: 1fr;
    }

    .field-color {
        max-width: none;
    }

    .entry-detail {
        padding: 18px 16px;
    }

    .entry-detail-title {
        font-size: 20px;
    }

    .entry-tags {
        justify-content: flex-start;
    }

    .cat-head {
        display: none;
    }

    .cat-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "form form"
            "count actions";
        gap: 6px;
        padding: 14px;
    }

    .cat-form {
        grid-area: form;
    }

    .cat-count {
        grid-area: count;
    }

    .cat-actions {
        grid-area: actions;
    }

    .cat-form input[type="text"] {
        max-width: none;
    }

    .tag-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .tag-row-time {
        display: none;
    }

    .auth-card {
        padding: 26px 20px 22px;
    }
}

/* --------------------------------------------------------------------------
   编辑器（图片上传）与正文图片
   -------------------------------------------------------------------------- */

.editor {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: hidden;
    transition: border-color .16s, box-shadow .16s;
}

.editor:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .14);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #fafbff;
    flex-wrap: wrap;
}

.editor-status {
    flex: 1;
    min-width: 180px;
    color: var(--muted);
    line-height: 1.6;
    word-break: break-all;
}

.editor-status.is-error {
    color: var(--danger);
}

.editor textarea {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 14px;
}

.editor textarea:focus {
    box-shadow: none;
}

.editor textarea.drag-over {
    background: #f2f6ff;
    outline: 2px dashed var(--primary);
    outline-offset: -6px;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview:not(:empty) {
    padding: 12px;
    border-top: 1px solid var(--line);
}

.preview-title {
    width: 100%;
}

.preview-item {
    margin: 0;
    width: 96px;
}

.preview-item img {
    display: block;
    width: 96px;
    height: 72px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.preview-item figcaption {
    margin-top: 3px;
    font-size: 11px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-image {
    margin: 14px 0;
}

.entry-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   置顶标识
   -------------------------------------------------------------------------- */

.pin-flag {
    display: inline-block;
    margin-right: 6px;
    padding: 0 6px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.7;
    color: #b45309;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    vertical-align: 1px;
}

.btn-pin-on {
    color: #b45309;
    border-color: #fed7aa;
    background: #fffbeb;
}

.btn-pin-on:hover {
    color: #92400e;
    border-color: #fcd34d;
    background: #fef3c7;
}
