/* 业绩模块 - 主框架样式 */
:root {
    --yeji-primary: #4080ff;
    --yeji-bg: #f0f2f5;
    --yeji-card-bg: #fff;
    --yeji-border: #e5e7eb;
    --yeji-text: #1f2937;
    --yeji-text-secondary: #6b7280;
    --yeji-radius: 6px;
}

/* 页面容器 */
.yeji-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--yeji-bg);
    overflow: hidden;
    position: relative;
}

.yeji-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    gap: 12px;
    display: flex;
    flex-direction: column;
}

/* ========== 搜索区域 ========== */
.yeji-search-container {
    flex-shrink: 0;
    padding: 12px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid rgba(209, 213, 219, 0.5);
}

.yeji-search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto;
}

.yeji-search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.yeji-search-input {
    width: 100%;
    height: 36px;
    padding: 0 40px 0 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    outline: none;
}

.yeji-search-input::placeholder { color: #9ca3af; }
.yeji-search-input:focus {
    border-color: var(--yeji-primary);
    box-shadow: 0 4px 16px rgba(64, 128, 255, 0.15);
}

.yeji-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    padding: 0;
    outline: none;
}

.yeji-search-clear:hover { background: #f3f4f6; color: #6b7280; }

.yeji-filter-toggle {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.yeji-filter-toggle:hover {
    border-color: var(--yeji-primary);
    color: var(--yeji-primary);
    background: #eef3ff;
}

.yeji-search-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 20px;
    background: var(--yeji-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(64, 128, 255, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.yeji-search-btn:hover { background: #3070e6; transform: translateY(-1px); }
.yeji-search-btn:disabled { background: #9ca3af; box-shadow: none; cursor: not-allowed; transform: none; }

/* 模板按钮 */
.yeji-tpl-wrap { position: relative; flex-shrink: 0; }
.yeji-tpl-btn {
    height: 36px; padding: 0 12px; gap: 4px;
    background: #fff; color: #6b7280;
    border: 1.5px solid #d1d5db; border-radius: 8px;
    font-size: 13px; cursor: pointer; white-space: nowrap;
    display: flex; align-items: center;
    transition: all 0.2s;
}
.yeji-tpl-btn:hover { border-color: var(--yeji-primary); color: var(--yeji-primary); }
.yeji-tpl-btn.yeji-tpl-active { border-color: var(--yeji-primary); color: var(--yeji-primary); background: #f0f5ff; }
.yeji-tpl-panel {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    width: max-content; min-width: 100%; max-width: 300px; background: #fff; border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.15); z-index: 9000;
    overflow: hidden;
}
.yeji-tpl-list { max-height: 420px; overflow-y: auto; padding: 4px 0; }
.yeji-tpl-item {
    display: flex; align-items: center; justify-content: space-between;
    margin: 4px 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; color: #333;
    background: #f7f8fa; border-radius: 6px; transition: background .15s;
}
.yeji-tpl-item:hover { background: #e8f0fe; }
.yeji-tpl-name {
    max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.yeji-tpl-item .yeji-tpl-del {
    color: #ccc; font-size: 11px; padding: 2px 4px; flex-shrink: 0;
}
.yeji-tpl-item .yeji-tpl-del:hover { color: #ff4d4f; }
.yeji-tpl-add {
    display: flex; align-items: center; justify-content: center;
    padding: 10px 12px; cursor: pointer; font-size: 16px;
    color: var(--yeji-primary); border-top: 1px solid #f0f0f0;
}
.yeji-tpl-add:hover { background: #f0f5ff; }
.yeji-tpl-empty { padding: 16px; text-align: center; color: #999; font-size: 12px; }
/* 模板命名弹窗 */
.yeji-tpl-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center; z-index: 10000;
}
.yeji-tpl-dialog {
    background: #fff; border-radius: 12px; padding: 20px; width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.yeji-tpl-dialog-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.yeji-tpl-dialog-title { font-size: 15px; font-weight: 600; color: #333; }
.yeji-tpl-dialog-close {
    cursor: pointer; font-size: 16px; color: #999; padding: 2px 4px; transition: color .15s;
}
.yeji-tpl-dialog-close:hover { color: #ff4d4f; }
.yeji-tpl-dialog-row { display: flex; gap: 8px; align-items: stretch; }
.yeji-tpl-dialog-input {
    width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 14px;
    border: 1.5px solid #d1d5db; border-radius: 8px; outline: none;
}
.yeji-tpl-dialog-input:focus { border-color: var(--yeji-primary); }
.yeji-tpl-dialog-ok {
    padding: 0 18px; border-radius: 8px; font-size: 13px; cursor: pointer;
    border: none; background: var(--yeji-primary); color: #fff; white-space: nowrap; transition: opacity .15s;
}
.yeji-tpl-dialog-ok:hover { opacity: .85; }
.yeji-tpl-suggest {
    position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px;
    background: #fff; border: 1px solid #e8e8e8; border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1); max-height: 180px; overflow-y: auto; z-index: 10;
}
.yeji-tpl-suggest-item {
    display: flex; align-items: center; padding: 8px 12px; cursor: pointer;
    font-size: 13px; color: #333; transition: background .15s;
}
.yeji-tpl-suggest-item:hover { background: #f0f5ff; }

/* ========== 可折叠筛选区 ========== */
.yeji-filter-dropdown {
    max-width: 900px;
    margin: 10px auto 0;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 0;
    align-items: center;
    justify-content: space-around;
}

.yeji-filter-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--yeji-text-secondary);
    min-width: 120px;
    justify-content: center;
}

.yeji-filter-item label {
    white-space: nowrap;
    font-size: 11px;
}

.yeji-btn {
    height: 28px;
    padding: 0 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.yeji-btn-primary {
    background: var(--yeji-primary);
    color: #fff;
}

.yeji-btn-default {
    background: #f3f4f6;
    color: var(--yeji-text-secondary);
    border: 1px solid var(--yeji-border);
}

.yeji-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ========== 手机端响应式 ========== */
@media screen and (max-width: 480px) {
    .yeji-search-container { padding: 8px 10px; }
    .yeji-search-box { gap: 6px; }
    .yeji-search-input { height: 32px; font-size: 12px; padding: 0 32px 0 10px; }
    .yeji-search-btn { padding: 0 10px; height: 32px; font-size: 12px; }
    .yeji-search-btn span { display: none; }
    .yeji-filter-toggle { width: 32px; height: 32px; }
    .yeji-tpl-btn { height: 32px; padding: 0 8px; font-size: 12px; }
    .yeji-tpl-panel { max-width: 240px; }

    /* 筛选区：手机端缩小字号间距 */
    .yeji-filter-item {
        gap: 2px;
        font-size: 11px;
        min-width: 100px;
    }
    .yeji-filter-item label { font-size: 10px; }

}
