/* ===================================================
   全局重置 & 基础
=================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 — 护眼青蓝，低饱和度，长时间使用不疲劳 */
    --primary: #3a7bd5;
    --primary-dark: #2c6abf;
    --primary-light: #e8f1fb;
    --gradient-main: linear-gradient(135deg, #3a7bd5 0%, #2e86ab 100%);
    --gradient-green: linear-gradient(135deg, #2ecc88, #26a570);
    --gradient-pink: linear-gradient(135deg, #5b9cf6, #3a7bd5);
    --gradient-orange: linear-gradient(135deg, #f0a500, #e08c00);

    /* 中性色 — 背景略暖，减少视觉疲劳 */
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --border: #dde3ed;
    --border-light: #eaecf3;

    /* 文字 — 不用纯黑，软化对比 */
    --text-primary: #1e2535;
    --text-secondary: #4e5a6e;
    --text-muted: #8e99b0;

    /* 功能色 */
    --success: #2ecc88;
    --danger: #e05353;
    --warning: #e6a817;
    --info: #3a7bd5;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);
    --shadow-primary: 0 8px 25px rgba(58, 123, 213, 0.28);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB',
                 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
}

a { text-decoration: none; color: inherit; }

/* 全局字体清晰度增强 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    -webkit-font-smoothing: subpixel-antialiased;
}

p, span, li, td, th, label, input, button, textarea, select {
    -webkit-font-smoothing: subpixel-antialiased;
}

/* ===================================================
   布局
=================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* ===================================================
   导航栏
=================================================== */
.top-nav-wrapper {
    background: var(--gradient-main);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 12px rgba(58, 123, 213, 0.18);
}

.top-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 100px;
}

.nav-right {
    justify-content: flex-end;
}

.nav-title {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.5px;
    text-align: center;
    flex: 1;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.nav-back:hover { background: rgba(255,255,255,0.15); }

.nav-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 17px;
    transition: background 0.2s;
    cursor: pointer;
}
.nav-icon-btn:hover { background: rgba(255,255,255,0.2); }

.nav-username {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 导航头像 */
.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.55);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s, transform 0.2s;
}
.nav-avatar:hover { border-color: white; transform: scale(1.08); }
.nav-avatar-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: 2px solid rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}
.nav-avatar-placeholder:hover { background: rgba(255,255,255,0.35); transform: scale(1.08); }

.nav-logout-btn {
    padding: 5px 14px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius-full);
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.1);
}
.nav-logout-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.7);
}

/* 兼容旧导航类 */
.top-nav .nav-home,
.top-nav .nav-logout,
.top-nav .nav-admin,
.top-nav .nav-sort {
    color: white;
    font-size: 14px;
}

/* ===================================================
   公告
=================================================== */
.announcement {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #92400e;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}
.announcement-icon { font-size: 17px; flex-shrink: 0; }

/* ===================================================
   区块标题
=================================================== */
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--gradient-main);
    border-radius: 2px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.section-header-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--gradient-main);
    border-radius: 2px;
    display: inline-block;
}
.section-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-btn {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.section-btn:hover {
    background: var(--primary);
    color: white;
}

/* 查看更多按钮 */
.more-btn {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border);
}
.more-btn a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.2s;
}
.more-btn a:hover {
    background: var(--primary);
    color: white;
}

/* 双栏布局（1:1 等宽，两栏完全对称） */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}
@media (max-width: 900px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}
.two-col-item {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

/* 提示词预览卡片（首页用） */
.prompt-preview-card {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.prompt-preview-card:last-child { margin-bottom: 0; }
.prompt-preview-card:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(58,123,213,0.1);
}
.prompt-preview-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
    flex-shrink: 0;
}
.prompt-preview-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prompt-preview-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.prompt-preview-content {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    flex: 1;
}
.prompt-preview-footer {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}
.btn-copy-preview {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 5px 13px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-copy-preview:hover {
    background: var(--primary);
    color: white;
}
.btn-copy-preview.copied {
    background: var(--success);
    color: white;
}
.prompt-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ===================================================
   快捷入口
=================================================== */
.quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.quick-link-item {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 18px 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.25s ease;
    cursor: pointer;
}
.quick-link-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.quick-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

.quick-link-item span:last-child {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

/* ===================================================
   工具分类卡片
=================================================== */
.tools-section { margin-bottom: 20px; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 1000px) {
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .tools-grid { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: repeat(3, 1fr); }
}

.tool-category-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s;
}
.tool-category-card:hover { box-shadow: var(--shadow-md); }

.tool-category-header {
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-light);
}

