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;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-archive-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    margin-left: 22px;
    padding: 0 13px 0 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 0 8px 8px 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.header-archive-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.header-archive-link svg {
    flex: 0 0 auto;
}

.mobile-archive-item {
    display: none;
}

.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;
    min-width: 0;
    flex: 0 1 auto;
}

/* 移动端导航栏适配 */
@media (max-width: 600px) {
    .top-header {
        padding: 8px 12px;
    }
    .header-right {
        gap: 8px;
    }
    .account-btn {
        padding: 6px 10px;
        gap: 4px;
        font-size: 0;
    }
    .account-btn > span {
        display: none;
    }
    .account-btn > svg:first-of-type {
        width: 20px;
        height: 20px;
    }
    .account-btn .dropdown-arrow {
        width: 14px;
        height: 14px;
    }
    .admin-nav-btn {
        padding: 6px 10px;
        font-size: 0;
        gap: 0;
    }
    .admin-nav-btn span {
        display: none;
    }
    .header-archive-link {
        display: none;
    }
    .dropdown-item.mobile-archive-item {
        display: flex;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 6px 10px;
    }
    .welcome-text {
        font-size: 12px;
    }
    .avatar-placeholder {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
}

/* ========== 后台管理导航按钮样式 ========== */
.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;
    min-width: 0;
}

.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;
    max-width: 100%;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

[hidden] {
    display: none !important;
}

.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;
}

/* ========== 功能卡片网格样式 ========== */
.home-quick-start {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1120px;
    margin: 20px auto 0;
    padding: 22px 26px;
    border: 1px solid #ead4d8;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff8f9 0%, #fff 68%);
    box-shadow: 0 5px 18px rgba(70, 25, 35, 0.06);
}

.home-quick-start h2 { margin: 4px 0 6px; color: #3d2529; font-size: 20px; }
.home-quick-start p { margin: 0; color: #706065; font-size: 13px; line-height: 1.6; }
.home-quick-start-kicker { color: #9c1630; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.home-quick-start button { flex: 0 0 auto; min-height: 44px; padding: 0 22px; border-radius: 999px; font-weight: 700; }

.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(3, 1fr);
        gap: 12px;
        padding: 15px;
    }
}

@media (max-width: 600px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }
}

@media (max-width: 340px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* 移动端卡片样式优化 */
@media (max-width: 768px) {
    .feature-card {
        padding: 18px 15px;
        min-height: 120px;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .feature-icon svg {
        width: 24px;
        height: 24px;
    }

    .feature-title {
        font-size: 14px;
    }

    .feature-desc {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .feature-card {
        padding: 15px 12px;
        min-height: 110px;
    }

    .feature-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 10px;
    }

    .feature-icon svg {
        width: 22px;
        height: 22px;
    }

    .feature-title {
        font-size: 13px;
    }

    .feature-desc {
        font-size: 10px;
    }
}

.feature-card {
    position: relative;
    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-group-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 6px 0 -6px;
    padding-top: 6px;
    border-top: 1px solid #eee6e8;
}

.feature-group-heading:first-child { border-top: 0; padding-top: 0; }
.feature-group-heading h2 { margin: 0; color: #42373a; font-size: 17px; }
.feature-group-heading p { margin: 0; color: #83777b; font-size: 12px; }

.feature-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f4e6e9;
    color: #8b0015;
    font-size: 10px;
    font-weight: 700;
}

.feature-badge-primary { background: #8b0015; color: #fff; }
.feature-badge-muted { background: #eef0f3; color: #5f6670; }

.feature-empty-state {
    display: grid;
    justify-items: start;
    gap: 8px;
    margin: 18px auto;
    max-width: 640px;
    padding: 22px;
    border: 1px solid #e2d7d9;
    border-radius: 12px;
    background: #fff;
    color: #665b5e;
}

.feature-empty-state strong { color: #392e31; }
.feature-empty-state a { display:inline-flex; padding:8px 14px; border-radius:8px; background:#8b0015; color:#fff; text-decoration:none; }
.feature-empty-state-actions {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* 基础卡片规则位于响应式规则之后，必须在此重新收口移动端尺寸。 */
@media (max-width: 768px) {
    .feature-card {
        padding: 16px 12px;
        min-height: 116px;
    }

    .feature-icon {
        width: 46px;
        height: 46px;
        margin-bottom: 10px;
    }

    .feature-title { font-size: 14px; }
    .feature-desc { font-size: 11px; }
}

@media (max-width: 600px) {
    .home-quick-start { align-items: stretch; margin: 12px; padding: 16px; gap: 14px; flex-direction: column; }
    .home-quick-start h2 { font-size: 17px; }
    .home-quick-start button { width: 100%; }
    .feature-group-heading { display:block; margin-top:10px; }
    .feature-group-heading h2 { font-size:15px; }
    .feature-group-heading p { margin-top:3px; font-size:11px; }

    .feature-card {
        padding: 12px 8px;
        min-height: 102px;
        border-radius: 12px;
    }

    .feature-icon {
        width: 38px;
        height: 38px;
        margin-bottom: 8px;
    }

    .feature-icon svg { width: 20px; height: 20px; }
    .feature-title { font-size: 13px; }
    .feature-desc { font-size: 10px; }
}

/* ========== 管理员卡片样式 ========== */
.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;
    flex-direction: column;
    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: 680px;
}

.fluctuation-options-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    text-align: left;
}

.fluctuation-options-copy strong {
    color: #2b2b2b;
    font-size: 16px;
}

.fluctuation-options-copy span,
.fluctuation-status {
    color: #666;
    font-size: 13px;
}

.fluctuation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.fluctuation-status {
    min-height: 18px;
    width: 100%;
    text-align: center;
}

.fluctuation-controls label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.fluctuation-controls select {
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    min-width: 140px;
}

.fluctuation-controls select:focus {
    outline: none;
    border-color: #b3001b;
}

.fluctuation-confirm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    line-height: 1;
    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);
}

/* 旧按钮容器样式保留以兼容 */



.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: left;
    margin: 20px auto;
    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;                      /* 圆角边框 */
}

#friend-search-input,
#person-select {
    width: 222px;
    height: 40px;
    margin: 0;
    box-sizing: border-box;
}

.fluctuation-confirm-btn:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

.feature-controls-heading {
    margin-bottom: 12px;
    text-align: center;
}

.feature-controls-heading h2 {
    margin: 0 0 4px;
    color: #2b2b2b;
    font-size: 18px;
}

.feature-controls-heading p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.friend-availability-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    #person-select-container {
        margin: 16px 12px;
        padding: 18px;
    }

    .friend-availability-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #friend-search-input,
    #person-select {
        width: 100%;
        height: 44px;
        margin: 0;
    }
}

.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%);
    z-index: 9999;
}

.right-aligned {
    float: right;
    width: 100px;
    display: inline-block;
}

#chart-container {
    text-align: center;
    min-height: 0;
}

#chart {
    width: min(100%, 880px);
    margin: 18px auto;
}

.chart-loading,
#chart > .error-message,
#chart > .empty-state {
    padding: 32px 16px;
    text-align: center;
}

.chart-loading {
    min-height: 180px;
}

