/* ============================================================
   赵氏家谱登记系统 —— 简单内联样式（无框架）
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #2b2b2b;
    background: #f6f4ef;
}

a { color: #8a5a2b; text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶栏 ---------- */
header {
    background: #6b3f22;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
header .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
}
header .brand a {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
}
header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
header nav a { color: #f4e7d8; }
header nav a:hover { color: #fff; text-decoration: underline; }
header .who { color: #d8bfa5; font-size: 13px; }

/* 导航上的待办计数小红标 */
.badge-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 9px;
    background: #d64545;
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
    vertical-align: middle;
}

/* ---------- 主体 ---------- */
main { padding: 20px 16px 40px; }

h2 { margin: 8px 0 16px; font-size: 22px; border-left: 5px solid #b5744a; padding-left: 10px; }
h3 { margin: 22px 0 10px; font-size: 17px; color: #6b3f22; }

footer {
    padding: 16px;
    text-align: center;
    color: #8d8d8d;
    font-size: 13px;
    border-top: 1px solid #e3ded4;
}

/* ---------- 提示条 ---------- */
.flashes { margin-bottom: 14px; }
.flash {
    padding: 9px 13px;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid transparent;
}
.flash.success { background: #e8f6ec; border-color: #a8dbb5; color: #1f6b34; }
.flash.error   { background: #fdecec; border-color: #efb0b0; color: #8c2020; }
.flash.warning { background: #fff7e0; border-color: #ecd499; color: #7a5a10; }
.flash.message { background: #eef4fb; border-color: #b6cdea; color: #1f4571; }

/* ---------- 卡片 / 面板 ---------- */
.panel {
    background: #fff;
    border: 1px solid #e3ded4;
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.panel h3:first-child, .panel h2:first-child { margin-top: 0; }

/* ---------- 表格 ---------- */
table.data {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}
table.data th, table.data td {
    border: 1px solid #e3ded4;
    padding: 7px 9px;
    text-align: left;
    vertical-align: top;
}
table.data th { background: #efe7da; color: #4d3016; font-weight: 600; white-space: nowrap; }
table.data tr:nth-child(even) td { background: #fcfaf6; }
table.data td.k { width: 130px; white-space: nowrap; background: #f7f3ec; color: #5a4227; }

/* ---------- 表单 ---------- */
form.form p { margin: 0 0 12px; }
form.form label.f-label { display: block; font-weight: 600; margin-bottom: 4px; color: #4d3016; }
form.form input[type=text], form.form input[type=password], form.form input[type=date],
form.form input[type=file], form.form select, form.form textarea {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #cfc6b8;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
}
form.form textarea { min-height: 90px; resize: vertical; }
form.form .hint { color: #8d8d8d; font-size: 12px; margin-left: 6px; font-weight: normal; }
form.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) {
    form.form .grid2 { grid-template-columns: 1fr; }
}

button, .btn {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid #8a5a2b;
    background: #8a5a2b;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}
button:hover, .btn:hover { background: #6b3f22; text-decoration: none; }
.btn-ghost { background: #fff; color: #8a5a2b; }
.btn-ghost:hover { background: #f2e9de; color: #6b3f22; }
.btn-danger { background: #a83a3a; border-color: #a83a3a; }
.btn-danger:hover { background: #8c2c2c; }
.btn-small { padding: 3px 10px; font-size: 13px; }

/* ---------- 搜索条 ---------- */
.search { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search input[type=text] {
    padding: 7px 10px; border: 1px solid #cfc6b8; border-radius: 4px;
    width: 220px; font-size: 14px;
}

/* ---------- 状态徽章 ---------- */
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    border: 1px solid;
}
.badge.published { background: #e8f6ec; border-color: #a8dbb5; color: #1f6b34; }
.badge.draft     { background: #fff7e0; border-color: #ecd499; color: #7a5a10; }
.badge.pending   { background: #eef4fb; border-color: #b6cdea; color: #1f4571; }
.badge.rejected  { background: #fdecec; border-color: #efb0b0; color: #8c2020; }
.badge.admin     { background: #f1e7fa; border-color: #cbb3e5; color: #55277d; }

/* ---------- 成员详情 ---------- */
.detail-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.detail-head .photo {
    width: 130px; height: 160px; object-fit: cover;
    border: 1px solid #d9d2c6; border-radius: 4px; background: #fff;
}
.detail-head .photo-none {
    width: 130px; height: 160px; border: 1px dashed #cfc6b8; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: #a9a29a; font-size: 13px; background: #fff;
}
.detail-head h2 { margin: 0 0 6px; border: none; padding: 0; }
.detail-head .sub { color: #7d6a55; font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; align-items: center; }
.inline-form { display: inline; }

/* ---------- 世系图 ---------- */
ul.tree, ul.tree ul { list-style: none; margin: 0; padding-left: 20px; }
ul.tree { padding-left: 0; }
ul.tree li { margin: 4px 0; }
ul.tree details > summary {
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e3ded4;
    display: inline-block;
    min-width: 260px;
}
ul.tree details > summary:hover { background: #f4ece1; }
ul.tree .leaf { display: inline-block; padding: 3px 6px 3px 24px; }
ul.tree .meta { color: #8d8d8d; font-size: 12px; margin-left: 6px; }
ul.tree .cnt { color: #a58b6a; font-size: 12px; margin-left: 6px; }

/* ---------- 其它 ---------- */
.empty { color: #8d8d8d; padding: 20px; text-align: center; background: #fff;
         border: 1px dashed #ddd6ca; border-radius: 6px; }
.count { color: #8d8d8d; font-weight: normal; font-size: 13px; }
.muted { color: #8d8d8d; font-size: 13px; }
.pre-wrap { white-space: pre-wrap; }
.stack > * + * { margin-top: 10px; }
