/* 全局样式 - 沿用Ping检测系统样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    background-color: #f5f7fa;
    padding: 0;
    min-width: 1200px; /* 电脑端最小宽度 */
}

/* 导航栏样式 - 完全保留 */
.navbar {
    background-color: #28a745;
    color: #fff;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}
.navbar-container {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-logo {
    font-size: 20px;
    font-weight: 700;
}
.navbar-menu {
    display: flex;
    gap: 30px;
}
.navbar-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}
.navbar-menu a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* 页脚样式 - 完全保留 */
.footer {
    background-color: #333;
    color: #ccc;
    padding: 20px 15px;
    margin-top: 40px;
}
.footer-copyright {
    text-align: center;
    font-size: 12px;
    color: #999;
    line-height: 1.6;
}

/* 容器样式 - 完全保留并适配内容 */
.container {
    width: 98%;
    max-width: 1920px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 30px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* ========== DNS文档专用样式（适配原有体系） ========== */
/* 页面标题 */
.doc-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #e5e9f0;
    margin-bottom: 30px;
}
.doc-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}
.doc-header p {
    color: #666;
    font-size: 16px;
}

/* 文档章节样式 */
.doc-section {
    margin-bottom: 25px;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.doc-section h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid #28a745; /* 适配原有绿色主题 */
}
.doc-section h3 {
    font-size: 16px;
    color: #28a745; /* 适配原有绿色主题 */
    margin: 10px 0;
}
.doc-section p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

/* 表格样式 */
.table-box {
    overflow-x: auto;
    margin: 15px 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e9f0;
}
table th, table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #e5e9f0;
}
table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}
table td {
    color: #555;
}

/* 代码块样式 */
.code-box {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 14px;
    overflow-x: auto;
    border: 1px solid #e5e9f0;
}
.code-box pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}
.code-title {
    font-size: 14px;
    color: #28a745; /* 适配原有绿色主题 */
    margin-bottom: 5px;
    font-weight: 600;
}

/* 提示框样式 */
.note {
    background-color: #f0f8ff;
    border-left: 4px solid #28a745; /* 适配原有绿色主题 */
    padding: 10px 15px;
    margin: 15px 0;
    color: #666;
    line-height: 1.6;
}

/* 表单控件样式 */
.form-group {
    margin-bottom: 15px;
    width: 100%;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
}
.form-control {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #e5e9f0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #333 !important;
    height: auto !important;
    min-height: 45px !important;
}
.form-control:focus {
    outline: none;
    border-color: #28a745; /* 适配原有绿色主题 */
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* 按钮样式 - 增强移动端点击 */
.btn {
    display: inline-block;
    padding: 12px 20px !important;
    background-color: #28a745; /* 适配原有绿色主题 */
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    position: relative !important;
    z-index: 1 !important;
}
.btn:hover {
    background-color: #218838; /* 适配原有绿色主题 */
}
.btn-reset {
    background-color: #6c757d;
    margin-left: 10px;
}
.btn-reset:hover {
    background-color: #5c636a;
}

/* 调试结果样式 */
.debug-result {
    margin-top: 20px;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    overflow: hidden;
}
.result-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e9f0;
    font-weight: 600;
    color: #2c3e50;
}
.result-body {
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
    background-color: #fff;
}
.loading {
    text-align: center;
    padding: 20px;
    color: #28a745; /* 适配原有绿色主题 */
}

/* 状态监控卡片样式 */
.status-card {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}
.status-item {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border-radius: 6px;
    background-color: #f8f9fa;
    border-left: 4px solid #28a745; /* 适配原有绿色主题 */
}
.status-item.success {
    border-left-color: #67c23a;
}
.status-item.error {
    border-left-color: #f56c6c;
}
.status-item .title {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}
.status-item .value {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}
.status-item.success .value {
    color: #67c23a;
}
.status-item.error .value {
    color: #f56c6c;
}
.status-time {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 列表样式 */
.doc-section ul {
    padding-left: 20px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
}
.doc-section li {
    margin-bottom: 8px;
}

/* 工具卡片样式 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.tool-card {
    background: #f8f9fa;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s;
}
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #28a745;
}
.tool-card h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 10px;
}
.tool-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.tool-card a {
    display: inline-block;
    padding: 8px 16px;
    background-color: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}
.tool-card a:hover {
    background-color: #218838;
}

/* 加密工具副导航栏样式 - 与主导航统一风格 */
.sub-navbar {
    background-color: #208838; /* 比主导航稍深一点的绿色，区分但统一 */
    color: #fff;
    padding: 10px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 15px;
}
.sub-navbar-container {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* 居中显示 */
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}
.sub-navbar-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}
.sub-navbar-menu a:hover,
.sub-navbar-menu a.active {
    background-color: rgba(255,255,255,0.2);
    text-decoration: none;
}

/* ============ 二维码工具专用样式 ============ */
.tool-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}
.tool-tab {
    padding: 12px 22px;
    border: none;
    border-radius: 6px;
    background: #f5f7fa;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
    text-align: center;
}
.tool-tab.active {
    background: #007bff;
    color: #fff;
}
.tool-panel {
    display: none;
    width: 100%;
}
.tool-panel.active {
    display: block;
}

