body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* ========== 顶部导航栏样式 ========== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.user-welcome {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    color: #b3001b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-text {
    color: #fff;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.welcome-text strong {
    font-weight: 600;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ========== 后台管理导航按钮样式 ========== */
.admin-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e94560, #0f3460);
    border: 1px solid rgba(233, 69, 96, 0.5);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

.admin-nav-btn:hover {
    background: linear-gradient(135deg, #ff6b8a, #1a4a7a);
    border-color: rgba(233, 69, 96, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.admin-nav-btn svg {
    opacity: 0.95;
}

/* ========== 账户下拉菜单样式 ========== */
.account-dropdown {
    position: relative;
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.account-btn .icon {
    opacity: 0.9;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.account-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    display: none;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1001;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    display: block;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item svg {
    color: #666;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.logout-item {
    color: #b3001b;
}

.logout-item:hover {
    background-color: #fff5f5;
}

.logout-item svg {
    color: #b3001b;
}

h1 {
    text-align: center;
    color: #333;
    margin-top: 20px;
}

/* ========== 功能卡片网格样式 ========== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 30px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 992px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 140px;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(179, 0, 27, 0.15);
    border-color: rgba(179, 0, 27, 0.2);
}

.feature-card:active {
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #b3001b 0%, #d71191 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    text-align: center;
}

.feature-desc {
    font-size: 12px;
    color: #888;
    text-align: center;
    line-height: 1.4;
}

/* ========== 管理员卡片样式 ========== */
.feature-card.admin-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #e94560;
}

.feature-card.admin-card .feature-icon {
    background: linear-gradient(135deg, #e94560, #0f3460);
}

.feature-card.admin-card .feature-title {
    color: #fff;
}

.feature-card.admin-card .feature-desc {
    color: #aaa;
}

.feature-card.admin-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(233, 69, 96, 0.3);
    border-color: #e94560;
}

/* ========== 知识管理弹窗样式 ========== */
.knowledge-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.knowledge-modal-content {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.knowledge-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #333;
}

.knowledge-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
}

.knowledge-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.knowledge-modal-close:hover {
    color: #e94560;
}

.knowledge-modal-body {
    padding: 20px 24px 24px;
}

.knowledge-upload-zone {
    border: 2px dashed #444;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.knowledge-upload-zone:hover,
.knowledge-upload-zone.dragover {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.05);
}

.knowledge-upload-zone p {
    color: #aaa;
    margin: 8px 0 0;
    font-size: 14px;
}

.knowledge-upload-hint {
    font-size: 12px !important;
    color: #666 !important;
}

#knowledge-upload-progress {
    margin-bottom: 16px;
}

.knowledge-progress-bar {
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.knowledge-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e94560, #0f3460);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

#knowledge-upload-status {
    color: #aaa;
    font-size: 13px;
}

.knowledge-doc-list h4 {
    color: #ccc;
    font-size: 14px;
    margin: 16px 0 10px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.knowledge-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.knowledge-doc-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.knowledge-doc-info strong {
    color: #fff;
    font-size: 14px;
}

.knowledge-doc-info span {
    color: #888;
    font-size: 12px;
}

.knowledge-doc-time {
    color: #666 !important;
}

.knowledge-doc-delete {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.knowledge-doc-delete:hover {
    color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

.knowledge-loading,
.knowledge-empty {
    color: #666;
    font-size: 13px;
    text-align: center;
    padding: 16px 0;
}

/* ========== 波动选项面板样式 ========== */
.fluctuation-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin: 0 auto 20px;
    max-width: 500px;
}

.fluctuation-options label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.fluctuation-options select {
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    min-width: 140px;
}

.fluctuation-options select:focus {
    outline: none;
    border-color: #b3001b;
}

.fluctuation-confirm-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fluctuation-confirm-btn:hover {
    background: linear-gradient(135deg, #d71191 0%, #b3001b 100%);
    transform: translateY(-1px);
}

/* 旧按钮容器样式保留以兼容 */
.button-container {
    text-align: center;
    margin-top: 20px;
}

.button-container a {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    font-size: 18px;
    background-color: #b3001b;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
}

.button-container a:hover {
    background-color: #d71191;
}

.content {
    margin: 20px auto;
    padding: 25px 40px;
    background-color: #fff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 1120px;
}

select {
    padding: 5px;
    font-size: 16px;
}

#person-select {
    padding: 10px;
    font-size: 16px;
    width: 200px;                           /* 设置一个适当的宽度 */
    margin: 0 auto;                         /* 居中 */
    border: 1px solid #ccc;                 /* 添加边框 */
    border-radius: 5px;                     /* 圆角边框 */
}

#person-select-container {
    text-align: center;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 15px 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    max-width: 1120px;
}

#friend-search-input {
    padding: 10px;
    font-size: 16px;
    width: 200px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#friend-search-input:focus {
    outline: none;
    border-color: #b3001b;
    box-shadow: 0 0 5px rgba(179, 0, 27, 0.3);
}

#friend-search-input::placeholder {
    color: #999;
    font-size: 14px;
}

#person-select {
    padding: 10px;
    font-size: 16px;
    width: 210px;                            /* 设置一个适当的宽度 */
    border: 1px solid #ccc;                  /* 添加边框 */
    border-radius: 5px;                      /* 圆角边框 */
}

.text-normal {
    font-size: 17px;
}

/* 将内容容器居中 */
#page-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#page-content > p {
    font-size: 12px;
    color: #666;
}

