
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Quicksand', 'Segoe UI', Roboto, sans-serif;
}

/* 主体背景：柔和的蓝紫渐变 */
body {
    background: linear-gradient(145deg, #eef2f9 0%, #dfe7f5 100%);
    min-height: 100vh;
    color: #2d3a4b;
    padding-bottom: 20px;
}

/* ---------- 登录/注册页面 ---------- */
.auth-bg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #b8c9f0 0%, #d0b7e8 100%);
}
.auth-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    border-radius: 48px;
    padding: 32px 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    text-align: center;
}
.auth-card h1 {
    font-size: 2.6rem;
    margin-bottom: 8px;
    background: linear-gradient(145deg, #6c5ce7, #a463f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(108, 92, 231, 0.2);
    letter-spacing: 2px;
}
.subtitle {
    color: #5b6e8c;
    margin-bottom: 28px;
    font-weight: 500;
}
.auth-card input {
    width: 100%;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.7);
    color: #1a2634;
    font-size: 1rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.9);
}
.auth-card input:focus {
    border-color: #6c5ce7;
    background: white;
}
.auth-card button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(145deg, #6c5ce7, #a463f5);
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 20px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.3);
}
.auth-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(108, 92, 231, 0.4);
}
.switch {
    margin-top: 24px;
    color: #5b6e8c;
}
.switch a {
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 600;
}
.error {
    background: #ffdad9;
    border: 1px solid #ff5e5e;
    color: #b00020;
    padding: 12px;
    border-radius: 30px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}
.success {
    background: #d8f0e2;
    border: 1px solid #2ecc71;
    color: #1e7e34;
    padding: 12px;
    border-radius: 30px;
    margin-bottom: 15px;
}

/* ---------- 导航栏（水平菜单式） ---------- */
.navbar {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    padding: 10px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* 隐藏汉堡按钮和覆盖层 */
.menu-toggle {
    display: none;
}

.menu-overlay {
    display: none;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    background: transparent;
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    box-shadow: none;
    overflow: visible;
    flex-direction: row;
}

.nav-links a {
    color: #2d3a4b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 40px;
    transition: 0.2s;
    text-align: center;
    white-space: nowrap;
    background: transparent;
    border: none;
}

.nav-links a.active {
    background: #6c5ce7;
    color: white;
}

.nav-links a:hover {
    background: #f0f3fe;
}

/* 响应式：小屏幕允许换行，并缩小字体 */
@media (max-width: 768px) {
    .nav-links a {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
}

@media (max-width: 600px) {
    .nav-links a {
        font-size: 0.8rem;
        padding: 5px 8px;
    }
}

/* ---------- 主容器 ---------- */
.container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* ---------- 卡片通用样式 ---------- */
.card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 22px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.card h3 {
    margin-bottom: 16px;
    font-size: 1.3rem;
    color: #3a4a5e;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card h3::before {
    content: '✨';
    font-size: 1.5rem;
    opacity: 0.8;
}

/* 欢迎卡片 */
.welcome h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: #2d3a4b;
}
.gold {
    background: linear-gradient(145deg, #f5b342, #f9d56e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    font-size: 1.7rem;
}

/* 资源网格 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.resource-item {
    background: white;
    border-radius: 24px;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.res-icon {
    font-size: 1.8rem;
}
.res-name {
    font-weight: 600;
    font-size: 0.7rem;
    color: #5b6e8c;
    margin: 3px 0;
}
.res-qty {
    font-weight: 600;
    color: #6c5ce7;
    font-size: 0.9rem;
    background: rgba(108, 92, 231, 0.1);
    padding: 2px 8px;
    border-radius: 30px;
}

/* 市场卡片列表 */
.market-orders {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* 订单卡片 */
.order-card.compact {
    background: white;
    border-radius: 24px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0,0,0,0.02);
    border: 1px solid rgba(255, 255, 255, 0.8);
}
.order-card.compact .order-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    margin-bottom: 10px;
}
.order-card.compact .order-badge {
    padding: 4px 12px;
    font-size: 0.75rem;
    border-radius: 40px;
    font-weight: 600;
}
.order-badge.buy {
    background: #6c5ce7;
    color: white;
}
.order-badge.sell {
    background: #ff85b3;
    color: white;
}
.order-card.compact .res-icon-small {
    font-size: 1.3rem;
}
.order-card.compact .order-detail {
    background: #f5f7fd;
    border-radius: 30px;
    padding: 4px 12px;
    font-size: 0.85rem;
    color: #2d3a4b;
}
.order-card.compact .order-detail .label {
    font-weight: 500;
    color: #6c5ce7;
    margin-right: 4px;
}
.order-card.compact .order-trader {
    color: #6c5ce7;
    font-weight: 600;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 4px;
}
.order-card.compact .order-action {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.order-card.compact .order-action input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 40px;
    background: #f0f3fe;
    font-size: 0.9rem;
    border: 1px solid #d9e0f0;
}
.order-card.compact .order-action button {
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 8px 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.2);
}
.order-card.compact .cancel-btn {
    background: #ffe2e2;
    color: #b00020;
    padding: 8px 18px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #ffb3b3;
}

