* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0b0c15;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    background: #1e1f2c;
    border-radius: 28px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 1100px;
    padding: 24px;
    color: #f0f0f0;
}

h1 {
    text-align: center;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffd966, #ffb347);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.game-layout {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.left-panel {
    flex: 1.2;
    min-width: 260px;
}

.right-panel {
    flex: 2;
    min-width: 300px;
}

.panel {
    background: #262838;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #3d405b;
}

.panel h3 {
    color: #ffd966;
    margin-bottom: 16px;
    border-left: 4px solid #ffb347;
    padding-left: 12px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    font-size: 14px;
}

.stat-label {
    font-weight: bold;
    color: #b9c3ff;
}

.stat-value {
    color: #f5f5f5;
    font-weight: 600;
}

.hp-bar, .mp-bar {
    background: #171a28;
    border-radius: 20px;
    overflow: hidden;
    margin: 12px 0;
    height: 10px;
}

.hp-fill {
    background: #4caf50;
    height: 100%;
    width: 100%;
}

.mp-fill {
    background: #2196f3;
    height: 100%;
}

.combat-log {
    background: #12131c;
    border-radius: 20px;
    padding: 12px;
    height: 180px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
    margin: 15px 0;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

button {
    background: #ff914d;
    border: none;
    padding: 8px 16px;
    font-weight: bold;
    border-radius: 60px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #ffb347;
    transform: scale(1.02);
}

.sub-btn {
    background: #4a4e72;
    color: white;
}

.sub-btn:hover {
    background: #5f6490;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.equip-slot {
    background: #1e1f2c;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ffb34755;
}

.equip-slot:hover {
    background: #2c2e42;
}

.slot-name {
    font-size: 12px;
    color: #ffb347;
}

.equip-name {
    font-weight: bold;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1f2132;
    border-radius: 24px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
}

.item-list, .dungeon-list {
    max-height: 300px;
    overflow-y: auto;
}

.item-option, .dungeon-option {
    background: #2c2e42;
    margin: 8px 0;
    padding: 10px;
    border-radius: 16px;
    cursor: pointer;
}

.item-option:hover, .dungeon-option:hover {
    background: #3d405b;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #cdd9ff;
}

input {
    width: 100%;
    padding: 12px 16px;
    background: #2c2e42;
    border: 1px solid #454b6e;
    border-radius: 60px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
}

input:focus {
    border-color: #ffb347;
    box-shadow: 0 0 0 2px rgba(255, 180, 71, 0.3);
}

.register-link {
    text-align: center;
    margin-top: 24px;
}

.register-link a {
    color: #ffb347;
    cursor: pointer;
    text-decoration: underline;
}

.error-msg {
    color: #ff8a7a;
    font-size: 0.8rem;
    margin-top: 8px;
    text-align: center;
}

.save-tip {
    font-size: 12px;
    color: #9aa3c7;
    text-align: right;
    margin-top: 8px;
}

.dungeon-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.dungeon-option {
    background: #ff914d;
    color: #1e1f2c;
    text-align: center;
}

.cancel-btn {
    background: #4a4e72;
    color: white;
    width: 100%;
    margin-top: 12px;
}

/* 背包网格 */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.inventory-slot {
    background: #1e1f2c;
    border-radius: 16px;
    padding: 10px;
    border: 2px solid #ffb34755;
    transition: 0.1s;
}

.inventory-slot:hover {
    background: #2c2e42;
}

.item-name {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 5px;
}

.item-stats {
    font-size: 11px;
    color: #ccc;
    margin: 8px 0;
}

.item-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.item-actions button {
    padding: 4px 8px;
    font-size: 12px;
    background: #4a4e72;
    color: white;
    border-radius: 20px;
}

.item-actions button:hover {
    background: #5f6490;
}

.empty-inventory {
    text-align: center;
    color: #aaa;
    padding: 20px;
}
.sell-all-area {
    text-align: right;
    margin-bottom: 10px;
}
.sell-all-btn {
    background: #c74f2b;
    color: white;
    padding: 5px 12px;
    font-size: 14px;
}
.sell-all-btn:hover {
    background: #e06c3c;
}
.sell-all-btn {
    background: #c74f2b;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}
.sell-all-btn:hover {
    background: #e06c3c;
}
/* 背包网格 - 更紧凑，每行4-5个 */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 10px;
    max-height: 500px;
    overflow-y: auto;
}
.inventory-slot {
    background: #1e1f2c;
    border-radius: 12px;
    padding: 6px;
    border: 1px solid #ffb34755;
    font-size: 12px;
}
.inventory-slot .item-name {
    font-size: 13px;
    margin-bottom: 4px;
}
.inventory-slot .item-stats {
    font-size: 10px;
    margin: 4px 0;
}
.inventory-slot .item-actions button {
    padding: 2px 6px;
    font-size: 10px;
}
/* 分页控制条 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 12px;
    font-size: 14px;
}
.pagination button {
    background: #4a4e72;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
}
.pagination button:hover {
    background: #5f6490;
}
.pagination span {
    color: #ffb347;
}
#settingsModal label {
    display: block;
    margin: 8px 0;
    cursor: pointer;
}
/* 设置弹窗样式 */
.settings-title {
    color: #ffd966;
    text-align: center;
}
.settings-label {
    color: #ffb347;
    font-weight: bold;
}
/* 装备栏属性小字 */
.item-stats-small {
    font-size: 10px;
    color: #aaa;
    margin: 4px 0;
    line-height: 1.2;
    word-break: break-word;
}

/* 装备槽内卸下按钮样式调整 */
.equip-slot .equip-actions button {
    padding: 2px 8px;
    font-size: 11px;
    background: #c74f2b;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}
.equip-slot .equip-actions button:hover {
    background: #e06c3c;
}
.equip-stats {
    font-size: 10px;
    color: #aaa;
    margin: 4px 0;
    line-height: 1.3;
}
.equip-slot .unequip-btn {
    padding: 2px 6px;
    font-size: 10px;
    background: #4a4e72;
    border-radius: 20px;
}
.equip-slot .unequip-btn:hover {
    background: #5f6490;
}
.enhance-item {
    background: #ffaa33;
    color: #1e1f2c;
}
.enhance-item:hover {
    background: #ffcc55;
}
.filter-buttons {
    margin-bottom: 10px;
}
.filter-btn {
    background: #4a4e72;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px;
    cursor: pointer;
    transition: 0.2s;
}
.filter-btn.active-filter {
    background: #ff914d;
    color: #1e1f2c;
}
.filter-btn:hover {
    background: #5f6490;
}
/* 物品记录卡片 */
.item-log-panel {
    margin-top: 16px;
}
.item-log {
    background: #12131c;
    border-radius: 20px;
    padding: 12px;
    height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
}
.item-log div {
    margin-bottom: 4px;
    border-bottom: 1px dotted #2a2c42;
    padding-bottom: 4px;
    color: #8bc34a;  /* 淡绿色，与战斗日志区分 */
}
/* 锻造炉 */
.forge-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #3d405b;
    padding-bottom: 10px;
}
.forge-tab {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 12px;
    transition: 0.2s;
}
.forge-tab:hover {
    color: #ffb347;
}
.forge-tab.active {
    color: #ffd966;
    border-bottom: 2px solid #ffb347;
}
.forge-tab-pane {
    display: none;
}
.forge-tab-pane.active {
    display: block;
}
.forge-item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
}
.forge-item-card {
    background: #1e1f2c;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #ffb347;
}
.forge-item-info {
    flex: 2;
}
.forge-item-name {
    font-weight: bold;
}
.forge-item-stats {
    font-size: 12px;
    color: #ccc;
}
.forge-item-cost {
    flex: 1;
    text-align: right;
    font-size: 12px;
    color: #ffb347;
}
.forge-item-actions {
    flex: 1;
    text-align: right;
}
.forge-info {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    margin-top: 10px;
}

