/* 现代化样式 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

* {
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, 'PingFang SC', 'Hiragino Sans GB', sans-serif
}

html,
body {
    height: auto;
    min-height: 100%;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #f3f7fb 0%, #ffffff 100%);
    color: #222
}

.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(20, 20, 30, 0.04);
    color: #0f172a;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10
}

.site-header h1 {
    margin: 0;
    font-size: 20px;
    color: #0b1220
}

.nav {
    display: flex;
    align-items: center;
    gap: 14px
}

.nav a {
    color: #334155;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px
}

.nav a:hover {
    background: rgba(15, 23, 42, 0.04)
}

.container {
    padding: 32px;
    max-width: 1100px;
    margin: 26px auto;
    background: transparent
}

.panel {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(11, 20, 32, 0.06);
    border: 1px solid rgba(11, 20, 32, 0.04)
}

.screen h2 {
    margin-top: 0;
    font-weight: 600;
    color: #0b1220
}

.list {
    display: block;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border: 1px solid rgba(15, 23, 42, 0.03)
}

.product-left {
    display: flex;
    gap: 12px;
    align-items: center
}

.product-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}

.product-thumb img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.product-info {
    min-width: 220px
}

.product-info h3 {
    margin: 0;
    font-size: 16px;
    margin-bottom: 6px;
}

.product-info .meta {
    font-size: 13px;
    color: #64748b
}

.product-qty {
    display: flex;
    align-items: center;
    gap: 8px
}

.qty-btn {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: #fff;
    cursor: pointer;
    color: #000;
}

.qty-input {
    width: 56px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e6eef5;
    text-align: center
}

.product-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px
}

.add-btn {
    padding: 8px 12px;
    border-radius: 8px;
    background: linear-gradient(180deg, #10b981, #047857);
    color: #fff;
    border: 0;
    cursor: pointer
}

.remove-btn {
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: 6px 10px;
    border-radius: 8px;
    color: #334155
}

/* pagination */
#pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center
}

#pagination button {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: #fff;
    cursor: pointer
}

#pagination button[disabled] {
    opacity: 0.5;
    cursor: not-allowed
}

#pagination button.active {
    background: linear-gradient(180deg, #2563eb, #1e40af);
    color: #fff;
    border-color: transparent
}

.meta {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px
}

.login-panel {
    max-width: 480px;
    margin: 48px auto;
    padding: 28px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    box-shadow: 0 12px 36px rgba(14, 30, 37, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.04)
}

.login-panel h2 {
    margin: 0 0 8px
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px
}

.form-field input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #e6eef5;
    font-size: 15px
}

.form-actions {
    /*display: flex;*/
    gap: 12px;
    align-items: center;
    margin-top: 12px
}

.form-actions .link-muted {
    color: #64748b;
    text-decoration: none
}

.btn-primary {
    background: linear-gradient(180deg, #2563eb, #1e40af);
    color: #fff;
    border: 0;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: 10px 14px;
    border-radius: 10px;
    color: #334155
}

.badge {
    display: inline-block;
    background: #eef2ff;
    color: #0b69ff;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    margin-right: 6px
}

.price {
    color: #ef4444;
    font-weight: 700;
    font-size: 16px
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto
}

button {
    background: linear-gradient(180deg, #2563eb, #1e40af);
    color: #fff;
    border: 0;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600
}

button.secondary {
    background: linear-gradient(180deg, #94a3b8, #64748b)
}

#pagination button {
    color: black;
}

#controls .qty {
    width: 72px;
    padding: 8px;
    border: 1px solid #e6eef5;
    border-radius: 8px
}

#cart-list,
#orders-list,
#order-detail {
    padding: 8px
}

.select.repair-select,
select.repair-select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e6eef5;
    background: #fff;
    margin-top: 6px
}

/* 将加入购物车按钮放右下角 */
.card .add {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 8px 12px;
    border-radius: 10px
}

.card {
    display: flex;
    margin-bottom: 10px;
}

#orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#cart-list,
#orders-list,
#order-detail {
    padding: 8px
}

#cart-list,
#orders-list,
#order-detail {
    padding: 8px
}

.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border: 1px solid rgba(15, 23, 42, 0.03);
    margin-bottom: 10px
}

.cart-row.sold-out {
    opacity: 0.6
}