#fluctuation-options,
#location-section,
#liunian-options,
#past-fortune-options,
#bazi-panel,
#person-select-container,
#update-birthtime-form-container,
#dating-candidate-container,
#page-content {
    scroll-margin-top: 88px;
}

@media (max-width: 600px) {
    #fluctuation-options,
    #location-section,
    #liunian-options,
    #past-fortune-options,
    #bazi-panel,
    #person-select-container,
    #update-birthtime-form-container,
    #dating-candidate-container,
    #page-content {
        scroll-margin-top: 70px;
    }
}

.trend-chart-shell,
.availability-results,
.leisure-all-details,
.trend-data-details {
    width: 100%;
    box-sizing: border-box;
}

.trend-chart-shell,
.availability-results {
    padding: 20px;
    border: 1px solid #eadde0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(66, 23, 31, 0.07);
}

.trend-chart-heading,
.availability-results-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
}

.trend-chart-heading h2,
.availability-results-heading h2 {
    margin: 0 0 4px;
    color: #2b2b2b;
    font-size: 20px;
}

.trend-chart-heading p,
.availability-results-heading p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.55;
}

.trend-point-count,
.availability-count {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff1f3;
    color: #9a0017;
    font-size: 12px;
    font-weight: 700;
}

.trend-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 10px;
}

.trend-summary-grid > div {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 3px 8px;
    padding: 11px 12px;
    border-radius: 10px;
    background: #faf7f7;
    text-align: left;
}

.trend-summary-grid span,
.trend-summary-grid small {
    color: #6b6264;
    font-size: 11px;
}

.trend-summary-grid strong {
    color: #8b0015;
    font-size: 19px;
}

.trend-summary-grid small {
    grid-column: 1 / -1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trend-init-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 34px 18px;
    border: 1px solid #eadfe1;
    border-radius: 12px;
    background: #fffafa;
    color: #5f5557;
    text-align: center;
}

.trend-init-state p {
    margin: 0;
    line-height: 1.6;
}

.trend-init-state progress {
    width: min(360px, 100%);
    height: 12px;
    accent-color: #a40018;
}

.trend-chart-scroll {
    width: 100%;
    overflow-x: auto;
}

.trend-chart {
    display: block;
    width: 100%;
    min-width: 320px;
    height: auto;
    border-radius: 10px;
    outline: none;
    touch-action: pan-y;
}

.trend-chart:focus-visible {
    box-shadow: 0 0 0 3px rgba(179, 0, 27, 0.2);
}

.trend-grid-line {
    stroke: #ede7e8;
    stroke-width: 1;
}

.trend-axis-line {
    stroke: #93888a;
    stroke-width: 1.2;
}

.trend-axis-label {
    fill: #665f60;
    font-size: 12px;
}

.trend-y-label {
    text-anchor: end;
}

.trend-line {
    fill: none;
    stroke: #b3001b;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.trend-hit-area {
    fill: transparent;
    cursor: crosshair;
}

.trend-cursor-line {
    stroke: #d86b7b;
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
    pointer-events: none;
}

.trend-cursor-point {
    fill: #fff;
    stroke: #b3001b;
    stroke-width: 3;
    pointer-events: none;
}

.trend-chart-readout {
    display: flex;
    justify-content: center;
    gap: 14px;
    min-height: 24px;
    margin-top: 4px;
    color: #5a5253;
    font-size: 13px;
}

.trend-chart-readout strong {
    color: #8b0015;
}

.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;                               /* 可选的: 更改颜色来增加可见度 */
}

/* ========== 朋友闲时表格样式 ========== */
.next-boost-finder {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #f0d6da;
    border-radius: 10px;
    background: linear-gradient(135deg, #fffafa 0%, #fff 100%);
}

.next-boost-heading h3 {
    margin: 0 0 5px;
    color: #8b0015;
    font-size: 17px;
}

.next-boost-heading p {
    margin: 0 0 14px;
    color: #777;
    font-size: 13px;
}

.next-boost-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.next-boost-controls label {
    color: #555;
    font-size: 14px;
}

.next-boost-controls input,
.next-boost-controls select {
    height: 36px;
    padding: 0 9px;
    border: 1px solid #d8c5c8;
    border-radius: 6px;
    background: #fff;
    color: #333;
}

.next-boost-controls input {
    width: 92px;
}

.next-boost-controls button {
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: #9f0018;
    color: #fff;
    cursor: pointer;
}

.next-boost-controls button:disabled {
    opacity: .6;
    cursor: wait;
}

.next-boost-result {
    display: none;
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 7px;
    font-size: 14px;
    line-height: 1.6;
}

.next-boost-result.loading,
.next-boost-result.found,
.next-boost-result.empty,
.next-boost-result.error {
    display: flex;
    flex-direction: column;
}

.next-boost-result.loading {
    background: #f7f7f7;
    color: #666;
}

.next-boost-result.found {
    border-left: 4px solid #2e7d32;
    background: #f1f8f2;
    color: #245d28;
}

.next-boost-result.empty {
    background: #fff8e8;
    color: #7a5b15;
}

.next-boost-result.error {
    background: #fff0f0;
    color: #a00018;
}

@media (max-width: 600px) {
    .next-boost-controls {
        align-items: stretch;
    }

    .next-boost-controls label {
        width: 100%;
    }

    .next-boost-controls input,
    .next-boost-controls select,
    .next-boost-controls button {
        flex: 1 1 100%;
        width: 100%;
    }
}

.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;
}

