/* 指令表 — 手机 / 微信内置浏览器优先 */

.cmd-help-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--cmd-page-bg, #f3f4f6);
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.cmd-help-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    padding-top: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] .cmd-help-header {
    background: rgba(17, 24, 39, 0.92);
    border-bottom-color: #374151;
}

.cmd-help-header-inner {
    max-width: 42rem;
    margin: 0 auto;
    padding: 1rem 1rem 0.875rem;
}

.cmd-help-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
    margin: 0;
}

[data-theme="dark"] .cmd-help-title {
    color: #f9fafb;
}

.cmd-help-meta {
    margin: 0.375rem 0 0;
    font-size: 0.75rem;
    color: #9ca3af;
}

.cmd-help-main {
    max-width: 42rem;
    margin: 0 auto;
    padding: 0.875rem 1rem 1.5rem;
}

.cmd-help-tips {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .cmd-help-tips {
    background: #1f2937;
    border-color: #374151;
}

.cmd-help-tips-title {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
}

.cmd-help-tips-list {
    margin: 0;
    padding-left: 1.125rem;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #374151;
}

[data-theme="dark"] .cmd-help-tips-list {
    color: #d1d5db;
}

.cmd-help-tips-list li + li {
    margin-top: 0.25rem;
}

.cmd-cat {
    margin-bottom: 1.25rem;
}

.cmd-cat-title {
    margin: 0 0 0.625rem;
    padding-left: 0.625rem;
    border-left: 3px solid #3b82f6;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1f2937;
}

[data-theme="dark"] .cmd-cat-title {
    color: #e5e7eb;
}

.cmd-cat-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.cmd-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    padding: 0.875rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .cmd-card {
    background: #1f2937;
    border-color: #374151;
}

.cmd-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.cmd-card-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

[data-theme="dark"] .cmd-card-name {
    color: #f9fafb;
}

.cmd-perm {
    flex-shrink: 0;
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.3125rem 0.5rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.cmd-perm-all {
    background: #dcfce7;
    color: #166534;
}

.cmd-perm-admin {
    background: #dbeafe;
    color: #1e40af;
}

.cmd-perm-super {
    background: #f3e8ff;
    color: #6b21a8;
}

[data-theme="dark"] .cmd-perm-all {
    background: #14532d;
    color: #bbf7d0;
}

[data-theme="dark"] .cmd-perm-admin {
    background: #1e3a8a;
    color: #bfdbfe;
}

[data-theme="dark"] .cmd-perm-super {
    background: #581c87;
    color: #e9d5ff;
}

.cmd-formats {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.cmd-format-line {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #1e40af;
    background: #eff6ff;
    border-radius: 0.5rem;
    padding: 0.5rem 0.625rem;
    word-break: break-word;
    overflow-wrap: anywhere;
    -webkit-user-select: all;
    user-select: all;
}

[data-theme="dark"] .cmd-format-line {
    color: #93c5fd;
    background: #1e3a5f;
}

.cmd-card-note {
    margin: 0.625rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #6b7280;
}

[data-theme="dark"] .cmd-card-note {
    color: #9ca3af;
}

.cmd-help-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.5;
}

/* 后台：桌面表格 / 手机卡片切换 */
.cmd-table-desktop {
    display: none;
}

.cmd-cards-mobile {
    display: block;
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .cmd-table-desktop {
        display: block;
    }

    .cmd-cards-mobile {
        display: none;
    }

    .cmd-help-header-inner,
    .cmd-help-main {
        max-width: 48rem;
    }
}

@media (min-width: 640px) {
    .cmd-help-title {
        font-size: 1.5rem;
    }

    .cmd-help-main {
        padding: 1rem 1.25rem 2rem;
    }
}

/* 微信内置浏览器 */
.is-wechat .cmd-help-page {
    background: #ededed;
}

.is-wechat .cmd-card,
.is-wechat .cmd-help-tips {
    border-radius: 0.625rem;
}

.is-wechat .cmd-format-line {
    font-size: 0.875rem;
}
