:root {
    --bg: #0f172a;
    --card: #111827;
    --primary: #38bdf8;
    --secondary: #f97316;
    --text: #f9fafb;
    --muted: #cbd5e1;
    --border: #4b5563;
}

body {
    margin: 0;
    font-family: 'Segoe UI', 'PingFang SC', sans-serif;
    background: linear-gradient(180deg, #050914, #0f1528);
    color: var(--text);
}

.container {
    max-width: 75%;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.9);
}
.site-header .container {
    max-width: 90%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.logo {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.2rem;
}

nav a {
    color: var(--text);
    margin-left: 1rem;
    text-decoration: none;
    font-weight: 500;
}

nav a:hover {
    color: var(--primary);
}

.nav-links,
.nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.45rem 0.9rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

.nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 手机端适配 */
@media (max-width: 640px) {
    .container { max-width: 100%; padding: 0 12px; }
    .header-inner { flex-wrap: wrap; gap: 8px; }
    .nav-links { flex-wrap: wrap; gap: 8px; }
    .nav-btn { flex: 1 1 48%; min-width: 140px; text-align: center; }
    main { padding: 12px 0; }
    .inventory-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .inventory-card img { max-width: 100%; height: auto; }
    .table-responsive { overflow-x: auto; }
    form input, form select, form textarea { width: 100%; box-sizing: border-box; }
    .card, .form-section { padding: 12px; }
    /* 登录/表单页面可读性 */
    .form-section h1 { font-size: 20px; }
    .form-section p.muted { font-size: 13px; line-height: 1.6; }
    .form-group label { font-size: 13px; }
}

.nav-auth form {
    margin: 0;
}

.home-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2.5rem 0 1rem;
}

.hero-left h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.8rem;
    background: rgba(248, 250, 252, 0.1);
    border: 1px solid rgba(248, 250, 252, 0.3);
    border-radius: 999px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.hero-stats div {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}

.hero-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-card {
    background: #101726;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 1.3rem;
}