/* 二维码布局样式 - 仅调整结构，不修改原有样式 */
.qrcode-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
}
.qrcode-form-wrap {
    flex: 1;
    width: 100%;
}
.qrcode-preview-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* 适配图片的三列布局 */
.form-row-three {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
}
.form-row-three .form-group {
    flex: 1;
    margin-bottom: 0;
}
/* 二维码占位区域样式 */
.qrcode-placeholder {
    width: 280px;
    height: 280px;
    border: 1px dashed #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    background-color: #f9f9f9;
}
.qrcode-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
    color: #ccc;
}
/* 二维码容器样式 */
#qrcode-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}
#qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ 手机端自适应样式 (768px以下) ============ */
@media only screen and (max-width: 767px) {
    /* 基础样式重置 */
    body {
        min-width: unset !important;
        width: 100% !important;
        overflow-x: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 容器适配 - 关键修复 */
    .container {
        width: 100% !important;
        padding: 15px !important;
        margin: 0 auto 10px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }
    
    /* 导航栏适配 */
    .navbar {
        padding: 10px 15px !important;
        width: 100% !important;
    }
    .navbar-container {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: flex-start !important;
        width: 100% !important;
    }
    .navbar-menu {
        gap: 8px !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }
    .navbar-menu a {
        font-size: 12px !important;
        padding: 2px 5px !important;
    }

    /* 文档样式适配 */
    .doc-header {
        padding: 15px 0 !important;
        margin-bottom: 15px !important;
    }
    .doc-header h1 {
        font-size: 20px !important;
    }
    .doc-header p {
        font-size: 14px !important;
    }
    .doc-section {
        padding: 15px !important;
        margin-bottom: 15px !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 5px rgba(0,0,0,0.05) !important;
        width: 100% !important;
    }
    .doc-section h2 {
        font-size: 18px !important;
    }
    .doc-section h3 {
        font-size: 15px !important;
    }
    .doc-section p {
        font-size: 14px !important;
    }

    /* 表格适配 */
    table th, table td {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }

    /* 代码块适配 */
    .code-box {
        padding: 10px !important;
        font-size: 13px !important;
    }

    /* 状态卡片适配 */
    .status-card {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .status-item {
        min-width: unset !important;
        padding: 10px !important;
    }
    .status-item .value {
        font-size: 18px !important;
    }

    /* 表单适配 - 关键修复 */
    .form-group {
        margin-bottom: 12px !important;
        width: 100% !important;
    }
    .form-group label {
        font-size: 14px !important;
        margin-bottom: 6px !important;
    }
    .form-control {
        width: 100% !important;
        padding: 12px 12px !important;
        font-size: 14px !important;
        min-height: 45px !important;
        border-radius: 4px !important;
    }
    
    /* 颜色选择器特殊适配 */
    input[type="color"].form-control {
        padding: 0 !important;
        height: 45px !important;
        min-height: 45px !important;
    }

    /* 按钮适配 - 关键修复 */
    .btn {
        width: 100% !important;
        padding: 12px 0 !important;
        font-size: 15px !important;
        margin-bottom: 10px !important;
        margin-right: 0 !important;
        display: block !important;
    }
    .btn-reset {
        margin-left: 0 !important;
    }

    /* 工具卡片移动端适配 */
    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    .home-title {
        font-size: 22px !important;
        margin-bottom: 15px !important;
    }

    /* 副导航移动端适配 */
    .sub-navbar {
        padding: 8px 15px !important;
        width: 100% !important;
    }
    .sub-navbar-container {
        gap: 8px !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
    .sub-navbar-menu a {
        font-size: 12px !important;
        padding: 4px 8px !important;
    }

    /* ============ 二维码工具重点修复 - 移动端 ============ */
    /* 选项卡适配 */
    .tool-tabs {
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 15px !important;
        width: 100% !important;
    }
    .tool-tab {
        width: 100% !important;
        padding: 12px 0 !important;
        font-size: 15px !important;
    }
    
    /* 布局改为纵向排列 */
    .qrcode-layout {
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
    }
    
    /* 三列布局改为单列 - 关键修复 */
    .form-row-three {
        flex-direction: column !important;
        gap: 0 !important;
        margin-bottom: 0 !important;
        width: 100% !important;
    }
    .form-row-three .form-group {
        margin-bottom: 12px !important;
        width: 100% !important;
    }
    
    /* 二维码预览区域适配 */
    .qrcode-preview-wrap {
        width: 100% !important;
    }
    .qrcode-placeholder, 
    #qrcode {
        width: 100% !important;
        max-width: 280px !important;
        height: auto !important;
        min-height: 280px !important;
        margin: 0 auto !important;
    }
    
    /* 操作按钮适配 */
    #generate .btn {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 10px !important;
    }
    .qrcode-preview-wrap .btn {
        width: 100% !important;
        min-width: unset !important;
        margin-bottom: 10px !important;
    }
    
    /* 解码面板适配 */
    #decode .btn {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    /* 文本域适配 */
    #content, #decodeResult {
        min-height: 80px !important;
        padding: 12px !important;
    }
}