* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #333;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.site-header {
    background: #2c3e50;
    padding: 14px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.site-header .logo {
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #c9d6e2;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #fff;
}

/* 主体 */
main.container {
    flex: 1;
    padding-top: 48px;
    padding-bottom: 48px;
}

.page-title {
    font-size: 28px;
    margin-bottom: 28px;
    padding-left: 12px;
    border-left: 4px solid #4a90d9;
}

/* 主页大图（约 1/3 屏高） */
.hero-photo {
    position: relative;
    height: 33vh;
    min-height: 260px;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.hero-placeholder {
    background: linear-gradient(135deg, #4a90d9, #7b5cd6);
}

.hero-mask {
    width: 100%;
    padding: 30px 36px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    color: #fff;
}

.hero-mask h1 {
    font-size: 30px;
}

.hero-nickname {
    opacity: 0.85;
    margin: 4px 0 12px;
}

.hero-info {
    list-style: none;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.hero-info li {
    font-size: 15px;
}

.hero-info li span {
    opacity: 0.7;
    margin-right: 8px;
    font-size: 13px;
}

.hero-bio {
    font-size: 14px;
    opacity: 0.85;
}

/* 主页跳转卡片 */
.page-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 40px;
}

.page-card {
    position: relative;
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 24px 20px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.page-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.page-card h3 {
    font-size: 19px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.page-card p {
    color: #888;
    font-size: 14px;
}

.lock-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 12px;
    color: #b8860b;
    background: #fdf3d7;
    border-radius: 4px;
    padding: 2px 8px;
}

/* 首页卡片行：小尺寸、一行排开不换行，窄屏可横向滑动 */
.page-cards-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 28px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.page-cards-row .page-card {
    flex: 1 1 0;
    min-width: 132px;
    padding: 14px 12px;
}

.page-cards-row .page-card h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.page-cards-row .page-card p {
    font-size: 12px;
    color: #999;
}

.page-cards-row .lock-tag {
    position: static;
    float: right;
    font-size: 10px;
    padding: 1px 6px;
    margin: 1px 0 4px 6px;
}

/* 主页「关于我」板块卡片：每个板块独自占一排 */
.skill-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.skill-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.skill-card h3 {
    color: #2c3e50;
    margin-bottom: 14px;
    font-size: 19px;
}

.skill-card p {
    color: #555;
    font-size: 15px;
    line-height: 1.9;
}

.about-me {
    margin-top: 26px;
}

/* 教育经历时间线 */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #d7e3f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4a90d9;
    border: 3px solid #dce9f7;
}

.timeline-content {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.timeline-content h3 {
    font-size: 17px;
    color: #2c3e50;
    margin-bottom: 6px;
}

.timeline-stage {
    color: #888;
    font-size: 14px;
}

.timeline-desc {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
    margin-top: 8px;
}

/* 空状态（工作经历 / 家庭关系） */
.empty-state {
    text-align: center;
    background: #fff;
    border-radius: 10px;
    padding: 60px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.empty-state p {
    font-size: 18px;
    color: #555;
}

.empty-state .empty-sub {
    margin-top: 10px;
    font-size: 14px;
    color: #999;
}

/* 密码验证框 */
.unlock-box {
    max-width: 400px;
    margin: 40px auto;
    background: #fff;
    border-radius: 10px;
    padding: 36px 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.unlock-box h2 {
    margin-bottom: 8px;
}

.unlock-tip {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
}

.form-error {
    color: #d9534f;
    font-size: 14px;
    margin-bottom: 14px;
}

.unlock-box input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid #d9dee4;
    border-radius: 6px;
    outline: none;
    margin-bottom: 16px;
}

.unlock-box input[type="password"]:focus {
    border-color: #4a90d9;
}

.unlock-box button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    color: #fff;
    background: #4a90d9;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.unlock-box button:hover {
    background: #3a7bc0;
}

/* 页脚 */
.site-footer {
    background: #2c3e50;
    color: #9fb2c3;
    text-align: center;
    padding: 16px 0;
    font-size: 14px;
}

.site-footer a {
    color: #9fb2c3;
    text-decoration: none;
}

.site-footer a:hover {
    color: #ffffff;
}

.beian {
    margin-top: 6px;
    font-size: 13px;
}

/* ========== 族谱树 ========== */
.tree-toolbar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #e6ecf3;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.05);
}

.tool-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tree-toolbar button,
.admin-login {
    padding: 7px 14px;
    border: 1px solid #cdd6e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #37485c;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tree-toolbar button:hover,
.admin-login:hover {
    background: #eef4fb;
    border-color: #4f8fdd;
    color: #2f6cb3;
}

.admin-badge {
    font-size: 12px;
    color: #1d7a3d;
    background: #e2f5e8;
    padding: 5px 12px;
    border-radius: 4px;
}

#tree-wrap {
    height: 68vh;
    min-height: 420px;
    background: #fbfcfe;
    background-image: radial-gradient(#dde5ef 1px, transparent 1px);
    background-size: 22px 22px;
    border: 1px solid #e1e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.05);
    overflow: hidden;
}

#tree-svg {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#tree-svg.grabbing {
    cursor: grabbing;
}

.tree-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #8a97a5;
    text-align: center;
}

/* 族谱 SVG 元素 */
.link {
    stroke: #aab8c9;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.spouse-link {
    stroke: #e08bb0;
    stroke-width: 2;
}

.person-card {
    cursor: pointer;
}

.person-card rect {
    filter: url(#card-shadow);
}

.person-card.male rect {
    fill: #e3f0ff;
    stroke: #4f8fdd;
    stroke-width: 1.5;
}

.person-card.female rect {
    fill: #ffe9f2;
    stroke: #e06fa0;
    stroke-width: 1.5;
}

.person-card:hover rect {
    stroke-width: 3;
}

.pname {
    font-size: 15px;
    font-weight: bold;
    fill: #2c3e50;
    pointer-events: none;
}

.pdates {
    font-size: 11px;
    fill: #8a97a5;
    pointer-events: none;
}

.empty-tip {
    font-size: 15px;
    fill: #8a97a5;
}

/* 弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-mask.hidden {
    display: none;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 26px 28px;
    width: 430px;
    max-width: 92vw;
    max-height: 86vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 14px;
    border: none;
    background: none;
    font-size: 26px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal h3 {
    margin-bottom: 16px;
    color: #2c3e50;
}

.info-row {
    padding: 9px 0;
    border-bottom: 1px dashed #eee;
    color: #444;
    font-size: 15px;
}

.info-row span {
    display: inline-block;
    width: 76px;
    color: #999;
    font-size: 13px;
}

.modal-tip {
    margin-top: 14px;
    font-size: 13px;
    color: #999;
}

.form-row {
    margin-bottom: 12px;
}

.form-row label {
    display: block;
    font-size: 13px;
    color: #777;
    margin-bottom: 5px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #d9dee4;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: #4a90d9;
}

.modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.modal-actions button {
    padding: 9px 16px;
    border: 1px solid #cdd6e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #37485c;
}

.modal-actions button:hover {
    background: #f0f5fa;
}

.modal-actions button.primary {
    background: #4a90d9;
    border-color: #4a90d9;
    color: #fff;
}

.modal-actions button.primary:hover {
    background: #3a7bc0;
}

.modal-actions button.danger {
    background: #fff;
    border-color: #e3a1a1;
    color: #c0392b;
}

.modal-actions button.danger:hover {
    background: #fdecec;
}

/* 提示条 */
#toast {
    position: fixed;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 200;
}

#toast.show {
    opacity: 0.95;
}