/* 锻造炉模态框内标题颜色 */
.forge-tab-pane h4 {
    color: #ffb347;
    border-left: 4px solid #ffb347;
    padding-left: 12px;
    margin-bottom: 16px;
}

/* 强化列表分组标题 */
.forge-group-title {
    color: #ffd966;
    font-size: 1rem;
    margin: 12px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #3d405b;
}

/* 弹窗按钮区域居中（适用于单个按钮） */
.modal .modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

/* 锻造炉模态框整体宽度增加 */
#forgeModal .modal-content {
    max-width: 800px;  /* 原可能为600px，增加至800px */
    width: 90%;
}

/* 装备卡片布局优化，确保属性显示完整 */
.forge-item-card {
    display: flex;
    flex-wrap: wrap;      /* 小屏幕时换行 */
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

/* 装备信息区域占据更多空间 */
.forge-item-info {
    flex: 2;
    min-width: 200px;
}

/* 属性文本允许换行 */
.forge-item-stats {
    white-space: normal;
    word-break: break-word;
    font-size: 12px;
    color: #ccc;
}

/* 消耗区域保持紧凑 */
.forge-item-cost {
    flex: 0 0 auto;
    text-align: right;
    font-size: 12px;
    color: #ffb347;
}

/* 操作按钮区域 */
.forge-item-actions {
    flex: 0 0 auto;
}

.forge-item-props {
    font-size: 11px;
    color: #b0b0b0;
    margin-top: 5px;
    line-height: 1.3;
    word-break: break-word;
}
/* 商店样式 */
.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #3d405b;
    padding-bottom: 10px;
}
.shop-tab {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 12px;
    transition: 0.2s;
}
.shop-tab:hover {
    color: #ffb347;
}
.shop-tab.active {
    color: #ffd966;
    border-bottom: 2px solid #ffb347;
}
.shop-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
}
.shop-item-card {
    background: #1e1f2c;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #ffb347;
}
.shop-item-name {
    font-weight: bold;
    font-size: 1rem;
}
.shop-item-price {
    color: #ffb347;
}
.shop-empty {
    text-align: center;
    color: #aaa;
    padding: 20px;
}
/* 商品名称更显眼 */
.shop-item-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #ffd966;   /* 改为金色，更醒目 */
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}
/* 价格也加强显示 */
.shop-item-price {
    color: #ffb347;
    font-size: 1rem;
    font-weight: bold;
}

