/* ============================================
   底部导航栏样式 - Flexbox 布局方案
   ============================================
   
   重构说明：
   - 不再使用 position: fixed
   - 作为父容器 flexbox 布局的一部分
   - 使用 flex-shrink: 0 保持固定高度
   - 自动适应安全区域（iPhone 底部横条）
   ============================================ */

.bottom-navbar {
  /* 不使用 fixed，作为 flex 布局的一部分 */
  flex-shrink: 0;
  
  /* 固定高度 */
  height: var(--navbar-height, 56px);
  
  /* 安全区域适配（iPhone 底部横条） */
  padding-bottom: env(safe-area-inset-bottom, 0);
  
  /* 样式 */
  background: #fff;
  border-top: 1px solid #e8e8e8;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  
  /* 内部布局 */
  display: flex;
  justify-content: space-around;
  align-items: center;
  
  /* 确保在最上层 */
  z-index: 100;
}

/* 导航项 */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 6px 16px;
  transition: color 0.2s;
  flex: 1;
  min-width: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
  opacity: 0.7;
}

/* 激活状态 */
.nav-item.active .nav-label,
.nav-item.active .nav-icon {
  color: #e60012;
}

/* 图标 */
.nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  color: #666;
  transition: color 0.2s;
}

/* 标签 */
.nav-label {
  font-size: 11px;
  color: #666;
  line-height: 1.2;
  white-space: nowrap;
}

/* 购物车图标包装器 */
.nav-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 购物车数量徽章 */
.cart-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: #e60012;
  color: #fff;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  padding: 0 4px;
  line-height: 1;
}
/* ICP 备案信息样式 */
/* 现在是内容的一部分，不再使用 fixed 定位 */

.icp-license-container {
  text-align: center;
  padding: 12px 16px;
  background: #f8f8f8;
  border-top: 1px solid #eee;
  margin-top: auto; /* 推到内容底部 */
}

.icp-license-link {
  font-size: 12px;
  color: #999;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s;
}

.icp-license-link:hover {
  color: #666;
}
/* ============================================
   商城布局样式 - 现代 Flexbox 架构
   ============================================
   
   布局结构：
   ┌─────────────────────────┐
   │     .shop-layout        │ ← 100dvh，flex 容器
   │  ┌───────────────────┐  │
   │  │ .shop-layout-main │  │ ← flex: 1，可滚动
   │  │    (内容区域)      │  │
   │  └───────────────────┘  │
   │  ┌───────────────────┐  │
   │  │ .bottom-navbar    │  │ ← flex-shrink: 0，固定高度
   │  └───────────────────┘  │
   └─────────────────────────┘
   
   优点：
   - 底部导航是布局的一部分，不会遮挡内容
   - 使用 dvh 自动适应移动端浏览器
   - 内容区域自动计算高度
   - 不需要任何 padding-bottom hack
   ============================================ */

/* CSS 变量定义 */
:root {
  --navbar-height: 56px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);
}

/* 主布局容器 */
.shop-layout {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  /* 使用 dvh（动态视口高度），自动适应移动端浏览器地址栏 */
  height: 100dvh;
  /* 降级方案：不支持 dvh 的浏览器使用 vh */
  height: 100vh;
  /* 现代浏览器会使用 dvh 覆盖上面的 vh */
  @supports (height: 100dvh) {
    height: 100dvh;
  }
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: #f5f5f5;
}

/* 内容区域包装器 */
.shop-layout-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* 关键：允许 flex 子元素正确收缩 */
  overflow: hidden;
}

/* 主内容区域 - 唯一可滚动的区域 */
.shop-layout-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
  overscroll-behavior-y: contain; /* 防止过度滚动传播到父元素 */
  min-height: 0; /* 关键：允许 flex 子元素正确收缩 */
}

/* 页面容器基础样式 */
.shop-layout-main > .shop-page-container {
  min-height: 100%;
  width: 100%;
}