/* ========== 朋友一览概览卡片 ========== */
.friends-overview-section {
    width: 100%;
    box-sizing: border-box;
    /* Prevent Android text autosizing from enlarging only long text blocks. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.friends-overview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.friends-overview-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #a00018;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
}

.friends-overview-header h2 {
    margin: 0;
    color: #272022;
    font-size: 24px;
}

.friends-overview-header p {
    max-width: 760px;
    margin: 7px 0 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.friends-overview-header > a {
    flex: 0 0 auto;
    padding: 9px 14px;
    border: 1px solid #b3001b;
    border-radius: 8px;
    color: #9d0018;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.friends-overview-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .friends-overview-cards {
        gap: 6px;
    }

    .friends-overview-card {
        padding: 8px 4px;
    }

    .overview-num {
        font-size: 17px;
    }

    .overview-label {
        font-size: 10px;
    }
}

.friends-overview-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.friends-overview-card.positive .overview-num {
    color: #2e7d32;
}

.friends-overview-card.best .overview-num {
    color: #b3001b;
}

.overview-num {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.friends-overview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-overview-item {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(104px, max-content);
    align-items: center;
    column-gap: 14px;
    row-gap: 8px;
    padding: 10px 14px;
    border: 1px solid #e5dfe1;
    border-radius: 9px;
    background: #fff;
}

.friend-overview-item-main {
    display: contents;
}

.friend-overview-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
    overflow: hidden;
}

.friend-overview-item-header h3 {
    margin: 0;
    color: #262021;
    font-size: 15px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-score-badge {
    flex: 0 0 auto;
    max-width: 150px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.friend-score-badge.pending {
    color: #775a12;
    background: #fff4ce;
}

.friend-primary-score {
    grid-column: 3;
    grid-row: 1;
    min-width: 104px;
    margin: 0;
    text-align: right;
}

.friend-primary-score dt {
    color: #777;
    font-size: 11px;
    line-height: 1.35;
}

.friend-primary-score dd {
    margin: 2px 0 0;
    color: #4f494b;
    font-size: 20px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.friend-primary-score dd.positive {
    color: #25602d;
}

.friend-primary-score dd.negative {
    color: #9d0018;
}

.friend-primary-score dd.neutral {
    color: #5f595b;
}

.friend-score-status {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 8px 0 0;
    color: #545052;
    font-size: 12px;
    line-height: 1.5;
}

.friend-overview-details {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0;
    justify-self: end;
}

.friend-overview-details > summary {
    display: block;
    max-width: 100%;
    padding: 6px 8px;
    overflow: hidden;
    border-radius: 999px;
    color: #8b0015;
    background: #faf7f8;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.friend-overview-details[open] {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #eee;
    justify-self: stretch;
}

.friend-overview-details[open] > summary {
    display: inline-block;
}

.friend-score-reference-note {
    margin: 8px 0 0;
    color: #6d5a24;
    font-size: 12px;
    line-height: 1.5;
}

.friend-overview-item > .friend-case-details {
    grid-column: 1 / -1;
    width: 100%;
}

.friend-score-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 0;
}

.friend-score-grid > div {
    min-width: 0;
    padding: 9px;
    border-radius: 8px;
    background: #faf7f8;
}

.friend-score-grid dt {
    color: #777;
    font-size: 11px;
    line-height: 1.4;
}

.friend-score-grid dd {
    margin: 4px 0 0;
    color: #2f292b;
    font-size: 15px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .friends-overview-header {
        display: block;
    }

    .friends-overview-header > a {
        display: inline-flex;
        margin-top: 12px;
    }

}

@media (max-width: 480px) {
    .friends-overview-header h2 {
        font-size: 21px;
    }

    .friend-overview-item {
        grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(96px, max-content);
        column-gap: 9px;
        padding: 9px 12px;
    }

    .friend-overview-item-header {
        grid-column: 1;
        grid-row: 1;
        overflow: hidden;
    }

    .friend-overview-item-header h3 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .friend-primary-score {
        min-width: 96px;
    }

    .friend-primary-score dt {
        white-space: nowrap;
        word-break: keep-all;
    }

    .friend-primary-score dd {
        margin-top: 1px;
        font-size: 19px;
    }

    .friend-score-badge {
        display: inline-flex;
        max-width: none;
    }

    .friend-overview-details {
        grid-row: 1;
        align-self: center;
    }

    .friend-overview-details > summary {
        padding: 5px 7px;
    }

    .friend-overview-details[open] {
        grid-row: 2;
        padding-top: 7px;
    }

    .friend-score-status {
        grid-row: 2;
        margin-top: 0;
    }

    .friend-score-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .friend-score-grid > div {
        padding: 8px 6px;
    }

    .friend-score-grid dt {
        font-size: 10px;
    }

    .friend-score-grid dd {
        font-size: 14px;
    }
}

/* ========== 未来日程（吉时）样式 ========== */
.good-moments-summary {
    background: #fff;
    border-left: 4px solid #b3001b;
    border-radius: 5px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #444;
    font-size: 14px;
}

.good-moments-day {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
}

.good-moments-day-header {
    padding: 10px 14px;
    font-weight: 600;
    color: #333;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.good-moments-day-count {
    font-size: 12px;
    font-weight: normal;
    color: #999;
}

.good-moments-table {
    margin: 0;
}

.good-moments-bar {
    position: relative;
    background: #f0f0f0;
    border-radius: 8px;
    height: 16px;
    min-width: 90px;
    overflow: hidden;
}

.good-moments-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s;
}

.good-moments-bar span {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    line-height: 16px;
    color: #333;
}

/* ========== 底部备案号样式 ========== */
.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;
    margin: 0;
}

.friends-score-policy-notice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid #e7c97a;
    border-radius: 10px;
    background: #fff9e8;
    color: #66521f;
    font-size: 13px;
    line-height: 1.55;
}

.friends-score-policy-notice a {
    margin-left: auto;
    color: #8b0014;
    font-weight: 700;
}

.pending-friends-details {
    flex: 1 0 100%;
    min-width: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(119, 90, 18, 0.18);
}

.pending-friends-details > summary {
    width: fit-content;
    color: #7b0013;
    font-weight: 700;
    cursor: pointer;
}

.pending-friends-details > p {
    margin: 5px 0 0;
    color: #796b49;
    font-size: 12px;
}

.pending-friends-name-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 7px;
    margin-top: 9px;
}

.pending-friend-entry {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex: 0 0 calc((100% - 14px) / 3);
    min-width: 250px;
    overflow: hidden;
    border: 1px solid #dccb98;
    border-radius: 10px;
    background: #fff;
}

.pending-friends-group + .pending-friends-group {
    margin-top: 12px;
}

.pending-friends-group > h4 {
    margin: 9px 0 0;
    color: #66521f;
    font-size: 12px;
    font-weight: 700;
}

.pending-friend-filter {
    display: grid;
    grid-template-columns: minmax(max-content, auto) minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 36px;
    padding: 4px 11px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #5f4c19;
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.pending-friend-tie-metrics {
    display: grid;
    gap: 3px;
    padding: 6px 10px 8px;
    border-top: 1px solid #eee2bf;
    background: #fffcf3;
}

.pending-friend-candidate-metric {
    display: grid;
    grid-template-columns: minmax(34px, max-content) minmax(0, 1fr);
    gap: 8px;
    color: #665d45;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.pending-friend-candidate-metric strong {
    color: #5f4c19;
}

.pending-friend-name {
    font-weight: 700;
}

.pending-friend-case-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 1.4em;
    color: #796b49;
    font-size: 11px;
    line-height: 1.4;
    text-align: right;
}

.pending-friend-period-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 7px;
    align-items: center;
    padding: 7px 10px 9px;
    border-top: 1px solid #eee2bf;
    background: #fffaf0;
}

.pending-friend-period-control label {
    grid-column: 1 / -1;
    color: #66521f;
    font-size: 11px;
    font-weight: 700;
}

.pending-friend-period-control select,
.pending-friend-period-control button {
    min-height: 30px;
    border: 1px solid #d8c388;
    border-radius: 7px;
    background: #fff;
    color: #5f4c19;
    font-size: 11px;
}

.pending-friend-period-control select {
    min-width: 0;
    padding: 4px 6px;
}

.pending-friend-period-control button {
    padding: 4px 8px;
    cursor: pointer;
}

.pending-friend-period-control button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.pending-friend-custom-candidates {
    grid-column: 1 / -1;
    min-width: 0;
    border-top: 1px dashed #e4d4a7;
    padding-top: 5px;
}

.pending-friend-custom-candidates summary {
    color: #6b5318;
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.pending-friend-candidate-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin: 7px 0;
}

.pending-friend-candidate-options label {
    grid-column: auto;
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    font-weight: 400;
    white-space: nowrap;
}

.pending-friend-candidate-options input {
    margin: 0;
}