.tool-cat-icon { font-size: 18px; }
.tool-cat-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }

.tool-category-body { padding: 10px; }

.tool-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: background 0.2s;
}
.tool-link-item:last-child { margin-bottom: 0; }
.tool-link-item:hover { background: var(--primary-light); }

.tool-link-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.tool-link-btn {
    background: var(--gradient-main);
    color: white;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.no-tools {
    text-align: center;
    color: var(--text-muted);
    padding: 16px 10px;
    font-size: 13px;
}

/* ===================================================
   教程/资料列表
=================================================== */
.tutorial-list {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.tutorial-row {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-light);
    color: inherit;
    transition: background 0.15s;
    gap: 12px;
}
.tutorial-row:last-child { border-bottom: none; }
.tutorial-row:hover { background: var(--surface-2); }

/* 首页双栏内的资料行 — 改为卡片风格，与提示词卡片等高 */
.two-col-item .tutorial-list {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.two-col-item .tutorial-row {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 14px 16px;
    min-height: 66px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.two-col-item .tutorial-row:last-child { border-bottom: 1px solid var(--border-light); }
.two-col-item .tutorial-row:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(58,123,213,0.1);
}

/* 首页资料卡片 — 与提示词卡片完全对称的新样式 */
.tut-preview-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    border: 1px solid var(--border-light);
    color: inherit;
    text-decoration: none;
    transition: all 0.2s;
}
.tut-preview-card:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(58,123,213,0.1);
}
.tut-preview-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    flex-shrink: 0;
}
.tut-preview-icon {
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}
.tut-preview-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tut-preview-content {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    flex: 1;
    word-break: break-all;
}
.tut-preview-footer {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}
.tut-preview-arrow {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

.tutorial-row-icon {
    width: 30px;
    height: 30px;
    background: var(--gradient-pink);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    flex-shrink: 0;
}

.tutorial-row-content { flex: 1; min-width: 0; }
.tutorial-row-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tutorial-row-arrow { color: var(--text-muted); font-size: 18px; }

/* 教程卡片（tutorials页面） */
.tutorial-card {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    cursor: pointer;
}
.tutorial-card:last-child { margin-bottom: 0; }
.tutorial-card:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateX(4px);
}