#loading-message {
    display: none;
    position: absolute;
    top: 21%;                                  /* 调整此值以满足你的需求 */
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

.right-aligned {
    float: right;
    width: 100px;
    display: inline-block;
}

#chart-container {
    text-align: center;
    height: 400px;                             /* 设置容器的高度 */
}

.tooltip {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 5px;
    font-size: 12px;
    display: none;                             /* 初始隐藏 */
}

/* ========== 位置信息区域样式 ========== */
.location-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 20px auto;
    padding: 20px 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-width: 1120px;
}

/* 定位信息显示 */
.location-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    min-width: 200px;
}

.location-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #b3001b, #d71191);
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
}

.location-icon svg {
    width: 18px;
    height: 18px;
}

.location-text {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.location-text.no-location {
    color: #999;
    font-style: italic;
}

/* 刷新定位按钮样式 */
.refresh-location {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 4px;
    border-radius: 50%;
    background: rgba(179, 0, 27, 0.1);
    color: #b3001b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-location:hover {
    background: rgba(179, 0, 27, 0.2);
    transform: rotate(15deg);
}

.refresh-location svg {
    display: block;
}

.location-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-display:has(.location-text.no-location) {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffdf5 0%, #fff 100%);
}

.location-display:has(.location-text.no-location) .location-icon {
    background: linear-gradient(135deg, #ffc107, #ff9800);
}

/* 城市选择器 */
.city-selector {
    width: 100%;
}

.city-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.city-select {
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z" fill="%23666"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.city-select:hover {
    border-color: #b3001b;
}

.city-select:focus {
    outline: none;
    border-color: #b3001b;
    box-shadow: 0 0 0 3px rgba(179, 0, 27, 0.1);
}

.city-input {
    padding: 10px 14px;
    font-size: 14px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    min-width: 160px;
    transition: all 0.2s ease;
}

.city-input:focus {
    outline: none;
    border-color: #b3001b;
    box-shadow: 0 0 0 3px rgba(179, 0, 27, 0.1);
}

.city-submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.city-submit-btn:hover {
    background: linear-gradient(135deg, #d71191 0%, #b3001b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(179, 0, 27, 0.3);
}

.city-submit-btn svg {
    opacity: 0.9;
}

#ip-container,
#local-time-container {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

#fluctuation-select {
    padding: 10px 30px 10px 15px;
    margin-left: 10px;                         /* 添加一些左边距，和按钮间隔开 */
    font-size: 14px;                           /* 字体大小与按钮一致 */
    background-color: #b3001b;                 /* 按钮的背景颜色 */
    color: #fff;                               /* 字体颜色 */
    border: none;                              /* 移除边框 */
    border-radius: 8px;                        /* 圆角边框 */
    -webkit-appearance: none;                  /* 移除iOS下的默认样式 */
    -moz-appearance: none;                     /* 移除Firefox下的默认样式 */
    appearance: none;                          /* 标准属性，移除默认下拉箭头 */
    cursor: pointer;                           /* 鼠标悬停时显示手指指针，更像按钮 */
    min-width: 100px;                          /* 最小宽度，确保足够空间显示文本和箭头 */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z" fill="%23ffffff"/></svg>'); /* 使用SVG箭头 */
    background-repeat: no-repeat;
    background-position: right 10px center;    /* 调整箭头位置 */
    background-size: 12px;                     /* 调整箭头大小 */
}

#fluctuation-select:hover {
    background-color: #d71191;                 /* 悬停时的背景颜色 */
}

#manual-location-form-container {
    display: flex;
    justify-content: center;                   /* This will center the contents horizontally */
    align-items: center;                       /* This will center the contents vertically (if needed) */
    margin-top: 20px;                          /* Add some top margin for spacing */
}