.pending-friend-custom-candidates p {
    margin: 0 0 7px;
    color: #7b6a42;
    font-size: 10px;
    line-height: 1.45;
}

@media (max-width: 480px) {
    .pending-friend-candidate-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.pending-friend-filter:hover,
.pending-friend-filter:focus-visible {
    border-color: #a00018;
    outline: none;
    background: #fff2f4;
    color: #8b0015;
}

.pending-friend-filter:hover .pending-friend-case-status,
.pending-friend-filter:focus-visible .pending-friend-case-status {
    color: inherit;
}

.friend-score-status > p {
    margin: 0;
}

.friend-tied-metrics {
    display: grid;
    gap: 5px;
    margin-top: 8px;
    padding: 9px 10px;
    border: 1px solid #ead9a8;
    border-radius: 8px;
    background: #fffbef;
    font-variant-numeric: tabular-nums;
}

.friend-tied-metrics-hint {
    margin: 0 0 2px;
    color: #796b49;
}

.friend-tied-metric-row {
    display: grid;
    grid-template-columns: minmax(36px, max-content) minmax(0, 1fr);
    gap: 9px;
}

.friend-tied-metric-row strong {
    color: #6f0011;
}

.friend-case-details {
    min-width: 0;
    margin-top: 8px;
    border-top: 1px solid #eee;
}

.friend-case-details > summary {
    padding: 8px 0 1px;
    color: #8b0015;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
}

.pending-friend-case-details {
    margin-top: auto;
    padding: 0 10px 8px;
    border-top-color: #eee2bf;
    background: #fff;
}

.pending-friend-case-details > summary {
    color: #6b5318;
    font-size: 11px;
}

.friend-case-details-body {
    max-height: 440px;
    margin-top: 7px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.friend-case-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.friend-case-item {
    display: block;
    min-width: 0;
    padding: 10px;
    border: 1px solid #e8dfe1;
    border-radius: 8px;
    background: #fcfafb;
    color: #4e4749;
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 0;
}

.friend-case-item span {
    min-width: 0;
    margin-left: 0;
    text-align: inherit;
}

.friend-case-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-variant-numeric: tabular-nums;
}

.friend-case-header > strong {
    color: #332d2f;
    font-size: 12px;
}

.friend-case-model-state {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.friend-case-model-state.included {
    color: #2f6735;
    background: #e8f5e9;
}

.friend-case-model-state.pending {
    color: #765d1f;
    background: #fff1c7;
}

.friend-case-relation {
    margin: 5px 0 0;
    color: #5a1b25;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.friend-case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 3px;
    color: #746d6f;
}

.friend-case-requirements {
    display: grid;
    gap: 4px;
    margin: 7px 0 0;
    padding: 0;
    list-style: none;
}

.friend-case-requirements > li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 7px;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 0;
}

.friend-case-result {
    flex: 0 0 auto;
}

.friend-case-result.pass {
    color: #2f6d38;
}

.friend-case-result.fail {
    color: #9d0018;
}

.friend-case-result.unknown {
    color: #777;
}

.friend-case-note {
    margin: 7px 0 0;
    padding-top: 7px;
    border-top: 1px dashed #e1dadd;
    color: #61595b;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.friend-case-edit {
    display: inline-flex;
    margin-top: 7px;
    color: #8b0015;
    font-weight: 700;
    text-decoration: none;
}

.friend-case-edit:hover,
.friend-case-edit:focus-visible {
    text-decoration: underline;
}

.friend-case-empty,
.friend-case-truncated {
    margin: 0;
    padding: 8px;
    border-radius: 7px;
    background: #faf7f8;
    color: #746d6f;
    font-size: 11px;
}

.friend-case-truncated {
    margin-top: 8px;
}

/*
 * Some Android browsers expose a viewport slightly wider than 600px. Keep the
 * pending-friend area in its readable mobile layout there instead of squeezing
 * three desktop cards together and triggering uneven browser text inflation.
 */
@media (max-width: 700px) {
    .friends-score-policy-notice {
        gap: 8px;
        padding: 12px;
        font-size: 14px;
        line-height: 1.55;
    }

    .friends-score-policy-notice a {
        margin-left: 0;
    }

    .pending-friends-details > summary {
        font-size: 14px;
        line-height: 1.45;
    }

    .pending-friends-details > p,
    .pending-friends-group > h4,
    .pending-friend-filter {
        font-size: 13px;
    }

    .pending-friends-name-list {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .pending-friend-entry {
        width: 100%;
        min-width: 0;
    }

    .pending-friend-filter {
        min-height: 42px;
        padding: 7px 11px;
    }

    .pending-friend-case-status,
    .pending-friend-candidate-metric,
    .pending-friend-period-control label,
    .pending-friend-period-control select,
    .pending-friend-period-control button,
    .pending-friend-custom-candidates summary,
    .pending-friend-case-details > summary {
        font-size: 12px;
    }

    .pending-friend-period-control select,
    .pending-friend-period-control button {
        min-height: 34px;
    }

    .pending-friend-custom-candidates p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .friend-overview-item > .friend-case-details {
        grid-column: 1 / -1;
        width: 100%;
    }

    .friend-case-header {
        align-items: flex-start;
    }

    .friend-case-details-body {
        max-height: 360px;
    }
}

#friends-overview-list {
    scroll-margin-top: 84px;
}

.availability-results {
    margin-bottom: 16px;
}

.recommendation-table {
    min-width: 720px;
}

.recommendation-rank {
    display: inline-grid;
    place-items: center;
    min-width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #fff0f2;
    color: #a00018;
    font-weight: 700;
}

.leisure-all-details,
.trend-data-details {
    margin-top: 16px;
    border: 1px solid #e1dadd;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.leisure-all-details > summary,
.trend-data-details > summary {
    padding: 13px 15px;
    color: #71313b;
    font-weight: 600;
    cursor: pointer;
}

.leisure-all-details[open] > summary,
.trend-data-details[open] > summary {
    border-bottom: 1px solid #eee;
}

.leisure-all-details .table-scroll,
.trend-data-details .table-scroll {
    border: 0;
    border-radius: 0;
}

.trend-data-details .leisure-table tr.current-time-row td {
    background: #fff0f2;
    color: #8b0015;
    font-weight: 700;
}

.trend-data-details .leisure-table tr.current-time-row td:first-child {
    box-shadow: inset 3px 0 #b3001b;
}

@media (max-width: 600px) {
    #person-select-container {
        margin: 12px 10px;
        padding: 14px;
    }

    .trend-chart-shell,
    .availability-results {
        padding: 14px;
    }

    .trend-summary-grid {
        gap: 6px;
    }

    .trend-summary-grid > div {
        display: block;
        padding: 9px;
    }

    .trend-summary-grid span,
    .trend-summary-grid strong,
    .trend-summary-grid small {
        display: block;
    }

    .trend-summary-grid small {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.35;
    }

    .trend-chart-readout {
        justify-content: space-between;
        text-align: left;
    }
}

#update-birthtime-form .form-group label {
    margin-bottom: 0;            /* 覆盖全局 label 的下边距，保证水平居中 */
    white-space: nowrap;
}

#update-birthtime-form .form-group select {
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    box-sizing: border-box;
}