.tutorial-card-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-main);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    margin-right: 14px;
    flex-shrink: 0;
}
.tutorial-card-content { flex: 1; min-width: 0; }
.tutorial-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.tutorial-card-meta { font-size: 12px; color: var(--text-muted); }
.tutorial-badge-link { background: #dbeafe; color: #1d4ed8; padding: 2px 8px; border-radius: 4px; margin-right: 4px; font-size: 11px; }
.tutorial-badge-doc  { background: #fce7f3; color: #be185d; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.tutorial-card-arrow { font-size: 20px; color: var(--text-muted); margin-left: 8px; }

/* ===================================================
   提示词卡片
=================================================== */
.prompt-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s;
}
.prompt-card:hover { box-shadow: var(--shadow-md); }

.prompt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.prompt-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}
.prompt-card-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}
.prompt-card-content {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    max-height: 90px;
    overflow: hidden;
    margin-bottom: 12px;
    white-space: pre-wrap;
    line-height: 1.7;
    border: 1px solid var(--border-light);
}
.prompt-card-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.prompt-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.prompt-card-actions button {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-weight: 500;
}
.btn-copy {
    background: var(--gradient-green);
    color: white;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-weight: 500;
}
.btn-copy:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-edit-prompt { background: #f1f5f9; color: var(--text-secondary); }
.btn-edit-prompt:hover { background: #e2e8f0; }
.btn-delete-prompt { background: #fee2e2; color: #dc2626; }
.btn-delete-prompt:hover { background: #fecaca; }

/* ===================================================
   工具卡片（tools.php）
=================================================== */
.tool-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}
.tool-card:last-child { margin-bottom: 0; }
.tool-card:hover {
    background: var(--primary-light);
    border-color: rgba(58,123,213,0.22);
}

.tool-card-info { display: flex; align-items: center; flex: 1; min-width: 0; }
.tool-card-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-green);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 17px;
    margin-right: 12px;
    flex-shrink: 0;
}
.tool-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tool-card-owner { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tool-card-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

.tool-visit-btn {
    padding: 5px 13px;
    background: var(--gradient-green);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    transition: opacity 0.2s;
}
.tool-visit-btn:hover { opacity: 0.85; }

.btn-edit-tool {
    padding: 5px 10px;
    background: #fef3c7;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: #92400e;
    transition: background 0.2s;
}
.btn-edit-tool:hover { background: #fde68a; }

.btn-delete-tool {
    padding: 5px 10px;
    background: #fee2e2;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: #dc2626;
    transition: background 0.2s;
}
.btn-delete-tool:hover { background: #fecaca; }

/* ===================================================
   首页显示开关
=================================================== */
.home-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 21px;
}
.home-switch input { opacity: 0; width: 0; height: 0; }
.home-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: var(--radius-full);
    transition: 0.3s;
}
.home-slider::before {
    position: absolute;
    content: '';
    height: 15px;
    width: 15px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.home-switch input:checked + .home-slider { background: var(--success); }
.home-switch input:checked + .home-slider::before { transform: translateX(17px); }

/* ===================================================
   搜索框
=================================================== */
.search-bar {
    position: relative;
    margin-bottom: 16px;
}
.search-bar input {
    width: 100%;
    padding: 11px 16px 11px 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 14px;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58,123,213,0.12);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

/* ===================================================
   页面头部（页面内标题 + 操作按钮）
=================================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}
.page-header h3 {
    margin: 0;
    font-size: 17px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================================================
   按钮
=================================================== */
.btn-add {
    padding: 9px 20px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s, transform 0.2s;
}
.btn-add:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-add-big {
    padding: 10px 22px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-add-big:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: var(--shadow-primary); }

.btn-submit {
    flex: 1;
    padding: 12px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-submit:hover { opacity: 0.9; }

.btn-cancel {
    padding: 12px 20px;
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-cancel:hover { background: var(--border); }

.btn-add-prompt {
    padding: 10px 22px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-add-prompt:hover { opacity: 0.9; transform: translateY(-2px); }

/* ===================================================
   弹窗
=================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 40, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}
.modal.active { display: flex; }

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-close {
    width: 28px;
    height: 28px;
    background: var(--surface-2);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ===================================================
   表单
=================================================== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58,123,213,0.1);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { min-height: 120px; resize: vertical; }

.sort-input { width: 90px !important; text-align: center; }

/* ===================================================
   分类排序
=================================================== */
.category-sort-item {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    user-select: none;
}
.category-sort-item:hover { background: var(--primary-light); border-color: var(--primary); }
.drag-handle { color: var(--text-muted); margin-right: 10px; font-size: 16px; }
.cat-icon { margin-right: 10px; font-size: 18px; }

.sort-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,18,40,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.sort-modal.active { display: flex; }
.sort-modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 26px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}
.sort-btns { display: flex; gap: 10px; margin-top: 18px; }
.btn-save-sort {
    flex: 1; padding: 11px;
    background: var(--gradient-main); color: white;
    border: none; border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-cancel-sort {
    padding: 11px 18px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-md); font-size: 14px; cursor: pointer;
    color: var(--text-secondary);
}

/* ===================================================
   后台管理
=================================================== */
.admin-container { max-width: 1000px; margin: 0 auto; padding: 16px; }

.admin-header {
    background: var(--gradient-main);
    color: white;
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-header h1 { font-size: 19px; }

.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.data-table th {
    background: var(--surface-2);
    font-weight: 700;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.data-table td { font-size: 14px; color: var(--text-primary); }
.data-table tr:hover td { background: var(--surface-2); }

.btn-edit, .btn-delete {
    padding: 5px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 5px;
    transition: opacity 0.2s;
}
.btn-edit  { background: #dbeafe; color: #1d4ed8; }
.btn-edit:hover  { background: #bfdbfe; }
.btn-delete { background: #fee2e2; color: #dc2626; }
.btn-delete:hover { background: #fecaca; }

/* ===================================================
   空状态
=================================================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 14px; display: block; }

/* ===================================================
   分类标签（提示词页）
=================================================== */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--surface);
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}
.tab-item {
    padding: 7px 16px;
    background: var(--surface-2);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}
.tab-item.active {
    background: var(--gradient-main);
    color: white;
}
.tab-item:hover:not(.active) { background: var(--border); }

/* ===================================================
   提示词列表（旧版兼容）
=================================================== */
.prompt-list {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

/* 首页双栏内的提示词列表 — 与资料列表对齐 */
.two-col-item .prompt-list {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.two-col-item .prompt-list .prompt-preview-card {
    margin-bottom: 0;
}
.prompt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
    gap: 12px;
}
.prompt-item:last-child { border-bottom: none; }
.prompt-item:hover { background: var(--surface-2); }
.prompt-item-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.prompt-item-badge {
    background: var(--gradient-main);
    color: white;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 11px;
    white-space: nowrap;
}
.prompt-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prompt-item-owner { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.prompt-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===================================================
   登录页
=================================================== */
.login-page {
    min-height: 100vh;
    background: var(--gradient-main);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}
.login-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.login-container { width: 100%; max-width: 400px; position: relative; z-index: 1; }

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo-icon {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.18);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin: 0 auto 14px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
}
.login-logo h1 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.login-logo p {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    margin-top: 5px;
}

.login-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px 30px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}

.login-box .form-group input {
    padding: 13px 16px;
    font-size: 15px;
}
.login-box .form-group input:focus { border-color: var(--primary); }

.login-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}
.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.remember-me input { width: auto; }
.remember-me label { font-size: 13px; color: var(--text-secondary); cursor: pointer; }

.login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #fecaca;
}

/* ===================================================
   首页欢迎（home）
=================================================== */
.home-container {
    min-height: 100vh;
    background: var(--gradient-main);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.home-content { text-align: center; color: white; }
.home-logo {
    width: 90px; height: 90px;
    background: rgba(255,255,255,0.18);
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
    font-size: 40px;
    backdrop-filter: blur(10px);
}
.home-title { font-size: 44px; font-weight: 800; margin-bottom: 8px; }
.home-subtitle { font-size: 16px; opacity: 0.85; margin-bottom: 36px; }
.home-btn {
    display: inline-block;
    padding: 14px 46px;
    background: white;
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    transition: all 0.3s;
}
.home-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(0,0,0,0.25); }

/* ===================================================
   底部
=================================================== */
.footer {
    text-align: center;
    padding: 24px 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===================================================
   响应式
=================================================== */
@media (max-width: 640px) {
    .home-title { font-size: 32px; }
    .quick-links { grid-template-columns: repeat(3, 1fr); gap: 9px; }
    .quick-link-item { padding: 14px 6px 12px; }
    .quick-icon { width: 44px; height: 44px; font-size: 20px; }
    .quick-link-item span:last-child { font-size: 12px; }

    .category-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .tab-item { white-space: nowrap; }

    .prompt-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .prompt-item-actions { width: 100%; justify-content: flex-end; }
    .prompt-card-actions { justify-content: flex-start; }

    .tool-card { flex-wrap: wrap; gap: 10px; }
    .tool-card-actions { flex-wrap: wrap; }

    .modal-content { padding: 20px 18px; }
    .container { padding: 12px; }
    .page-header { padding: 14px 16px; }
}

@media (max-width: 400px) {
    .quick-links { gap: 7px; }
    .quick-link-item span:last-child { display: none; }
    .quick-icon { width: 48px; height: 48px; }
}

/* ===================================================
   图片管理 — 上传区域
=================================================== */
.img-upload-area {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

/* 上传区标题行 */
.img-upload-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.img-upload-header-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.img-upload-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.img-upload-header-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.img-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface-2);
}
.img-upload-zone:hover,
.img-upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}
.img-upload-icon { font-size: 40px; margin-bottom: 10px; }
.img-upload-tip { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.img-upload-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.btn-choose-file {
    padding: 10px 26px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-choose-file:hover { opacity: 0.88; }

/* 上传队列 */
.upload-queue {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}
.upload-queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    width: calc(50% - 6px);
    min-width: 240px;
}
@media (max-width: 600px) {
    .upload-queue-item { width: 100%; }
}
.upload-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.upload-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.upload-title-input {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.upload-title-input:focus { border-color: var(--primary); }
.upload-size { font-size: 11px; color: var(--text-muted); }
.upload-remove-btn {
    width: 26px;
    height: 26px;
    background: #fee2e2;
    border: none;
    border-radius: 50%;
    color: #dc2626;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    line-height: 1;
}
.upload-remove-btn:hover { background: #fecaca; }

/* ===================================================
   图片管理 — 图片网格
=================================================== */
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.img-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.img-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.img-card-thumb {
    position: relative;
    overflow: hidden;
    height: 160px;
    cursor: pointer;
    background: var(--surface-2);
}
.img-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.img-card:hover .img-card-thumb img { transform: scale(1.04); }

.img-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.img-card:hover .img-card-overlay { opacity: 1; }
.img-card-view {
    color: white;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
}

.img-card-info {
    padding: 10px 12px 6px;
    flex: 1;
}
.img-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.img-card-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.img-card-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px 10px;
    border-top: 1px solid var(--border-light);
}
.btn-img-copy {
    flex: 1;
    padding: 6px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-img-copy:hover { background: var(--gradient-main); color: white; }
.btn-img-copy.copied { background: var(--gradient-green); color: white; }

.btn-img-edit,
.btn-img-delete {
    padding: 6px 9px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.btn-img-edit  { background: #fef3c7; color: #92400e; }
.btn-img-edit:hover  { background: #fde68a; }
.btn-img-delete { background: #fee2e2; color: #dc2626; }
.btn-img-delete:hover { background: #fecaca; }
.btn-img-download {
    padding: 6px 9px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    background: #dbeafe;
    color: #1d4ed8;
}
.btn-img-download:hover { background: #bfdbfe; }

/* ===================================================
   灯箱
=================================================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    cursor: pointer;
}
.lightbox.active { display: flex; }

.lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lightbox-inner img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-lg);
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
.lightbox-caption {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    max-width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lightbox-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.lightbox-btn-download {
    padding: 8px 22px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: var(--radius-full);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.lightbox-btn-download:hover { background: rgba(255,255,255,0.28); }

/* ===================================================
   首页图片预览区
=================================================== */
.home-img-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 4px 0;
}
@media (max-width: 900px) {
    .home-img-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 540px) {
    .home-img-grid { grid-template-columns: repeat(3, 1fr); }
}

.home-img-item {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-light);
    transition: all 0.2s;
    background: var(--surface-2);
    position: relative;
}
.home-img-item:hover {
    border-color: var(--primary);
    transform: scale(1.04);
    box-shadow: var(--shadow-md);
}
.home-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* 图片名称：悬停时底部浮现 */
.home-img-name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
    color: white;
    font-size: 10px;
    font-weight: 500;
    padding: 12px 5px 4px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}
.home-img-item:hover .home-img-name { opacity: 1; }

.home-img-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    background: var(--gradient-main);
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
    border: 2px solid transparent;
}
.home-img-more:hover { opacity: 0.88; }

/* form-input (用于弹窗中独立的 input，不在 form-group 内) */
.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58,123,213,0.1);
}

/* ===================================================
   个人资料弹窗
=================================================== */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.profile-avatar-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    border: 3px solid var(--primary-light);
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}
.profile-avatar-wrap:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(58,123,213,0.15);
}
.profile-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-avatar-ph {
    width: 100%;
    height: 100%;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: white;
    user-select: none;
}
.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }

.profile-avatar-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

/* ===================================================
   全局 Toast 提示
=================================================== */
.global-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30,37,53,0.92);
    color: white;
    padding: 11px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.global-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.global-toast.toast-error {
    background: rgba(220,38,38,0.92);
}

