/*
 * 道金幻境录 - 人物属性页面样式
 *
 * 按照修仙文学顾问和前端设计顾问建议设计
 * 深蓝渐变 + 金色点缀 + 云雾纹理，体现修仙秘境意境
 */

body {
    /* 淡绿色修仙背景，符合道法自然、清净无为的道家意境 */
    background: 
        radial-gradient(circle at 0% 0%, rgba(167, 212, 155, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(53, 189, 122, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(167, 212, 155, 0.05) 0%, transparent 50%);
    background-color: #0a1f14;
    background-image: 
        linear-gradient(135deg, rgba(167, 212, 155, 0.03) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            rgba(232, 245, 233, 0.02) 0px,
            transparent 10px,
            rgba(232, 245, 233, 0.01) 10px,
            transparent 20px
        );
    color: #e8f5e9;
    min-height: 100vh;
}

/* 整体容器 - 添加云雾纹理背景，配合淡绿色修仙主题 */
.game-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 25px;
    background: 
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(53, 189, 122, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 0, 0, 0.05) 0%, transparent 50%);
    background-color: rgba(26, 58, 46, 0.85);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid #2d5a4a;
    backdrop-filter: blur(10px);
}

/* 游戏头部 - 提亮金色，增加发光效果 */
.game-header {
    background: linear-gradient(135deg, #1a2a4a, #2d4a86);
    color: #ffeb8a;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.15);
    text-shadow: 0 0 20px rgba(255, 235, 138, 0.6), 0 0 40px rgba(212, 175, 55, 0.3);
}

/* 统计卡片区域 */
.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #2a4a3a;
    padding: 20px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 10px rgba(212, 175, 55, 0.1);
    text-align: center;
    border: 1px solid #4a7a5a;
}

.stat-card h3 {
    color: #000;
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: bold;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #ffeb8a;
    margin: 10px 0;
    text-shadow: 0 0 15px rgba(255, 235, 138, 0.4), 0 0 30px rgba(212, 175, 55, 0.2);
}

/* 主内容区域 */
.game-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.game-main {
    background: #163020;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    border: 1px solid #3a6a4a;
    width: 100%;
}

.game-sidebar {
    background: #163020;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    border: 1px solid #3a6a4a;
}

/* 游戏按钮 */
.btn-game {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: #2c3e50;
    color: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 1px solid #4a5a6e;
}

.btn-game:hover {
    background: #357abd;
    border-color: #d4af37;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-game:active {
    transform: translateY(0);
}

.btn-game-nav {
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
    transform-origin: center;
    will-change: transform, filter;
    touch-action: manipulation;
}

.btn-game-nav img {
    display: block;
    pointer-events: none;
}

.btn-game-nav:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.12) drop-shadow(0 0 8px rgba(255, 220, 120, 0.55));
}

.btn-game-nav:active {
    transform: translateY(1px) scale(0.96);
    filter: brightness(0.9);
}