#update-birthtime-form button {
    white-space: nowrap; /* 防止按钮内容被折行 */
    height: 40px;
    padding: 0 20px;
    font-size: 14px;
    border-radius: 6px;
    box-sizing: border-box;
}

/* ========== 进度条美化样式 ========== */
#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;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    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;
    box-sizing: border-box;
    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, #friends-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 41px;
    padding: 0 20px;
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1;
    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;
}

/* 朋友一览表格：横向滚动容器 + 美化 */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.friends-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

.friends-table th,
.friends-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
    white-space: nowrap;
}

.friends-table thead th {
    background: #b3001b;
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.friends-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.friends-table tbody tr:hover {
    background: #fff5f6;
}

.friends-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 8px 4px;
    color: #555;
    font-size: 14px;
}

.friends-pagination button {
    border: 1px solid #b3001b;
    border-radius: 4px;
    padding: 6px 14px;
    color: #b3001b;
    background: #fff;
    cursor: pointer;
}

.friends-pagination button:disabled {
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
}

#friends-view-toggle {
    border: 1px solid #666;
    color: #555;
    background: #fff;
}

#friends-view-toggle:hover,
#friends-view-toggle[aria-pressed="true"] {
    border-color: #b3001b;
    color: #b3001b;
    background: #fff5f6;
}

/* 名字列吸附在左侧，横向滚动时始终可见 */
.friends-table th:first-child,
.friends-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: inherit;
}

.friends-table thead th:first-child {
    background: #b3001b;
    z-index: 2;
}

.friends-table tbody tr td:first-child {
    background: #fff;
}

.friends-table tbody tr:nth-child(even) td:first-child {
    background: #fafafa;
}

@media (max-width: 768px) {
    .friends-search-container {
        padding: 10px;
    }

    #friends-search {
        flex: 1 1 100%;
        width: 100%;
    }

    #search-btn, #reset-btn, #friends-view-toggle {
        flex: 1;
        height: 38px;
        font-size: 14px;
    }

    .friends-table {
        font-size: 12px;
    }

    .friends-table th,
    .friends-table td {
        padding: 6px 8px;
    }
}

/* ========== 训练样本管理表格样式 ========== */
.training-case-create {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #eadde0;
    border-radius: 10px;
    background: #fff;
}

.training-case-create > summary {
    cursor: pointer;
    color: #8b0014;
    font-weight: 700;
}

.training-case-create form {
    margin-top: 14px;
}

.training-case-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.training-case-create label,
.training-case-create fieldset {
    display: grid;
    gap: 6px;
    color: #444;
    font-size: 13px;
}

.training-case-create input,
.training-case-create textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    font: inherit;
}

.training-case-create fieldset {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.training-case-create fieldset label {
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.training-case-create fieldset input {
    width: auto;
    margin-top: 2px;
}

.training-empty-state {
    padding: 24px 12px !important;
    color: #777;
    text-align: center;
}
.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;
    scroll-margin-top: 88px;
    border-bottom: 2px solid #b3001b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-management-container h2:focus {
    outline: 2px solid rgba(166, 33, 59, .55);
    outline-offset: 4px;
    border-radius: 4px;
}

.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;
    min-height: 40px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    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;
}

.friend-identity-details {
    margin: 4px 0 18px;
    padding: 12px 14px;
    border: 1px solid #e2e4e8;
    border-radius: 8px;
    background: #fafafa;
}

.friend-identity-details summary {
    cursor: pointer;
    color: #555;
    font-weight: 600;
}

.friend-identity-details > p,
.friend-city-status {
    display: block;
    margin: 8px 0 12px;
    color: #70757f;
    font-size: 12px;
    line-height: 1.55;
}

.friend-time-unknown-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 11px 13px;
    border: 1px solid #ead3d7;
    border-radius: 8px;
    background: #fff8f9;
    cursor: pointer;
}

.friend-time-unknown-option input {
    margin-top: 3px;
}

.friend-time-unknown-option span,
.friend-time-unknown-option small {
    display: block;
}

.friend-birth-period-group small {
    display: block;
    margin-top: 5px;
    color: #717171;
    font-size: 12px;
}

@media (max-width: 920px) {
    .pending-friend-entry {
        flex-basis: calc((100% - 7px) / 2);
    }
}

@media (max-width: 620px) {
    .pending-friend-entry {
        flex-basis: 100%;
        min-width: 0;
    }
}

.friend-time-unknown-option small {
    margin-top: 3px;
    color: #717171;
    font-weight: 400;
}

@media (max-width: 700px) {
    .add-friend-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
    }

    .tab-btn {
        flex: 1 0 auto;
        min-height: 44px;
        padding: 10px 14px;
        white-space: nowrap;
    }
}

.user-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-account {
    color: #777;
    font-size: 12px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.friend-request-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.friend-request-groups h4 {
    margin: 0 0 8px;
    color: #444;
    font-size: 14px;
}

.btn-request-secondary {
    padding: 6px 12px;
    border: 1px solid #bbb;
    border-radius: 6px;
    background: #fff;
    color: #555;
    cursor: pointer;
}

@media (max-width: 700px) {
    .friend-request-groups {
        grid-template-columns: 1fr;
    }

    .user-item {
        align-items: flex-start;
        gap: 10px;
    }
}

/* 新增朋友表单样式 */
.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;
    min-width: 0;
}

.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%;
    min-width: 0;
    box-sizing: border-box;
    display: block;
    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;
}


.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;
}

/* Relationship archive refresh: match the warm, editorial styling of My Archive. */
.friend-management-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    box-sizing: border-box;
    width: 100%;
    max-width: 1060px;
    gap: 0 20px;
    padding: 28px;
    background: #f8f4ed;
    border: 1px solid #e3d8c8;
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(67, 48, 28, 0.08);
}