/* 通用隐藏 / 复选框行 */
.hidden {
    display: none;
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: auto;
}

/* ========== 主页：文章 + 留言 ========== */
.home-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    margin-top: 30px;
}

@media (max-width: 860px) {
    .home-columns {
        grid-template-columns: 1fr;
    }
}

.section-title {
    font-size: 20px;
    margin-bottom: 14px;
    padding-left: 10px;
    border-left: 4px solid #4a90d9;
}

.article-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.article-card h3 {
    font-size: 17px;
    color: #2c3e50;
    margin-bottom: 6px;
}

.article-card p {
    color: #777;
    font-size: 14px;
    margin-bottom: 8px;
}

.article-date {
    font-size: 12px;
    color: #aaa;
}

/* 留言板 */
.msg-form {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.msg-form input,
.msg-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d9dee4;
    border-radius: 6px;
    margin-bottom: 10px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    resize: vertical;
}

.msg-form input:focus,
.msg-form textarea:focus {
    border-color: #4a90d9;
}

.msg-form button {
    width: 100%;
    padding: 10px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}

.msg-form button:hover {
    background: #3a7bc0;
}

.msg-item {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.msg-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.msg-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.msg-date {
    font-size: 12px;
    color: #aaa;
    flex: 1;
}

.msg-del {
    border: none;
    background: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.msg-content {
    font-size: 14px;
    color: #555;
}

.empty-line {
    color: #999;
    font-size: 14px;
    padding: 8px 2px;
}

/* ========== 文章详情 ========== */
.post-detail {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 36px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.post-detail h1 {
    font-size: 26px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.post-date {
    color: #999;
    font-size: 13px;
    margin-bottom: 20px;
}

.post-content {
    line-height: 1.9;
    color: #444;
}

.back-link {
    display: inline-block;
    margin-top: 26px;
    color: #4a90d9;
    text-decoration: none;
}

/* ========== 家庭关系入口页 ========== */
.family-intro {
    color: #666;
    margin-bottom: 20px;
}

.family-card {
    min-height: 120px;
}

/* ========== 照片墙 ========== */
.photo-tabs .tab {
    padding: 7px 14px;
    border: 1px solid #cdd6e0;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
    color: #37485c;
    text-decoration: none;
}

.photo-tabs .tab:hover {
    background: #f0f5fa;
}

.photo-tabs .tab.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: #fff;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.photo-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.photo-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.25s;
}

.photo-thumb:hover {
    transform: scale(1.03);
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
}

.photo-title {
    font-size: 14px;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-cat {
    flex-shrink: 0;
    font-size: 12px;
    color: #4a90d9;
    background: #e8f2ff;
    border-radius: 4px;
    padding: 2px 8px;
}

.photo-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
}

.photo-actions form {
    margin: 0;
}

.photo-actions button {
    padding: 5px 12px;
    font-size: 13px;
    border: 1px solid #cdd6e0;
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    color: #37485c;
}

.photo-actions button:hover {
    background: #f0f5fa;
}

.photo-actions .btn-del {
    color: #c0392b;
    border-color: #e3a1a1;
}

.photo-actions .btn-del:hover {
    background: #fdecec;
}

/* 大图预览 */
.lightbox-body {
    position: relative;
    max-width: 88vw;
}

.lightbox-body img {
    max-width: 88vw;
    max-height: 80vh;
    border-radius: 8px;
    display: block;
}

.lightbox-body .modal-close {
    color: #fff;
    top: -36px;
    right: 0;
    font-size: 30px;
}

#lightbox-caption {
    color: #eee;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

/* 操作结果提示（留言验证码、上传校验等） */
.flash-messages {
    margin-bottom: 12px;
}

.flash {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    background: #e8f2ff;
    color: #2c5d8f;
}

.flash.error {
    background: #fdecec;
    color: #c0392b;
}

.flash.success {
    background: #e2f5e8;
    color: #1d7a3d;
}

/* 留言验证码 */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.captcha-row label {
    flex-shrink: 0;
    font-size: 14px;
    color: #777;
}

.captcha-row input {
    margin-bottom: 0;
}

/* ========== 小组件 ========== */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    max-width: 820px;
}

.widget-btn {
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 34px 24px 26px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.08);
    border: 1px solid #e9eef4;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.widget-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(44, 62, 80, 0.14);
    border-color: #4f8fdd;
}

.widget-symbol {
    display: inline-block;
    font-size: 20px;
    font-weight: bold;
    color: #4f8fdd;
    background: #e3f0ff;
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 14px;
    letter-spacing: 2px;
}

.widget-btn h3 {
    font-size: 19px;
    color: #2c3e50;
    margin-bottom: 6px;
}

.widget-btn p {
    font-size: 13px;
    color: #999;
}

/* ========== 计算器 ========== */
.calc-wrap {
    width: 320px;
    max-width: 92vw;
    margin: 10px auto 0;
    background: #2c3e50;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.25);
}

.calc-display {
    background: #1c2833;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    text-align: right;
    overflow: hidden;
}

.calc-expr {
    min-height: 20px;
    font-size: 14px;
    color: #7f8c9b;
    word-break: break-all;
}

.calc-current {
    font-size: 34px;
    font-weight: bold;
    color: #fff;
    line-height: 1.3;
    word-break: break-all;
}

.calc-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-keys button {
    padding: 16px 0;
    font-size: 20px;
    border: none;
    border-radius: 10px;
    background: #3d5266;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}

.calc-keys button:hover {
    background: #4a637c;
}

.calc-keys button:active {
    transform: scale(0.96);
}

.calc-keys .key-func {
    background: #54687d;
}

.calc-keys .key-func:hover {
    background: #637b93;
}

.calc-keys .key-op {
    background: #4f8fdd;
}

.calc-keys .key-op:hover {
    background: #3f7dc8;
}

.calc-keys .key-eq {
    grid-row: span 2;
    background: #e06fa0;
    font-size: 24px;
}

.calc-keys .key-eq:hover {
    background: #ce5c8e;
}

.calc-keys .key-zero {
    grid-column: span 2;
}

/* ========== 日期计算器 ========== */
.datecalc-wrap {
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    padding: 28px 30px;
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.08);
}

.datecalc-tip {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.datecalc-tip code {
    background: #f0f5fa;
    border-radius: 4px;
    padding: 1px 6px;
    color: #2f6cb3;
}

.datecalc-form {
    margin-top: 18px;
}

.datecalc-field {
    margin-bottom: 14px;
}

.datecalc-field label {
    display: block;
    font-size: 13px;
    color: #777;
    margin-bottom: 5px;
}

.datecalc-field input {
    width: 100%;
    padding: 11px 14px;
    font-size: 16px;
    border: 1px solid #d9dee4;
    border-radius: 8px;
    outline: none;
    letter-spacing: 1px;
}

.datecalc-field input:focus {
    border-color: #4f8fdd;
}

#btn-calc {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background: #4f8fdd;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

#btn-calc:hover {
    background: #3f7dc8;
}

.datecalc-result {
    margin-top: 20px;
    padding: 16px;
    background: #e3f0ff;
    border-radius: 10px;
    font-size: 16px;
    color: #2c3e50;
    text-align: center;
}

.days-num {
    font-size: 26px;
    font-weight: bold;
    color: #2f6cb3;
    padding: 0 4px;
}

.days-sub {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #7f8c9b;
}

.datecalc-err {
    margin-top: 20px;
    padding: 12px 16px;
    background: #fdecec;
    border-radius: 10px;
    font-size: 14px;
    color: #c0392b;
}

/* ========== 导航栏管理员入口（仅首页显示） ========== */
.nav-admin a {
    color: #9fb2c3;
    border: 1px solid #4a5a6a;
    border-radius: 5px;
    padding: 3px 10px;
    font-size: 13px;
}

.nav-admin a:hover {
    color: #fff;
    border-color: #9fb2c3;
}

/* ========== 记账 ========== */
.expense-unlock {
    max-width: 380px;
    margin: 40px auto;
    background: #fff;
    border-radius: 14px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.08);
}

