/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    /* 移动端安全区域支持 */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

/* 顶部导航栏 */
.header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #27313f;
    text-decoration: none;
    white-space: nowrap;
}

.logo img {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
}

.brand-link span {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.nav-items {
    display: flex;
    gap: 24px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
    padding: 8px 12px;
    border-radius: 8px;
}

.nav-item:hover,
.nav-item.active {
    color: #647718;
    background-color: #f8f8df;
}

.nav-item i {
    font-size: 16px;
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-balance {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid #e5dda0;
    border-radius: 10px;
    background: #fbfae9;
    color: #56601f;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.nav-balance:hover {
    border-color: #cabf65;
    background: #f7f3cc;
}

.nav-balance:active {
    transform: translateY(1px);
}

.nav-balance:focus-visible {
    outline: 3px solid rgba(202, 191, 101, 0.34);
    outline-offset: 2px;
}

.nav-balance i {
    color: #8a7812;
    font-size: 13px;
}

.nav-balance-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(99, 82, 10, 0.16));
}

.nav-balance-label {
    color: #6c7350;
    font-size: 12px;
}

.nav-balance strong {
    min-width: 2ch;
    color: #29320e;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* 默认隐藏移动端搜索按钮 */
.mobile-nav-search-btn {
    display: none;
}

/* 移动端导航搜索按钮与搜索栏 */
@media (max-width: 768px) {
    .mobile-nav-search-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        background: none;
        border-radius: 8px;
        color: #666;
        font-size: 16px;
        cursor: pointer;
    }
    .mobile-nav-search-btn:hover { background: #f5f5f5; color: #333; }
    
    /* 搜索模式：整个导航栏变成搜索栏 */
    .mobile-header-search { 
        display: none; 
        padding: 10px 12px; 
        align-items: center; 
        gap: 10px; 
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background: #fff;
        z-index: 1000;
        height: 64px;
        box-sizing: border-box;
    }
    .mobile-header-search.show { 
        display: flex !important; 
    }
    
    /* 搜索模式下隐藏原导航内容 */
    .navbar.search-mode .nav-left,
    .navbar.search-mode .nav-right {
        opacity: 0;
        visibility: hidden;
    }
    
    .mobile-search-back-btn { 
        width: 36px; 
        height: 36px; 
        border: none; 
        background: none; 
        border-radius: 8px; 
        color: #666; 
        font-size: 16px; 
        display: inline-flex; 
        align-items: center; 
        justify-content: center; 
        cursor: pointer;
    }
    .mobile-search-back-btn:hover { background: #f5f5f5; color: #333; }
    
    .mobile-header-search-box { 
        flex: 1; 
        display: flex; 
        align-items: center; 
        gap: 8px; 
        background: #f1f3f5; 
        border-radius: 12px; 
        padding: 10px 12px; 
    }
    .mobile-header-search-box i { color: #6c757d; font-size: 16px; }
    #indexMobileSearchInput { 
        flex: 1; 
        border: none; 
        outline: none; 
        background: transparent; 
        font-size: 16px; 
        color: #333; 
    }
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 280px;
    height: 36px;
    padding: 0 40px 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #a99c37;
}

.search-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 6px;
}

/* 用户菜单 */
.user-menu {
    position: relative;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.user-avatar:hover {
    background-color: #f8f9fa;
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e5dda0;
    background: #fbfae9;
    object-fit: contain;
    padding: 2px;
}

.nav-username {
    max-width: 136px;
    overflow: hidden;
    color: #343a44;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s;
}

.user-menu.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    /* 提升层级，确保不被其它固定层挡住（如移动端设置面板） */
    z-index: 2001;
    margin-top: 8px;
}

.user-menu.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e5dda0;
    background: #fbfae9;
    object-fit: contain;
    padding: 3px;
}

.user-info {
    flex: 1;
}