.shop-item-limit {
    font-size: 12px;
    color: #8bc34a;
    margin-top: 4px;
}

/* 制造界面 */
.craft-recipe-card {
    background: #1e1f2c;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    border-left: 4px solid #ffb347;
}
.craft-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffd966;
    margin-bottom: 8px;
}
.craft-desc {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 8px;
}
.craft-missing {
    color: #ff8a7a;
    font-size: 12px;
    margin-bottom: 8px;
}
.craft-btn {
    background: #ff914d;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
}
.craft-btn:disabled {
    background: #4a4e72;
    cursor: not-allowed;
}
.craft-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 10px 0;
}

/* 制造等级标签 */
.craft-level-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.craft-level-tab {
    background: #4a4e72;
    border: none;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.2s;
}
.craft-level-tab.active {
    background: #ff914d;
    color: #1e1f2c;
}
.craft-level-tab:hover {
    background: #5f6490;
}
/* 注册模态框输入框优化 */
#registerModal input {
    margin-bottom: 16px;
    padding: 12px 16px;
    font-size: 1rem;
}
#registerModal .modal-buttons button {
    padding: 10px 0;
    font-size: 1rem;
    border-radius: 40px;
}
#registerModal .cancel-btn {
    background: #4a4e72;
    color: white;
}
#registerModal .cancel-btn:hover {
    background: #5f6490;
}
#registerModal input {
    border-radius: 30px;
    background: #2c2e42;
    border: 1px solid #454b6e;
    color: #fff;
}
#registerModal h3 {
    margin-bottom: 30px;
    font-size: 1.6rem;
    color: #ffd966;
    text-align: center;
    text-shadow: 0 0 3px #000;
}
#registerModal input {
    margin-bottom: 16px;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 30px;
    background: #2c2e42;
    border: 1px solid #454b6e;
    color: #fff;
}
#registerModal .modal-buttons button {
    padding: 10px 0;
    font-size: 1rem;
    border-radius: 40px;
}
#registerModal .cancel-btn {
    background: #4a4e72;
    color: white;
}
#registerModal .cancel-btn:hover {
    background: #5f6490;
}
