:root{
	--bg:linear-gradient(120deg,#f6f8fb,#eef4ff,#f0f7ff);
	--card:#ffffff;
	--accent:#2563eb;
	--accent-light:#3b82f6;
	--red:#dc2626;
	--red-light:#ef4444;
	--muted:#6b7280;
	--glass: rgba(255,255,255,0.6);
	--text-primary: #0f172a;
	--border: rgba(15,23,42,0.1);
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
	:root {
		--bg: linear-gradient(120deg, #0f172a, #1e293b, #334155);
		--card: rgba(30, 41, 59, 0.8);
		--accent: #3b82f6;
		--accent-light: #60a5fa;
		--red: #ef4444;
		--red-light: #f87171;
		--muted: #94a3b8;
		--glass: rgba(30, 41, 59, 0.6);
		--text-primary: #f8fafc;
		--border: rgba(148, 163, 184, 0.2);
	}
}
*{
    box-sizing:border-box;
    font-family:Inter,Segoe UI,Roboto,'Microsoft YaHei',system-ui;
}
body {
    color: var(--text-primary);
}
html, body {
    height: 100%;
    margin: 0;
    color: #0f172a;
    overflow: hidden;
}
body{
    background: var(--bg);
    background-attachment: fixed;
    height: 100vh;
    opacity: 0;
    animation: pageLoad 0.6s ease forwards;
}

@keyframes pageLoad {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.app {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
header.top{display:flex;flex-direction:column;gap:16px}

/* 品牌区域 */
.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.brand-main {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.brand-text h1{
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-text .tag{
    margin: 2px 0 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

/* 配置切换按钮 */
.config-toggle {
    background: var(--glass);
    border: 1px solid rgba(15,23,42,0.1);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.config-toggle:hover {
    background: rgba(255,255,255,0.8);
    border-color: var(--accent-light);
    transform: translateY(-1px);
}
.config-icon {
    font-size: 16px;
}

/* 配置面板 */
.cfg {
    width: 100%;
    background: var(--glass);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(15,23,42,0.1);
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.cfg-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cfg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cfg-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
}
.cfg-field input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(15,23,42,0.1);
    background: rgba(255,255,255,0.8);
    font-size: 14px;
    transition: all 0.2s ease;
}
.cfg-field input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.cfg-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}
main {
    margin-top: 18px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 重要：允许 flex 子元素收缩 */
}
.panel {
    background: var(--card);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(16,24,40,0.04);
}
.new-panel {
    flex-shrink: 0; /* 防止新建面板被压缩 */
}
.new-panel textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,0.06);
    resize: vertical;
}
/* 列表面板占满剩余空间并添加滚动 */
.list-panel {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 重要：允许内容滚动 */
    margin-bottom: 0;
}
/* 列表容器可滚动 */
.list-panel ul {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px; /* 为滚动条留出空间 */
}
/* 美化滚动条 */
.list-panel ul::-webkit-scrollbar {
    width: 6px;
}
.list-panel ul::-webkit-scrollbar-track {
    background: transparent;
}
.list-panel ul::-webkit-scrollbar-thumb {
    background-color: var(--accent-light);
    border-radius: 3px;
}
/* Firefox 滚动条 */
.list-panel ul {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-light) transparent;
}
/* 操作行布局 */
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 16px;
}
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
/* 按钮基础样式 */
button {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

/* 按钮点击涟漪效果 */
button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
button:active::before {
    width: 200px;
    height: 200px;
}

/* 带图标的按钮 */
.btn-with-icon {
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-icon {
    font-size: 16px;
}

/* 主要按钮 */
.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37,99,235,0.4);
}
.primary:active {
    transform: translateY(0);
}

/* 次要按钮 */
.secondary {
    background: rgba(248,250,252,0.8);
    color: var(--accent);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(8px);
}
.secondary:hover {
    background: rgba(241,245,249,0.9);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 轮廓红色按钮 */
.outline-red {
    background: white;
    color: var(--red);
    border: 1px solid var(--red);
}
.outline-red:hover {
    background: #fef2f2;
}

/* 操作按钮 */
.action-copy {
    background: rgba(240,249,255,0.8);
    color: var(--accent);
    border: 1px solid rgba(37,99,235,0.2);
    backdrop-filter: blur(4px);
}
.action-copy:hover {
    background: rgba(224,242,254,0.9);
    border-color: var(--accent);
    transform: scale(1.05);
}

.action-delete {
    background: rgba(254,242,242,0.8);
    color: var(--red);
    border: 1px solid rgba(220,38,38,0.2);
    backdrop-filter: blur(4px);
}
.action-delete:hover {
    background: rgba(254,226,226,0.9);
    border-color: var(--red);
    transform: scale(1.05);
}

.action-preview {
    color: var(--accent);
    background: none;
    border: none;
    padding: 2px 6px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.action-preview:hover {
    background: rgba(37,99,235,0.1);
    text-decoration: none;
}

/* 状态提示 */
.status {
    color: var(--muted);
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-height: 20px;
}
.status.success {
    color: #059669;
    background: rgba(16,185,129,0.1);
}
.status.error {
    color: var(--red);
    background: rgba(239,68,68,0.1);
}
.status.loading {
    color: var(--accent);
    background: rgba(37,99,235,0.1);
}
.status:not(:empty) {
    animation: statusFadeIn 0.3s ease;
}

@keyframes statusFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 加载旋转动画 */
.load-more-spinner {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* 搜索面板 */
.search-panel {
    flex-shrink: 0;
    margin-bottom: 12px;
}
.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}
.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: var(--muted);
    pointer-events: none;
}
.search-input-container input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,0.1);
    background: rgba(255,255,255,0.8);
    font-size: 14px;
    transition: all 0.2s ease;
}
.search-input-container input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: white;
}
.filter-controls {
    display: flex;
    gap: 8px;
}
.filter-controls select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(15,23,42,0.1);
    background: rgba(255,255,255,0.9);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter-controls select:hover {
    border-color: var(--accent-light);
    background: white;
}
.list-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
/* 展开/收起按钮 */
.toggle-expand {
    background: none;
    border: none;
    color: var(--accent);
    padding: 0;
    margin-left: 8px;
    cursor: pointer;
    font-size: 12px;
}
.toggle-expand:hover {
    text-decoration: underline;
}
/* 剪贴板条目样式 */
.clip {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: var(--glass);
    border: 1px solid rgba(15,23,42,0.08);
    transition: all 0.2s ease;
    position: relative;
    backdrop-filter: blur(8px);
}
.clip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16,24,40,0.1);
    border-color: rgba(37,99,235,0.2);
}