.friend-management-container h2 {
    margin: 0;
    padding: 0;
    border: 0;
    color: #182033;
    font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
    font-size: 27px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.friend-management-container .friend-management-actions {
    align-self: center;
    margin: 0;
}

.friend-management-container > .add-friend-panel,
.friend-management-container > .friend-lists-wrapper,
.friend-management-container > .friend-management-tips {
    grid-column: 1 / -1;
}

.friend-management-container > .add-friend-panel {
    margin-top: 22px;
}

.friend-management-container .btn-primary {
    min-height: 42px;
    padding: 10px 19px;
    background: #a6213b;
    border: 1px solid #a6213b;
    border-radius: 10px;
    box-shadow: none;
}

.friend-management-container .btn-primary:hover {
    background: #8f1830;
    box-shadow: 0 8px 18px rgba(166, 33, 59, 0.18);
}

.friend-management-container .add-friend-panel {
    padding: 24px;
    border-color: #dfd4c4;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(67, 48, 28, 0.07);
}

.friend-management-container .friend-lists-wrapper {
    gap: 16px;
    margin: 24px 0 16px;
}

.friend-management-container .friend-list-section {
    border-color: #dfd4c4;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(67, 48, 28, 0.06);
}

.friend-management-container .section-header {
    padding: 17px 20px;
    background: #f4ede3;
    color: #202638;
    border-bottom: 1px solid #e4d9ca;
}

.friend-management-container .section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.friend-management-container .section-header h3 svg {
    color: #a6213b;
    opacity: 1;
}

.friend-management-container .friend-count {
    color: #7e6d5a;
    opacity: 1;
}

.friend-management-container .section-actions,
.friend-management-container .list-filter-box {
    background: #fffdfa;
    border-color: #eee5d9;
}

.friend-management-container .list-filter-box {
    padding: 12px 16px;
}

.friend-management-container .list-filter-box input,
.friend-management-container .search-box input,
.friend-management-container .form-group input,
.friend-management-container .form-group select {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #d9cebf;
    border-radius: 9px;
    background: #fff;
}

.friend-management-container .list-filter-box input:focus,
.friend-management-container .search-box input:focus,
.friend-management-container .form-group input:focus,
.friend-management-container .form-group select:focus {
    border-color: #a6213b;
    box-shadow: 0 0 0 3px rgba(166, 33, 59, 0.08);
}

.friend-management-container .friend-item {
    min-height: 50px;
    padding: 12px 18px;
}

.friend-management-container .friend-item:hover {
    background: #fcf7f3;
}

.friend-management-container .btn-batch-add,
.friend-management-container .btn-add-important {
    background: #a6213b;
    border-radius: 8px;
}

.friend-management-container .btn-batch-add:hover,
.friend-management-container .btn-add-important:hover {
    background: #8f1830;
}

.friend-management-container .btn-view-detail {
    background: #3f7167;
    border-radius: 8px;
}

.friend-management-container .btn-view-detail:hover {
    background: #315d54;
}

.friend-management-container .friend-management-tips {
    padding: 17px 20px;
    background: #fffaf1;
    border-color: #eadcc4;
    border-radius: 12px;
}

.friend-management-container .friend-management-tips p,
.friend-management-container .friend-management-tips li {
    color: #765f43;
}

@media (max-width: 700px) {
    .friend-management-container {
        grid-template-columns: 1fr;
        padding: 20px 16px;
        border-radius: 16px;
    }

    .friend-management-container h2 {
        font-size: 23px;
    }

    .friend-management-container .friend-management-actions {
        margin-top: 16px;
    }

    .friend-management-container .friend-management-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .friend-management-container > .add-friend-panel,
    .friend-management-container > .friend-lists-wrapper,
    .friend-management-container > .friend-management-tips {
        grid-column: 1;
    }

    .friend-management-container .friend-item {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .friend-management-container .friend-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .friend-management-container .friend-actions > button,
    .friend-management-container .friend-actions > .important-badge,
    .friend-management-container .friend-item > .btn-remove-important {
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 8px 10px;
        white-space: normal;
        text-align: center;
    }

    .friend-management-container .friend-actions > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .friend-management-container .friend-item > .btn-remove-important {
        width: 100%;
    }

    .friend-management-container h2 {
        scroll-margin-top: 70px;
    }
}

/* ========== 约会兼容性分析 ========== */

/* 候选人选择面板 */
.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;
}

.dating-date-group-label {
    width: 100%;
    font-size: 13px;
    color: #555;
    font-weight: 600;
}

.dating-date-field {
    display: flex;
    flex: 1 1 210px;
    flex-direction: column;
    gap: 4px;
}

.dating-default-range-hint {
    flex-basis: 100%;
    color: #777;
    line-height: 1.45;
}

.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;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    cursor: pointer;
    background: #fafafa;
    color: inherit;
    font: inherit;
    text-align: left;
    transition: background 0.15s;
}

.detail-header:hover {
    background: #f0f0f0;
}

.detail-header:focus-visible {
    outline: 3px solid rgba(179, 0, 27, 0.25);
    outline-offset: -3px;
}

.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-liuyue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.liunian-liuyue-cell {
    background: #fff;
    border-radius: 8px;
    border-top: 3px solid #ccc;
    padding: 10px 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.liuyue-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.liuyue-month {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.liuyue-level {
    font-size: 13px;
    font-weight: 700;
}

.liuyue-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.liuyue-note {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin-top: 4px;
}

.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-interpretation-notice {
    margin: 12px 0 18px;
    padding: 10px 12px;
    border-left: 4px solid #c79b43;
    border-radius: 6px;
    background: #fff9e8;
    color: #66521f;
    font-size: 13px;
    line-height: 1.65;
}

.classic-reference-disclosure summary {
    cursor: pointer;
    font-weight: 600;
    color: #5f4b00;
    padding: 10px 0;
}

.classic-reference-disclosure summary:focus-visible {
    outline: 3px solid rgba(179, 0, 27, 0.25);
    outline-offset: 3px;
}

.classic-reference-context {
    margin: 4px 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff8df;
    color: #66520b;
    font-size: 13px;
    line-height: 1.6;
}

/* ========== 神煞与贵人样式 ========== */
.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-current-short {
    display: none;
    min-width: 20px;
    text-align: center;
    font-weight: 650;
}

.lang-dropdown {
    display: none;
    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: 99999;
    overflow-y: auto;
    max-height: min(60vh, 480px);
    pointer-events: none;
}

.lang-dropdown.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-option {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    color: #333;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    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;
}

/* 主页顶部导航栏中的语言切换器下拉框 */
.home-lang-switcher .lang-dropdown {
    left: 0;
    right: auto;
}

/* 响应式适配 */
@media (max-width: 600px) {
    .language-switcher {
        order: -1;
    }

    .lang-btn {
        padding: 6px 10px;
        font-size: 13px;
        min-height: 44px;
    }

    .lang-current {
        display: none;
    }

    .lang-current-short {
        display: inline-block;
    }

    .lang-dropdown {
        right: 0;
        left: auto;
        max-width: calc(100vw - 24px);
    }

    /* 登录页导航栏内的语言切换器移动端居中 */
    .nav-login-wrapper .login-lang-switcher {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* ========== 移动端字体适配（放在文件末尾确保优先级） ========== */

/* 错误信息样式 */
.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;
    }
}

/* ========== 加载动画 & 进度条 ========== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(179, 0, 27, 0.15); }
    50% { box-shadow: 0 0 0 8px rgba(179, 0, 27, 0); }
}

/* 内联加载环 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f0e6e8;
    border-top-color: #b3001b;
    border-radius: 50%;
    background: none;
    mask: none;
    -webkit-mask: none;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* 主加载区域 */
#loading-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 500px;
    margin: 20px auto;
    min-height: 180px;
    color: #888;
    font-size: 15px;
    gap: 16px;
}

/* 主加载双环嵌套动画 */
#loading-message .loading-spinner {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    background: none;
    mask: none;
    -webkit-mask: none;
    margin-right: 0;
    animation: ring-pulse 2s ease-in-out infinite;
}
#loading-message .loading-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #b3001b;
    border-bottom-color: #e94560;
    animation: spin 0.85s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
}
#loading-message .loading-spinner::after {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-left-color: #f0c8cf;
    border-right-color: #b3001b;
    animation: spin 0.65s cubic-bezier(0.4, 0.0, 0.2, 1) infinite reverse;
}
#progress-container {
    max-width: 500px;
    margin: 20px auto;
    padding: 24px 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: none;
    flex-direction: column;
    gap: 8px;
}
#progressBar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    border: none;
    background: #f0f0f0;
}
#progressBar::-webkit-progress-bar {
    background: #f0f0f0;
    border-radius: 4px;
}
#progressBar::-webkit-progress-value {
    background: linear-gradient(90deg, #b3001b, #e94560);
    border-radius: 4px;
    transition: width 0.3s ease;
}
#progressBar::-moz-progress-bar {
    background: linear-gradient(90deg, #b3001b, #e94560);
    border-radius: 4px;
}
#progressLabel {
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* ========== 升级横幅 ========== */
.upgrade-banner {
    max-width: 1200px;
    margin: 24px auto 0;
    padding: 0 20px;
}
.upgrade-banner-inner {
    padding: 18px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff7f8, #fff);
    border: 1px solid #f0c8cf;
    box-shadow: 0 8px 24px rgba(179, 0, 27, 0.08);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.upgrade-banner-title {
    font-weight: 700;
    color: #8b0014;
    font-size: 18px;
    margin-bottom: 6px;
}
.upgrade-banner-desc {
    color: #666;
    line-height: 1.7;
}
.upgrade-btn {
    padding: 10px 18px;
    border-radius: 999px;
    background: #b3001b;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
}
.upgrade-btn:hover {
    background: #8b0015;
    transform: translateY(-1px);
}
.member-badge {
    max-width: 1200px;
    margin: 24px auto 0;
    padding: 0 20px;
}
.member-badge-inner {
    padding: 16px 20px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #d8e6ff;
    color: #335;
}

/* ========== 功能卡片悬停动效 ========== */
.feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(179, 0, 27, 0.12);
}
.feature-card:active {
    transform: translateY(-1px);
}

