/* TechEnterprise 主题 v3.1 - 图2风格浅色电商交易平台 */
/* 主色调: 蓝色 #2979FF / 背景 #F5F7FA / 侧边栏 #FFFFFF / 文字 #333/#666/#999 */

:root{
  --te-primary:#2979FF;--te-primary-light:#5B9BFF;--te-primary-dark:#1A6FE3;--te-accent:#2979FF;--te-accent-dim:#1A6FE3;
  --te-bg:#F5F7FA;--te-sidebar-bg:#FFFFFF;--te-text:#333333;--te-text-muted:#666666;--te-text-hint:#999999;
  --te-border:#E0E6ED;--te-card:#FFFFFF;--te-card-hover:#FAFBFC;
  --te-success:#28a745;--te-danger:#FF5252;--te-warning:#ff9900;--te-alert-bg:#FFEBEE;--te-alert-border:#FF5252;
  --te-radius:8px;--te-radius-sm:4px;
  --te-shadow:0 2px 8px rgba(0,0,0,.06);--te-shadow-lg:0 4px 16px rgba(0,0,0,.1);
  --te-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang SC","Microsoft YaHei",sans-serif;
  --te-navbar-h:50px;--te-sidebar-w:220px;--te-container-w:1400px;
}
[data-theme="dark"]{--te-bg:#1a1f2e;--te-sidebar-bg:#141822;--te-card:#222834;--te-card-hover:#2d3548;--te-border:#374055;--te-text:#e4e7eb;--te-text-muted:#9ca3af;--te-text-hint:#6b7280;--te-shadow:0 2px 8px rgba(0,0,0,.3);--te-shadow-lg:0 4px 16px rgba(0,0,0,.4);}
[data-theme="light"]{--te-bg:#F5F7FA;--te-sidebar-bg:#FFFFFF;--te-card:#FFFFFF;--te-card-hover:#FAFBFC;--te-border:#E0E6ED;--te-text:#333333;--te-text-muted:#666666;--te-text-hint:#999999;}

/* ========== 基础 ========== */
.te-body,.te-auth-body{margin:0;font-family:var(--te-font);background:var(--te-bg);color:var(--te-text);min-height:100vh;overflow-x:hidden;}
*{box-sizing:border-box;}
a{color:var(--te-accent);text-decoration:none;}a:hover{opacity:.85;}
#tech-enterprise-root{max-width:var(--te-container-w);margin:0 auto;position:relative;}
.te-main{padding:1rem 0;max-width:var(--te-container-w);margin:0 auto;}

/* ========== 3D 动效背景（可选，默认关闭） ========== */
.te-hero-bg{position:fixed;top:0;left:0;width:100%;height:320px;z-index:0;pointer-events:none;overflow:hidden;}
.te-hero-fallback{position:absolute;inset:0;background:linear-gradient(135deg,var(--te-accent) 0%,var(--te-primary-light) 50%,var(--te-accent) 100%);opacity:.08;}
.te-hero-canvas{position:absolute;inset:0;width:100%;height:100%;}

/* ========== 顶部导航栏 50px ========== */
.te-navbar{background:var(--te-card);border-bottom:1px solid var(--te-border);position:sticky;top:0;z-index:1000;box-shadow:var(--te-shadow);}
.te-brand{color:var(--te-text)!important;font-weight:600;font-size:1.1rem;}
.te-brand-logo{width:28px;height:28px;border-radius:var(--te-radius-sm);}
.te-brand-name{letter-spacing:.5px;}
.te-nav-link{color:var(--te-text-muted)!important;font-size:.9rem;transition:color .2s;}
.te-nav-link:hover,.te-nav-link.te-active{color:var(--te-accent)!important;}
.te-search .input-group-text{background:var(--te-card);border:1px solid var(--te-border);color:var(--te-text-muted);}
.te-search .form-control{background:var(--te-card);border:1px solid var(--te-border);color:var(--te-text);}
.te-search .form-control:focus{border-color:var(--te-accent);box-shadow:0 0 0 .15rem rgba(74,144,226,.15);}
.te-lang-btn,.te-user-btn{color:var(--te-text);background:transparent;border:1px solid var(--te-border);}
.te-lang-btn:hover,.te-user-btn:hover{border-color:var(--te-accent);}
.te-lang-menu{background:var(--te-card);border:1px solid var(--te-border);}
.te-lang-menu .dropdown-item{color:var(--te-text);}
.te-lang-menu .dropdown-item:hover{background:var(--te-card-hover);}
.te-avatar{width:32px;height:32px;border-radius:50%;object-fit:cover;border:1px solid var(--te-border);}
.te-username{font-size:.85rem;font-weight:600;color:var(--te-text);}
.te-balance{font-size:.72rem;color:var(--te-text-muted);}
.te-balance-val{color:var(--te-success);}
.te-user-menu{background:var(--te-card);border:1px solid var(--te-border);}
.te-user-menu .dropdown-item{color:var(--te-text);}
.te-user-menu .dropdown-item:hover{background:var(--te-card-hover);}
.te-logout{color:var(--te-danger)!important;}
.te-auth-btns{display:flex;gap:.5rem;align-items:center;}
.te-btn-primary{background:var(--te-accent);color:#fff!important;border:none;font-weight:500;transition:opacity .2s;}
.te-btn-primary:hover{opacity:.88;}
.te-btn-outline{background:transparent;color:var(--te-accent)!important;border:1px solid var(--te-accent);}
.te-btn-outline:hover{background:var(--te-accent);color:#fff!important;}
.te-toggler{border-color:var(--te-border);}
.te-text-muted{color:var(--te-text-muted);}

/* ========== 跑马灯（核心视觉动效） ========== */
.marquee-container{background:var(--te-accent);overflow:hidden;width:100%;height:40px;position:relative;z-index:1;}
.marquee-content{color:#ffffff;white-space:nowrap;animation:marquee_scroll 20s linear infinite;will-change:transform;display:inline-block;line-height:40px;font-size:.9rem;padding-left:100%;}
@keyframes marquee_scroll{from{transform:translateX(0);}to{transform:translateX(-100%);}}
@media(prefers-reduced-motion:reduce){.marquee-content{animation:none;transform:none;padding-left:0;}}

/* ========== 红色警示横幅 ========== */
.te-alert-banner{border:1px solid var(--te-alert-border);background:var(--te-alert-bg);border-radius:var(--te-radius-sm);padding:.75rem 1rem;margin-bottom:.5rem;color:var(--te-danger);font-size:.85rem;display:flex;align-items:center;gap:.5rem;}

/* ========== 蓝色法律声明条 ========== */
.te-notice-bar{background:var(--te-accent);color:#FFFFFF;padding:.6rem 1rem;margin-bottom:.75rem;border-radius:var(--te-radius-sm);font-size:.82rem;display:flex;align-items:center;gap:.5rem;}

/* ========== 功能按钮组 ========== */
.te-func-bar{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem;}
.te-func-btn{display:inline-flex;align-items:center;gap:.4rem;background:var(--te-card);color:var(--te-accent);border:1px solid var(--te-border);border-radius:var(--te-radius);padding:.45rem .9rem;font-size:.82rem;cursor:pointer;transition:all .2s;}
.te-func-btn:hover{border-color:var(--te-accent);background:var(--te-card-hover);}

/* ========== 左侧边栏 220px ========== */
.te-layout{display:flex;min-height:calc(100vh - var(--te-navbar-h));}
.sidebar-nav{width:var(--te-sidebar-w);background:var(--te-sidebar-bg);border-right:1px solid var(--te-border);box-shadow:1px 0 4px rgba(0,0,0,.04);position:sticky;top:var(--te-navbar-h);height:calc(100vh - var(--te-navbar-h));overflow-y:auto;flex-shrink:0;z-index:800;}
.sidebar-nav__list{list-style:none;margin:0;padding:.5rem 0;}
.sidebar-nav__item a{display:flex;align-items:center;gap:.5rem;padding:.7rem 1rem;color:var(--te-text);font-size:.875rem;transition:all .2s;border-left:3px solid transparent;}
.sidebar-nav__item a:hover{background:var(--te-card-hover);color:var(--te-accent);}
.sidebar-nav__item a.is-active{color:var(--te-accent);border-left-color:var(--te-accent);background:var(--te-card);}
.sidebar-nav__item i{font-style:normal;width:20px;text-align:center;}
.te-layout__main{flex:1;min-width:0;padding:1rem 1.25rem;}

/* 移动端汉堡菜单按钮 */
.sidebar-toggle{display:none;background:var(--te-card);border:1px solid var(--te-border);border-radius:var(--te-radius-sm);width:40px;height:40px;align-items:center;justify-content:center;cursor:pointer;color:var(--te-text);font-size:1.2rem;}
.sidebar-toggle:hover{border-color:var(--te-accent);color:var(--te-accent);}
.sidebar-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.4);z-index:899;}

/* ========== 面板/卡片 ========== */
.te-panel{background:var(--te-card);border:1px solid var(--te-border);border-radius:var(--te-radius);margin-bottom:1.25rem;box-shadow:var(--te-shadow);position:relative;z-index:1;}
.te-panel-header{display:flex;align-items:center;gap:.6rem;padding:1rem 1.25rem;border-bottom:1px solid var(--te-border);}
.te-panel-icon{color:var(--te-accent);font-size:1.1rem;display:inline-flex;}
.te-panel-title{margin:0;font-size:.95rem;font-weight:600;color:var(--te-text);letter-spacing:.3px;}
.te-panel-body{padding:1.25rem;}

/* ========== 分类标签 ========== */
.te-category-bar{overflow-x:auto;-webkit-overflow-scrolling:touch;margin-bottom:1rem;}
.te-chip-list{display:flex;gap:.5rem;flex-wrap:wrap;}
.te-chip{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .9rem;border-radius:20px;background:var(--te-card-hover);color:var(--te-text-muted);font-size:.82rem;cursor:pointer;transition:all .2s;white-space:nowrap;border:1px solid transparent;}
.te-chip:hover{border-color:var(--te-border);}
.te-chip.is-active{background:var(--te-accent);color:#fff!important;font-weight:500;}
.te-chip-icon{width:18px;height:18px;border-radius:50%;display:inline-block;}

/* ========== 产品列表表格 ========== */
.te-product-table{width:100%;border-collapse:collapse;background:var(--te-card);border-radius:var(--te-radius);overflow:hidden;box-shadow:var(--te-shadow);table-layout:fixed;}
.te-product-table thead th{background:var(--te-sidebar-bg);color:var(--te-text-muted);font-size:.8rem;font-weight:600;padding:.75rem 1rem;text-align:left;border-bottom:1px solid var(--te-border);}
.te-product-table thead th.col-name{width:auto;}
.te-product-table thead th.col-stock{width:100px;}
.te-product-table thead th.col-price{width:120px;}
.te-product-table thead th.col-action{width:110px;}
.te-product-table tbody td{padding:.6rem 1rem;border-bottom:1px solid var(--te-border);color:var(--te-text);font-size:.85rem;}
.te-product-table tbody tr:hover{background:var(--te-card-hover);}
.te-product-table tbody tr:nth-child(even){background:var(--te-card-hover);}
.te-product-table tbody tr:last-child td{border-bottom:none;}
.te-product-table .col-price{font-weight:600;}
.te-product-table .col-stock{color:var(--te-success);}
.te-product-table .btn-buy{background:var(--te-accent);color:#fff;border:none;border-radius:var(--te-radius-sm);padding:.4rem .9rem;font-size:.8rem;cursor:pointer;transition:opacity .2s;text-align:center;display:inline-block;}
.te-product-table .btn-buy:hover{opacity:.88;}
/* V3.3 废弃：售罄按钮改用 .btn-soldout，此类保留不删避免影响其他引用 */
.te-product-table .btn-buy.is-disabled{background:var(--te-text-muted);cursor:not-allowed;opacity:.6;pointer-events:none;}
.te-product-table .btn-soldout{display:inline-block;background:var(--te-text-muted);color:#fff;border:none;border-radius:var(--te-radius-sm);padding:.4rem .9rem;font-size:.8rem;cursor:not-allowed;pointer-events:none;text-decoration:none;white-space:nowrap;}
.te-product-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
.te-product-table tbody tr.is-soldout{opacity:.6;}
.te-stock-tag{background:var(--te-success);color:#fff;border-radius:12px;padding:.2rem .6rem;font-size:.78rem;font-weight:500;white-space:nowrap;display:inline-block;}
.te-stock-tag.is-soldout{background:var(--te-danger);}
.te-price-symbol{color:var(--te-danger);font-weight:600;}
.te-price-amount{color:var(--te-text);font-weight:600;}
.te-product-icon{width:36px;height:36px;border-radius:var(--te-radius-sm);object-fit:cover;flex-shrink:0;}
.te-product-name-cell{display:flex;align-items:center;gap:.6rem;}
.te-product-name{font-weight:500;color:var(--te-text);}
.te-product-badges{display:inline-flex;align-items:center;gap:.3rem;flex-wrap:wrap;}
/* V3.3 废弃：已售文字已移除渲染，此类保留不删避免影响其他引用 */
.te-sold-count{color:var(--te-text-muted);font-size:.72rem;}
.te-item-list{width:100%;}

/* 标签色 */
.badge-recommend{background:#fff5e6;color:#ff9900;border:1px solid #ff9900;border-radius:var(--te-radius-sm);padding:.15rem .5rem;font-size:.72rem;}
.badge-multi{background:#e6f7ee;color:#28a745;border:1px solid #28a745;border-radius:var(--te-radius-sm);padding:.15rem .5rem;font-size:.72rem;}

/* ========== 商品网格 ========== */
.te-item-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;}
.te-item-loading{text-align:center;color:var(--te-text-muted);padding:2rem;grid-column:1/-1;}

/* ========== 页脚 ========== */
.te-footer{background:var(--te-card);border-top:1px solid var(--te-border);padding:1rem 0;text-align:center;position:relative;z-index:1;}
.te-footer-icp{color:var(--te-text-muted);font-size:.8rem;}

/* ========== 会员中心 ========== */
.te-nav-wrap{position:sticky;top:0;z-index:900;}
.te-nav{display:flex;align-items:center;justify-content:space-between;background:var(--te-card);border-bottom:1px solid var(--te-border);padding:0 1rem;height:var(--te-navbar-h);box-shadow:var(--te-shadow);}
.te-brand{display:flex;align-items:center;gap:.5rem;}
.te-brand__logo{width:28px;height:28px;border-radius:var(--te-radius-sm);}
.te-brand__name{color:var(--te-text);font-weight:600;}
.te-nav__list{display:flex;align-items:center;gap:.25rem;list-style:none;margin:0;padding:0;}
.te-nav__item{display:flex;align-items:center;gap:.3rem;padding:.5rem .8rem;color:var(--te-text-muted);font-size:.85rem;cursor:pointer;transition:color .2s;}
.te-nav__item:hover{color:var(--te-accent);}
.te-has-sub{position:relative;}
.te-submenu{position:absolute;top:100%;left:0;background:var(--te-card);border:1px solid var(--te-border);border-radius:var(--te-radius);min-width:180px;box-shadow:var(--te-shadow-lg);padding:.5rem 0;display:none;z-index:1000;}
.te-has-sub:hover .te-submenu{display:block;}
.te-subitem{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;color:var(--te-text-muted);font-size:.85rem;}
.te-subitem:hover{background:var(--te-card-hover);color:var(--te-accent);}
.te-subitem__badge{background:var(--te-accent);color:#fff;border-radius:10px;padding:0 6px;font-size:.7rem;}
.te-nav__right{display:flex;align-items:center;gap:.75rem;}
.te-nav__link{display:flex;align-items:center;gap:.3rem;color:var(--te-text-muted);font-size:.85rem;}
.te-nav__link:hover{color:var(--te-accent);}
.te-card{background:var(--te-card);border:1px solid var(--te-border);border-radius:var(--te-radius);box-shadow:var(--te-shadow);margin-bottom:1.25rem;position:relative;z-index:1;}
.te-card__body{padding:1.25rem;}
.te-cta{display:inline-flex;align-items:center;gap:.4rem;background:var(--te-accent);color:#fff;border:none;border-radius:var(--te-radius-sm);padding:.6rem 1.2rem;font-weight:500;cursor:pointer;transition:opacity .2s;}
.te-cta:hover{opacity:.88;}
.te-info{display:flex;flex-direction:column;gap:.75rem;}
.te-info__row{display:flex;justify-content:space-between;align-items:center;padding:.5rem 0;border-bottom:1px solid var(--te-border);}
.te-info__k{color:var(--te-text-muted);font-size:.85rem;}
.te-info__v{color:var(--te-text);font-size:.85rem;}
.te-ip{color:var(--te-accent);}
.te-warn{color:var(--te-warning);font-size:.75rem;}
.te-minibtn{display:inline-flex;align-items:center;gap:.2rem;color:var(--te-text-muted);cursor:pointer;font-size:.8rem;}
.te-minibtn:hover{color:var(--te-accent);}
.te-tabpanel{display:none;}
.te-tabpanel.active{display:block;}
.te-form{display:flex;flex-direction:column;gap:1rem;}
.form-block{display:flex;flex-direction:column;gap:1rem;}
.form-header{color:var(--te-text-muted);font-size:.82rem;font-weight:500;}
.form-body{color:var(--te-text);}
.te-input{background:var(--te-card);border:1px solid var(--te-border);border-radius:var(--te-radius-sm);color:var(--te-text);padding:.5rem .75rem;width:100%;}
.te-input:focus{border-color:var(--te-accent);outline:none;}
.te-avatar-edit{cursor:pointer;border-radius:50%;border:2px solid var(--te-border);width:80px;height:80px;object-fit:cover;}
.te-drawer{position:fixed;top:0;left:-280px;width:280px;height:100vh;background:var(--te-card);border-right:1px solid var(--te-border);z-index:1100;transition:left .3s;overflow-y:auto;padding:1rem;}
.te-drawer__group{padding:.5rem 0;border-bottom:1px solid var(--te-border);}
.te-drawer__gtitle{color:var(--te-text-muted);font-size:.75rem;padding:.5rem;}
.te-drawer__link{display:flex;align-items:center;gap:.5rem;color:var(--te-text);padding:.6rem .5rem;font-size:.85rem;}
.te-drawer__link:hover{background:var(--te-card-hover);color:var(--te-accent);}
.te-drawer__shade{position:fixed;top:0;left:0;width:0;height:100vh;background:rgba(0,0,0,.5);z-index:1050;transition:width .3s;}
.te-burger{display:none;background:transparent;border:none;color:var(--te-text);font-size:1.5rem;cursor:pointer;}
.te-message-badge,.te-ticket-nav-badge{background:var(--te-danger);color:#fff;border-radius:10px;padding:0 5px;font-size:.7rem;}
.is-empty{display:none;}
.te-theme-btn{background:transparent;border:1px solid var(--te-border);color:var(--te-text);border-radius:var(--te-radius-sm);cursor:pointer;}

/* ========== 认证页 ========== */
.te-auth-body{display:flex;align-items:center;justify-content:center;min-height:100vh;background:var(--te-bg);}
.auth-wrapper{width:100%;max-width:420px;padding:1.5rem;position:relative;z-index:1;}
.auth-card{background:var(--te-card);border:1px solid var(--te-border);border-radius:var(--te-radius);padding:2rem;box-shadow:var(--te-shadow-lg);}
.brand-header{text-align:center;margin-bottom:1.5rem;}
.brand-logo{display:inline-block;}
.brand-icon{width:48px;height:48px;}
.auth-subtitle{color:var(--te-text-muted);font-size:.85rem;text-align:center;}
.text-link{color:var(--te-accent);}
.form-floating>.form-control,.form-floating>label{color:var(--te-text);}
.form-floating>.form-control{background:var(--te-card);border:1px solid var(--te-border);}
.form-floating>.form-control:focus{border-color:var(--te-accent);box-shadow:0 0 0 .15rem rgba(74,144,226,.15);}
.btn-gradient{background:linear-gradient(135deg,var(--te-accent),var(--te-primary-dark));color:#fff;border:none;font-weight:600;}
.divider{display:flex;align-items:center;gap:.5rem;color:var(--te-text-muted);font-size:.8rem;}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--te-border);}
.image-code{cursor:pointer;border-radius:var(--te-radius-sm);}

/* ========== 表格 ========== */
.table{color:var(--te-text);border-color:var(--te-border);}
.table thead th{background:var(--te-sidebar-bg);border-color:var(--te-border);color:var(--te-text-muted);font-size:.8rem;}
.table tbody td{border-color:var(--te-border);}
.table-striped tbody tr:nth-of-type(odd){background:var(--te-card-hover);}

/* ========== 支付方式图标化 UI ========== */
.te-pay-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:.75rem;}
.te-pay-card{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:1rem;border:1px solid var(--te-border);border-radius:var(--te-radius);background:var(--te-card);cursor:pointer;transition:all .2s;min-height:88px;}
.te-pay-card:hover{border-color:var(--te-accent);background:var(--te-card-hover);}
.te-pay-card.is-selected{border-color:var(--te-accent);background:var(--te-card-hover);box-shadow:0 0 0 2px rgba(74,144,226,.2);}
.te-pay-card__icon{width:36px;height:36px;object-fit:contain;}
.te-pay-card__name{font-size:.8rem;color:var(--te-text);}

/* ========== 响应式 ========== */
@media(max-width:1024px){
  .te-item-grid{grid-template-columns:repeat(2,1fr);}
  .te-nav__list{display:none;}
  .te-burger{display:inline-flex;}
  .sidebar-nav{position:fixed;top:var(--te-navbar-h);left:0;transform:translateX(-100%);transition:transform .3s;z-index:950;}
  .sidebar-nav.open{transform:translateX(0);}
  .sidebar-toggle{display:inline-flex;}
  .sidebar-overlay.display{display:block;}
  .te-sold-count{display:none;}
}
@media(max-width:768px){
  .te-item-grid{grid-template-columns:1fr;}
  .te-main{padding:1rem;}
  .te-layout__main{padding:1rem;}
  .te-panel-body{padding:1rem;}
  .te-hero-bg{height:200px;}
  .te-auth-btns .btn{padding:.25rem .5rem;font-size:.8rem;}
  .te-search{display:none!important;}
  .te-pay-grid{grid-template-columns:repeat(2,1fr);}
  .te-drawer.active{left:0;}
  .te-drawer__shade.active{width:100%;}
  .te-user .dropdown-toggle .d-flex{display:none!important;}
  .te-product-table-wrap{overflow-x:auto;}
  .te-product-table{min-width:480px;}
  .te-product-table .btn-buy{min-height:44px;min-width:44px;padding:.5rem 1rem;}
  .te-product-table .btn-soldout{min-height:44px;min-width:44px;padding:.5rem 1rem;}
  .te-func-bar{flex-direction:column;}
  .te-func-btn{width:100%;justify-content:center;}
}
@media(max-width:480px){
  .te-pay-grid{grid-template-columns:1fr;}
  .te-chip{font-size:.78rem;padding:.35rem .7rem;}
}

/* ========== iOS Safari 兼容 ========== */
@supports(-webkit-touch-callout:none){
  .te-nav-wrap{position:sticky;top:0;}
  .sidebar-nav{position:sticky;top:var(--te-navbar-h);}
}
.te-body{min-height:100vh;min-height:100dvh;}
