/*
 * PHP Manual 开发手册样式
 * ============================================================================
 * 版权所有 (C) 西安尊云信息科技有限公司，并保留所有权利。
 * 网站地址: http://www.zunyunkeji.com
 * ----------------------------------------------------------------------------
 * 许可声明：未经许可不得将本软件的整体或任何部分用于商业用途及再发布。
 * ============================================================================
 * Author: 缘境 (yvsm@zunyunkeji.com) QQ:316430983 微信：yvsm316
*/

.tool-pm-section { padding: 40px 0 72px; background: #f7f9fc; }

.pm-toolbar {
    display: flex; align-items: center; gap: 14px;
    max-width: 960px; margin: 0 auto 18px;
}
.tool-pm-search {
    position: relative; flex: 1; max-width: none; margin: 0;
}
.tool-pm-search i.fa-search {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 15px;
}
.tool-pm-search input {
    width: 100%; height: 46px; padding: 0 44px 0 44px;
    border: 2px solid #e2e8f0; border-radius: 12px;
    background: #fff; font-size: 15px; color: #1e293b;
    outline: none; transition: border-color .2s, box-shadow .2s;
}
.tool-pm-search input:focus {
    border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.pm-search-clear {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border: none; border-radius: 50%;
    background: #f1f5f9; color: #64748b; cursor: pointer;
}
.pm-search-clear:hover { background: #e2e8f0; color: #334155; }

.pm-fullscreen-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; font-size: 12.5px; color: #475569;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    cursor: pointer; transition: all .15s;
}
.pm-fullscreen-btn:hover {
    border-color: #2563eb; color: #2563eb; background: #edf3ff;
}

.tool-pm-layout {
    display: grid; grid-template-columns: 240px 1fr; gap: 24px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden;
    min-height: 480px;
}

.tool-pm-sidebar {
    background: #f8fafc; border-right: 1px solid #e5e7eb;
}
.pm-sidebar-inner { padding: 8px 0; }

.pm-chapter { margin-bottom: 2px; }
.pm-chapter:last-child { margin-bottom: 0; }

.pm-chapter-title {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 14px 10px 14px; font-size: 13px; font-weight: 700;
    color: #1e3a8a; letter-spacing: .5px; cursor: pointer;
    user-select: none; border-bottom: 1px dashed #e2e8f0;
    transition: background .15s;
}
.pm-chapter-title:hover { background: #eef3fb; }

.pm-chapter-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 3px;
    background: #e2e8f0; color: #475569; font-size: 13px; font-weight: 700;
    font-family: Consolas, "Courier New", monospace; line-height: 1;
    transition: background .15s, transform .2s;
}
.pm-chapter.is-open .pm-chapter-toggle { background: #2563eb; color: #fff; }

.pm-chapter-text { flex: 1; }

.pm-chapter-subs {
    max-height: 600px; overflow: hidden;
    transition: max-height .28s ease, padding .28s ease, opacity .22s ease;
    padding: 6px 8px 8px; opacity: 1;
}
.pm-chapter:not(.is-open) .pm-chapter-subs {
    max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0;
}

.pm-sub-item {
    position: relative; display: flex; align-items: center;
    padding: 7px 12px 7px 22px; font-size: 13.5px;
    color: #475569; cursor: pointer; border-radius: 6px;
    text-decoration: none; font-weight: 500;
    transition: background .15s, color .15s, padding-left .15s;
}
.pm-sub-item:hover {
    background: #edf3ff; color: #2563eb;
    padding-left: 26px;
}
.pm-sub-item.is-active {
    background: linear-gradient(90deg, #dbeafe 0%, #eff6ff 100%);
    color: #1d4ed8; font-weight: 600;
    padding-left: 26px;
    box-shadow: inset 3px 0 0 #2563eb;
}
.pm-sub-item.is-active .pm-sub-dot { background: #2563eb; transform: scale(1.4); }
.pm-sub-item.is-active::after {
    content: ''; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: #2563eb; opacity: .5;
}

.pm-sub-dot {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 5px; height: 5px; border-radius: 50%;
    background: #cbd5e1; transition: background .15s, transform .15s;
    flex-shrink: 0;
}
.pm-sub-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 滚动条美化 */
.pm-sidebar-inner::-webkit-scrollbar { width: 6px; }
.pm-sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.pm-sidebar-inner::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.pm-sidebar-inner::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.tool-pm-main { padding: 28px 32px; }

.pm-breadcrumb {
    font-size: 12px; color: #94a3b8; margin-bottom: 6px;
    padding-bottom: 8px; border-bottom: 1px solid #f1f5f9;
}
.pm-bc-sep { margin: 0 6px; color: #cbd5e1; }

.pm-content h2 {
    font-size: 20px; font-weight: 700; color: #1e293b; margin-bottom: 18px;
    padding-bottom: 10px; border-bottom: 2px solid #eef2f7;
}
.pm-content h3 {
    font-size: 15px; font-weight: 600; color: #334155; margin: 22px 0 12px;
    padding-left: 10px; border-left: 3px solid #2563eb;
}
.pm-content h3:first-child { margin-top: 0; }

.pm-func-list { display: grid; gap: 10px; }
.pm-func-item {
    padding: 12px 16px; background: #f8fafc; border: 1px solid #e5edf7;
    border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.pm-func-item:hover {
    border-color: #93c5fd; box-shadow: 0 2px 8px rgba(37,99,235,.08);
}
.pm-func-name {
    font-family: Consolas, "Courier New", monospace; font-size: 14.5px;
    font-weight: 600; color: #1d4ed8; margin-bottom: 4px;
}
.pm-func-desc { font-size: 13px; color: #64748b; line-height: 1.6; }
.pm-func-signature {
    font-family: Consolas, "Courier New", monospace; font-size: 12.5px;
    color: #64748b; margin-top: 6px; padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.pm-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.pm-table th, .pm-table td {
    padding: 10px 14px; border: 1px solid #e5edf7; text-align: left; vertical-align: top;
}
.pm-table th {
    background: #f0f4fa; color: #334155; font-weight: 600; width: 28%;
    font-family: Consolas, "Courier New", monospace;
}
.pm-table td { color: #475569; line-height: 1.6; }

.pm-code-block {
    background: #1e293b; color: #e2e8f0; padding: 14px 16px;
    border-radius: 10px; font-family: Consolas, "Courier New", monospace;
    font-size: 13px; line-height: 1.7; overflow-x: auto; margin: 10px 0;
}
.pm-code-block .c { color: #64748b; }
.pm-code-block .k { color: #c084fc; }
.pm-code-block .s { color: #4ade80; }
.pm-code-block .n { color: #fbbf24; }

.pm-empty {
    text-align: center; padding: 40px 20px; color: #94a3b8; font-size: 14px;
}
.pm-empty i { font-size: 42px; margin-bottom: 12px; display: block; }

.tool-pm-mobile-tabs {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
}
.tool-pm-mobile-tabs button {
    padding: 7px 14px; border: 1px solid #d5e0ef; border-radius: 999px;
    background: #fff; color: #475569; font-size: 13px; cursor: pointer;
}
.tool-pm-mobile-tabs button.is-active {
    border-color: #2563eb; background: #edf3ff; color: #2563eb; font-weight: 650;
}

.pm-content-mobile {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 18px;
}

/* ========== 全屏无干扰模式 ========== */
.pm-fullscreen header,
.pm-fullscreen footer,
.pm-fullscreen .page-hero,
.pm-fullscreen .tool-feature-grid,
.pm-fullscreen .tool-seo-block,
.pm-fullscreen .page-breadcrumb {
    display: none !important;
}
.pm-fullscreen .tool-pm-section {
    padding: 16px 0 32px !important; background: #f7f9fc;
    min-height: 100vh;
}
.pm-fullscreen .site-container { max-width: 1400px; }
.pm-fullscreen .tool-pm-layout {
    border-radius: 12px;
    grid-template-columns: 260px 1fr;
}
.pm-fullscreen .tool-pm-sidebar { position: sticky; top: 16px; align-self: start; }

@media (max-width: 767px) {
    .tool-pm-section { padding: 20px 0 48px; }
    .tool-pm-layout { display: none; }
    .tool-pm-main { padding: 18px; }
    .pm-table th, .pm-table td { padding: 8px 10px; font-size: 12.5px; }
    .pm-func-item { padding: 10px 12px; }
}
@media (min-width: 768px) {
    .tool-pm-mobile-tabs { display: none; }
    .pm-content-mobile { padding: 0; background: transparent; border: none; }
}

/* ========== 版本特性卡片样式 ========== */
.pm-content .pm-func-item:has(.pm-feats-grid) {
    padding: 0;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    overflow: hidden;
    margin-bottom: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.pm-content .pm-func-item:has(.pm-feats-grid) .pm-func-name {
    background: linear-gradient(135deg, #eff6ff 0%, #f5f6ff 100%);
    padding: 14px 20px;
    font-size: 17px;
    font-weight: 700;
    color: #1e3a8a;
    border-bottom: 1px solid #dbeafe;
    letter-spacing: .3px;
}
.pm-content .pm-func-item:has(.pm-feats-grid) .pm-func-desc {
    padding: 10px 20px;
    color: #4b5563;
    font-size: 14px;
    border-bottom: 1px dashed #e5e7eb;
    background: #fafbff;
}

/* 升级迁移指南 */
.pm-migrate {
    margin: 14px 20px 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1px solid #a7f3d0;
    overflow: hidden;
}
.pm-migrate-head {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #047857;
    background: rgba(16,185,129,.08);
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #a7f3d0;
}
.pm-migrate-head i {
    font-size: 13px;
}
.pm-migrate-body {
    padding: 12px 14px;
    font-size: 13.5px;
    color: #065f46;
    line-height: 1.75;
}

/* 特性网格 */
.pm-feats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 20px 20px;
}
.pm-feat-chip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border-radius: 9px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: all .2s ease;
}
.pm-feat-chip:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37,99,235,.1);
}
.pm-feat-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #2563eb;
}
.pm-feat-desc {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .pm-feats-grid { grid-template-columns: 1fr; }
}