/* 卡片出现动画 */
.clip {
    animation: clipFadeIn 0.4s ease forwards;
}
@keyframes clipFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(15px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}
.clip .content{
    white-space:pre-wrap;
    font-size:14px;
    max-height: 160px;
    overflow-y: auto;
    /* 美化滚动条 */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-light) transparent;
}
/* Webkit 浏览器的滚动条样式 */
.clip .content::-webkit-scrollbar {
    width: 6px;
}
.clip .content::-webkit-scrollbar-track {
    background: transparent;
}
.clip .content::-webkit-scrollbar-thumb {
    background-color: var(--accent-light);
    border-radius: 3px;
}
/* 超过4行时显示省略号 */
.clip .content.collapsed {
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-line-clamp: 4;
    -moz-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    max-height: none;
}
.clip .meta{color:var(--muted);font-size:12px;margin-top:8px}
.ops{margin-top:10px}
.clip {
    position: relative;
}
/* 操作按钮样式优化 */
.ops {
    position: absolute;
    right: 16px;
    top: 16px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.clip:hover .ops {
    opacity: 1;
}
.ops button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.ops button:hover {
    transform: scale(1.05);
}
/* 列表头部 */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 12px 0;
    border-bottom: 1px solid rgba(15,23,42,0.06);
    margin-bottom: 12px;
}
.list-count {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

/* 分页器 */
.pager {
    display: flex;
    justify-content: center;
    margin-top: 16px;
    flex-shrink: 0;
}
.load-more-btn {
    padding: 12px 24px;
    border-radius: 10px;
    background: var(--glass);
    border: 1px solid rgba(15,23,42,0.1);
    color: var(--accent);
    font-weight: 500;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}
.load-more-btn:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}
.empty-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #374151;
}
.empty-hint {
    font-size: 14px;
    opacity: 0.8;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}
.modal-content {
    background: var(--glass);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    max-width: 90vw;
    width: 800px;
    margin: 20px auto;
    backdrop-filter: blur(8px);
}
.modal h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 24px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
}
.modal-close:hover {
    background: rgba(0,0,0,0.05);
    color: var(--accent);
}
.modal textarea {
    width: 100%;
    height: 70vh;
    margin: 12px 0;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,0.1);
    background: white;
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.modal textarea:focus {
    outline: none;
    border-color: var(--accent-light);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}
.modal-actions button {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}
.modal-actions button:active {
    transform: scale(0.98);
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.toast.show {
    opacity: 1;
    visibility: visible;
}
.toast-content {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 12px;
}
.toast-action {
    color: var(--accent);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.toast-close {
    color: var(--muted);
    background: none;
    border: none;
    padding: 0 4px;
    cursor: pointer;
    margin-left: 8px;
}
.toast-action:hover {
    text-decoration: underline;
}

/* 内容预览样式 */
.content-preview {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 操作按钮样式优化 */
.action-preview {
    color: var(--accent);
    background: none;
    border: none;
    padding: 0;
    margin-left: 8px;
    cursor: pointer;
    font-size: 12px;
}
.action-preview:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app {
        padding: 12px;
    }
    
    /* 品牌区域在移动端的调整 */
    .brand {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .brand-main {
        width: 100%;
        justify-content: space-between;
    }
    .config-toggle {
        align-self: flex-end;
    }
    
    /* 搜索栏在移动端变为垂直布局 */
    .search-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .filter-controls {
        justify-content: space-between;
    }
    .filter-controls select {
        flex: 1;
    }
    
    /* 配置面板在移动端的调整 */
    .cfg {
        padding: 16px;
    }
    .cfg-actions {
        flex-direction: column;
        gap: 8px;
    }
    .cfg-actions button {
        width: 100%;
    }
    
    /* 新建面板按钮组在移动端的调整 */
    .row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    .action-buttons button {
        width: 100%;
        justify-content: center;
    }
    
    /* 剪贴板条目在移动端的调整 */
    .clip {
        padding: 14px;
        padding-right: 14px;
    }
    .ops {
        position: static;
        opacity: 1;
        margin-top: 12px;
        justify-content: flex-end;
    }
    .clip .content {
        margin-right: 0;
        padding-right: 0;
    }
    
    /* 模态框在移动端的调整 */
    .modal-content {
        width: 95vw;
        padding: 20px;
        margin: 10px;
    }
    .modal textarea {
        height: 60vh;
    }
    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    .modal-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 8px;
    }
    
    .brand-text h1 {
        font-size: 20px;
    }
    
    .new-panel textarea {
        height: 100px;
    }
    
    .clip {
        padding: 12px;
    }
}