/* 长生殿 - 极简版样式 */
:root {
    --primary-color: #5d4037;
    --secondary-color: #8d6e63;
    --accent-color: #d4c6a6;
    --bg-color: #f8f4e9;
    --paper-bg: #f5eedf;
    --border-color: #d4c6a6;
    --text-color: #5d4037;
    --text-light: #8d6e63;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --shadow: 0 4px 52px rgba(93, 64, 55, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Ma Shan Zheng', cursive;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 150vh;
    padding: 50px;
    user-select: none;
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding-bottom: 320px;
}

/* 牛皮纸效果 */
.paper {
    background-color: var(--paper-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 95%, rgba(0,0,0,0.03) 100%);
    pointer-events: none;
    border-radius: 10px;
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
}

.status-left .player-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

.realm-info {
    font-size: 14px;
    opacity: 0.9;
}

.realm-name {
    margin-right: 8px;
    font-weight: bold;
}

.status-right {
    display: flex;
    gap: 16px;
}

.resource {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.resource i {
    font-size: 16px;
    opacity: 0.9;
}

/* 经验进度条 */
.exp-bar-container {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
}

.exp-bar-label {
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--text-light);
}

.exp-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
    position: relative;
}

.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.exp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.exp-text {
    font-size: 12px;
    text-align: center;
    color: var(--text-light);
}

/* 主内容区 */
.main-content {
    margin-bottom: 20px;
}

.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 修炼面板 */
.cultivation-info {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.cultivation-rate {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.cultivation-bonuses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
}

.cultivation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

/* 修炼计时器 */
.cultivation-timer {
    text-align: center;
    margin-bottom: 20px;
}

.timer-circle {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(var(--success-color) 0deg, #e0e0e0 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-fill {
    position: absolute;
    width: 84px;
    height: 84px;
    background: var(--paper-bg);
    border-radius: 50%;
}

.timer-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    position: relative;
    z-index: 1;
}

/* 修炼事件 */
.cultivation-events {
    margin-top: 20px;
}

.events-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.event {
    padding: 8px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    border-left: 4px solid var(--success-color);
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

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

/* 战斗面板 */
.enemy-list {
    margin-bottom: 20px;
}

.enemy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    transition: all 0.2s;
}

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

.enemy-info {
    flex-grow: 1;
    margin-left: 12px;
}

.enemy-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.enemy-stats {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 12px;
}

.battle-log {
    margin-top: 20px;
}

.log-content {
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.log-entry {
    padding: 6px;
    margin-bottom: 4px;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* 商店面板 */
.shop-items {
    margin-bottom: 20px;
}

.shop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.item-info {
    flex-grow: 1;
    margin-left: 12px;
}

.item-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.item-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.item-price {
    font-size: 14px;
    color: var(--success-color);
    font-weight: bold;
}

.balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-weight: bold;
}

/* 技能面板 */
.skills-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.skill {
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
}

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

.skill-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.skill-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.skill-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-width: 480px;
    margin: 0 auto;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--text-light);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-4px);
}

.nav-btn i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-btn span {
    font-size: 12px;
}

/* 按钮样式 */
.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: translateY(2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #ffb74d);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #66bb6a);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #ef5350);
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* 浮动消息 */
#floatingMessages {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
    max-width: 480px;
    margin: 0 auto;
}

.floating-message {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
    animation: floatUp 2s ease forwards;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(20px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* 突破动画 */
.breakthrough-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    display: none;
}

.breakthrough-content {
    text-align: center;
    color: white;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.breakthrough-text {
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.success-rate {
    font-size: 20px;
    opacity: 0.8;
}

/* 游戏统计 */
.stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.modal-content {
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.stats-grid {
    margin: 20px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* 游戏设置按钮 */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.settings-btn:active {
    transform: scale(0.9);
}

/* 退出登录按钮 */
.logout-btn {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.logout-btn:active {
    transform: scale(0.9);
}

/* 响应式调整 */
@media (max-width: 480px) {
    .container {
        padding-bottom: 70px;
    }
    
    .panel h2 {
        font-size: 18px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .cultivation-controls {
        grid-template-columns: 1fr;
    }
    
    .logout-btn {
        top: 70px;
        right: 10px;
        width: 35px;
        height: 35px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}
/* 改名按钮样式 */
.rename-btn {
    position: absolute;
    top: 20px;
    right: 70px;
    width: 40px;
    height: 40px;
    background: var(--info-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.rename-btn:active {
    transform: scale(0.9);
}

/* 排行按钮样式 */
.rank-btn {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FF9800, #FFB74D);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.rank-btn:active {
    transform: scale(0.9);
}

/* 改名模态框 */
.rename-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    display: none;
}

.rename-content {
    background: var(--paper-bg);
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.rename-input {
    width: 100%;
    padding: 12px;
    margin: 16px 0;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 16px;
    background: white;
}

.rename-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* 排行榜模态框 */
.rank-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    display: none;
}

.rank-content {
    background: var(--paper-bg);
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.rank-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.rank-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 16px;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
}

.rank-tab.active {
    color: var(--primary-color);
    font-weight: bold;
}

.rank-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

.rank-list {
    margin-top: 20px;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border-left: 4px solid transparent;
}

.rank-item.me {
    background: rgba(33, 150, 243, 0.1);
    border-left-color: var(--info-color);
}

.rank-position {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin-right: 12px;
    font-weight: bold;
}

.rank-position.gold { background: linear-gradient(135deg, #FFD700, #FFA500); }
.rank-position.silver { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); }
.rank-position.bronze { background: linear-gradient(135deg, #CD7F32, #A0522D); }

.rank-info {
    flex-grow: 1;
}

.rank-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.rank-stats {
    font-size: 12px;
    color: var(--text-light);
}

.rank-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 18px;
}