/* 属性网格 */
.attribute-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.attribute-card {
    background: #2d4f36;
    padding: 20px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 8px rgba(212, 175, 55, 0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #5a8a6e;
}

.attribute-card h4 {
    color: #000;
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: bold;
}

.attribute-value {
    font-size: 32px;
    font-weight: bold;
    color: #ffffff;
    margin: 12px 0;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* 属性按钮容器 - 支持+1和+10按钮 */
.attribute-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-attribute {
    background: #2c3e50;
    color: #fff;
    border: 1px solid #d4af37;
    border-radius: 4px;
    width: 40px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-attribute:hover {
    background: #d4af37;
    color: #0a0e27;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
}

.btn-attribute:active {
    transform: scale(0.95);
}

/* 派生属性区域 */
.derived-attributes,
.cultivation-attributes {
    background: #2d4f36;
    padding: 22px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
    border: 1px solid #5a8a6e;
}

.derived-attributes h3,
.cultivation-attributes h3 {
    color: #ffeb8a;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(255, 235, 138, 0.4), 0 0 20px rgba(212, 175, 55, 0.2);
}

.derived-attr,
.cultivation-attr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px 0;
    border-bottom: 1px solid #5a6a9e;
}

.derived-attr span:first-child,
.cultivation-attr span:first-child {
    color: #dddddd;
    font-size: 16px;
}

.derived-attr span:last-child,
.cultivation-attr span:last-child {
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.derived-attr:last-child,
.cultivation-attr:last-child {
    border-bottom: none;
}

/* 修仙属性区域特殊标记 - 金色发光边框 */
.cultivation-attributes {
    background: #2d3f66;
    border: 2px solid #ffeb8a;
    box-shadow: 0 0 15px rgba(255, 235, 138, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cultivation-attr span:last-child {
    color: #ffeb8a;
    text-shadow: 0 0 8px rgba(255, 235, 138, 0.4);
}

/* 加载覆盖层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    border: 4px solid #2c3e50;
    border-top: 4px solid #d4af37;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

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

.loading-overlay p {
    color: #d4af37;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* 确认弹窗 */
.attribute-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.attribute-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #162040;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 235, 138, 0.15);
    border: 2px solid #ffeb8a;
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    color: #ffeb8a;
    margin-top: 0;
    text-shadow: 0 0 15px rgba(255, 235, 138, 0.4), 0 0 30px rgba(212, 175, 55, 0.2);
}

.preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid #5a6a9e;
}

.preview-label {
    color: #cccccc;
    font-size: 15px;
}

.preview-value {
    color: #ffeb8a;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 235, 138, 0.3);
}

.preview-increase {
    color: #cccccc;
    font-weight: bold;
}

.preview-increase.increase {
    color: #4ade80;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.preview-increase.decrease {
    color: #f87171;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn-modal {
    padding: 10px 25px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid;
}

.btn-cancel {
    background: #2c3e50;
    color: #ccc;
    border-color: #4a5a6e;
}

.btn-cancel:hover {
    background: #34495e;
    border-color: #ccc;
}

.btn-confirm {
    background: #d4af37;
    color: #0a0e27;
    border-color: #d4af37;
    font-weight: bold;
}

.btn-confirm:hover {
    background: #f0e68c;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* 响应式调整 - 移动端框体优化 */
@media (max-width: 768px) {
    .game-container {
        margin: 10px auto;
        padding: 15px;
    }
    
    .game-header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .game-header h2 {
        font-size: 1.25rem;
    }
    
    .game-header p {
        font-size: 0.875rem;
    }
    
    .game-stats {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .game-stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .stat-card {
        padding: 12px 10px;
        border-radius: 8px;
    }
    
    .stat-card h3 {
        font-size: 13px;
        margin: 0 0 6px 0;
    }
    
    .stat-value {
        font-size: 24px;
        margin: 6px 0;
    }
    
    .game-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-main,
    .game-sidebar {
        padding: 15px;
        border-radius: 8px;
    }
    
    .attribute-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .attribute-card {
        padding: 12px 10px;
        border-radius: 8px;
    }
    
    .attribute-card h4 {
        font-size: 16px;
        margin: 0 0 8px 0;
    }
    
    .attribute-value {
        font-size: 24px;
        margin: 8px 0;
    }
    
    .attribute-buttons {
        margin-top: 8px;
        gap: 6px;
    }
    
    .btn-attribute {
        width: 36px;
        height: 28px;
        font-size: 14px;
    }
    
    .derived-attributes,
    .cultivation-attributes {
        padding: 15px 12px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .derived-attributes h3,
    .cultivation-attributes h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .derived-attr,
    .cultivation-attr {
        margin: 8px 0;
        padding: 6px 0;
    }
    
    .derived-attr span:first-child,
    .cultivation-attr span:first-child {
        font-size: 14px;
    }
    
    .derived-attr span:last-child,
    .cultivation-attr span:last-child {
        font-size: 18px;
    }
    
    .btn-game {
        padding: 10px;
        margin: 8px 0;
        font-size: 14px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-content h3 {
        font-size: 18px;
    }
    
    .modal-buttons {
        margin-top: 15px;
        gap: 10px;
    }
    
    .btn-modal {
        padding: 8px 20px;
        font-size: 14px;
    }
}

/* 数字变化动画 */
@keyframes valueChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.attribute-value.change {
    animation: valueChange 0.3s ease;
}

/* Toast消息提示 */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    max-width: 90%;
    width: auto;
}

.toast-message {
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: toastSlideDown 0.3s ease forwards;
    opacity: 0;
    transform: translateY(-20px);
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-message.hide {
    animation: toastSlideUp 0.3s ease forwards;
}

.toast-message.success {
    background: rgba(40, 167, 69, 0.85);
    border: 1px solid #28a745;
}

.toast-message.error {
    background: rgba(220, 53, 69, 0.85);
    border: 1px solid #dc3545;
}

.toast-message.warning {
    background: rgba(255, 193, 7, 0.85);
    border: 1px solid #ffc107;
    color: #000000;
}

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

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

/* 移动端适配 */
@media (max-width: 768px) {
    .toast-container {
        top: 60px;
        max-width: 95%;
    }
    
    .toast-message {
        font-size: 13px;
        padding: 10px 16px;
    }
}

/* 经验进度条样式 */
.exp-progress-container {
    margin-top: 10px;
    text-align: center;
}

.exp-progress-bar {
    width: 100%;
    height: 16px;
    background-color: #1a3a2a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #3a6a4a;
    margin-bottom: 5px;
}

.exp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #ffeb8a);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.exp-progress-text {
    font-size: 12px;
    color: #cccccc;
    opacity: 0.8;
}

/* 可折叠卡片 - 灵石显示优化 */
.collapsible-card {
    position: relative;
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.toggle-icon {
    font-size: 12px;
    color: #ffeb8a;
    transition: transform 0.3s ease;
    opacity: 0.8;
    text-shadow: 0 0 8px rgba(255, 235, 138, 0.4);
}

.collapsible-card.collapsed .toggle-icon {
    transform: rotate(0deg);
}

.collapsible-card.expanded .toggle-icon {
    transform: rotate(180deg);
}

.collapsible-card.collapsed .collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 0;
}

.collapsible-card.expanded .collapsible-content {
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 10px;
}

/* 灵石详情容器 */
.stone-detail-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 10px;
}

.stone-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stone-detail-row:last-child {
    border-bottom: none;
}

.stone-detail-row span:first-child {
    color: #cccccc;
    font-size: 14px;
}

.stone-detail-row span:last-child {
    color: #ffeb8a;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 235, 138, 0.4);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .collapsible-header {
        padding: 5px 0;
    }
    
    .stone-detail-row {
        padding: 4px 0;
    }
    
    .stone-detail-row span:first-child {
        font-size: 13px;
    }
    
    .stone-detail-row span:last-child {
        font-size: 15px;
    }
}