.expense-unlock p {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.expense-unlock form {
    display: flex;
    gap: 10px;
}

.expense-unlock input {
    flex: 1;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d9dee4;
    border-radius: 8px;
    outline: none;
}

.expense-unlock input:focus {
    border-color: #4f8fdd;
}

.expense-unlock button {
    padding: 10px 22px;
    background: #4f8fdd;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
}

.expense-unlock button:hover {
    background: #3f7dc8;
}

.expense-err {
    margin-top: 12px;
    color: #c0392b;
    font-size: 14px;
}

.expense-panel {
    background: #fff;
    border-radius: 14px;
    padding: 22px 26px;
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.08);
}

.expense-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef1f5;
    margin-bottom: 16px;
}

.expense-today {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.expense-identity {
    font-size: 14px;
    color: #777;
    display: flex;
    align-items: center;
    gap: 10px;
}

.expense-identity b {
    color: #2f6cb3;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-btn {
    border: none;
    background: none;
    color: #4f8fdd;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
}

.expense-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.expense-form .expense-user,
.expense-form .expense-amount {
    width: 130px;
}

.expense-form input,
.expense-form select {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d9dee4;
    border-radius: 8px;
    outline: none;
}

.expense-form input:focus,
.expense-form select:focus {
    border-color: #4f8fdd;
}

.expense-form .purpose-input {
    flex: 1;
    min-width: 180px;
}

.purpose-hint {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.purpose-hint b {
    color: #4f8fdd;
}

/* 记账表单里的内联下拉标签（记账人/付款人、共同消费开关） */
.shared-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.expense-form .expense-shared {
    width: 62px;
}

/* 打卡表单：项目复选框组 */
.checkin-items {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #37485c;
}

.checkin-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
}

.checkin-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4f8fdd;
    cursor: pointer;
}