#manual-location-form {
    display: flex;
    flex-direction: row;                      /* This ensures that the children of the form are in a row */
    gap: 10px;                                /* This adds some space between your select box and button */
}

#city-select, #city-input, button {
    height: 35px;                             /* Ensuring consistent height */
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0 10px;                          /* Some padding inside the elements */
}

button {
    cursor: pointer;                          /* Changes the mouse cursor to a pointer on hover over the button */
    background-color: #b3001b;
    color: white;
    border: none;                             /* Removes the default border */
}

button:hover {
    background-color: #d71191;                /* A lighter shade for hover effect */
}

ul {
    list-style-type: none;                    /* 去除列表的项目符号 */
    padding: 0;                               /* 去除内边距 */
}

li {
    display: flex;                            /* 启用 flexbox */
    justify-content: flex-end;                /* 子项向右对齐 */
    align-items: center;                      /* 中心对齐子项 */
    margin-bottom: 10px;                      /* 添加点底部外边距 */
}

li span {
    margin-left: 10px;                        /* 在span元素之间添加一些空间 */
    min-width: 100px;                         /* 设置最小宽度，保持列宽一致 */
    text-align: right;                        /* 右对齐文本 */
}

.highlighted {
    font-weight: bold;                        /* 加粗突出显示 */
    color: red;                               /* 可选的: 更改颜色来增加可见度 */
}

/* ========== 朋友闲时表格样式 ========== */
.leisure-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.leisure-table thead {
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
}

.leisure-table th {
    padding: 10px 8px;
    text-align: center;
    font-weight: 500;
}

.leisure-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.leisure-table tbody tr:hover {
    background: #fff5f5;
}

.leisure-table tbody tr.highlighted {
    background: #fff0f0;
    color: #b3001b;
}

.leisure-table .positive-boost {
    color: #2e7d32;
    font-weight: 500;
}

/* ========== 底部备案号样式 ========== */
.footer {
    text-align: center;
    font-size: 13px;
    color: #999;
    padding: 30px 20px;
    margin-top: 40px;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.02) 100%);
    border-top: 1px solid #eee;
}

.footer a {
    color: #b3001b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #d71191;
    text-decoration: underline;
}

.popup-form {
    display: flex;
    justify-content: center;     /* 水平居中 */
    margin-top: 20px;
}

.form-wrapper {
    display: flex;
    justify-content: center;     /* 保证 wrapper 自身居中 */
    width: 100%;
}

#update-birthtime-form {
    display: flex;
    flex-direction: row;         /* 水平排列 */
    align-items: center;
    justify-content: center;     /* 水平居中 */
    gap: 15px;
    padding: 12px 20px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 8px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

#update-birthtime-form .form-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

#update-birthtime-form button {
    white-space: nowrap; /* 防止按钮内容被折行 */
}

/* ========== 进度条美化样式 ========== */
#progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    padding: 25px 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 1120px;
}

#progressBar {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: #e9ecef;
    -webkit-appearance: none;
    appearance: none;
}

#progressBar::-webkit-progress-bar {
    background: #e9ecef;
    border-radius: 6px;
}

#progressBar::-webkit-progress-value {
    background: linear-gradient(90deg, #b3001b 0%, #d71191 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

#progressBar::-moz-progress-bar {
    background: linear-gradient(90deg, #b3001b 0%, #d71191 100%);
    border-radius: 6px;
}

#progressLabel {
    margin-top: 12px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

#progressHistory {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    width: 100%;
    max-height: 100px;
    overflow-y: auto;
}

#progressHistory div {
    padding: 3px 0;
    border-bottom: 1px solid #eee;
}

