/* =========================================================
   离退休人员服务管理系统
   全局样式
   ========================================================= */


/* =========================================================
   1. 全局基础
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        "Hiragino Sans GB",
        "Microsoft YaHei",
        sans-serif;
    background: #f5f6f8;
    color: #222;
}

body {
    min-height: 100vh;
}


/* =========================================================
   2. 系统整体布局
   ========================================================= */

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.app-body-login {
    display: block;
}


/* =========================================================
   3. 顶部
   ========================================================= */

.app-header {
    height: 60px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.app-header-title {
    font-size: 20px;
    font-weight: 600;
}

.app-header-user {
    font-size: 14px;
    color: #666;
}

.app-current-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
/* =========================================================
   顶部账号菜单
   ========================================================= */

.app-current-user {
    position: relative;

    display: flex;
    align-items: center;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px 10px;

    border: 0;
    background: transparent;

    color: #555;
    font-size: 14px;

    cursor: pointer;
}

.user-menu-button:hover {
    background: #f3f4f6;
}

.user-menu-arrow {
    font-size: 10px;
}

.user-menu {
    position: absolute;
    z-index: 1000;

    top: calc(100% + 8px);
    right: 0;

    width: 130px;

    padding: 6px 0;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;

    box-shadow:
        0 6px 18px
        rgba(0, 0, 0, 0.12);
}

.user-menu-item {
    display: block;

    width: 100%;

    padding: 10px 18px;

    border: 0;
    background: transparent;

    text-align: left;
    font-size: 14px;

    cursor: pointer;
}

.user-menu-item:hover {
    background: #f3f4f6;
}


/* =========================================================
   个人设置
   ========================================================= */

.settings-overlay {
    position: fixed;
    z-index: 2000;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;

    background: rgba(0, 0, 0, 0.35);
}

.settings-overlay[hidden] {
    display: none;
}

.settings-overlay-secondary {
    z-index: 2100;

    background: rgba(0, 0, 0, 0.20);
}

.settings-dialog {
    width: min(900px, 90vw);

    background: #ffffff;
    border-radius: 4px;

    box-shadow:
        0 14px 40px
        rgba(0, 0, 0, 0.20);
}

.settings-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 24px;

    border-bottom: 1px solid #e5e7eb;
}

.settings-dialog-header h2 {
    margin: 0;

    font-size: 18px;
}

.settings-close {
    padding: 0;

    border: 0;
    background: transparent;

    color: #666;
    font-size: 28px;
    line-height: 1;

    cursor: pointer;
}

.settings-dialog-body {
    padding: 28px 36px 40px;
}

.settings-section {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 20px 0;

    border-bottom: 1px solid #e5e7eb;
}

.settings-section-title {
    margin-bottom: 8px;

    font-size: 18px;
    font-weight: 600;
}

.settings-section-description {
    color: #888;
}

.settings-action {
    border: 0;
    background: transparent;

    font-size: 15px;
    color: #2563eb;

    cursor: pointer;
}


/* =========================================================
   修改密码弹窗
   ========================================================= */

.password-dialog {
    width: min(460px, 90vw);

    background: #ffffff;
    border-radius: 4px;

    box-shadow:
        0 14px 40px
        rgba(0, 0, 0, 0.25);
}

.password-dialog-body {
    padding: 24px;
}

.password-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;

    padding: 0 24px 24px;
}
.header-link {
    color: #555;
    text-decoration: none;
}

.header-link:hover {
    color: #111;
}


/* =========================================================
   4. 左侧业务导航
   ========================================================= */

.app-sidebar {
    width: 190px;
    flex-shrink: 0;

    padding: 30px 20px;

    background: #ffffff;
    border-right: 1px solid #e5e7eb;
}

.sidebar-title {
    margin-bottom: 24px;

    font-size: 14px;
    color: #999;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-link {
    display: block;

    padding: 12px 14px;

    border-radius: 6px;

    color: #444;
    text-decoration: none;

    font-size: 15px;
}

.sidebar-link:hover {
    background: #f3f4f6;
    color: #222;
}


/* 当前业务导航项 */

.sidebar-link.active {
    background: #f3f4f6;
    color: #222;
    font-weight: 600;
}


/* =========================================================
   5. 主内容区域
   ========================================================= */

.app-main {
    flex: 1;
    min-width: 0;
    width: 100%;

    max-width: 1180px;

    margin: 0 auto;
    padding: 28px 36px;
}


