/* ============================================================
   收藏集 · 设计系统
   参考 Raindrop.io 等成熟收藏工具的信息架构与视觉语言：
   顶栏（搜索/主题/新增）+ 左侧标签栏 + 卡片/列表双视图 + 详情抽屉
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --text-1: #1b2333;
    --text-2: #5c6575;
    --text-3: #8b93a3;
    --border: #e5e8ee;
    --border-strong: #d4d9e3;
    --accent: #4f6ef7;
    --accent-strong: #3d5bef;
    --accent-soft: #eef1ff;
    --danger: #e5484d;
    --danger-soft: #fdecec;
    --success: #22a06b;
    --success-soft: #e6f6ef;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --topbar-h: 60px;
    --sidebar-w: 230px;
    --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0f1216;
    --surface: #171b22;
    --surface-2: #1f242e;
    --text-1: #e9ecf2;
    --text-2: #a3acbd;
    --text-3: #6e7788;
    --border: #262d3a;
    --border-strong: #333c4d;
    --accent: #7c9aff;
    --accent-strong: #93aaff;
    --accent-soft: #1f2740;
    --danger: #f2666b;
    --danger-soft: #3a2224;
    --success: #4cc38a;
    --success-soft: #1d3229;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- 基础 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

::selection {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* hidden 属性必须赢过任何 display 规则（模态框/抽屉 backdrop 用它控制显隐） */
[hidden] {
    display: none !important;
}

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

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- 通用控件 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition),
        border-color var(--transition), box-shadow var(--transition),
        transform var(--transition);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-strong);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-1);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    color: var(--text-2);
}

.btn-ghost:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

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

.btn-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

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

.btn-danger:disabled {
    opacity: 0.6;
    cursor: wait;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 15px;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.text-btn {
    color: var(--accent);
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background var(--transition);
}

.text-btn:hover {
    background: var(--accent-soft);
}

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--topbar-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: var(--text-1);
}

.brand:hover {
    text-decoration: none;
}

.brand-icon {
    font-size: 20px;
}

.brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 520px;
    min-width: 0;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: 0.55;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 38px;
    padding: 0 36px 0 34px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-1);
    font-size: 14px;
    transition: border-color var(--transition), background var(--transition),
        box-shadow var(--transition);
}

.search-box input::-webkit-search-cancel-button {
    display: none;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: var(--text-3);
    font-size: 12px;
}

.search-clear:hover {
    background: var(--border);
    color: var(--text-1);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sidebar-toggle {
    display: none;
}

/* ---------- 布局 ---------- */
.layout {
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    min-height: calc(100vh - var(--topbar-h));
}

/* ---------- 侧边标签栏 ---------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    padding: 20px 12px 20px 20px;
    border-right: 1px solid var(--border);
    position: sticky;
    top: var(--topbar-h);
    align-self: flex-start;
    max-height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.sidebar::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 8px;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-3);
}

.tag-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13.5px;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}

.tag-item:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.tag-item.selected {
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 600;
}

.tag-item .tag-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-item .tag-count {
    flex-shrink: 0;
    min-width: 22px;
    text-align: center;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-3);
    font-size: 11.5px;
    line-height: 18px;
}

.tag-item.selected .tag-count {
    background: var(--accent);
    color: #fff;
}

.sidebar-backdrop {
    display: none;
}

/* ---------- 主区域 ---------- */
.main {
    flex: 1;
    min-width: 0;
    padding: 20px 24px 48px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.result-info {
    color: var(--text-3);
    font-size: 13px;
}

.view-toggle {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}

.view-btn {
    width: 30px;
    height: 28px;
    font-size: 13px;
    color: var(--text-3);
}

.view-btn.active {
    background: var(--surface);
    color: var(--text-1);
    box-shadow: var(--shadow-sm);
}

/* 激活中的筛选 chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.active-filters:empty {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12.5px;
    font-weight: 500;
}

.filter-chip button {
    color: inherit;
    opacity: 0.7;
    font-size: 11px;
    line-height: 1;
}

.filter-chip button:hover {
    opacity: 1;
}

/* ---------- 卡片网格 ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition),
        border-color var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.card:hover .card-title {
    color: var(--accent-strong);
}

.card-desc {
    font-size: 13px;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.mini-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-3);
    font-size: 11.5px;
    white-space: nowrap;
}

.card-domain {
    color: var(--text-3);
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover .card-actions,
.card:focus-within .card-actions {
    opacity: 1;
}

.card-actions .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 13px;
}

.card-actions a {
    text-decoration: none;
}

@media (hover: none) {
    .card-actions {
        opacity: 1;
    }
}

/* ---------- 列表视图 ---------- */
.row-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.row:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.row:hover .row-title {
    color: var(--accent-strong);
}

.row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.row-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.row-main {
    flex: 1;
    min-width: 0;
}

.row-title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition);
}

.row-desc {
    display: block;
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-tags {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.row-domain {
    max-width: 160px;
    color: var(--text-3);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.row-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition);
}

.row:hover .row-actions,
.row:focus-within .row-actions {
    opacity: 1;
}

.row-actions .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 13px;
}

.row-actions a {
    text-decoration: none;
}