#progressHistory div:last-child {
    border-bottom: none;
}

/* 过去运势分析进度条样式 */
.past-fortune-progress {
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.past-fortune-progress .progress-bar-container {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.past-fortune-progress .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b3001b 0%, #d71191 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.past-fortune-progress .progress-message {
    font-size: 15px;
    color: #555;
    font-weight: 500;
}

/* 朋友一览搜索框样式 */
.friends-search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

#friends-search {
    padding: 10px 15px;
    width: 280px;
    font-size: 15px;
    border: 2px solid #b3001b;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#friends-search:focus {
    border-color: #d71191;
    box-shadow: 0 0 5px rgba(215, 17, 145, 0.3);
}

#friends-search::placeholder {
    color: #999;
}

#search-btn, #reset-btn {
    padding: 10px 20px;
    font-size: 15px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#search-btn {
    background-color: #b3001b;
    color: white;
}

#search-btn:hover {
    background-color: #d71191;
}

#reset-btn {
    background-color: #666;
    color: white;
}

#reset-btn:hover {
    background-color: #888;
}

/* ========== 训练样本管理表格样式 ========== */
.training-cases-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.training-cases-container h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #b3001b;
}

#training-cases-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

#training-cases-table thead {
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
}

#training-cases-table th {
    padding: 14px 16px;
    text-align: left;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#training-cases-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 14px;
}

#training-cases-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

#training-cases-table tbody tr:hover {
    background-color: #fff5f5;
}

#training-cases-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格内按钮样式 */
#training-cases-table .btn-edit,
#training-cases-table .btn-delete {
    padding: 6px 14px;
    margin-right: 6px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#training-cases-table .btn-edit {
    background-color: #4CAF50;
    color: white;
}

#training-cases-table .btn-edit:hover {
    background-color: #45a049;
}

#training-cases-table .btn-delete {
    background-color: #f44336;
    color: white;
}

#training-cases-table .btn-delete:hover {
    background-color: #da190b;
}

/* 标签样式 */
.label-positive {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: #e8f5e9;
    color: #2e7d32;
}

.label-negative {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: #ffebee;
    color: #c62828;
}

/* ========== 分页样式 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a {
    background-color: #fff;
    color: #b3001b;
    border: 1px solid #ddd;
}

.pagination a:hover {
    background-color: #b3001b;
    color: #fff;
    border-color: #b3001b;
}

.pagination span {
    color: #666;
}

.pagination span strong {
    display: inline-block;
    padding: 8px 14px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
}

/* 每页显示选择器 */
.per-page-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.per-page-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

.per-page-selector select:hover {
    border-color: #b3001b;
}

.per-page-selector select:focus {
    outline: none;
    border-color: #b3001b;
    box-shadow: 0 0 5px rgba(179, 0, 27, 0.2);
}

/* ========== 编辑训练样本页面样式 ========== */
.edit-case-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.edit-case-container h2 {
    color: #333;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #b3001b;
    font-size: 20px;
}

.edit-case-form .form-group {
    margin-bottom: 20px;
}

.edit-case-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.edit-case-form input[type="text"],
.edit-case-form input[type="number"],
.edit-case-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.edit-case-form input:focus,
.edit-case-form textarea:focus {
    outline: none;
    border-color: #b3001b;
    box-shadow: 0 0 5px rgba(179, 0, 27, 0.2);
}

.edit-case-form textarea {
    min-height: 100px;
    resize: vertical;
}

.edit-case-form .btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edit-case-form .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(179, 0, 27, 0.3);
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #b3001b;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #d71191;
    text-decoration: underline;
}

/* ========== 自定义确认弹窗样式 ========== */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.confirm-modal-overlay.show {
    display: flex;
}

.confirm-modal {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.confirm-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #b3001b 0%, #d71191 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-icon svg {
    width: 30px;
    height: 30px;
    color: #fff;
}

.confirm-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.confirm-modal-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.confirm-modal-btn {
    padding: 6px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.confirm-modal-btn.cancel {
    background: #f0f0f0;
    color: #666;
}

.confirm-modal-btn.cancel:hover {
    background: #e0e0e0;
}

.confirm-modal-btn.confirm {
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
}

.confirm-modal-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(179, 0, 27, 0.3);
}

