/* 基础页面布局与排版 (已移除 CSS 变量，增加 WebKit 前缀以兼容 iOS 8/9) */
body {
    background-color: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    /* 兼容极老版本 WebKit 的 Flexbox 写法 */
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    min-height: 100vh;
}

/* 新增：多语言切换按钮样式 */
.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #1c1c1e;
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    z-index: 100;
}

/* 头部标题区域样式 */
.header {
    text-align: center;
    margin-top: 50px; /* 优化：为右上角语言按钮预留空间 */
    margin-bottom: 40px;
}
.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: 0.5px;
}
.header p {
    color: #8e8e93;
    font-size: 15px;
    margin: 0;
}

/* 设备环境检测信息徽章的样式 */
.device-badge {
    margin-top: 15px;
    font-size: 14px;
    background-color: #1c1c1e;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.1);
}
.status-ok { color: #32d74b; font-weight: bold; margin-left: 5px; cursor: pointer; }
.status-err { color: #ff453a; font-weight: bold; margin-left: 5px; cursor: pointer; }

/* 功能卡片列表布局 (已废弃 Grid 布局，改用 Block 兼容旧设备) */
.grid {
    display: block;
    width: 100%;
    max-width: 400px;
}

/* 单个操作卡片样式 */
.action-card {
    background-color: #1c1c1e;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.2s, background-color 0.2s;
    transition: transform 0.2s, background-color 0.2s;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 20px; /* 替代原有 grid 的 gap 属性 */
}

/* 最后一个卡片不需要底部边距 */
.action-card:last-child {
    margin-bottom: 0;
}

/* 卡片点击时的交互动画效果 */
.action-card:active {
    -webkit-transform: scale(0.96);
    transform: scale(0.96);
    background-color: #2c2c2e;
}

/* 被禁用的操作卡片样式（视觉置灰并强制取消点击反馈） */
.action-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    -webkit-transform: none !important;
    transform: none !important;
    background-color: #1c1c1e !important;
}

.action-card h2 {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: #0a84ff;
}

/* 危险操作卡片的特殊强调颜色 */
.action-card.danger h2 {
    color: #ff453a;
}
.action-card p {
    font-size: 14px;
    color: #8e8e93;
    margin: 0;
}

/* 底部版权信息样式 */
.footer {
    margin-top: auto;
    padding: 20px 0;
    color: #8e8e93;
    font-size: 12px;
    text-align: center;
}

/* 自定义弹窗遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    -webkit-transition: visibility 0s linear 0.2s, opacity 0.2s;
    transition: visibility 0s linear 0.2s, opacity 0.2s;
}

/* 弹窗显示状态 */
.modal-overlay.active {
    visibility: visible;
    opacity: 1;
    -webkit-transition-delay: 0s;
    transition-delay: 0s;
}

/* 弹窗主体容器 */
.modal-box {
    background-color: #2c2c2e;
    width: 85%;
    max-width: 340px;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    -webkit-transform: translateY(20px);
    transform: translateY(20px);
    -webkit-transition: -webkit-transform 0.2s ease-out;
    transition: transform 0.2s ease-out;
}

.modal-overlay.active .modal-box {
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

/* 弹窗标题 */
.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-align: center;
}

.modal-title.danger {
    color: #ff453a;
}

/* 弹窗内容文字 */
.modal-content {
    font-size: 14px;
    color: #d1d1d6;
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-content p {
    margin: 8px 0;
}

.modal-content .highlight {
    color: #ff453a;
    font-weight: bold;
}

/* 弹窗按钮组 */
.modal-actions {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
}

.modal-btn {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    padding: 12px 0;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

/* 替代 gap 属性，给第二个和第三个按钮添加左边距 */
.modal-btn + .modal-btn {
    margin-left: 12px;
}

.modal-btn-cancel {
    background-color: #3a3a3c;
    color: #ffffff;
}

.modal-btn-confirm {
    background-color: #0a84ff;
    color: #ffffff;
}

.modal-btn-danger {
    background-color: #ff453a;
    color: #ffffff;
}