/* Prompt 工具箱 · Apple 风格组件层（加载顺序：base → components → modes） */
/* Lucide 统一尺寸规则：随父级字号缩放 */
.lucide { width: 1em; height: 1em; stroke-width: 2; flex-shrink: 0; }

.action-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 7px 14px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}
.action-btn .lucide { width: 15px; height: 15px; }
.action-btn:hover {
    background: var(--hover);
    border-color: var(--border);
}
.action-btn:active {
    background: var(--hover-strong);
}
.action-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.action-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.action-btn.primary:active {
    background: var(--accent-active);
}

.theme-btn {
    display: flex;
    width: 34px; height: 34px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--fg);
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.theme-btn .lucide { width: 15px; height: 15px; }
.theme-btn:hover { background: var(--hover); }

.more-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 34px; height: 34px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--fg);
    transition: background 0.15s;
    flex-shrink: 0;
}
.more-btn .lucide { width: 17px; height: 17px; }
.more-btn:hover { background: var(--hover); }
.more-btn:active { background: var(--hover-strong); }

.more-dropdown {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + 38px + 4px);
    right: 16px;
    background: var(--float-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 170px;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    flex-direction: column;
    gap: 2px;
}
.more-dropdown.open { display: flex; }
.more-dropdown .more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--fg);
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.1s;
    white-space: nowrap;
}
.more-dropdown .more-item .lucide { width: 15px; height: 15px; color: var(--muted); }
.more-dropdown .more-item:hover { background: var(--hover); }
.more-dropdown .more-item:active { background: var(--hover-strong); }
.more-dropdown .more-item.primary { color: var(--accent); }

/* 媒体查询：位置与原文件一致（在 .card 之前），保持层叠语义不变 */
@media (max-width: 620px) {
    .grid { grid-template-columns: 1fr; }
    .search-box input { max-width: 140px; }
    .header-inner { padding: 0 16px; }
    .main { padding: 0 16px; }
    .filter-bar { padding: 4px 8px; margin-top: 10px; }
    .logo-text p { display: none; }
    .controls .action-btn:not(.more-btn) { display: none; }
    .more-btn { display: flex; }
    .controls .action-btn span { display: none; }
}
@media (max-width: 480px) {
    .shortcut-hint { display: none; }
    .search-box input { max-width: 120px; font-size: 12px; padding: 7px 32px 7px 28px; }
    .search-box > .lucide { left: 9px; }
    .controls { gap: 4px; }
    .action-btn { padding: 7px 8px; font-size: 12px; }
    .section-title { font-size: 15px; }
    .card { padding: 18px; }
    .overlay { padding: 12px; }
    .modal-body { padding: 16px; }
    .modal-header { padding: 16px 16px 0; }
    .modal-footer { padding: 12px 16px 16px; }
}
@media (max-width: 380px) {
    .search-box input { max-width: 90px; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}
.card-header h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h3 .lucide {
    color: var(--accent);
    width: 16px;
    height: 16px;
}

.tag {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    white-space: nowrap;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.tag.concept {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}
.tag.framework {
    background: var(--ph-bg);
    color: var(--ph-fg);
}

.card-desc {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 14px;
    line-height: 1.5;
}
.card-desc b {
    color: var(--fg);
    font-weight: 550;
}

.prompt-block {
    background: var(--fill);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    position: relative;
}
.prompt-text {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--fg);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.65;
}
.prompt-text .ph {
    color: var(--ph-fg);
    font-weight: 500;
    background: var(--ph-bg);
    padding: 0 3px;
    border-radius: 4px;
}

.tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface-2);
    border-radius: 10px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}
.tip .lucide {
    color: var(--warn);
    margin-top: 2px;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.tip b {
    color: var(--fg);
    font-weight: 550;
}

.card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    align-self: flex-end;
    margin-top: 4px;
}
.card-actions .copy-btn {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 16px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    letter-spacing: 0.02em;
}
.card-actions .copy-btn .lucide { width: 14px; height: 14px; }
.card-actions .copy-btn:hover {
    background: var(--hover);
    border-color: var(--border);
}
.card-actions .copy-btn:active {
    transform: scale(0.97);
}
.card-actions .copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    opacity: 0;
}
.icon-btn .lucide { width: 15px; height: 15px; }
.card:hover .icon-btn {
    opacity: 1;
}
.icon-btn:hover {
    background: var(--hover);
    color: var(--fg);
}
.icon-btn.danger:hover {
    background: rgba(255, 59, 48, 0.12);
    color: var(--danger);
}

.empty-state {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state.visible {
    display: block;
}
.empty-state .lucide {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    color: var(--border);
    stroke-width: 1.5;
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 6px;
}
.empty-state p {
    font-size: 14px;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--toast-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 10px 20px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}
.toast .lucide { width: 15px; height: 15px; color: var(--success); }
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden-file-input {
    display: none;
}

/* ── Search highlight ── */
.ph-hl { background: var(--hl-bg); color: var(--fg); padding: 1px 2px; border-radius: 3px; font-weight: 500; }

/* ── Use badge ── */
.use-badge { font-size: 11px; color: var(--muted); letter-spacing: 0.01em; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.use-badge .lucide { width: 12px; height: 12px; }

/* ── Batch bar ── */
.batch-bar { display: none; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; box-shadow: var(--shadow-sm); }
.batch-bar.open { display: flex; flex-wrap: wrap; }
.batch-bar .count { font-size: 13px; font-weight: 500; color: var(--fg); margin-right: auto; }
.batch-checkbox { position: absolute; top: 12px; left: 12px; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; display: none; align-items: center; justify-content: center; transition: all 0.12s; z-index: 1; }
.batch-checkbox .lucide { width: 13px; height: 13px; }
.batch-checkbox.checked { background: var(--accent); border-color: var(--accent); color: #fff; }
.batch-checkbox .lucide { display: none; }
.batch-checkbox.checked .lucide { display: block; }
.batch-mode .batch-checkbox { display: flex; }
.batch-mode .card { padding-left: 44px; }
.batch-mode .icon-btn { opacity: 1; }

/* ── Tag pill ── */
.tag-pill { background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 11px; color: var(--muted); cursor: pointer; white-space: nowrap; transition: all 0.12s; letter-spacing: 0.01em; }
.tag-pill:hover { border-color: var(--muted); color: var(--fg); }
.tag-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-filter-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 14px;
    display: none;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.tag-filter-wrap.open { display: flex; }