/* ========== 朋友管理页面样式 ========== */
.friend-management-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.friend-management-container h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #b3001b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-management-actions {
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(179, 0, 27, 0.3);
}

/* 添加朋友面板 */
.add-friend-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: #333;
}

/* 标签页样式 */
.add-friend-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn:hover {
    color: #b3001b;
}

.tab-btn.active {
    color: #b3001b;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #b3001b;
}

.btn-search {
    padding: 10px 20px;
    background: #b3001b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search:hover {
    background: #8b0015;
}

/* 搜索结果样式 */
.search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item:hover {
    background: #f9f9f9;
}

.user-item.is-friend {
    background: #f5fff5;
}

.user-name {
    font-size: 14px;
    color: #333;
}

.friend-badge {
    font-size: 12px;
    color: #4CAF50;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 12px;
}

.btn-add {
    padding: 6px 14px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add:hover {
    background: #45a049;
}

/* 新增朋友表单样式 */
.create-friend-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #b3001b;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary {
    padding: 10px 24px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(179, 0, 27, 0.3);
}

.btn-secondary {
    padding: 10px 24px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* 朋友列表区域 */
.friend-lists-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .friend-lists-wrapper {
        grid-template-columns: 1fr;
    }
}

.friend-list-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
}

.section-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h3 svg {
    opacity: 0.9;
}

.friend-count {
    font-size: 13px;
    opacity: 0.9;
}

.list-filter-box {
    padding: 10px 15px;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}

.list-filter-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.list-filter-box input:focus {
    border-color: #b3001b;
}

.list-filter-box input::placeholder {
    color: #999;
}

.friend-list {
    max-height: 350px;
    overflow-y: auto;
}

.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.friend-item:last-child {
    border-bottom: none;
}

.friend-item:hover {
    background: #fff5f5;
}

