/* ==========================================================================
   专利检索 /tools/patent — 极简界面样式（适配桌面 / 平板 / 手机）
   前缀统一使用 pt-，配色沿用站点主题变量并带兜底值，自动适配浅色 / 深色主题。
   ========================================================================== */

/* 全屏布局：解除全站 1280px 中心限宽，保留左侧导航 */
body.page-patent-full .app { max-width: 100%; }
body.page-patent-full .main-content { max-width: 100%; width: 100%; border-right: 0; }

.pt-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 22px 56px;
    box-sizing: border-box;
}

/* ---------------- 标题区 ---------------- */
.pt-hero { margin-bottom: 22px; }
.pt-title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--text-primary, #1a1a1a);
}
.pt-sub {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary, #666);
    max-width: 780px;
}
.pt-sub b { color: var(--accent, #136ce9); font-weight: 600; }

/* ---------------- 搜索 ---------------- */
.pt-search {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.pt-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 15px;
    font-size: 15px;
    color: var(--text-primary, #1a1a1a);
    background: var(--bg-secondary, #f6f7fa);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 12px;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
}
.pt-input:focus {
    border-color: var(--accent, #136ce9);
    box-shadow: 0 0 0 3px rgba(19, 108, 233, .12);
}
.pt-input::placeholder { color: #9aa0a6; }

.pt-btn {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 20px;
    font-size: 14.5px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background .16s, border-color .16s, opacity .16s;
    white-space: nowrap;
}
.pt-btn-primary {
    background: var(--accent, #136ce9);
    color: #fff;
}
.pt-btn-primary:hover { opacity: .9; }
.pt-btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.pt-btn-ghost {
    background: transparent;
    color: var(--text-secondary, #666);
    border-color: var(--border, #e2e2e2);
}
.pt-btn-ghost:hover { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }

/* ---------------- 筛选 ---------------- */
.pt-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.pt-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pt-field-label { font-size: 12px; color: var(--text-secondary, #666); }
.pt-sel {
    height: 38px;
    padding: 0 10px;
    font-size: 14px;
    color: var(--text-primary, #1a1a1a);
    background: var(--bg-secondary, #f6f7fa);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 10px;
    outline: none;
}
.pt-sel:focus { border-color: var(--accent, #136ce9); }

/* ---------------- 状态栏 ---------------- */
.pt-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-secondary, #666);
}
.pt-meta b { color: var(--text-primary, #1a1a1a); }
.pt-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(19, 108, 233, .1);
    color: var(--accent, #136ce9);
}
.pt-export {
    margin-left: auto;
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
    background: transparent;
    color: var(--text-secondary, #666);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 8px;
    cursor: pointer;
}
.pt-export:hover { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }

/* ---------------- 结果列表 ---------------- */
.pt-list { display: flex; flex-direction: column; gap: 10px; }

.pt-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-secondary, #f6f7fa);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 14px;
    transition: border-color .16s;
}
.pt-item:hover { border-color: var(--accent, #136ce9); }
.pt-item-main { flex: 1 1 auto; min-width: 0; }
.pt-item-title {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary, #1a1a1a);
    word-break: break-word;
    margin-bottom: 8px;
}
.pt-item-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 13px;
    color: var(--text-secondary, #666);
}
.pt-badge {
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--accent, #136ce9);
    background: rgba(19, 108, 233, .1);
    border-radius: 6px;
}
.pt-kind {
    padding: 2px 7px;
    font-size: 11.5px;
    color: var(--text-secondary, #666);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 6px;
}
.pt-dot { color: #c4c8cc; }
.pt-applicant {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-item-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pt-act {
    height: 30px;
    padding: 0 11px;
    font-size: 13px;
    color: var(--text-secondary, #666);
    background: transparent;
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    line-height: 28px;
    white-space: nowrap;
}
.pt-act:hover { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }

/* ---------------- 状态 / 空态 / 错误 ---------------- */
.pt-state {
    padding: 30px 10px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary, #666);
}
.pt-state:empty { display: none; }
.pt-state.is-error { color: #d33; }

/* ---------------- 分页 ---------------- */
.pt-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}
.pt-pg {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: 13.5px;
    color: var(--text-primary, #1a1a1a);
    background: var(--bg-secondary, #f6f7fa);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 9px;
    cursor: pointer;
}
.pt-pg:hover:not(:disabled) { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }
.pt-pg.is-active {
    background: var(--accent, #136ce9);
    border-color: var(--accent, #136ce9);
    color: #fff;
}
.pt-pg:disabled { opacity: .45; cursor: not-allowed; }
.pt-pg-dots { padding: 0 4px; color: var(--text-secondary, #666); }

/* ---------------- 说明 ---------------- */
.pt-note {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--border, #e2e2e2);
}
.pt-note-title { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--text-primary, #1a1a1a); }
.pt-note-list { margin: 0; padding-left: 18px; font-size: 12.8px; line-height: 1.85; color: var(--text-secondary, #666); }
.pt-note-list a { color: var(--accent, #136ce9); text-decoration: none; }
.pt-note-list a:hover { text-decoration: underline; }

/* ---------------- 详情弹窗 ---------------- */
.pt-mask {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .5);
}
.pt-mask[hidden] { display: none !important; }
.pt-modal {
    width: 100%;
    max-width: 620px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 16px;
    overflow: hidden;
}
.pt-modal-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border, #e2e2e2);
}
.pt-modal-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-primary, #1a1a1a); }
.pt-modal-close {
    width: 30px;
    height: 30px;
    font-size: 15px;
    line-height: 1;
    color: var(--text-secondary, #666);
    background: transparent;
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 8px;
    cursor: pointer;
}
.pt-modal-close:hover { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }
.pt-modal-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 20px; }

.pt-dl { margin: 0; }
.pt-dl-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border, #e2e2e2);
    font-size: 14px;
}
.pt-dl-row:last-child { border-bottom: 0; }
.pt-dl-k { color: var(--text-secondary, #666); }
.pt-dl-v { color: var(--text-primary, #1a1a1a); word-break: break-word; }
.pt-dl-v a { color: var(--accent, #136ce9); text-decoration: none; }
.pt-dl-v a:hover { text-decoration: underline; }
.pt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-chip {
    padding: 2px 8px;
    font-size: 12.5px;
    background: var(--bg-secondary, #f6f7fa);
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 6px;
}
.pt-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pt-link-btn {
    height: 34px;
    padding: 0 13px;
    font-size: 13.5px;
    line-height: 32px;
    color: var(--accent, #136ce9);
    text-decoration: none;
    border: 1px solid var(--accent, #136ce9);
    border-radius: 9px;
}
.pt-link-btn:hover { background: rgba(19, 108, 233, .08); }
.pt-loading { padding: 26px 0; text-align: center; color: var(--text-secondary, #666); font-size: 14px; }

/* ==========================================================================
   响应式：平板（768~991）
   ========================================================================== */
@media (max-width: 991px) {
    .pt-page { padding: 22px 18px 48px; }
    .pt-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pt-title { font-size: 23px; }
}

/* ==========================================================================
   响应式：手机（<768）
   ========================================================================== */
@media (max-width: 767px) {
    .pt-page { padding: 18px 14px 40px; }
    .pt-hero { margin-bottom: 18px; }
    .pt-title { font-size: 21px; }

    /* 搜索：输入框整行，按钮下方平铺 */
    .pt-search { flex-wrap: wrap; gap: 8px; }
    .pt-input { flex: 1 1 100%; font-size: 16px; }  /* 16px 防 iOS 聚焦缩放 */
    .pt-btn { flex: 1 1 0; min-width: 0; padding: 0 10px; }

    /* 筛选：两列 */
    .pt-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .pt-sel { height: 40px; font-size: 16px; }      /* 防 iOS 聚焦缩放 */

    /* 结果卡片：内容纵向，操作按钮铺满一行 */
    .pt-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 13px; }
    .pt-item-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .pt-act { text-align: center; padding: 0 6px; }

    .pt-export { margin-left: 0; }

    /* 详情弹窗：移动端贴底全宽（bottom sheet） */
    .pt-mask { padding: 0; align-items: flex-end; }
    .pt-modal {
        max-width: none;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        border-bottom: 0;
    }
    .pt-dl-row { grid-template-columns: 78px 1fr; font-size: 13.5px; }
}

@media (max-width: 380px) {
    .pt-filters { grid-template-columns: 1fr; }
    .pt-item-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