/* 登录页特殊处理 */

.app-main-login {
    max-width: none;

    display: flex;
    justify-content: center;
}


/* =========================================================
   6. 页脚
   ========================================================= */

.app-footer {
    padding: 14px 28px;

    text-align: center;

    font-size: 13px;
    color: #999;

    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}


/* =========================================================
   7. 通用页面标题
   ========================================================= */

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
}

.page-header p {
    margin: 6px 0 0;
    color: #777;
}


/* =========================================================
   8. 通用卡片
   ========================================================= */

.search-card,
.result-card,
.detail-card {
    padding: 24px;
    margin-bottom: 20px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}


/* =========================================================
   9. 通用按钮
   ========================================================= */

.btn {
    min-width: 80px;
    height: 40px;

    padding: 0 16px;

    border: 0;
    border-radius: 6px;

    cursor: pointer;

    font-size: 14px;
}

.btn-primary {
    background: #222;
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #e5e7eb;
    color: #333;
}

.btn-small {
    min-width: auto;
    height: 32px;

    padding: 0 12px;

    background: #f0f0f0;
    color: #333;
}


/* =========================================================
   10. 通用表单
   ========================================================= */

.form-item {
    margin-bottom: 18px;
}

.form-item label {
    display: block;

    margin-bottom: 7px;

    font-size: 14px;
    font-weight: 500;
}

.form-item input {
    width: 100%;
    height: 42px;

    padding: 0 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    font-size: 16px;

    outline: none;
}

.form-item input:focus {
    border-color: #888;
}

.form-message {
    min-height: 22px;

    margin-bottom: 10px;

    font-size: 14px;
}


/* =========================================================
   11. 登录页面
   ========================================================= */

.login-page {
    min-height: calc(100vh - 150px);

    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;

    padding: 36px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.login-title {
    text-align: center;

    font-size: 24px;
    font-weight: 600;
}

.login-subtitle {
    margin-top: 8px;
    margin-bottom: 28px;

    text-align: center;

    color: #777;
}

.login-button {
    margin-top: 4px;
}


/* =========================================================
   12. 人员查询
   ========================================================= */

.search-basic-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.search-filter-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    margin-top: 18px;
}

.search-filter-card {
    padding: 14px 16px;

    background: #f8f9fb;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.search-filter-card label {
    display: block;

    margin-bottom: 8px;

    font-size: 14px;
    font-weight: 600;
}

.search-filter-card select {
    width: 100%;
    height: 40px;

    padding: 0 10px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: #ffffff;

    font-size: 14px;
}

.search-filter-card select:focus {
    outline: none;
    border-color: #888;
}

.search-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 20px;
}

.search-actions .btn {
    min-width: 90px;
}


/* =========================================================
   13. 查询结果
   ========================================================= */

.result-header {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 16px;
}

.result-title-group {
    display: flex;
    align-items: center;

    gap: 12px;
}

.result-title-group h2 {
    margin: 0;

    font-size: 18px;
}

#result-count {
    color: #777;
    font-size: 14px;
}

#result-message {
    min-height: 22px;

    margin-bottom: 10px;

    color: #666;
}


/* =========================================================
   14. 表格
   ========================================================= */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;

    border-bottom: 1px solid #eee;

    text-align: left;

    white-space: nowrap;
}

th {
    background: #f8f8f8;
    font-weight: 600;
}


/* =========================================================
   15. 人员详情
   ========================================================= */

.detail-message {
    margin-bottom: 20px;
    color: #666;
}


/* =========================================================
   详情分类：两列卡片
   ========================================================= */

.detail-container {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}


.person-detail-section {
    min-width: 0;

    padding: 24px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;
}


/* =========================================================
   分类标题
   ========================================================= */

.person-detail-section-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 20px;
}


.person-detail-section-header h2 {
    margin: 0;

    font-size: 20px;
}


/* =========================================================
   分类内部字段：两列
   ========================================================= */

.person-detail-fields {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px 28px;
}


.person-detail-field {
    min-width: 0;
}


.person-detail-label {
    margin-bottom: 6px;

    font-size: 13px;

    color: #777;
}


.person-detail-value {
    min-height: 24px;

    font-size: 15px;

    word-break: break-all;
}

/* ---------------------------------------------------------
   单个字段
   --------------------------------------------------------- */