/* 桌面端居中显示 */
@media (min-width: 781px) {
  .shop-layout {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.app {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 40px;
  max-width: 600px;
  width: 100%;
}

h1 {
  color: #333;
  text-align: center;
  margin-bottom: 30px;
  font-size: 28px;
}

.content {
  margin-top: 20px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #667eea;
  font-size: 18px;
}

.error {
  text-align: center;
  padding: 20px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  color: #c33;
}

.error button {
  margin-top: 15px;
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.error button:hover {
  background: #5568d3;
}

.data-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 25px;
}

.data-card h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 20px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.data-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #e0e0e0;
}

.data-item:last-child {
  border-bottom: none;
}

.label {
  font-weight: 600;
  color: #555;
  min-width: 100px;
}

.value {
  color: #333;
  text-align: right;
  flex: 1;
}

/* ============================================
   全局样式 - 移动端商城
   ============================================ */

/* CSS 变量 */
:root {
  /* 导航栏高度 */
  --navbar-height: 56px;
  --top-bar-height: 56px;
  
  /* 安全区域 */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

/* 全局字体 */
* {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* HTML 和 Body 基础设置 */
html {
  /* 防止文字大小自动调整 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 防止移动端弹性滚动 */
  overscroll-behavior: none;
  /* 背景色 */
  background: #f5f5f5;
}

#root {
  /* 根容器 */
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============================================
   iOS Safari 输入框缩放修复
   ============================================ */
/* iOS Safari 会在输入框字体小于 16px 时自动缩放页面 */
input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Ant Design 输入框修复 */
.ant-input,
.ant-input-affix-wrapper .ant-input,
.ant-select-selection-search-input,
.adm-input-element,
.adm-text-area-element {
  font-size: 16px !important;
}

/* ============================================
   辅助样式
   ============================================ */

/* 屏幕阅读器专用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 代码字体 */
code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}
:root {
  --adm-radius-s: 4px;
  --adm-radius-m: 8px;
  --adm-radius-l: 12px;
  --adm-font-size-1: 9px;
  --adm-font-size-2: 10px;
  --adm-font-size-3: 11px;
  --adm-font-size-4: 12px;
  --adm-font-size-5: 13px;
  --adm-font-size-6: 14px;
  --adm-font-size-7: 15px;
  --adm-font-size-8: 16px;
  --adm-font-size-9: 17px;
  --adm-font-size-10: 18px;
  --adm-color-primary: #1677ff;
  --adm-color-success: #00b578;
  --adm-color-warning: #ff8f1f;
  --adm-color-danger: #ff3141;
  --adm-color-yellow: #ff9f18;
  --adm-color-orange: #ff6430;
  --adm-color-wathet: #e7f1ff;
  --adm-color-text: #333333;
  --adm-color-text-secondary: #666666;
  --adm-color-weak: #999999;
  --adm-color-light: #cccccc;
  --adm-color-border: #eeeeee;
  --adm-color-background: #ffffff;
  --adm-color-highlight: var(--adm-color-danger);
  --adm-color-white: #ffffff;
  --adm-color-box: #f5f5f5;
  --adm-color-text-light-solid: var(--adm-color-white);
  --adm-color-text-dark-solid: #000000;
  --adm-color-fill-content: var(--adm-color-box);
  --adm-font-size-main: var(--adm-font-size-5);
  --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
    helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
    'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
  --adm-border-color: var(--adm-color-border);
}
html[data-prefers-color-scheme='dark'] {
  --adm-color-primary: #3086ff;
  --adm-color-success: #34b368;
  --adm-color-warning: #ffa930;
  --adm-color-danger: #ff4a58;
  --adm-color-yellow: #ffa930;
  --adm-color-orange: #e65a2b;
  --adm-color-wathet: #0d2543;
  --adm-color-text: #e6e6e6;
  --adm-color-text-secondary: #b3b3b3;
  --adm-color-weak: #808080;
  --adm-color-light: #4d4d4d;
  --adm-color-border: #2b2b2b;
  --adm-color-box: #0a0a0a;
  --adm-color-background: #1a1a1a;
  --adm-color-background-body: var(--adm-color-background);
  --adm-border-color: var(--adm-color-border);
}
:root {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html {
  background-color: var(--adm-color-background-body);
}
body {
  color: var(--adm-color-text);
  font-size: var(--adm-font-size-main);
  font-family: var(--adm-font-family);
}
a,
button {
  cursor: pointer;
}
a {
  color: var(--adm-color-primary);
  transition: opacity ease-in-out 0.2s;
}
a:active {
  opacity: 0.8;
}
.adm-plain-anchor {
  color: unset;
  transition: none;
}
.adm-plain-anchor:active {
  opacity: unset;
}
body.adm-overflow-hidden {
  overflow: hidden !important;
}
div.adm-px-tester {
  --size: 1;
  height: calc(var(--size) / 2 * 2px);
  width: 0;
  position: fixed;
  left: -100vw;
  top: -100vh;
  -webkit-user-select: none;
          user-select: none;
  pointer-events: none;
}
/* stylelint-disable */
html,
body {
  width: 100%;
  height: 100%;
}
input::-ms-clear,
input::-ms-reveal {
  display: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-family: sans-serif;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -ms-overflow-style: scrollbar;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  margin: 0;
}
[tabindex='-1']:focus {
  outline: none;
}
hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 0.5em;
  font-weight: 500;
}
p {
  margin-top: 0;
  margin-bottom: 1em;
}
abbr[title],
abbr[data-original-title] {
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
  border-bottom: 0;
  cursor: help;
}
address {
  margin-bottom: 1em;
  font-style: normal;
  line-height: inherit;
}
input[type='text'],
input[type='password'],
input[type='number'],
textarea {
  -webkit-appearance: none;
}
ol,
ul,
dl {
  margin-top: 0;
  margin-bottom: 1em;
}
ol ol,
ul ul,
ol ul,
ul ol {
  margin-bottom: 0;
}
dt {
  font-weight: 500;
}
dd {
  margin-bottom: 0.5em;
  margin-left: 0;
}
blockquote {
  margin: 0 0 1em;
}
dfn {
  font-style: italic;
}
b,
strong {
  font-weight: bolder;
}
small {
  font-size: 80%;
}
sub,
sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}
sub {
  bottom: -0.25em;
}
sup {
  top: -0.5em;
}
pre,
code,
kbd,
samp {
  font-size: 1em;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}
pre {
  margin-top: 0;
  margin-bottom: 1em;
  overflow: auto;
}
figure {
  margin: 0 0 1em;
}
img {
  vertical-align: middle;
  border-style: none;
}
a,
area,
button,
[role='button'],
input:not([type='range']),
label,
select,
summary,
textarea {
  touch-action: manipulation;
}
table {
  border-collapse: collapse;
}
caption {
  padding-top: 0.75em;
  padding-bottom: 0.3em;
  text-align: left;
  caption-side: bottom;
}
input,
button,
select,
optgroup,
textarea {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
}
button,
input {
  overflow: visible;
}
button,
select {
  text-transform: none;
}
button,
html [type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button;
}
button::-moz-focus-inner,
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
  padding: 0;
  border-style: none;
}
input[type='radio'],
input[type='checkbox'] {
  box-sizing: border-box;
  padding: 0;
}
input[type='date'],
input[type='time'],
input[type='datetime-local'],
input[type='month'] {
  -webkit-appearance: listbox;
}
textarea {
  overflow: auto;
  resize: vertical;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
legend {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-bottom: 0.5em;
  padding: 0;
  color: inherit;
  font-size: 1.5em;
  line-height: inherit;
  white-space: normal;
}
progress {
  vertical-align: baseline;
}
[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
  height: auto;
}
[type='search'] {
  outline-offset: -2px;
  -webkit-appearance: none;
}
[type='search']::-webkit-search-cancel-button,
[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
}
::-webkit-file-upload-button {
  font: inherit;
  -webkit-appearance: button;
}
output {
  display: inline-block;
}
summary {
  display: list-item;
}
template {
  display: none;
}
[hidden] {
  display: none !important;
}