/* ========== Toast 通知 ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: toast-in 0.3s ease;
    max-width: 360px;
}
.toast-error { background: #e74c3c; }
.toast-success { background: #27ae60; }
.toast-info { background: #3498db; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== 骨架屏加载动画 ========== */
@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 6px;
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 30px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.skeleton-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.skeleton-card .skeleton-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.skeleton-card .skeleton-title {
    height: 16px;
    width: 70%;
    margin-bottom: 10px;
}

.skeleton-card .skeleton-desc {
    height: 12px;
    width: 90%;
    margin-bottom: 6px;
}

.skeleton-card .skeleton-desc:last-child {
    width: 60%;
}

@media (max-width: 992px) {
    .skeleton-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .skeleton-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 15px;
    }
    .skeleton-card { padding: 18px 15px; }
    .skeleton-card .skeleton-icon { width: 48px; height: 48px; }
    .skeleton-card .skeleton-title { height: 14px; }
}

@media (max-width: 600px) {
    .skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }
}

@media (max-width: 340px) {
    .skeleton-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Toggle Switch (通知开关) ========== */
.toggle-switch input:checked + .toggle-slider {
    background: #b3001b;
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 通知选项 hover */
.notif-option:hover {
    background: #f5f5f5;
}
.notif-option input:checked + div div:first-child {
    color: #b3001b;
}

/* ========== 注册匹配弹窗 ========== */
.match-actions {
    display: flex; gap: 10px; margin-top: 20px;
    flex-direction: column; align-items: stretch;
}
.match-actions .btn-submit {
    padding: 12px 20px; background: #b3001b; color: #fff;
    border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.match-actions .btn-submit:hover:not(:disabled) { background: #8c0016; }
.match-actions .btn-submit:disabled { background: #ccc; cursor: not-allowed; }
.btn-skip-merge {
    padding: 10px 16px; background: transparent; color: #888;
    border: 1px dashed #ccc; border-radius: 8px; font-size: 13px;
    cursor: pointer; transition: all 0.2s;
}
.btn-skip-merge:hover { color: #b3001b; border-color: #b3001b; background: #fff5f5; }

/* ========== 合婚按钮 ========== */
.dating-bazi-btn {
    display: block; width: calc(100% - 16px); margin: 10px 8px 4px;
    padding: 7px 0; background: #fff; color: #8b0000;
    border: 1.5px solid #d4a574; border-radius: 6px;
    cursor: pointer; font-size: 13px; font-weight: 600;
    transition: all 0.2s; letter-spacing: 0.5px;
}
.dating-bazi-btn:hover { background: #fff5eb; border-color: #b8860b; box-shadow: 0 1px 6px rgba(184,134,11,0.2); }

/* ========== 合婚报告模态框 ========== */
.marriage-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.marriage-modal {
    background: #fff; border-radius: 16px; max-width: 640px;
    width: 100%; max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,0.25); animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(30px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.marriage-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; border-bottom: 1px solid #f0f0f0;
}
.marriage-modal-header h2 { margin: 0; font-size: 20px; color: #8b0000; }
.marriage-modal-close {
    font-size: 28px; color: #999; cursor: pointer; line-height: 1;
    padding: 0 4px;
}
.marriage-modal-close:hover { color: #333; }
.marriage-modal-body {
    padding: 20px 24px; overflow-y: auto; flex: 1; line-height: 1.7;
    font-size: 14px; color: #333;
}
.marriage-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 24px; border-top: 1px solid #f0f0f0;
}
.marriage-loading {
    text-align: center; padding: 40px 0; color: #888; font-size: 15px;
}
.btn-marriage-save, .btn-marriage-close {
    padding: 8px 20px; border-radius: 6px; border: none;
    cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.btn-marriage-save { background: #8b0000; color: #fff; }
.btn-marriage-save:hover { background: #b3001b; }
.btn-marriage-close { background: #f0f0f0; color: #555; }
.btn-marriage-close:hover { background: #e0e0e0; }

/* 合婚报告内容 */
.marriage-report-section { margin-bottom: 18px; }
.marriage-report-section h3 {
    font-size: 15px; color: #8b0000; margin: 0 0 6px;
    padding-bottom: 4px; border-bottom: 2px solid #f5e6d3;
}
.marriage-report-section p { margin: 4px 0; font-size: 14px; line-height: 1.8; }
.marriage-bazi-row {
    display: flex; gap: 20px; margin: 8px 0 14px;
    padding: 12px 16px; background: #faf6f0; border-radius: 8px; align-items: center;
}
.marriage-bazi-person { flex: 1; text-align: center; }
.marriage-bazi-person .name { font-weight: 700; font-size: 15px; color: #333; }
.marriage-bazi-person .bazi { font-size: 18px; color: #8b0000; margin: 4px 0; letter-spacing: 4px; }
.marriage-bazi-person .meta { font-size: 12px; color: #888; }
.marriage-bazi-vs {
    display: flex; align-items: center; font-size: 22px; color: #d4a574; font-weight: 700;
}
.marriage-score-big {
    text-align: center; padding: 12px 0 18px;
}
.marriage-score-big .score-num {
    font-size: 56px; font-weight: 800; color: #8b0000; line-height: 1;
}
.marriage-score-big .score-label { font-size: 13px; color: #888; margin-top: 4px; }
.marriage-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.marriage-tag {
    padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: #f0f7f0; color: #1b8b3a; border: 1px solid #c8e6c9;
}
.marriage-tag.warning { background: #fff8e1; color: #e6a817; border-color: #ffe082; }

@media (max-width:600px) {
    .marriage-modal { max-height: 90vh; }
    .marriage-modal-body { padding: 16px; }
    .marriage-bazi-row { flex-direction: column; gap: 8px; }
    .marriage-bazi-vs { transform: rotate(90deg); }
    .marriage-score-big .score-num { font-size: 42px; }
}
html.i18n-pending body {
    visibility: hidden;
}

/* ========== 八字排盘面板 ========== */
.bazi-panel {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0e8ee;
    animation: fadeIn 0.3s ease;
}

.bazi-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0e8ee;
}

.bazi-panel-header h3 {
    margin: 0;
    font-size: 20px;
    color: #8b0014;
}

.bazi-panel-subtitle {
    font-size: 14px;
    color: #999;
}

.bazi-chart-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.bazi-chart-cell {
    background: #fafafa;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.bazi-chart-cell.bazi-day-cell {
    border-color: #b3001b;
    background: linear-gradient(135deg, #fff5f7 0%, #fff0f3 100%);
    box-shadow: 0 2px 12px rgba(179,0,27,0.1);
}

.bazi-cell-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.bazi-cell-gan {
    font-size: 28px;
    font-weight: 700;
    color: #b3001b;
    line-height: 1.2;
}

.bazi-cell-ten {
    font-size: 10px;
    color: #b3001b;
    opacity: 0.7;
    line-height: 1.3;
    margin-bottom: 2px;
}

.bazi-cell-zhi {
    font-size: 20px;
    color: #555;
    line-height: 1.3;
}

.bazi-cell-cang {
    font-size: 10px;
    color: #aaa;
    line-height: 1.3;
    margin-top: 2px;
}

.bazi-cell-nayin {
    font-size: 10px;
    color: #999;
    line-height: 1.3;
    margin-top: 2px;
}

/* 日主信息行 */
.bazi-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 16px;
}

.bazi-plain-summary {
    margin: 0 0 18px;
    padding: 18px 20px;
    color: #4c4037;
    text-align: left;
    background: #fffaf1;
    border: 1px solid #eadcc4;
    border-radius: 12px;
}

.bazi-plain-summary h4 {
    margin: 0 0 10px;
    color: #202638;
    font-size: 17px;
}

.bazi-plain-summary p {
    margin: 7px 0;
    line-height: 1.65;
}

.bazi-plain-summary details {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eadcc4;
}

.bazi-plain-summary summary {
    color: #7b2538;
    font-weight: 600;
    cursor: pointer;
}

.bazi-plain-summary dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 12px;
    margin: 12px 0 0;
}

.bazi-plain-summary dt { font-weight: 700; }
.bazi-plain-summary dd { margin: 0; color: #675b51; }

.bazi-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-label {
    font-size: 13px;
    color: #888;
}

.info-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.info-value.highlight { color: #b3001b; }
.info-value.yong { color: #2e7d32; }
.info-value.ji { color: #c62828; }

/* 五行统计 */
.bazi-wx-stats {
    margin-bottom: 20px;
}

.bazi-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.bazi-wx-bars {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 10px;
}

.bazi-wx-bars .wx-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bazi-wx-bars .wx-bar-item.wx-lack {
    opacity: 0.5;
}

.wx-bar-name {
    font-size: 13px;
    font-weight: 700;
    color: #555;
}

.wx-bar-name.wx-dominant {
    color: #b3001b;
}

.wx-bar-val {
    font-size: 12px;
    color: #999;
    font-weight: 600;
}

/* 大运时间线 */
.bazi-dayun-section {
    margin-bottom: 20px;
}

.bazi-dayun-timeline {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 12px 8px;
    background: #f8f9fa;
    border-radius: 10px;
}

.dayun-item {
    flex-shrink: 0;
    text-align: center;
    padding: 8px 14px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    min-width: 60px;
}

.dayun-age {
    font-size: 11px;
    color: #999;
}

.dayun-ganzhi {
    font-size: 18px;
    font-weight: 700;
    color: #b3001b;
}

.dayun-wx {
    font-size: 10px;
    color: #aaa;
}

/* 流年信息 */
.bazi-liunian-section {
    margin-bottom: 10px;
}

.bazi-liunian-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #fff0f3 100%);
    border-radius: 10px;
    border: 1px solid rgba(179,0,27,0.08);
}

.liunian-ganzhi {
    font-size: 22px;
    font-weight: 700;
    color: #b3001b;
}

.liunian-ten {
    font-size: 13px;
    color: #666;
    padding: 2px 10px;
    background: #fff;
    border-radius: 4px;
}

.liunian-relation {
    font-size: 12px;
    color: #e67e22;
    background: #fff8e1;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 加载动画 */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #f0e6e8;
    border-top-color: #b3001b;
    background: none;
    mask: none;
    -webkit-mask: none;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-msg {
    color: #c62828;
    padding: 20px;
    text-align: center;
    font-size: 14px;
}

.bazi-wuxing-method {
    margin: 8px 0 18px;
    color: #777;
    font-size: 12px;
    line-height: 1.55;
}

.bazi-empty-state {
    max-width: 560px;
    margin: 8px auto;
    padding: 24px;
    text-align: center;
    color: #555;
    background: #fff8e8;
    border: 1px solid #ead49a;
    border-radius: 12px;
}

.bazi-empty-state strong {
    display: block;
    color: #6f5100;
    font-size: 17px;
}

.bazi-empty-state p {
    margin: 8px 0 16px;
    line-height: 1.6;
}

.bazi-empty-state a,
.bazi-empty-state button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: #fff;
    background: #8b0014;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.bazi-empty-state button:disabled {
    cursor: wait;
    opacity: .7;
}

.friend-data-use-notice {
    margin: 10px 0 16px;
    padding: 12px 14px;
    color: #5f4b19;
    background: #fff8e6;
    border: 1px solid #ead8a3;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.65;
}

.friend-search-status {
    min-height: 20px;
    margin: -4px 0 10px;
    color: #666;
    font-size: 12px;
    line-height: 1.5;
}

.friend-management-container .btn-search:disabled {
    cursor: not-allowed;
    opacity: .48;
}

@media (max-width: 600px) {
    .fluctuation-options {
        align-items: stretch;
        margin-inline: 12px;
        padding: 18px;
    }

    .fluctuation-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .fluctuation-controls select,
    .fluctuation-confirm-btn {
        box-sizing: border-box;
        width: 100%;
        min-height: 44px;
    }

    .bazi-plain-summary { padding: 16px; }
    .bazi-plain-summary dl { grid-template-columns: 1fr; gap: 3px; }
    .bazi-plain-summary dd { margin-bottom: 7px; }
    .bazi-chart-grid { gap: 4px; }
    .bazi-chart-cell { padding: 8px 4px; }
    .bazi-cell-gan { font-size: 22px; }
    .bazi-cell-zhi { font-size: 16px; }
    .bazi-wx-bars { flex-wrap: wrap; }
    .bazi-wx-bars .wx-bar-item { min-width: 30%; flex: none; }
    .bazi-info-row { gap: 10px; }
    .bazi-dayun-timeline { padding: 8px 4px; }
    .dayun-item { min-width: 50px; padding: 6px 10px; }
}