.friend-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.btn-remove {
    padding: 5px 12px;
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-remove:hover {
    background: #da190b;
}

.friend-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add-important {
    padding: 5px 12px;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-important:hover {
    background: #e68900;
}

.btn-remove-important {
    padding: 5px 12px;
    background: #9e9e9e;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-remove-important:hover {
    background: #757575;
}

.important-badge {
    padding: 4px 10px;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    border-radius: 5px;
    font-size: 12px;
}

.btn-view-detail {
    padding: 5px 12px;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-view-detail:hover {
    background: #1565c0;
}

.friend-detail-content {
    text-align: left;
    padding: 15px 0;
}

.friend-detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.friend-detail-row:last-child {
    border-bottom: none;
}

.friend-detail-row .detail-label {
    color: #666;
    min-width: 80px;
    flex-shrink: 0;
}

.dayun-table {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.dayun-item {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
}

.no-dayun {
    color: #999;
    font-size: 13px;
}

.friend-edit-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.friend-edit-input:focus {
    outline: none;
    border-color: #1976d2;
}

.confirm-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}


.section-actions {
    padding: 8px 20px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 36px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.section-actions-placeholder {
    visibility: hidden;
    min-height: 36px;
    padding: 8px 20px;
    box-sizing: border-box;
}

.btn-batch-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-batch-add:hover {
    background: #e68900;
}

.btn-batch-add-placeholder {
    visibility: hidden;
}

.empty-list {
    padding: 30px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.loading {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* 提示信息 */
.friend-management-tips {
    background: #fffdf5;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 15px 20px;
}

.friend-management-tips p {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 14px;
}

.friend-management-tips ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.friend-management-tips li {
    display: list-item;
    justify-content: flex-start;
    color: #856404;
    font-size: 13px;
    margin-bottom: 5px;
    text-align: left;
}

/* ========== 约会兼容性分析 ========== */

/* 候选人选择面板 */
.dating-candidate-panel {
    max-width: 600px;
    margin: 16px auto;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dating-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.dating-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.dating-date-range label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}

.dating-date-input {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    flex: 1;
    min-width: 140px;
}

.dating-date-input:focus {
    outline: none;
    border-color: #b3001b;
    box-shadow: 0 0 0 2px rgba(179, 0, 27, 0.1);
}

.dating-date-sep {
    font-size: 13px;
    color: #999;
}

.dating-clear-dates-btn {
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
}

.dating-clear-dates-btn:hover {
    background: #eee;
    color: #555;
}

#dating-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

#dating-search-input:focus {
    outline: none;
    border-color: #b3001b;
    box-shadow: 0 0 0 2px rgba(179, 0, 27, 0.1);
}

.dating-candidate-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 4px;
}

.dating-candidate-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s;
}

.dating-candidate-item:hover {
    background: #f5f5f5;
}

.dating-candidate-item.selected {
    background: #fff0f0;
    color: #b3001b;
    font-weight: 500;
}

.dating-candidate-item input[type="checkbox"] {
    accent-color: #b3001b;
}

.dating-panel-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

#dating-selected-count {
    font-size: 13px;
    color: #888;
}

.dating-analyze-btn {
    padding: 8px 24px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dating-analyze-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dating-analyze-btn:not(:disabled):hover {
    opacity: 0.9;
}

/* 分析结果 */
.dating-analysis-container {
    max-width: 900px;
    margin: 0 auto;
}

.dating-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dating-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.dating-modify-btn {
    padding: 6px 16px;
    background: #fff;
    color: #b3001b;
    border: 1.5px solid #b3001b;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.dating-modify-btn:hover {
    background: #b3001b;
    color: #fff;
}

.dating-range-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.dating-subtitle {
    font-size: 15px;
    font-weight: 600;
    color: #555;
    margin: 24px 0 12px 0;
    padding-left: 8px;
    border-left: 3px solid #b3001b;
}

/* 排名卡片 */
.dating-ranking-cards {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
}

.dating-rank-card {
    flex: 1;
    min-width: 160px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-align: center;
    border: 2px solid transparent;
    transition: transform 0.15s;
}

.dating-rank-card:hover {
    transform: translateY(-2px);
}

.dating-rank-card.gold {
    border-color: #ffd700;
    background: linear-gradient(180deg, #fffdf0 0%, #fff 100%);
}

.dating-rank-card.silver {
    border-color: #c0c0c0;
    background: linear-gradient(180deg, #f8f8f8 0%, #fff 100%);
}

.dating-rank-card.bronze {
    border-color: #cd7f32;
    background: linear-gradient(180deg, #fdf5ee 0%, #fff 100%);
}

.rank-medal {
    font-size: 28px;
    margin-bottom: 4px;
}

.rank-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.rank-score {
    font-size: 28px;
    font-weight: 800;
    color: #b3001b;
    margin-bottom: 8px;
}

.score-unit {
    font-size: 13px;
    font-weight: 400;
    color: #999;
    margin-left: 2px;
}

.rank-highlights {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.highlight-item {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
}

/* 对比表格 */
.dating-table-wrapper {
    overflow-x: auto;
}

.dating-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.dating-compare-table th {
    background: #b3001b;
    color: #fff;
    padding: 10px 12px;
    font-weight: 600;
    text-align: center;
}

.dating-compare-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.dating-compare-table .metric-label {
    text-align: left;
    font-weight: 500;
    color: #555;
    background: #fafafa;
    white-space: nowrap;
}

.dating-compare-table .highlight-row td {
    background: #fff8f0;
    font-weight: 700;
    font-size: 14px;
}

.dating-compare-table .best-value {
    color: #b3001b;
    font-weight: 700;
}

/* 加成时段详情（可展开） */
.dating-detail-section {
    margin-bottom: 8px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.15s;
}

.detail-header:hover {
    background: #f0f0f0;
}

.detail-toggle-icon {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}

.dating-detail-section.expanded .detail-toggle-icon {
    transform: rotate(90deg);
}

.detail-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.detail-summary {
    font-size: 12px;
    color: #888;
    margin-left: auto;
}

.detail-body {
    display: none;
    padding: 8px;
}

.dating-detail-section.expanded .detail-body {
    display: block;
}

.dating-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dating-detail-table th {
    background: #f5f5f5;
    padding: 6px 10px;
    font-weight: 600;
    color: #555;
    text-align: center;
}

.dating-detail-table td {
    padding: 5px 10px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.dating-detail-table .mutual-row {
    background: #f0fff0;
}

.dating-detail-table .positive-boost {
    color: #2e8b57;
    font-weight: 600;
}

.dating-detail-table .negative-boost {
    color: #999;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .dating-ranking-cards {
        flex-direction: column;
    }

    .dating-rank-card {
        min-width: auto;
    }

    .dating-compare-table {
        font-size: 12px;
    }

    .dating-compare-table th,
    .dating-compare-table td {
        padding: 6px 8px;
    }
}

/* ========== 流年分析面板样式 ========== */
.liunian-options {
    padding: 15px 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin: 0 auto 20px;
    max-width: 600px;
}

.liunian-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.liunian-mode-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.liunian-mode-btn {
    padding: 10px 24px;
    font-size: 14px;
    border: none;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.liunian-mode-btn.active {
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
}

.liunian-friend-select {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.liunian-friend-select label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.liunian-friend-select input {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 180px;
}

.liunian-friend-select select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-width: 140px;
}

.liunian-friend-select input:focus,
.liunian-friend-select select:focus {
    outline: none;
    border-color: #b3001b;
}

.liunian-year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.liunian-year-selector label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.liunian-year-selector input {
    width: 90px;
    padding: 8px 10px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.liunian-year-selector input:focus {
    outline: none;
    border-color: #b3001b;
}

.liunian-year-nav {
    width: 36px;
    height: 36px;
    border: 2px solid #b3001b;
    border-radius: 50%;
    background: #fff;
    color: #b3001b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.liunian-year-nav:hover {
    background: #b3001b;
    color: #fff;
}

.liunian-year-nav svg {
    display: block;
}

.liunian-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.liunian-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
}

.liunian-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #b3001b;
    cursor: pointer;
}

.liunian-analyze-btn {
    padding: 10px 32px;
    font-size: 15px;
    background: linear-gradient(135deg, #b3001b 0%, #8b0015 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.liunian-analyze-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(179, 0, 27, 0.3);
}

.liunian-save-btn {
    padding: 12px 32px;
    font-size: 15px;
    background: linear-gradient(135deg, #8b5a2b 0%, #6b4423 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto;
}

.liunian-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 90, 43, 0.3);
}

.bazi-gan {
    color: #b3001b;
    font-weight: 600;
    letter-spacing: 2px;
}

.bazi-zhi {
    color: #2c3e50;
    font-weight: 600;
    letter-spacing: 2px;
}

/* ========== 流年分析结果样式 ========== */
.liunian-result {
    max-width: 900px;
    margin: 0 auto;
}

.liunian-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.liunian-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.liunian-overall-badge {
    padding: 6px 18px;
    border-radius: 20px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.liunian-summary {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 3px solid #b3001b;
}

.liunian-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.liunian-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
}

.liunian-card-wide {
    grid-column: 1 / -1;
}

.liunian-card h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #b3001b;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.liunian-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px dashed #f5f5f5;
}

.liunian-info-row span {
    color: #888;
}

.liunian-info-row strong {
    color: #333;
}

.liunian-he-section {
    margin-top: 10px;
}

.liunian-he-note {
    font-size: 13px;
    color: #e67e22;
    padding: 4px 0;
}

.liunian-dayun-coop {
    font-size: 13px;
    color: #555;
    margin: 8px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.liunian-dayun-years {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.liunian-dayun-year {
    font-size: 12px;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
}

.liunian-dayun-year.current {
    background: #b3001b;
    color: #fff;
    font-weight: 600;
}

.liunian-section {
    margin-bottom: 20px;
}

.liunian-section h3 {
    font-size: 16px;
    color: #333;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #b3001b;
}

.liunian-interpretation {
    line-height: 1.8;
    color: #444;
}

.liunian-interpretation p {
    text-align: justify;
    margin: 0 0 8px 0;
}

.liunian-interpretation p:empty {
    margin: 0;
}

.liunian-relations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.liunian-relation-badge {
    display: inline-block;
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid;
    border-radius: 6px;
    background: #fff;
    line-height: 1.4;
}

.liunian-relation-badge small {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-top: 2px;
}

.liunian-dims {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.liunian-dim-item {
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.liunian-dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.liunian-dim-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.liunian-dim-score {
    font-size: 18px;
    font-weight: 700;
}

.liunian-score-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.liunian-score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.liunian-notes {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.liunian-note {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.liunian-suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.liunian-suggestions li {
    padding: 10px 14px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    color: #444;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border-left: 3px solid #b3001b;
    line-height: 1.5;
}

/* ========== 神煞与贵人样式 ========== */
.liunian-shensha-group {
    margin-bottom: 16px;
}

.liunian-shensha-group h4 {
    font-size: 14px;
    color: #666;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.liunian-shensha-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.liunian-shensha-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 160px;
    flex: 1 1 200px;
    max-width: 300px;
}

.liunian-shensha-item.liunian-active {
    border-color: #b3001b;
    background: #fef5f5;
}

.liunian-shensha-item.guiren {
    border-color: #d4a017;
    background: #fffdf5;
}

.liunian-shensha-item.guiren.liunian-active {
    border-color: #c0392b;
    background: #fef5f5;
}

.shensha-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: inline-block;
    margin-right: 8px;
}

.shensha-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f0f0;
    color: #888;
}

.liunian-shensha-item.liunian-active .shensha-status,
.liunian-shensha-item.guiren.liunian-active .shensha-status {
    background: #b3001b;
    color: #fff;
}

.shensha-desc {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    line-height: 1.4;
}

.liunian-shensha-clashes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.liunian-clash-note {
    font-size: 13px;
    color: #555;
    padding: 8px 12px;
    background: #fff;
    border-left: 3px solid #e67e22;
    border-radius: 4px;
    line-height: 1.5;
}

.clash-type {
    font-weight: 600;
    margin-right: 6px;
}

.liunian-natal-shens {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.liunian-natal-shen {
    font-size: 13px;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
    border: 1px solid #e0e0e0;
}

/* 流年分析移动端适配 */
@media (max-width: 640px) {
    .liunian-grid {
        grid-template-columns: 1fr;
    }

    .liunian-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .liunian-friend-select {
        flex-direction: column;
    }

    .liunian-friend-select input,
    .liunian-friend-select select {
        width: 100%;
    }
}

/* ========== 语言切换器样式 ========== */
.language-switcher {
    position: relative;
    display: inline-block;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-btn svg {
    flex-shrink: 0;
}

.lang-btn .dropdown-arrow {
    transition: transform 0.2s ease;
}

.lang-current {
    min-width: 60px;
    text-align: center;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
    overflow: hidden;
    pointer-events: none;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lang-option:hover {
    background: #f5f5f5;
    color: #b3001b;
}

.lang-option.active {
    background: linear-gradient(135deg, #fff5f7 0%, #fff0f3 100%);
    color: #b3001b;
    font-weight: 500;
}

.lang-option.active::before {
    content: '✓';
    margin-right: 8px;
    font-weight: 600;
}

/* 登录页语言切换器特殊样式 */
.login-lang-switcher {
    /* 移除margin-left: auto; 避免覆盖输入框 */
}

.login-lang-switcher .lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 主页语言切换器样式 */
.home-lang-switcher .lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    font-size: 13px;
}

.home-lang-switcher .lang-current {
    min-width: 50px;
}

/* 响应式适配 */
@media (max-width: 600px) {
    .language-switcher {
        order: -1;
    }

    .lang-btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    .lang-current {
        display: none;
    }

    .lang-dropdown {
        right: auto;
        left: 0;
    }
}

/* ========== 移动端字体适配（放在文件末尾确保优先级） ========== */

/* 错误信息样式 */
.error-message {
    font-size: 14px !important;
    color: #b3001b;
    text-align: center;
    padding: 20px;
    white-space: normal !important;
    word-break: keep-all;
}

@media (max-width: 768px) {
    .error-message {
        font-size: 13px !important;
        padding: 15px;
    }

    #page-content > p {
        font-size: 12px !important;
        line-height: 1.5;
        white-space: normal;
    }

    #progressLabel {
        font-size: 11px !important;
    }

    #progress-container {
        padding: 18px 25px;
    }

    .content {
        padding: 15px 20px;
    }

    .feature-title {
        font-size: 14px;
    }

    .feature-desc {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .error-message {
        font-size: 12px !important;
        padding: 12px;
    }

    #page-content > p {
        font-size: 11px !important;
        line-height: 1.4;
        white-space: normal;
    }

    #progressLabel {
        font-size: 10px !important;
    }

    .content {
        padding: 12px 15px;
    }

    #progress-container {
        padding: 12px 15px;
    }

    .feature-title {
        font-size: 13px;
    }

    .feature-desc {
        font-size: 10px;
    }

    .welcome-text {
        font-size: 13px;
    }
}