.cart-actions {
    margin-top: 14px;
    display: flex;
    gap: 12px
}

.hint {
    color: #64748b
}

.muted {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 14px;
}

.empty {
    padding: 28px;
    text-align: center;
    color: #94a3b8
}

@media (max-width:760px) {
    .grid {
        grid-template-columns: 1fr
    }

    .site-header {
        padding: 10px 12px
    }

    .container {
        padding: 16px
    }
}

.sold-badge {
    display: inline-block;
    background: #6b7280;
    color: #fff;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12px;
    margin-left: 8px
}

#place-order[disabled] {
    opacity: 0.5;
    cursor: not-allowed
}

.remove-sold-btn {
    background: #ef4444;
    color: #fff;
    border: 0;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 8px
}

.TVAM {
    display: inline-block;
    color: #4dd007;
    background: #d6f1c9;
    padding: 6px 4px;
    border-radius: 3px;
    font-size: 12px;
}

.TVAC {
    display: inline-block;
    color: #0353f4;
    background: #d3def6;
    padding: 6px 4px;
    border-radius: 3px;
    font-size: 12px;
}

.type_container {
  display: flex;           /* 启用 Flexbox 布局 */
  align-items: center;     /* 关键：使子元素在交叉轴（垂直方向）居中 */
  gap: 2px;                /* 可选：设置图片与文字之间的间距 */
  font-size: 13px;         /* 设置基础字体大小，便于图片高度使用 em 单位 */
}

.type_container img {
  height: 1em;           /* 图片高度设置为字体大小的倍数，保持比例协调 */
  /* 不需要 vertical-align */
}

.type_container span {
  line-height: 1.2;        /* 可选：微调多行文本的行高，优化视觉效果 */
}

.type-functional {
    color: #4dd007;
}

.type-repair {
    color: #ef4444;
}



.listing-grade {
    /*flex-basis: 210px;
    flex-shrink: 0;
    flex-grow: 0;
    display: flex;
    justify-content: flex-start;*/
    padding: 2px 3px;
    border-radius: 3px;
    display: inline-block;
    background: linear-gradient(135deg, #f5f8fc 0%, #eef3f9 100%);
    /*border: 1px solid #d8e1ee;*/
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.listing-grade .grade {
    font-size: 12px;
    font-weight: 600;
    height: 24px;
    line-height: 24px;
    border-radius: 4px;
    display: inline-flex;
    padding: 0 4px;
    width: auto;
    margin: 0;
    text-align: center;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    color: #3d4657;
}

.listing-grade .grade .grade-container {
    display: flex;
    flex-direction: row;
    gap: 1px;
}

.listing-grade .grade.multi-grade .grade:first-child {
    margin-left: 5px;
    /*margin-right: 5px;*/
}

.listing-grade .grade.multi-grade .grade.grade-A {
    background: #ffd966;
    box-shadow: 0 1px 3px rgba(255, 193, 7, 0.4);
    z-index: 5;
    color: #8b6f00;
}

.listing-grade .grade.multi-grade .grade.grade-B {
    background: #cbd5e0;
    box-shadow: 0 1px 3px rgba(107, 114, 128, 0.3);
    z-index: 4;
    color: #2d3748;
}

.listing-grade .grade.multi-grade .grade.grade-C {
    background: #f5a962;
    box-shadow: 0 1px 3px rgba(245, 127, 23, 0.4);
    z-index: 3;
    color: #fff;
}

.listing-grade .grade.multi-grade .grade.grade-D {
    background: #4a5568;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 2;
    color: #fff;
}

.listing-grade .grade.multi-grade .grade {
    height: 18px;
    width: 18px;
    text-align: center;
    line-height: 18px;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    flex-grow: 0;
    flex-shrink: 0;
    padding: 0;
    margin: 0 0 0 -6px;
    position: relative;
    transition: transform 0.15s ease;
}

.listing-grade .grade.multi-grade .grade:hover {
    transform: scale(1.1);
}

/* 标签栏样式 */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    /*border-bottom: 2px solid #eee;
    padding-bottom: 10px;*/
}

/* 单个标签样式 */
.tab-item {
    padding: 12px 24px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    color: black;
}

/* 选中标签样式（高亮） */
.tab-item.active {
    background: #0b69ff;
    color: #fff;
}

.tab-item:hover:not(.active) {
    background: #e8e8e8;
}