/* 泓太汇 - 科技感商城样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: #1e293b; background: #f5f7fb; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* 顶部导航 - 科技渐变 */
.topbar {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 2px 20px rgba(79, 70, 229, .25);
    position: relative; z-index: 10;
}
.topbar-inner {
    max-width: 1200px; margin: 0 auto; padding: 14px 16px;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.logo {
    font-size: 24px; font-weight: 800; letter-spacing: 2px;
    background: linear-gradient(90deg, #22d3ee, #a5b4fc);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo small { font-size: 12px; font-weight: normal; letter-spacing: 1px; color: #c7d2fe; margin-left: 8px; }
.searchbox { flex: 1; display: flex; min-width: 240px; }
.searchbox input {
    flex: 1; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1);
    padding: 10px 16px; border-radius: 8px 0 0 8px; font-size: 14px; outline: none; color: #fff;
}
.searchbox input::placeholder { color: #a5b4fc; }
.searchbox input:focus { background: rgba(255,255,255,.18); }
.searchbox button {
    border: none; background: linear-gradient(90deg, #06b6d4, #3b82f6); color: #fff;
    padding: 10px 22px; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 14px;
}
.searchbox button:hover { filter: brightness(1.1); }
.top-links a { color: #e0e7ff; margin-left: 18px; font-size: 14px; transition: color .2s; }
.top-links a:hover { color: #22d3ee; }
.cart-badge { background: #22d3ee; color: #0f172a; border-radius: 10px; padding: 1px 7px; font-size: 12px; margin-left: 4px; font-weight: bold; }

/* 分类导航 */
.catnav { background: #fff; border-bottom: 1px solid #eef2f7; box-shadow: 0 2px 8px rgba(30, 41, 59, .04); }
.catnav-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; }
.catnav a { padding: 13px 18px; font-size: 15px; color: #475569; border-bottom: 3px solid transparent; transition: all .2s; }
.catnav a:hover, .catnav a.active { color: #4f46e5; border-bottom-color: #4f46e5; }

/* 主体 */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }

/* banner - 科技渐变 */
.banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 55%, #06b6d4 120%);
    color: #fff; border-radius: 16px; padding: 44px 40px; margin-bottom: 24px;
    box-shadow: 0 12px 40px rgba(79, 70, 229, .3);
}
.banner h1 { font-size: 30px; margin-bottom: 8px; letter-spacing: 1px; }
.banner p { opacity: .9; color: #e0e7ff; }

.section-title { font-size: 20px; font-weight: 700; margin: 28px 0 16px; color: #0f172a; }
.section-title span {
    background: linear-gradient(90deg, #4f46e5, #06b6d4);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* 商品网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card {
    background: #fff; border-radius: 14px; overflow: hidden;
    transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column;
    border: 1px solid #eef2f7;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(79, 70, 229, .18); border-color: #c7d2fe; }
.card-img { height: 160px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 40px; font-weight: bold; flex-direction: column; }
img.card-img { width: 100%; height: 160px; object-fit: cover; display: block; }
img.detail-img { object-fit: contain; background: #fff; }
.card-img .cat { font-size: 13px; font-weight: normal; opacity: .95; margin-top: 4px; }
.card-body { padding: 13px 15px; flex: 1; display: flex; flex-direction: column; }
.card-name { font-size: 15px; font-weight: 600; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name:hover { color: #4f46e5; }
.card-spec { font-size: 12px; color: #94a3b8; margin: 4px 0 8px; }
.card-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.price {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-size: 19px; font-weight: 800;
}
.price small { font-size: 12px; font-weight: normal; }
.add-btn {
    background: linear-gradient(90deg, #4f46e5, #7c3aed); color: #fff; border: none;
    padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;
    box-shadow: 0 2px 10px rgba(79, 70, 229, .3); transition: all .2s;
}
.add-btn:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(79, 70, 229, .45); }

/* 列表页布局 */
.list-layout { display: flex; gap: 20px; }
.sidebar { width: 180px; flex-shrink: 0; background: #fff; border-radius: 14px; padding: 14px; height: fit-content; border: 1px solid #eef2f7; }
.sidebar h4 { margin-bottom: 10px; font-size: 15px; color: #0f172a; }
.sidebar a { display: block; padding: 8px 12px; color: #475569; font-size: 14px; border-radius: 8px; transition: all .2s; }
.sidebar a:hover, .sidebar a.active { background: #eef2ff; color: #4f46e5; }
.sidebar a .n { float: right; color: #cbd5e1; font-size: 12px; }
.list-main { flex: 1; }
.list-toolbar { background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; color: #475569; border: 1px solid #eef2f7; }

/* 详情页 */
.detail { display: flex; gap: 24px; background: #fff; border-radius: 16px; padding: 26px; border: 1px solid #eef2f7; }
.detail-img { width: 380px; height: 320px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; flex-direction: column; font-size: 60px; font-weight: bold; flex-shrink: 0; }
.detail-info { flex: 1; }
.detail-info h1 { font-size: 24px; margin-bottom: 10px; color: #0f172a; }
.detail-price { background: #f5f7ff; padding: 16px 18px; border-radius: 12px; margin: 14px 0; border: 1px solid #e0e7ff; }
.detail-price .price { font-size: 32px; }
.detail-meta { color: #64748b; font-size: 14px; margin: 10px 0; }
.detail-meta span { margin-right: 24px; }
.qty-box { display: flex; align-items: center; gap: 0; margin: 18px 0; }
.qty-box button, .qty-box input { width: 40px; height: 38px; text-align: center; border: 1px solid #e2e8f0; background: #fff; font-size: 15px; }
.qty-box input { width: 60px; }
.buy-btn {
    background: linear-gradient(90deg, #4f46e5, #7c3aed); color: #fff; border: none;
    padding: 13px 42px; font-size: 16px; border-radius: 10px; cursor: pointer; margin-right: 10px;
    box-shadow: 0 4px 16px rgba(79, 70, 229, .35); transition: all .2s;
}
.buy-btn:hover { filter: brightness(1.1); box-shadow: 0 6px 24px rgba(79, 70, 229, .5); }
.desc { margin-top: 20px; color: #475569; font-size: 14px; line-height: 1.8; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
th { background: #f8fafc; color: #475569; font-weight: 600; }
.text-right { text-align: right; }
.total-bar { background: #fff; border-radius: 14px; padding: 18px 22px; margin-top: 16px; display: flex; justify-content: flex-end; align-items: center; gap: 20px; border: 1px solid #eef2f7; }
.total-bar .price { font-size: 26px; }

/* 表单 */
.form-card { background: #fff; border-radius: 14px; padding: 26px; max-width: 640px; border: 1px solid #eef2f7; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 14px; color: #475569; }
.form-row input, .form-row textarea, .form-row select {
    width: 100%; padding: 11px 13px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; transition: all .2s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); outline: none; }
.form-row textarea { resize: vertical; }
.primary-btn {
    background: linear-gradient(90deg, #4f46e5, #7c3aed); color: #fff; border: none;
    padding: 12px 38px; font-size: 16px; border-radius: 10px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(79, 70, 229, .35); transition: all .2s;
}
.primary-btn:hover { filter: brightness(1.1); box-shadow: 0 6px 24px rgba(79, 70, 229, .5); }
.secondary-btn {
    background: #fff; color: #475569; border: 1px solid #e2e8f0; padding: 11px 28px;
    font-size: 15px; border-radius: 10px; cursor: pointer; transition: all .2s;
}
.secondary-btn:hover { border-color: #6366f1; color: #4f46e5; }

/* 消息提示 */
.flash { padding: 11px 17px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.flash.err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: #94a3b8; background: #fff; border-radius: 14px; border: 1px solid #eef2f7; }
.empty .icon { font-size: 52px; }

/* 成功页 */
.success-box { background: #fff; border-radius: 16px; padding: 40px; text-align: center; border: 1px solid #eef2f7; }
.success-box .icon { font-size: 62px; color: #06b6d4; }
.success-box h2 { margin: 16px 0 8px; }
.order-no { font-size: 20px; color: #4f46e5; font-weight: 700; margin: 12px 0; }

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 8px 15px; background: #fff; border-radius: 8px; color: #475569; border: 1px solid #e2e8f0; }
.pager a:hover { color: #4f46e5; border-color: #6366f1; }
.pager .cur { background: linear-gradient(90deg, #4f46e5, #7c3aed); color: #fff; border: none; }

/* 页脚 */
.footer { text-align: center; color: #94a3b8; font-size: 13px; padding: 26px; margin-top: 32px; }

@media (max-width: 720px) {
    .container { padding: 12px 10px; }
    .topbar-inner { flex-direction: column; gap: 10px; padding: 10px 12px; }
    .topbar-inner .logo { font-size: 18px; }
    .searchbox { width: 100%; min-width: 0; }
    .top-links { display: flex; flex-wrap: wrap; }
    .top-links a { margin-left: 0; margin-right: 14px; font-size: 13px; }
    .catnav-inner { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .catnav-inner a { white-space: nowrap; padding: 10px 14px; font-size: 14px; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-img { height: 130px; }
    .card-name { font-size: 13px; }
    .price { font-size: 16px; }
    .detail { flex-direction: column; padding: 16px; }
    .detail-img { width: 100%; height: 240px; }
    .detail-info h1 { font-size: 20px; }
    .list-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    table { display: block; overflow-x: auto; }
    .form-card { padding: 16px; }
    .buy-btn { padding: 10px 24px; font-size: 15px; }
    .banner { padding: 24px 20px; }
    .banner h1 { font-size: 20px; }
}
