/* iOS9兼容方案：使用固定颜色值代替CSS变量 */
body {
    font-family: -apple-system, Helvetica, sans-serif; /* 简化字体栈 */
    background: #1c1c1e; /* 原--iOS-BG */
    color: #ffffff; /* 原--iOS-Label */
    margin: 0;
    line-height: 1.5;
}

@media (min-width: 768px) {
    body {
        margin: 0 30%;
    }
}

.iOS-container {
    max-width: 90%;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Package Header 容器样式 (兼容 iOS9) */
.package-header {
    text-align: center;
  /* Flexbox 布局（旧语法兼容） */
  display: -webkit-box; /* 兼容 iOS Safari 6.1-9.3 的旧版弹性盒子 */
  display: -ms-flexbox; /* 兼容 IE10 的弹性盒子中间语法 */
  display: flex; /* 现代浏览器标准语法 */

  /* 主轴居中（横向居中） */
  -webkit-box-pack: center; /* 旧版语法：主轴对齐方式 */
  -ms-flex-pack: center;    /* IE10 语法：主轴对齐方式 */
  justify-content: center; /* 标准语法：主轴对齐方式 */

  /* 交叉轴居中（纵向居中） */
  -webkit-box-align: center; /* 旧版语法：交叉轴对齐 */
  -ms-flex-align: center;    /* IE10 语法：交叉轴对齐 */
  align-items: center;       /* 标准语法：交叉轴对齐 */

  /* 容器样式 (与 detail-card 保持视觉统一) */
  background: #000000; /* 卡片背景颜色 (原--iOS-Card) */
  -webkit-border-radius: 16px; /* iOS9 需要前缀的圆角 */
  border-radius: 16px;         /* 标准圆角 */
  padding: 20px;               /* 内边距保障内容呼吸 */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); /* 卡片投影增强层次感 */
  word-break: break-word;       /* 长文本自动换行防止溢出 */

  /* 边距处理（注意优化顺序） */
  margin: 20px auto; /* 初始边距设置 */
  margin: 16px 0;    /* 覆盖上边距，最终效果：上下16px 左右自动 */
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

/* 按钮兼容方案 */
.back-button {
    display: -webkit-inline-box; /* iOS9兼容flex写法 */
    display: inline-flex;
    -webkit-box-align: center; /* 旧版对齐方式 */
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
    padding: 10px 16px;
    margin-bottom: 20px;
    color: #007AFF; /* 原--iOS-Blue */
    background-color: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.2);
    -webkit-border-radius: 10px;
    border-radius: 10px;
    font-weight: 500;
    text-decoration: none;
    -webkit-transition: all 0.3s ease; /* 添加前缀 */
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.back-button:hover,
.back-button:active {
    /* iOS不支持:hover，但保留供其他设备使用 */
    background-color: rgba(10, 132, 255, 0.15);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.back-button:active {
    background-color: rgba(10, 132, 255, 0.2);
    -webkit-transform: translateY(0);
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 卡片布局兼容 */
.detail-card {
    background: #000000; /* 原--iOS-Card */
    -webkit-border-radius: 16px;
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    word-break: break-word; /* 替代overflow-wrap */
}

/* 下载按钮优化 */
.download-button {
    display: block;
    padding: 14px 16px;
    margin: 8px 0;
    background: #0a84ff;
    color: white;
    text-align: center;
    -webkit-border-radius: 12px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 16px;
    -webkit-appearance: none;
}

.download-button:active {
    background: #007AFF;
}

/* 加载动画兼容 */
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid #007AFF;
    border-top-color: transparent;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    -webkit-animation: spin 1s linear infinite; /* 添加前缀 */
    animation: spin 1s linear infinite;
}

/* 动画兼容写法 */
@-webkit-keyframes spin {
    to { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 现代浏览器增强 */
@supports (--css: variables) {
    :root {
        --iOS-BG: #1c1c1e;
        --iOS-Card: #000;
        --iOS-Label: #fff;
        --iOS-Blue: #007AFF;
    }
    
    body {
        background: var(--iOS-BG);
        color: var(--iOS-Label);
    }
    
    .back-button {
        color: var(--iOS-Blue);
    }
    
    .detail-card {
        background: var(--iOS-Card);
    }
}