/* ===========================================================================
   360 度评估问卷平台 —— 公共样式
   设计取向：参照 RuoYi 的经典后台观感（深色侧栏 + 浅色内容区 + 卡片表格），
   但全部手写，不引入外部 UI 框架，保证在离线环境也能完整运行。
   =========================================================================== */

:root {
    --primary: #1677ff;
    --primary-dark: #0958d9;
    --success: #00b42a;
    --warning: #ff7d00;
    --danger: #f53f3f;
    --text-1: #1d2129;
    --text-2: #4e5969;
    --text-3: #86909c;
    --border: #e5e6eb;
    --bg: #f2f3f5;
    --sidebar-bg: #2b3648;
    --sidebar-active: #1677ff;
    --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text-1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---------------------------------------------------------------- 登录页 */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2d3d 0%, #2b3648 55%, #1677ff 160%);
}

.login-box {
    width: 380px;
    background: #fff;
    border-radius: 12px;
    padding: 34px 34px 26px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.login-box h1 { font-size: 20px; margin: 0 0 6px; }
.login-box .sub { color: var(--text-3); font-size: 13px; margin: 0 0 22px; }

/* --------------------------------------------------------------- 站点首页 */
body.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2d3d 0%, #2b3648 60%, #1677ff 170%);
}

.landing-box {
    background: #fff;
    border-radius: 14px;
    padding: 46px 52px;
    width: 520px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

.landing-box h1 { font-size: 24px; margin: 0 0 8px; }
.landing-box .sub { color: var(--text-3); margin: 0 0 26px; }
.landing-actions { margin-bottom: 22px; }
.landing-tip { font-size: 13px; color: var(--text-3); line-height: 1.9; border-top: 1px dashed var(--border); padding-top: 18px; }

/* ------------------------------------------------------------- 表单与按钮 */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-item .required::before { content: "*"; color: var(--danger); margin-right: 3px; }

.input, .select, .textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-1);
    background: #fff;
    outline: none;
    transition: border-color .15s;
    font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.textarea { resize: vertical; min-height: 90px; }
.input[readonly] { background: #f7f8fa; color: var(--text-3); }

.btn {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text-1);
    font-size: 13px;
    cursor: pointer;
    line-height: 1.5;
    transition: all .15s;
    white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #ffd2d2; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ----------------------------------------------------------------- 布局 */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 216px;
    background: var(--sidebar-bg);
    color: #c9cdd4;
    flex: 0 0 216px;
    display: flex;
    flex-direction: column;
}
.sidebar .brand {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar nav { padding: 10px 0; overflow-y: auto; flex: 1; }
.sidebar .nav-group-title {
    padding: 12px 18px 6px;
    font-size: 12px;
    color: #6b7a90;
    letter-spacing: .5px;
}
.sidebar a.nav-item {
    display: block;
    padding: 9px 18px 9px 22px;
    color: #c9cdd4;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar a.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar a.nav-item.active { background: rgba(22, 119, 255, .18); color: #fff; border-left-color: var(--sidebar-active); }
.sidebar a.nav-sub { padding-left: 38px; font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .user { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 14px; }

.content { padding: 18px 20px 40px; flex: 1; }

/* ----------------------------------------------------------------- 卡片 */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    margin-bottom: 16px;
}
.card-head {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ------------------------------------------------------------ 工具条/表格 */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: #fcfcfd;
}
.toolbar .spacer { flex: 1; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.table th { background: #fafbfc; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: #f7f9fc; }
.table td.actions { white-space: nowrap; }
.table .empty { text-align: center; color: var(--text-3); padding: 40px 0; }

.pagination { display: flex; gap: 6px; align-items: center; padding: 14px 18px; justify-content: flex-end; font-size: 13px; }
.pagination a, .pagination span {
    padding: 4px 10px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-2); background: #fff;
}
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { color: #c9cdd4; }

/* ----------------------------------------------------------------- 标签 */
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; line-height: 18px; }
.tag-default { background: #f2f3f5; color: var(--text-2); }
.tag-blue { background: #e8f3ff; color: #1677ff; }
.tag-green { background: #e8ffea; color: #00b42a; }
.tag-orange { background: #fff7e8; color: #ff7d00; }
.tag-red { background: #ffece8; color: #f53f3f; }
.tag-gray { background: #f2f3f5; color: #86909c; }

/* --------------------------------------------------------------- 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.stat-card .label { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat-card .value small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }

/* ----------------------------------------------------------- 筛选条
   card-body.tight 里（padding: 0）自带内边距，与下方表格用一条分隔线隔开 */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.filter-bar .filter-keyword { flex: 1 1 260px; min-width: 180px; }
.filter-bar .filter-dept { flex: 0 1 320px; max-width: 360px; }

/* --------------------------------------------------------------- 提示条 */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; line-height: 1.7; }
.alert-info { background: #e8f3ff; color: #1c4f9c; }
.alert-success { background: #e8ffea; color: #1a7f37; }
.alert-warning { background: #fff7e8; color: #a45c00; }
.alert-danger { background: #ffece8; color: #c0392b; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* --------------------------------------------------------------- 弹窗 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
    display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
    background: #fff; border-radius: 10px; width: 640px; max-width: 100%; max-height: 88vh;
    display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; }
.modal-head .close { cursor: pointer; color: var(--text-3); font-size: 18px; line-height: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* --------------------------------------------------------------- 进度条 */
.progress { background: #f2f3f5; border-radius: 10px; height: 8px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 10px; }

/* --------------------------------------------------------------- 空状态 */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty-state .big { font-size: 40px; margin-bottom: 10px; }

/* --------------------------------------------------------------- 表单行 */
.form-row { display: flex; gap: 16px; }
.form-row > .form-item { flex: 1; }
.form-tip { font-size: 12px; color: var(--text-3); margin-top: 4px; line-height: 1.7; }

/* ---------------------------------------------------- 通讯录选人（补全）
   刻意不用绝对定位：弹窗 body 是 overflow-y:auto，绝对定位的下拉会被裁掉。
   这里做成普通块级列表，撑开弹窗（弹窗自己会滚动），不会被裁。 */
.picker-list {
    margin-top: 6px; max-height: 240px; overflow: auto;
    border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.picker-item { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f5f6f8; }
.picker-item:last-child { border-bottom: none; }
.picker-item:hover { background: #f5f9ff; }
.picker-item .name { font-weight: 600; }
.picker-item .tag { float: right; }
.picker-empty { padding: 12px; font-size: 13px; color: var(--text-3); }

/* ------------------------------------------------------------ 只读信息表 */
.desc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.desc-table th { width: 130px; text-align: right; padding: 9px 12px; color: var(--text-3); font-weight: 400; background: #fafbfc; }
.desc-table td { padding: 9px 12px; border-bottom: 1px solid #f0f1f3; }

/* --------------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; flex: none; }
    .sidebar nav { display: flex; overflow-x: auto; padding: 0; }
    .sidebar .nav-group-title { display: none; }
    .sidebar a.nav-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .sidebar a.nav-item.active { border-left: none; border-bottom-color: var(--sidebar-active); }
    .form-row { flex-direction: column; gap: 0; }
}