/* 迷你订单卡片（用于首页） */
.order-card.mini {
    background: white;
    border-radius: 20px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.order-card.mini .order-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
}
.order-card.mini .order-badge {
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 30px;
}
.order-card.mini .res-icon-small {
    font-size: 1.1rem;
}
.order-card.mini .order-detail {
    background: #f5f7fd;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    color: #2d3a4b;
}
.order-card.mini .order-trader {
    color: #6c5ce7;
    font-weight: 600;
    font-size: 0.75rem;
    width: 100%;
}

/* 视图切换按钮 */
.view-toggle {
    display: flex;
    gap: 8px;
}
.view-toggle a {
    padding: 5px 12px;
    border-radius: 40px;
    background: white;
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(108, 92, 231, 0.3);
}
.view-toggle a.active {
    background: #6c5ce7;
    color: white;
    border-color: transparent;
}

/* 筛选表单 */
.filter-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.5);
    padding: 12px;
    border-radius: 40px;
}
.filter-form select, .filter-form button, .filter-form a {
    padding: 6px 12px;
    border-radius: 40px;
    border: none;
    background: white;
    color: #2d3a4b;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.filter-form button {
    background: #6c5ce7;
    color: white;
    border: none;
}
.filter-form a {
    background: #f0f3fe;
    color: #6c5ce7;
}

/* 挂单表单 */
.place-order-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.place-order-form select, .place-order-form input {
    flex: 1 1 100px;
    padding: 10px 14px;
    border-radius: 40px;
    border: 1px solid #d9e0f0;
    background: white;
    font-size: 0.85rem;
    outline: none;
}
.place-order-form button {
    flex: 0 0 90px;
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.2);
}

/* 排行榜 */
.rank ol {
    padding-left: 24px;
}
.rank li {
    margin: 8px 0;
    font-size: 1rem;
    color: #2d3a4b;
}

/* 个人资料表格 */
.profile-table {
    width: 100%;
    border-collapse: collapse;
}
.profile-table td {
    padding: 12px 5px;
    border-bottom: 1px dashed #cbd5e0;
}

/* 消息弹窗 */
.message-pop {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    padding: 12px 28px;
    border-radius: 60px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 0 0 1px rgba(255,255,255,0.6);
    color: #2d3a4b;
    font-weight: 600;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
    max-width: 90%;
    font-size: 0.9rem;
}
.message-pop.error {
    color: #b00020;
    background: #ffebee;
}
.message-pop.success {
    color: #1e7e34;
    background: #e6f7e6;
}
@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* 响应式优化 */
@media (max-width: 640px) {
    .market-orders {
        grid-template-columns: 1fr;
    }
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}