/* 全局基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.8;
    color: #000;
    background-color: #fff;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* 允许内容区域选中文本 */
.document-container {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 主容器 */
.document-container {
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 16px;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* 欢迎部分 - 主标题 */
.welcome-section {
    padding: 0;
    margin-bottom: 24px;
    text-align: center;
}

.welcome-text {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.6;
}

.welcome-sub {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* 章节标题 - 子标题 */
.section-title {
    font-size: 17px;
    font-weight: 600;
    color: #2c3e50;
    margin: 28px 0 14px 0;
    padding: 0;
    border: none;
}

/* 正文内容 */
.content {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 12px;
    text-align: justify;
    word-break: break-all;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* 列表项 */
.list-item {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 10px;
    padding-left: 18px;
    position: relative;
    word-break: break-all;
}

.list-item::before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 2px;
}

/* 子列表项 */
.sub-item {
    padding-left: 36px;
    font-size: 15px;
    color: #444;
}

.sub-item::before {
    content: "◦";
    left: 20px;
}

/* 高亮提示框 */
.highlight-box {
    background: transparent;
    border-left: none;
    padding: 0;
    margin: 12px 0;
    border-radius: 0;
    font-size: 15px;
    color: #444;
}

/* 列表项 */
.list-item {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 8px;
    padding-left: 18px;
    position: relative;
    word-break: break-all;
}

.list-item::before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 2px;
}

/* 子列表项 */
.sub-item {
    padding-left: 36px;
    font-size: 13px;
    color: #666;
}

.sub-item::before {
    content: "◦";
    left: 20px;
}

/* 高亮提示框 */
.highlight-box {
    /* background: #fff8e1; */
    /* border-left: 3px solid #ffc107; */
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #666;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 10px;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 10px;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    color: #555;
    word-break: break-all;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:active {
    background-color: #f0f7ff;
}

/* 图片样式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 链接样式 */
a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(52, 152, 219, 0.2);
    padding: 2px 0;
}

a:active {
    color: #2980b9;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 2px;
}

/* 强调文本 */
strong, b {
    color: #2c3e50;
    font-weight: 600;
}

/* 引用块 */
blockquote {
    background: #f8f9fa;
    border-left: 3px solid #3498db;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #666;
    font-size: 13px;
}

/* 代码块 */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", "Monaco", "Menlo", monospace;
    font-size: 12px;
    color: #e74c3c;
}

/* 分割线 */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 24px 0;
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid #e8e8e8;
    color: #888;
    font-size: 12px;
}

/* 权限使用说明部分 */
.permission-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e8e8e8;
}

.subsection-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
}

.app-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13px;
}

.app-info p {
    margin: 4px 0;
    color: #555;
}

.app-info strong {
    color: #333;
}

/* 权限卡片 */
.permission-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.permission-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px;
}

.permission-content {
    padding: 12px 14px;
}

.permission-name {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 0 0 8px 0;
    font-family: "SF Mono", "Monaco", "Menlo", monospace;
    word-break: break-all;
    line-height: 1.5;
}

.permission-desc {
    font-size: 13px;
    color: #444;
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.permission-path {
    font-size: 12px;
    color: #888;
    margin: 0;
    padding-top: 8px;
    border-top: 1px dashed #eee;
}

.permission-content a {
    color: #3498db;
    word-break: break-all;
    border-bottom: 1px solid transparent;
}

.permission-content a:active {
    color: #2980b9;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 2px;
}

/* 响应式设计 - 平板 */
@media (min-width: 768px) {
    body {
        padding: 20px;
        background-color: #f5f7fa;
    }

    .document-container {
        max-width: 700px;
        margin: 0 auto;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        padding: 30px 40px;
    }

    .section-title {
        font-size: 17px;
    }

    .content, .list-item {
        font-size: 15px;
    }

    table {
        display: table;
    }
}

/* 响应式设计 - 桌面 */
@media (min-width: 1024px) {
    .document-container {
        max-width: 800px;
        padding: 40px 50px;
    }

    .section-title {
        font-size: 18px;
        margin: 30px 0 15px 0;
    }

    .content, .list-item {
        font-size: 15px;
        line-height: 1.9;
    }

    th, td {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* iOS特定优化 */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }

    .document-container {
        min-height: -webkit-fill-available;
    }
}

/* Android特定优化 */
@supports (-webkit-appearance: none) {
    a {
        -webkit-tap-highlight-color: rgba(52, 152, 219, 0.3);
    }
}

/* 暗色模式样式 */
.theme-dark {
    color-scheme: dark;
}

.theme-dark body {
    background-color: #000;
    color: #fff;
}

.theme-dark .document-container {
    background: #000;
}

.theme-dark  {
    background: linear-gradient(135deg, #1a2a3a, #1e3040);
    border-left-color: #3498db;
}

.theme-dark .welcome-text {
    color: #ffffff;
}

.theme-dark .welcome-sub {
    color: #aaa;
}

.theme-dark .section-title {
    color: #fff;
}

.theme-dark .content,
.theme-dark .list-item {
    color: #ccc;
}

.theme-dark strong,
.theme-dark b {
    color: #fff;
}

.theme-dark table {
    background: #2d2d2d;
}

.theme-dark td {
    border-bottom-color: #444;
    color: #ccc;
}

.theme-dark tr:nth-child(even) {
    background-color: #333;
}

.theme-dark blockquote {
    background: #333;
    color: #aaa;
}

.theme-dark .highlight-box {
    background: transparent;
    border-left: none;
    color: #ccc;
}

.theme-dark .sub-item {
    color: #ccc;
}

.theme-dark .footer {
    border-top-color: #444;
    color: #888;
}

.theme-dark .permission-section {
    border-top-color: #444;
}

.theme-dark .subsection-title {
    color: #fff;
    border-bottom-color: #444;
}

.theme-dark .app-info {
    background: #333;
}

.theme-dark .app-info p {
    color: #ccc;
}

.theme-dark .app-info strong {
    color: #fff;
}

.theme-dark .permission-card {
    background: #2d2d2d;
    border-color: #444;
}

.theme-dark .permission-header {
    background: linear-gradient(135deg, #2980b9, #1a5276);
}

.theme-dark .permission-name {
    background: #333;
    color: #aaa;
}

.theme-dark .permission-desc {
    color: #ccc;
}

.theme-dark .permission-path {
    color: #888;
    border-top-color: #444;
}

.theme-dark .permission-content a {
    color: #5dade2;
}

/* 强制亮色模式 */
.theme-light {
    color-scheme: light;
}

.theme-light body {
    background-color: #fff;
    color: #000;
}

.theme-light .document-container {
    background: #fff;
}

/* 打印样式 */
@media print {
    body {
        background: #fff;
        padding: 0;
    }

    .document-container {
        box-shadow: none;
        border-radius: 0;
        padding: 20px;
        max-width: 100%;
    }

    .section-title {
        border-left-color: #000;
    }

    th {
        background: #000 !important;
        color: #fff !important;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* 禁止缩放的额外保障 */
@media (pointer: coarse) {
    * {
        touch-action: manipulation;
    }

    button, a, input, select, textarea {
        touch-action: manipulation;
    }
}

/* 滚动条样式（Webkit） */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