.detail-item {
    min-width: 0;

    padding: 12px 14px;

    background: #f8f9fb;

    border: 1px solid #eef0f3;
    border-radius: 8px;
}


/* ---------------------------------------------------------
   字段名称
   --------------------------------------------------------- */

.detail-label {
    margin-bottom: 5px;

    font-size: 13px;

    color: #777;
}


/* ---------------------------------------------------------
   字段值
   --------------------------------------------------------- */

.detail-value {
    min-height: 24px;

    font-size: 15px;
    line-height: 1.5;

    word-break: break-all;
}


/* ---------------------------------------------------------
   页面操作
   --------------------------------------------------------- */

.detail-page-actions {
    display: flex;

    align-items: center;

    gap: 14px;
}


/* ---------------------------------------------------------
   历史备用信息标题区域
   --------------------------------------------------------- */

.detail-section-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}


.detail-section-header h2 {
    margin: 0;
}


/* 历史备用信息默认隐藏 */

.historical-info.hidden {
    display: none;
}


/* =========================================================
   16. 人员修改申请
   ========================================================= */

.change-field-list {
    display: flex;
    flex-direction: column;

    gap: 18px;
}

.change-field {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) minmax(220px, 0.9fr);

    grid-template-areas:
        "label input"
        "current input"
        "hint hint";

    column-gap: 24px;
    row-gap: 6px;

    align-items: center;

    padding: 16px 0;

    border-bottom: 1px solid #eeeeee;
}

.change-field:last-child {
    border-bottom: none;
}

.change-field-label {
    grid-area: label;

    font-weight: 600;
}

.change-current-value {
    grid-area: current;

    color: #222;
}

.change-input {
    grid-area: input;

    width: 100%;

    padding: 12px 14px;

    border: 1px solid #d5d9df;
    border-radius: 6px;

    font-size: 16px;
}

.change-input:focus {
    outline: none;
    border-color: #888888;
}

.change-field-hint {
    grid-area: hint;

    color: #777777;

    font-size: 14px;
}

.change-actions {
    display: flex;

    justify-content: flex-end;

    gap: 12px;

    margin: 24px 0 40px;
}


/* =========================================================
   17. 修改申请审核
   ========================================================= */

.review-toolbar {
    display: flex;
    align-items: center;

    gap: 18px;

    margin-bottom: 20px;
}

.review-status-filter {
    display: flex;
    align-items: center;

    gap: 10px;
}

.review-status-filter label {
    font-size: 14px;
    font-weight: 600;

    color: #444;
}

.review-status-filter select {
    min-width: 130px;
    height: 40px;

    padding: 0 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: #fff;

    font-size: 14px;
}

.review-status-filter select:focus {
    outline: none;
    border-color: #888;
}

.review-count {
    color: #777;
    font-size: 14px;
}


/* 修改申请审核列表 */

.review-list {
    display: flex;
    flex-direction: column;

    gap: 14px;
}

.review-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;

    padding: 18px 20px;

    background: #ffffff;

    border: 1px solid #e2e5e9;
    border-radius: 8px;
}

.review-item-main {
    min-width: 0;

    line-height: 1.8;
}

.review-item-title {
    margin-bottom: 4px;

    font-size: 17px;
    font-weight: 600;
}

.review-item-person {
    margin-bottom: 4px;

    font-size: 15px;
}

.review-item-meta,
.review-item-reason {
    color: #666;

    font-size: 14px;
}

.review-item-action {
    flex-shrink: 0;

    padding-top: 2px;
}


/* =========================================================
   18. 通用隐藏
   ========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   19. 响应式
   ========================================================= */

@media (max-width: 900px) {

    .search-basic-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .search-filter-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .detail-container {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .person-detail-fields {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 800px) {

    .change-field {
        grid-template-columns: 1fr;

        grid-template-areas:
            "label"
            "current"
            "input"
            "hint";

        gap: 8px;
    }
}


@media (max-width: 700px) {

    .review-item {
        flex-direction: column;

        gap: 12px;
    }

    .review-item-action {
        align-self: flex-start;
    }
}


@media (max-width: 600px) {

    .search-basic-grid,
    .search-filter-grid {
        grid-template-columns: 1fr;
    }

    .result-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-title-group {
        align-items: flex-start;
        flex-direction: column;

        gap: 4px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-section-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {

    .person-detail-fields {
        grid-template-columns: 1fr;
    }

    .person-detail-section-header {
        align-items: flex-start;

        flex-direction: column;
    }
}