.hero-card.highlight {
    background: linear-gradient(135deg, #1a2338, #2d3a53);
    border-color: rgba(56, 189, 248, 0.4);
}

.hero-card .card-title {
    color: #94a3b8;
    font-size: 0.85rem;
}

.ticker {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ticker li {
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.9rem;
}

.quick-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.nav-item {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 16px;
    padding: 1.3rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item.hot .label {
    color: #fb7185;
}

.nav-item.red .label {
    color: #f97316;
}

.label {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.product-section {
    margin: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.product-card {
    background: rgba(15, 23, 42, 0.85);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 1rem;
    text-align: center;
    position: relative;
}

.product-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.2);
    border-radius: 999px;
}

.product-img {
    height: 120px;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.2));
}

.price {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.features {
    padding: 2rem 0 4rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.feature-card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.feature-card.glass {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(6px);
}

.feature-card h3 {
    margin-top: 0;
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 更紧凑的内边距 */
    padding: 0.5rem 1rem;
    /* 扁平风格：较小圆角（不再是 pill） */
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease, transform 0.08s ease;
    /* 取消可能的卡片/浮动阴影，保持扁平 */
    box-shadow: none;
    /* 统一高度，便于布局对齐 */
    min-height: 36px;
    line-height: 1;
}

.btn.primary {
    background: var(--primary);
    color: #0f172a;
}

.btn.secondary {
    background: var(--primary);
    color: #0f172a;
}
.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 交互状态：微小按下与可访问性 focus 可视化 */
.btn:active {
    transform: translateY(1px) scale(0.995);
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
    border-radius: 8px;
}

.form-section {
    padding: 3rem 0 4rem;
}

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    align-items: center;
}

.qr-box {
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
}

.qr-box img {
    width: 220px;
    height: 220px;
}

.pay-info p {
    margin: 0.4rem 0;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 0.3rem;
    color: var(--muted);
}

input,
select {
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
    color: var(--text);
}

.tip {
    color: var(--muted);
    font-size: 0.85rem;
}

.message {
    margin-top: 1rem;
    min-height: 1.5rem;
}

.message.success {
    color: #4ade80;
}

.message.error {
    color: #fb7185;
}

.auth-panel .message {
    color: #0f172a;
}

.auth-panel .message.success {
    color: #16a34a;
}

.auth-panel .message.error {
    color: #dc2626;
}

.payment-modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 23, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.payment-modal.hidden {
    display: none;
}

.payment-dialog {
    background: #0b1220;
    border-radius: 24px;
    padding: 1.5rem;
    max-width: 520px;
    width: 90%;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.payment-dialog iframe {
    width: 100%;
    height: 340px;
    border: none;
    border-radius: 16px;
    background: #fff;
}

.payment-close {
    border: none;
    background: transparent;
    color: #cbd5f5;
    font-size: 1.4rem;
    float: right;
    cursor: pointer;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.inventory-grid.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.inventory-card {
    background: rgba(238, 239, 242, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(81, 81, 27, 0.967);
    padding: 1rem;
    text-align: center;
}

.inventory-card img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    margin-bottom: 0.8rem;
}

.inventory-card.compact {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
    padding: 0.9rem;
}

.inventory-card.compact img {
    width: 72px;
    height: 72px;
    margin: 0;
    flex-shrink: 0;
}

.inventory-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.inventory-card-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.inventory-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.inventory-link {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
}

.table th,
.table td {
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.3rem;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0 2rem;
    color: var(--muted);
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        gap: 0.5rem;
    }
}
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.auth-modal {
    display: flex;
    background: #0b1220;
    border-radius: 24px;
    overflow: hidden;
    max-width: 980px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.auth-media {
    width: 45%;
    background: url('https://steamcommunity-a.akamaihd.net/economy/image/Gg5y7z-wcD1ZZZ') center/cover no-repeat, #1c253b;
    position: relative;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
}

.media-badge {
    display: inline-block;
    background: linear-gradient(90deg, #f97316, #facc15);
    color: #1e1e1e;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.auth-panel {
    flex: 1;
    background: #f4f6fb;
    padding: 1.5rem;
    position: relative;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-tabs {
    display: inline-flex;
    background: #e3e8f5;
    border-radius: 999px;
    padding: 0.2rem;
}

.auth-tab {
    border: none;
    background: transparent;
    color: #475569;
    padding: 0.4rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

.auth-tab.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.auth-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: #475569;
}

.auth-content {
    display: none;
    margin-top: 1rem;
}

.auth-panel[data-panel="register"] #register-panel,
.auth-panel[data-panel="login"] #login-panel {
    display: block;
}

.panel-desc {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.inline-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    margin-bottom: 1rem;
}

.input-split {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.5rem;
}

.input-split button {
    grid-column: 2 / 3;
}

.btn.subtle {
    background: #e2e8f0;
    color: #0f172a;
    border-radius: 8px;
}

.btn.full {
    width: 100%;
}

.agreement {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    margin-bottom: 0.8rem;
}

.agreement a {
    color: var(--secondary);
    text-decoration: none;
}
/* 商品飞到购物车动画 */
.flying-item {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    pointer-events: none;
    z-index: 13000;
    transform: translate(0, 0) scale(1);
    opacity: 1;
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.6s;
    background: #f5f5f5;
    border: 1px solid #e5e7eb;
}
.flying-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.price-line{
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;     /* 不换行 */
  flex-wrap: nowrap;       /* 不换行 */
  overflow: hidden;        /* 太长就裁掉 */
  text-overflow: ellipsis; /* 需要时显示省略号 */
}

.price-line > span{
  white-space: nowrap;
}

* {
    box-sizing: border-box;
}
 
/* ✅ Mobile 顶部栏：右侧动作区整体靠右 */
.mobile-topbar .inner{
    display:flex;
    align-items:center;
    gap:10px;
}

/* 右侧按钮容器：吃掉中间空间 => 靠右 */
.mobile-topbar .top-actions{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:10px;
}

/* 如果你希望余额按钮也跟着购物车一起靠右（成一组） */
.mobile-topbar .balance-pill{
    margin-left:10px; /* 可选：和购物车拉开点距离 */
}


/* 让色条固定在卡片底部 */
.inv-thumb { position: relative; }

/* 磨损色条容器 */
.wear-meter{
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 8px;
  height: 4px;
  z-index: 5;
  pointer-events: none; /* 避免挡住点击 */
}

/* 色条本体：按 FN/MW/FT/WW/BS 分段 */
.wear-meter-bar{
  position: absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
  background: linear-gradient(90deg,
    #0b5ed7 0%,   #0b5ed7 7%,    /* FN 深蓝（贴近你 FN 蓝系） */
    #32ae4f 7%,   #32ae4f 15%,   /* MW 深绿 */
    #9f7a1c 15%,  #c39216 38%,   /* FT 深金黄 */
    #c05621 38%,  #c05621 45%,   /* WW 深橙 */
    #8b1e1e 45%,  #8b1e1e 100%   /* BS 深红 */

  );
  opacity: 0.92;
}
/* 指针：倒立黑色三角 */
.wear-meter-pointer{
  position: absolute;
  top: -8px;                 /* 控制与色条的距离 */
  left: 0%;
  transform: translateX(-50%);
  width: 0;
  height: 0;

  /* 倒立三角（尖端朝下） */
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid #0f172a;   /* 深黑灰，和你整体 UI 很搭 */

  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

/* 移除原本的竖线 */
.wear-meter-pointer::after{
  display: none;
}
/* 数值标签（你截图那种底部数字） */
.wear-meter-label{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: rgba(15, 23, 42, .9);
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

/* 如果你卡片底部还有别的 badge，可能需要给图片底部留空间 */
.inv-thumb img{ display:block; }
/* ===== 手机端适配：磨损条更可见 + 不挡内容 =====
   这里用 768px（与站内移动端断点一致），避免部分设备/浏览器不命中 640px 导致样式异常。 */
@media (max-width: 768px){

  /* 色条：加粗一点、贴更底、左右留点边 */
  .wear-meter{
    left: 4px;
    right: 4px;
    bottom: 4px;
    height: 3px;            /* 小卡片也能看清 */
  }

  /* 色条：边框/阴影稍微加强，避免糊 */
  .wear-meter-bar{
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,.22),
      0 1px 2px rgba(0,0,0,.20);
  }

  /* 指针：缩小并贴近色条 */
  .wear-meter-pointer{
    top: -5px;
    border-left-width: 4px;
    border-right-width: 4px;
    border-top-width: 6px;
  }

  /* 数值：小胶囊，避免遮挡武器图 */
  .wear-meter-label{
    left: auto;
    right: 6px;
    bottom: 14px;           /* 在色条上方一点 */
    text-align: right;
    font-size: 9px;
    font-weight: 800;
    color: rgba(15, 23, 42, .92);
    text-shadow: none;

    background: rgba(255,255,255,.78);
    padding: 1px 6px;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
    display: inline-flex;
    align-items: center;
    line-height: 1.1;
    white-space: nowrap;
  }
}