.expense-form .note-input {
    flex: 1;
    min-width: 180px;
}

.expense-submit {
    padding: 10px 24px;
    background: #4f8fdd;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
}

.expense-submit:hover {
    background: #3f7dc8;
}

.expense-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.expense-table th,
.expense-table td {
    border: 1px solid #e6ecf3;
    padding: 9px 10px;
    text-align: center;
}

.expense-table thead th {
    background: #f0f5fa;
    color: #37485c;
    font-weight: bold;
}

.expense-table td.amt {
    color: #c0392b;
    font-weight: bold;
}

.expense-table .purpose-cell {
    position: relative;
}

/* 各记账人分组之间用粗线分隔，便于区分 */
.expense-table .grp {
    border-left: 3px solid #8ea6c1;
}

.cell-ops {
    margin-left: 8px;
    white-space: nowrap;
}

.cell-ops button {
    padding: 2px 8px;
    font-size: 12px;
    border: 1px solid #cdd6e0;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #37485c;
}

.cell-ops button:hover {
    background: #f0f5fa;
}

.cell-ops .rec-del {
    color: #c0392b;
    border-color: #e3a1a1;
}

.cell-ops .rec-del:hover {
    background: #fdecec;
}

.expense-cancel {
    padding: 10px 18px;
    background: #fff;
    color: #666;
    border: 1px solid #cdd6e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.expense-cancel:hover {
    background: #f0f5fa;
}