.username {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.user-level {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.dropdown-menu {
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.logout {
    color: #333; /* 与普通项一致 */
}

.dropdown-item.logout:hover {
    background-color: #f8f9fa; /* 与普通 hover 一致 */
}

.dropdown-item i {
    width: 16px;
    font-size: 14px;
    color: #666;
}

.dropdown-item.logout i {
    color: #666; /* 与普通图标一致 */
}

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 0;
}

/* 分类导航 */
.category-nav {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 0;
}

.category-buttons {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.category-btn:hover,
.category-btn.active {
    background: #ff6b6b;
    color: #fff;
    border-color: #ff6b6b;
}

.tags {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.tag:hover {
    background: #e9ecef;
    color: #495057;
}

/* 主要内容区域 */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 40px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 28px;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top; /* 从顶部对齐，适配9:16裁切顶部显示 */
    transition: transform 0.3s;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.heat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fire-icon {
    font-size: 14px;
}

.fire-count {
    font-size: 14px;
    color: #666;
}

.author {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.author-name {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.publish-time {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 导航栏优化 */
    .navbar {
        padding: 0 16px;
        height: 56px;
        min-height: 56px;
        flex-wrap: nowrap; /* 防止换行 */
    }
    
    .nav-left {
        gap: 12px;
        flex: 1;
        min-width: 0; /* 允许收缩 */
    }
    
    .logo img {
        width: 32px;
        height: 32px;
    }

    .brand-link span {
        display: none;
    }
    
    .nav-items {
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-items::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 6px;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: auto;
    }
    
    .nav-item span {
        font-weight: 500;
    }
    
    .nav-item i {
        font-size: 14px;
        margin-right: 4px;
        margin-bottom: 0;
    }
    
    .nav-right {
        gap: 8px;
        flex-shrink: 0;
    }

    .nav-balance {
        min-height: 34px;
        padding: 0 9px;
        gap: 6px;
    }

    .nav-balance-label {
        display: none;
    }

    .nav-balance-icon {
        width: 19px;
        height: 19px;
        flex-basis: 19px;
    }
    
    /* 移动端隐藏搜索框 */
    .search-container {
        display: none;
    }
    
    .user-avatar {
        padding: 4px;
    }
    
    .user-avatar img {
        width: 32px;
        height: 32px;
    }
    
    .dropdown-arrow {
        font-size: 10px;
        margin-left: 4px;
    }
    
    .user-dropdown {
        right: 0;
        left: auto;
        width: 280px;
        max-width: calc(100vw - 16px);
        margin-right: 8px;
    }
    
    /* 分类按钮优化 */
    .category-buttons {
        padding: 12px 16px;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .category-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .category-btn {
        padding: 8px 16px;
        font-size: 14px; /* 保持与桌面版相同 */
        white-space: nowrap;
        flex-shrink: 0;
        min-width: auto;
    }
    
    /* 标签区域优化 */
    .tags {
        padding: 8px 16px;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tags::-webkit-scrollbar {
        display: none;
    }
    
    .tag {
        padding: 4px 12px; /* 恢复与桌面版相同的padding */
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 主内容区域优化 */
    .main-content {
        padding: 16px;
        max-width: 100%;
    }
    
    /* 角色卡片优化 - 横向布局 */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    /* 横向卡片：左图右文 */
    .cards-grid .card {
        display: flex;
        align-items: stretch;
        border-radius: 12px;
        overflow: hidden;
    }
    
    .cards-grid .card-image {
        flex: 0 0 120px;
        width: 120px;
        height: 180px;
        border-radius: 12px 0 0 12px;
    }
    
    .cards-grid .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .cards-grid .card-content {
        flex: 1;
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        min-height: 0;
    }
    
    .cards-grid .card-title {
        font-size: 12px;
        line-height: 1.3;
        margin-bottom: 4px;
        display: -webkit-box;
        line-clamp: 1;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-weight: 600;
    }
    
    .cards-grid .card-description {
        font-size: 10px;
        line-height: 1.4;
        color: #666;
        margin-bottom: 8px;
        display: -webkit-box;
        line-clamp: 3;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        flex: 1;
    }
    
    .cards-grid .card-stats {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 8px;
        margin-top: auto;
    }
    
    .cards-grid .card-stats .heat {
        display: flex;
        align-items: center;
        gap: 2px;
        font-size: 8px;
    }
    
    .cards-grid .card-stats .author-info {
        display: flex;
        align-items: center;
        gap: 3px;
        color: #888;
    }
    
    .cards-grid .card-stats .author-avatar {
        width: 12px;
        height: 12px;
        border-radius: 50%;
    }
    
    .cards-grid .card-stats .author-name {
        color: #888;
        font-size: 8px;
    }
    
    .cards-grid .card-stats .publish-time {
        color: #999;
        font-size: 8px;
    }
    
    .author {
        gap: 6px;
    }
    
    .author-avatar {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    /* 小屏手机角色卡片优化 - 单列横向布局 */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* 横向卡片：左图右文 */
    .cards-grid .card {
        display: flex;
        align-items: stretch;
        border-radius: 12px;
        overflow: hidden;
    }
    
    .cards-grid .card-image {
        flex: 0 0 150px;
        width: 150px;
        height: 225px;
        border-radius: 12px 0 0 12px;
    }
    
    .cards-grid .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .cards-grid .card-content {
        flex: 1;
        padding: 12px 15px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        min-height: 0;
    }
    
    .cards-grid .card-title {
        font-size: 13px;
        line-height: 1.3;
        margin-bottom: 5px;
        display: -webkit-box;
        line-clamp: 1;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-weight: 600;
    }
    
    .cards-grid .card-description {
        font-size: 11px;
        line-height: 1.4;
        color: #666;
        margin-bottom: 10px;
        display: -webkit-box;
        line-clamp: 4;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        flex: 1;
    }
    
    .cards-grid .card-stats {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 9px;
        margin-top: auto;
    }
    
    .cards-grid .card-stats .heat {
        display: flex;
        align-items: center;
        gap: 3px;
        font-size: 9px;
    }
    
    .cards-grid .card-stats .author-info {
        display: flex;
        align-items: center;
        gap: 4px;
        color: #888;
    }
    
    .cards-grid .card-stats .author-avatar {
        width: 14px;
        height: 14px;
        border-radius: 50%;
    }
    
    .cards-grid .card-stats .author-name {
        color: #888;
        font-size: 9px;
    }
    
    .cards-grid .card-stats .publish-time {
        color: #999;
        font-size: 9px;
    }
    
    .author {
        gap: 8px;
    }
    
    .author-avatar {
        width: 18px;
        height: 18px;
    }
    
    /* 移动端表单优化 */
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
        color: #333;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px; /* 防止iOS缩放 */
        line-height: 1.5;
        border: 2px solid #e0e0e0;
        border-radius: 12px;
        background: #fff;
        transition: all 0.3s ease;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        outline: none;
        border-color: #ff6b6b;
        box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    }
    
    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }
    
    /* 按钮移动端优化 */
    .btn {
        padding: 14px 24px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 12px;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        min-height: 48px; /* 满足触摸目标最小尺寸 */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }
    
    .btn-primary {
        background: #ff6b6b;
        color: white;
    }
    
    .btn-primary:hover {
        background: #ff5252;
        transform: translateY(-1px);
    }
    
    .btn-secondary {
        background: #f8f9fa;
        color: #333;
        border: 2px solid #e0e0e0;
    }
    
    .btn-secondary:hover {
        background: #e9ecef;
        border-color: #d0d0d0;
    }
    
    .btn-block {
        width: 100%;
        margin-bottom: 16px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}



/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease-out;
}

.character-modal {
    max-width: 800px;
}

/* 桌面端保持按钮，只隐藏角色标题 */
@media (min-width: 769px) {
    .character-modal .header-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: auto;
    }
    
    .character-modal .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .character-modal .character-title {
        display: none;
    }

    /* 桌面端收藏按钮样式调整 */
    .character-modal .favorite-btn {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 6px;
        background: #f8f9fa;
        border: 1px solid #ddd;
        color: #666;
        min-width: auto;
    }
    
    .character-modal .favorite-btn.favorited {
        background: #fff0f0;
        border-color: #ff6b6b;
        color: #ff6b6b;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.close {
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.login-btn,
.register-btn {
    width: 100%;
    height: 44px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 8px;
}

.login-btn:hover,
.register-btn:hover {
    background: #ff5252;
}

.form-footer {
    margin-top: 24px;
    text-align: center;
}

.forgot-password,
.terms-link,
.privacy-link {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 14px;
}

.forgot-password:hover,
.terms-link:hover,
.privacy-link:hover {
    text-decoration: underline;
}

.register-link,
.login-link {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

.register-link a,
.login-link a {
    color: #ff6b6b;
    text-decoration: none;
}

.register-link a:hover,
.login-link a:hover {
    text-decoration: underline;
}

/* 角色详情样式 */
.character-detail {
    display: flex;
    gap: 24px;
}

.character-image {
    flex-shrink: 0;
}

.character-image img {
    width: 270px;
    height: 480px;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
}

.character-info {
    flex: 1;
}

.character-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.stat-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.character-description h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.character-description p {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
}

.character-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: #ff6b6b;
    color: white;
}

.btn-primary:hover {
    background: #ff5252;
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
    color: #333;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式网格布局 */
@media (min-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    
    .card-image {
        height: 240px;
    }
    
    .main-content {
        max-width: 1200px;
        padding: 24px 30px;
    }
    
    .navbar, .category-buttons, .tags {
        max-width: 1200px;
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .card-image {
        height: 200px;
    }
    
    .main-content {
        max-width: 900px;
        padding: 24px 20px;
    }
    
    .navbar, .category-buttons, .tags {
        max-width: 900px;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* 响应式模态框 */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .card-image {
        height: 180px;
    }
    
    .main-content {
        max-width: 100%;
        padding: 16px 12px;
    }
    
    .navbar {
        padding: 0 12px;
    }
    
    .category-buttons, .tags {
        padding: 0 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .character-detail {
        flex-direction: column;
    }
    
    .character-image img {
        width: 100%;
        height: 200px;
    }
    
    .character-stats {
        grid-template-columns: 1fr;
    }
    
    .character-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .card-image {
        height: 240px;
    }
    
    .main-content {
        padding: 12px 8px;
    }
    
    .navbar {
        padding: 0 8px;
    }
    
    .category-buttons, .tags {
        padding: 0 8px;
    }
}

/* 加载指示器样式 */
.loading-indicator {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    margin: 20px 0;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
}

.refresh-icon {
    font-size: 32px;
    color: #ff6b6b;
    animation: refresh-spin 1s linear infinite;
}

.refresh-icon i {
    display: block;
}

@keyframes refresh-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 侧边栏样式 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-panel.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e5dda0;
    background: #fbfae9;
    object-fit: contain;
    padding: 3px;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
}

.sidebar-username {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.sidebar-user-level {
    font-size: 12px;
    color: #666;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: #f0f0f0;
    color: #333;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px 8px;
    margin-bottom: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    text-decoration: none;
}

.sidebar-item:hover {
    background: #f8f9fa;
    color: #ff6b6b;
}

.sidebar-item i {
    width: 20px;
    font-size: 16px;
    color: #666;
    transition: color 0.2s ease;
}

.sidebar-item:hover i {
    color: #ff6b6b;
}

.sidebar-item span {
    font-size: 14px;
    font-weight: 500;
}

/* 侧边栏特殊颜色样式 */
.sidebar-item-blue {
    color: #007bff !important;
}

.sidebar-item-blue:hover {
    background: #e7f3ff;
    color: #0056b3 !important;
}

.sidebar-item-blue i {
    color: #007bff !important;
}

.sidebar-item-blue:hover i {
    color: #0056b3 !important;
}

.sidebar-item-red {
    color: #dc3545 !important;
}

.sidebar-item-red:hover {
    background: #f8d7da;
    color: #721c24 !important;
}

.sidebar-item-red i {
    color: #dc3545 !important;
}

.sidebar-item-red:hover i {
    color: #721c24 !important;
}

/* 侧边栏响应式设计 */
@media (max-width: 768px) {
    .sidebar-panel {
        width: 320px;
    }
    
    .sidebar-header {
        padding: 20px 16px;
    }
    
    .sidebar-avatar {
        width: 44px;
        height: 44px;
    }
    
    .sidebar-username {
        font-size: 15px;
    }
    
    .sidebar-user-level {
        font-size: 11px;
    }
    
    .sidebar-close {
        font-size: 18px;
        padding: 6px;
    }
    
    .sidebar-content {
        padding: 12px 0;
    }
    
    .sidebar-item {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .sidebar-item i {
        font-size: 15px;
        width: 18px;
    }
    
    .sidebar-item span {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .sidebar-panel {
        width: 100%;
        border-radius: 0;
    }
    
    .sidebar-header {
        padding: 16px;
        border-bottom: 1px solid #eee;
    }
    
    .sidebar-avatar {
        width: 40px;
        height: 40px;
    }
    
    .sidebar-username {
        font-size: 14px;
    }
    
    .sidebar-user-level {
        font-size: 10px;
    }
    
    .sidebar-content {
        padding: 8px 0;
    }
    
    .sidebar-item {
        padding: 16px;
        gap: 12px;
        border-bottom: 1px solid #f5f5f5;
    }
    
    .sidebar-item:last-child {
        border-bottom: none;
    }
    
    .sidebar-item i {
        font-size: 16px;
        width: 20px;
    }
    
    .sidebar-item span {
        font-size: 14px;
        font-weight: 500;
    }
    
    /* 移动端侧边栏特殊颜色样式增强 */
    .sidebar-item-blue {
        background: rgba(0, 123, 255, 0.05);
        border-left: 3px solid #007bff;
    }
    
    .sidebar-item-red {
        background: rgba(220, 53, 69, 0.05);
        border-left: 3px solid #dc3545;
    }
}

/* 移动端模态框和表单额外优化 */
@media (max-width: 768px) {
    /* 模态框移动端优化 */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        border-radius: 16px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 20px 20px 0;
        border-bottom: none;
    }
    
    .modal-title {
        font-size: 18px;
        font-weight: 600;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 0 20px 20px;
        border-top: 1px solid #f0f0f0;
        margin-top: 20px;
        gap: 12px;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-height: 48px;
    }
    
    /* 手机端角色详情弹窗优化 */
    .modal-content.character-modal {
        width: 100%;
        height: calc(var(--vh, 1vh) * 100);
        max-width: 100%;
        max-height: calc(var(--vh, 1vh) * 100);
        border-radius: 0;
        margin: 0;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        box-sizing: border-box;
    }
    
    .character-modal .modal-header {
        padding: 16px;
        position: sticky;
        top: env(safe-area-inset-top);
        background: #fff;
        z-index: 1001;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    }
    
    .character-modal .modal-header h2 {
        display: none; /* 隐藏原来的标题 */
    }
    
    .character-modal .header-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        justify-content: space-between;
    }
    
    .character-modal .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .character-modal .start-chat-btn {
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 20px;
    }
    
    .character-modal .favorite-btn {
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 20px;
        background: #f8f9fa;
        border: 1px solid #ddd;
        color: #666;
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: auto;
    }
    
    .character-modal .favorite-btn.favorited {
        background: #fff0f0;
        border-color: #ff6b6b;
        color: #ff6b6b;
    }
    
    .character-modal .close {
        font-size: 24px;
        color: #666;
    }
    
    .character-detail {
        flex-direction: column;
        gap: 0;
    }
    
    .character-modal .character-title {
        text-align: center;
        padding: 16px 16px 8px 16px;
        background: #f8f9fa;
        border-bottom: none;
    }
    
    .character-modal .character-title h3 {
        font-size: clamp(16px, 4vw, 24px);
        font-weight: 600;
        margin: 0;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .character-image {
        width: 100%;
        text-align: center;
        padding: 8px 16px 16px 16px;
        background: #f8f9fa;
    }
    
    .character-image img {
        width: 224px;  /* 280px * 0.8 = 224px */
        height: 336px; /* 420px * 0.8 = 336px */
        max-width: 100%;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .character-info {
        padding: 16px;
    }
    
    .character-stats {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
        background: #f8f9fa;
        padding: 16px;
        border-radius: 12px;
    }
    
    .character-modal .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
        background: none;
        border-radius: 0;
    }
    
    .character-modal .stat-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .character-modal .stat-label {
        font-size: 14px;
        color: #666;
        font-weight: 500;
    }
    
    .character-modal .stat-value {
        font-size: 14px;
        color: #333;
        font-weight: 600;
    }
    
    .character-description {
        background: #fff;
    }
    
    .character-description h3 {
        font-size: 16px;
        color: #333;
        margin: 0 0 12px 0;
        font-weight: 600;
    }
    
    .character-description p {
        font-size: 14px;
        line-height: 1.6;
        color: #666;
        margin: 0;
    }
    
    /* 支付页面移动端优化 */
    .payment-container {
        padding: 16px;
    }
    
    .payment-card {
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .payment-method {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .payment-method input[type="radio"] {
        width: 20px;
        height: 20px;
    }
    
    .payment-method label {
        font-size: 16px;
        font-weight: 500;
    }
    
    .amount-input {
        font-size: 18px;
        text-align: center;
        padding: 16px;
        border-radius: 12px;
        border: 2px solid #e0e0e0;
    }
    
    .amount-buttons {
        gap: 8px;
        margin: 16px 0;
    }
    
    .amount-btn {
        flex: 1;
        padding: 12px;
        font-size: 16px;
        border-radius: 12px;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    /* 小屏模态框优化 */
    .modal {
        padding: 5px;
    }
    
    .modal-content {
        border-radius: 12px;
        max-height: calc(100vh - 10px);
    }
    
    .modal-header {
        padding: 16px 16px 0;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 0 16px 16px;
    }
    
    /* 支付页面小屏优化 */
    .payment-container {
        padding: 12px;
    }
    
    .payment-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    .amount-buttons {
        flex-direction: column;
    }
    
    .amount-btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* 移动端性能和触摸体验优化 */
@media (max-width: 768px) {
    /* 触摸优化 */
    * {
        -webkit-tap-highlight-color: rgba(255, 107, 107, 0.2);
        -webkit-touch-callout: none;
    }
    
    /* 可点击元素最小尺寸确保触摸友好 */
    button,
    .btn,
    .nav-item,
    .category-btn,
    .sidebar-item,
    .message-actions button {
        min-height: 44px;
    }
    
    /* tag保持与桌面端一致的尺寸，不强制44px高度 */
    .tag {
        min-height: auto;
    }
    
    /* 防止iOS Safari缩放 */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
    
    /* 滚动性能优化 */
    .chat-messages,
    .chat-list,
    .nav-items,
    .category-buttons,
    .tags {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 字体渲染优化 */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    /* 固定定位导航栏 */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
    }
    
    body {
        padding-top: 56px;
    }
    
    /* 安全区域适配 (iPhone X等) */
    .header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-top: max(0px, env(safe-area-inset-top));
    }
    
    .chat-input-area {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    .sidebar-panel {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

@media (max-width: 390px) {
    .navbar {
        padding: 0 10px;
    }

    .nav-left {
        gap: 8px;
    }

    .nav-items {
        gap: 2px;
    }

    .nav-item {
        padding: 5px 6px;
    }

    .nav-balance {
        padding: 0 7px;
    }

    .nav-balance i {
        display: none;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    .header {
        height: 48px;
        min-height: 48px;
    }
    
    body {
        padding-top: 48px;
    }
    
    .nav-item {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .user-avatar img {
        width: 28px;
        height: 28px;
    }
    
    .chat-sidebar {
        height: 44px;
    }
    
    .message-input {
        min-height: 36px;
    }
    
    .send-btn {
        width: 36px;
        height: 36px;
    }
}

/* 移动端角色选择界面样式 */
@media (max-width: 768px) {
    .mobile-character-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        visibility: hidden;
        background: rgba(0, 0, 0, 0.5);
        transition: all 0.3s ease;
        opacity: 0;
    }
    
    .mobile-character-overlay.show {
        visibility: visible;
        opacity: 1;
    }
    
    .mobile-character-panel {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-character-overlay.show .mobile-character-panel {
        transform: translateY(0);
    }
    
    .mobile-character-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #e0e0e0;
        background: #fff;
        flex-shrink: 0;
        height: 56px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .mobile-character-header h2 {
        font-size: 18px;
        font-weight: 600;
        color: #333;
        margin: 0;
    }
    
    .mobile-character-close {
        width: 36px;
        height: 36px;
        border: none;
        background: none;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        color: #666;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 16px;
    }
    
    .mobile-character-close:hover {
        background: #f5f5f5;
        color: #333;
    }
    
    .mobile-character-content {
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-character-search {
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
        background: #fff;
        flex-shrink: 0;
    }
    
    .mobile-search-input-container {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .mobile-search-input-container i {
        position: absolute;
        left: 12px;
        color: #999;
        font-size: 14px;
        z-index: 1;
    }
    
    .mobile-character-search-input {
        width: 100%;
        padding: 12px 16px 12px 40px;
        border: 1px solid #e0e0e0;
        border-radius: 20px;
        font-size: 16px;
        background: #f8f9fa;
        color: #333;
        outline: none;
        transition: all 0.2s;
    }
    
    .mobile-character-search-input:focus {
        border-color: #007bff;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }
    
    .mobile-character-list {
        flex: 1;
        overflow-y: auto;
        padding: 0;
    }
    
    .mobile-character-item {
        display: flex;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #f0f0f0;
        cursor: pointer;
        transition: background-color 0.2s;
        background: #fff;
    }
    
    .mobile-character-item:hover {
        background: #f8f9fa;
    }
    
    .mobile-character-item.active {
        background: #e3f2fd;
        border-left: 4px solid #007bff;
    }
    
    .mobile-character-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        object-fit: cover;
        margin-right: 16px;
        flex-shrink: 0;
        border: 2px solid #f0f0f0;
    }
    
    .mobile-character-info {
        flex: 1;
        min-width: 0;
    }
    
    .mobile-character-name {
        font-size: 16px;
        font-weight: 500;
        color: #333;
        margin: 0 0 4px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-character-preview {
        font-size: 14px;
        color: #666;
        margin: 0 0 4px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-character-meta {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .mobile-character-time {
        font-size: 12px;
        color: #999;
    }
    
    .mobile-add-character {
        padding: 16px 20px;
        border-top: 1px solid #e0e0e0;
        background: #fff;
        flex-shrink: 0;
    }
    
    .mobile-add-character-btn {
        width: 100%;
        padding: 12px 16px;
        background: #fff;
        color: #007bff;
        border: 1px solid #007bff;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 500;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .mobile-add-character-btn:hover {
        background: #007bff;
        color: #fff;
    }
    
    .mobile-add-character-btn i {
        font-size: 16px;
    }
}
/* 游客模式 */
.guest-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.guest-identity {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #606875;
    font-size: 13px;
    font-weight: 600;
}

.guest-identity img {
    width: 34px;
    height: 34px;
    border: 1px solid #f1caca;
    border-radius: 50%;
    background: #fff7f4;
    object-fit: contain;
    padding: 3px;
}

.guest-login-link,
.guest-register-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.guest-login-link {
    color: #3f4652;
    border: 1px solid #d9dde4;
    background: #f8f9fb;
}

.guest-register-link {
    color: #fdfdfd;
    border: 1px solid #e85f5f;
    background: #e85f5f;
}

.guest-login-link:active,
.guest-register-link:active {
    transform: translateY(1px);
}

.guest-auth-prompt {
    position: relative;
    width: min(420px, calc(100vw - 32px));
    padding: 36px 32px 30px;
    text-align: center;
    border-radius: 16px;
}

.guest-auth-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #666d78;
    font-size: 26px;
    cursor: pointer;
}

.guest-auth-avatar {
    width: 72px;
    height: 72px;
    display: block;
    margin: 0 auto 18px;
    object-fit: contain;
}

.guest-auth-prompt h2 {
    margin: 0 0 10px;
    color: #242933;
    font-size: 24px;
    line-height: 1.25;
}

.guest-auth-prompt p {
    max-width: 31ch;
    margin: 0 auto 24px;
    color: #606875;
    font-size: 15px;
    line-height: 1.65;
}

.guest-auth-actions {
    display: grid;
    gap: 12px;
}

.guest-auth-actions .btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
}

.guest-auth-login {
    color: #4c5563;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 640px) {
    .guest-nav-actions {
        gap: 6px;
    }

    .guest-login-link,
    .guest-register-link {
        min-height: 34px;
        padding: 0 10px;
        font-size: 13px;
    }

    .guest-identity span,
    .nav-username {
        display: none;
    }

    .guest-identity img {
        width: 32px;
        height: 32px;
    }

    .guest-auth-prompt {
        padding: 32px 22px 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .guest-login-link,
    .guest-register-link {
        transition: none;
    }
}