@media (hover: none) {
    .row-actions {
        opacity: 1;
    }
}

/* ---------- 详情抽屉 ---------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(10, 14, 22, 0.45);
    opacity: 0;
    transition: opacity 220ms ease;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 61;
    width: min(460px, 100%);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

body.drawer-open .drawer-backdrop {
    opacity: 1;
}

body.drawer-open .drawer {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.drawer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}

.drawer-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drawer-title-wrap {
    flex: 1;
    min-width: 0;
}

.drawer-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
}

.drawer-domain {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--text-3);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.drawer-desc {
    color: var(--text-2);
    font-size: 13.5px;
    word-break: break-word;
}

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

.drawer-meta {
    font-size: 12px;
    color: var(--text-3);
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}

.drawer-foot {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

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

/* ---------- Markdown 渲染 ---------- */
.md {
    font-size: 13.5px;
    color: var(--text-1);
    word-break: break-word;
}

.md > *:first-child {
    margin-top: 0;
}

.md h1,
.md h2,
.md h3 {
    margin: 1.2em 0 0.5em;
    line-height: 1.4;
}

.md h1 { font-size: 1.35em; }
.md h2 { font-size: 1.2em; }
.md h3 { font-size: 1.08em; }

.md p {
    margin: 0.6em 0;
}

.md ul,
.md ol {
    margin: 0.6em 0;
    padding-left: 1.5em;
}

.md li {
    margin: 0.25em 0;
}

.md blockquote {
    margin: 0.8em 0;
    padding: 6px 14px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-2);
}

.md code {
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
    font-size: 0.92em;
}

.md pre {
    margin: 0.8em 0;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.md pre code {
    padding: 0;
    background: none;
    border: none;
    font-size: 12.5px;
    line-height: 1.6;
}

.md img {
    max-width: 100%;
    border-radius: var(--radius-md);
}

.md a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- 模态框 ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(10, 14, 22, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 16px 16px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 200ms ease;
}

.modal {
    width: 100%;
    max-width: 560px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
}

body.modal-open .modal-backdrop {
    opacity: 1;
}

body.modal-open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    font-size: 16px;
    font-weight: 700;
}

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

.form-row {
    margin-bottom: 14px;
}

.form-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}

.form-group .req {
    color: var(--danger);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-1);
    font-size: 13.5px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group textarea {
    resize: vertical;
    min-height: 38px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-hint {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 5px;
}

/* 链接自动填充的状态提示 */
.url-hint {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 5px;
}

.url-hint.success {
    color: var(--success);
}

.url-hint.error {
    color: var(--danger);
}

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

.form-status {
    display: none;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
}

.form-status.show {
    display: block;
}

.form-status.info {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.form-status.success {
    background: var(--success-soft);
    color: var(--success);
}

.form-status.error {
    background: var(--danger-soft);
    color: var(--danger);
}

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 4px;
}

.modal-foot-right {
    display: flex;
    gap: 10px;
}

/* 预览面板 */
.preview-panel {
    padding-top: 4px;
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.preview-head h3 {
    font-size: 14px;
    color: var(--text-2);
}

.preview-card {
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.preview-card .card {
    cursor: default;
    box-shadow: none;
}

.preview-card .card:hover {
    transform: none;
    border-color: var(--border);
}

/* ---------- 状态块（加载失败 / 空 / 无结果） ---------- */
.state-block {
    text-align: center;
    padding: 72px 20px;
}

.state-emoji {
    font-size: 40px;
    margin-bottom: 14px;
}

.state-block h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.state-hint {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 16px;
}

/* ---------- 骨架屏 ---------- */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}

.sk-card {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.sk-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.sk-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
}

.sk-line {
    height: 12px;
    border-radius: 6px;
    flex: 1;
}

.sk-line.short {
    flex: 0 0 40%;
}

.sk-block {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.sk-block:last-child {
    margin-bottom: 0;
}

.sk-block.w70 { width: 70%; }
.sk-block.w45 { width: 45%; }

.sk-icon,
.sk-line,
.sk-block {
    background: linear-gradient(
        90deg,
        var(--surface-2) 25%,
        var(--border) 50%,
        var(--surface-2) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 90;
    transform: translateX(-50%) translateY(8px);
    max-width: calc(100vw - 40px);
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--text-1);
    color: var(--bg);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
    word-break: break-all;
}

body.toast-open .toast {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 65;
        width: 264px;
        max-height: none;
        padding-top: 24px;
        background: var(--surface);
        transform: translateX(-100%);
        transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

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

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 64;
        background: rgba(10, 14, 22, 0.45);
        opacity: 0;
        transition: opacity 200ms ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .main {
        padding: 16px 16px 40px;
    }

    .row-desc,
    .row-tags {
        display: none;
    }
}

@media (max-width: 560px) {
    .topbar-inner {
        padding: 0 12px;
        gap: 8px;
    }

    .brand-name {
        display: none;
    }

    .btn-primary {
        padding: 0 12px;
    }

    .form-cols {
        grid-template-columns: 1fr;
    }

    .card-grid,
    .skeleton-grid {
        grid-template-columns: 1fr;
    }

    .row-domain {
        display: none;
    }

    .modal-backdrop {
        padding: 4vh 10px 10px;
    }
}