/* 本月消费统计：三个记账人并列 */
.month-stats {
    margin-bottom: 18px;
}

.month-stats-title {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

.month-stats-cards {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 140px;
    background: #f0f5fa;
    border: 1px solid #dbe6f2;
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-name {
    color: #37485c;
    font-weight: bold;
}

.stat-amount {
    color: #c0392b;
    font-weight: bold;
    font-size: 17px;
}

/* 统计卡片里的本月总额：次于今日总额显示 */
.stat-month {
    color: #b08080;
    font-size: 13px;
    font-weight: normal;
}

/* 全部记录分页栏：页码在左，统计信息在右下角 */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.page-links a,
.page-current {
    display: inline-block;
    padding: 5px 11px;
    margin-right: 4px;
    border: 1px solid #dbe6f2;
    border-radius: 6px;
    color: #4a90d9;
    background: #fff;
    font-size: 14px;
}

.page-links a:hover {
    background: #f0f5fa;
}

.page-current {
    color: #fff;
    background: #4a90d9;
    border-color: #4a90d9;
}

.page-info {
    color: #888;
    font-size: 13px;
}

.expense-date {
    padding: 10px 12px;
    border: 1px solid #cdd6e0;
    border-radius: 8px;
    font-size: 15px;
}

.month-export input {
    padding: 8px 10px;
    border: 1px solid #cdd6e0;
    border-radius: 8px;
    font-size: 14px;
}

.month-export button {
    margin-left: 8px;
}

.expense-admin-bar {
    margin-top: 18px;
    text-align: right;
}
