/* ============================================================
   凯冠商城 全站样式 static/app.css
   参照截图 UI：绿色主按钮、深蓝点缀、卡片式布局
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f5f5; color: #333; max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 60px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 顶部搜索栏 */
.search-bar { display: flex; align-items: center; background: #16305a; padding: 10px 14px; }
.search-bar input { flex: 1; border: none; border-radius: 18px; padding: 8px 14px; font-size: 14px; outline: none; }

/* 导航 Tab */
.nav-tabs { display: flex; gap: 18px; background: #16305a; color: #d8d8d8; padding: 10px 14px 12px; font-size: 15px; }
.nav-tabs a.active { color: #fff; font-weight: bold; }

/* 轮播 Banner */
.banner { margin: 10px; border-radius: 10px; overflow: hidden; }
.banner img { width: 100%; }

/* 区块标题 */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 12px 8px; }
.sec-head h3 { font-size: 17px; }
.sec-head span { font-size: 12px; color: #999; }

/* 商品网格（两列） */
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 12px; }
.goods-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.goods-card .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eee; }
.goods-card .info { padding: 8px 10px 12px; }
.goods-card .name { font-size: 13px; line-height: 1.4; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.goods-card .price { color: #333; font-weight: bold; margin: 6px 0 8px; }

/* 绿色主按钮（登录/购买/保存） */
.btn-primary { display: block; width: 100%; background: #14a327; color: #fff; border: none; border-radius: 24px; padding: 12px; font-size: 16px; text-align: center; cursor: pointer; }
.btn-buy { background: #16305a; color: #fff; border: none; border-radius: 14px; padding: 6px 16px; font-size: 13px; }

/* 商品详情页：JS 驱动横向轮播（手指滑动 / 鼠标拖动 / 箭头 / 圆点） */
.swiper { position: relative; background: #000; overflow: hidden; }   /* 超出部分裁掉 */
.swiper-track {
    display: flex;                       /* 横向并排 */
    transition: transform .3s ease;      /* 切换动画 */
    will-change: transform;
    cursor: grab;                        /* 提示可拖动 */
    touch-action: pan-y;                 /* 允许纵向滚动页面，横向交给 JS */
}
.swiper-track.dragging { transition: none; cursor: grabbing; }        /* 拖动中去掉动画 */
.swiper .swiper-slide { flex: 0 0 100%; }                            /* 每张占满一屏宽 */
.swiper .swiper-slide img { width: 100%; aspect-ratio: 1; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.swiper .counter { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; border-radius: 12px; padding: 2px 10px; pointer-events: none; }

/* 左右箭头 */
.swiper .arrow-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; line-height: 28px; text-align: center;
    background: rgba(0,0,0,.35); color: #fff; border-radius: 50%; font-size: 16px; cursor: pointer;
}
.swiper .arrow-btn.prev { left: 8px; }
.swiper .arrow-btn.next { right: 8px; }

/* 底部圆点指示 */
.swiper .dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.swiper .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.45); }
.swiper .dots i.on { background: #fff; width: 14px; border-radius: 3px; }
.pd-price-row { display: flex; gap: 6px; padding: 8px 12px 0; align-items: center; flex-wrap: wrap; }
.tag { background: #eef3fb; color: #16305a; border: 1px solid #16305a; border-radius: 14px; font-size: 12px; padding: 3px 10px; }
.pd-price { font-size: 20px; font-weight: bold; }
.pd-title { font-size: 16px; font-weight: bold; padding: 6px 12px; line-height: 1.5; }
.pd-meta { display: flex; justify-content: space-between; color: #999; font-size: 12px; padding: 0 12px 10px; }
.card { background: #fff; border-radius: 10px; margin: 10px 12px; padding: 12px; }
.spec-row { display: flex; justify-content: space-between; align-items: center; }
.arrow { color: #ccc; }

/* 规格弹层 */
.spec-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 99; }
.spec-panel { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; background: #fff; border-radius: 14px 14px 0 0; padding: 14px; display: none; z-index: 100; max-height: 70vh; overflow: auto; }
.spec-item { display: inline-block; border: 1px solid #16305a; color: #16305a; border-radius: 14px; padding: 5px 12px; font-size: 13px; margin: 4px 6px 4px 0; cursor: pointer; }
.spec-item.on { background: #16305a; color: #fff; }
.num-ctrl { display: inline-flex; align-items: center; gap: 10px; }
.num-ctrl button { width: 28px; height: 28px; border: 1px solid #ddd; background: #fff; border-radius: 6px; }

/* 底部操作栏（详情页） */
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; background: #fff; display: flex; align-items: center; padding: 8px 12px; gap: 8px; box-shadow: 0 -2px 8px rgba(0,0,0,.06); z-index: 90; }
.bottom-bar .op { text-align: center; font-size: 11px; color: #666; width: 44px; }
.bottom-bar .op .ico { font-size: 18px; }
.btn-cart { flex: 1; background: #9aa6bd; color: #fff; border: none; border-radius: 22px; padding: 11px; font-size: 15px; }
.btn-buy2 { flex: 1; background: #16305a; color: #fff; border: none; border-radius: 22px; padding: 11px; font-size: 15px; }

/* 底部 TabBar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; background: #fff; display: flex; border-top: 1px solid #eee; z-index: 90; }
.tabbar a { flex: 1; text-align: center; padding: 8px 0 10px; font-size: 11px; color: #888; }
.tabbar a .ico { font-size: 20px; display: block; }
.tabbar a.active { color: #16305a; }

/* 表单（登录/地址） */
.form-item { display: flex; align-items: center; gap: 8px; background: #fff; border-bottom: 1px solid #eee; padding: 14px 16px; }
.form-item input { flex: 1; border: none; outline: none; font-size: 15px; }

/* 订单/地址列表 */
.cell { background: #fff; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f0f0f0; }

/* 会员中心头部 */
.me-head { background: #16305a; color: #fff; padding: 18px 16px 0; }
.me-stats { display: flex; text-align: center; padding: 14px 0; }
.me-stats div { flex: 1; }
.me-stats b { display: block; font-size: 18px; }
.me-stats span { font-size: 12px; color: #cfd8ea; }

/* 订单状态宫格 */
.order-grid { display: flex; background: #fff; padding: 12px 0; margin-top: 10px; }
.order-grid a { flex: 1; text-align: center; font-size: 12px; color: #555; position: relative; }
.order-grid .ico { font-size: 22px; display: block; margin-bottom: 4px; }
.order-grid .badge { position: absolute; top: -6px; right: 18%; background: #e33; color: #fff; font-size: 10px; border-radius: 10px; padding: 0 5px; }

/* 后台管理 admin.css 复用部分样式 */
.admin-wrap { max-width: 100%; }
.admin-nav { background: #1f2d3d; color: #fff; }
.admin-nav a { color: #c6cbd4; display: block; padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.admin-nav a.active { background: #16305a; color: #fff; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { border-bottom: 1px solid #eee; padding: 10px; font-size: 13px; text-align: left; }
.table th { background: #f8f9fb; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; border: 1px solid #ddd; background: #fff; cursor: pointer; }
.btn-del { color: #e33; border-color: #e33; }
