/* 
 * === 全局重置与基础设置 ===
 * 统一元素的盒模型计算方式，确保布局一致性
 */
* {
    box-sizing: border-box;  /* 包含padding和border在内的元素尺寸计算方式 */
}

/* 
 * === 页面主体样式 ===
 * 设置基础布局和排版规则，构建整体视觉框架
 */
body {
    background: #000000;      /* 深色背景色 */
    color: #ffffff;           /* 白色文字 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

/* 
 * === 卡片式布局组件 ===
 * 统一卡片容器的视觉样式，创建层次结构
 */
.box, 
.source-item {
    background: #1c1c1e;       /* iOS深色模式卡片背景 */
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    
    /* 内容约束与溢出处理 */
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    -webkit-hyphens: auto;     /* 只保留webkit前缀 */
    word-break: break-word;
    
    /* 多行文本截断（iOS9需要旧语法） */
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* 
 * === 表单组件样式 ===
 */
input,
textarea,
button {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-size: 16px;
    background-color: rgba(255,255,255,0.1);
    color: white;
    border: none;
}

/* 
 * === 主操作按钮 ===
 */
button {
    background-color: #007bff;
    font-weight: 600;
}

/* 
 * === 分页组件 ===
 * 使用旧版flexbox语法
 */
.pagination {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    margin: 20px 0;
}

/* 分页链接基础样式 */
.pagination a {
    padding: 8px 12px;
    margin: 0 5px;
    border-radius: 4px;
    background: white;
    color: #333;
}

.pagination a.active {
    background: #888;
    color: white;
}

/* 
 * === 源操作按钮组 ===
 * 完全使用旧版flex语法
 */
.source-actions {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    margin-top: 15px;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

/* 
 * === 通用按钮组件 ===
 * 使用兼容性写法
 */
.add-button {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 10px 15px;
    margin: 0 8px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.0;
    min-width: 120px;
}

.add-button img {
    width: 22px;
    height: 22px;
    margin-right: 8px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

/* 品牌按钮颜色保持 */
.cydia-add { background-color: #ff9500; }
.sileo-add { background-color: #5e72e4; }
.verify-btn { background-color: #007bff; }

/* 
 * === 交互反馈 ===
 * 添加浏览器前缀
 */
.add-button:active {
    opacity: 0.7;
    -webkit-transform: scale(0.98);
    transform: scale(0.98);
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

/* 
 * === 其他兼容性调整 ===
 */
.source-meta {
    color: #7f8c8d;
    font-size: 0.9em;
    margin: 10px 0;
}

.source-description {
    margin-top: 12px;
    padding: 10px;
    background: #888;
    border-radius: 4px;
    color: #ffffff;
}

/* 链接样式保持 */
.source-item h3 a {
    color: #fff;
    text-decoration: none;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.source-item h3 a:hover { opacity: 0.8; text-decoration: underline; }
.source-item h3 a:visited { color: #fff; }
.source-item h3 a:focus { outline: 2px solid rgba(255,255,255,0.3); }

/* 响应式设计保持 */
@media (max-width: 767px) {
    .add-button {
        padding: 8px 12px;
        min-width: 110px;
        font-size: 14px;
    }
    
    .add-button img {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }
}