/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: '微软雅黑', Consolas, Monaco, 'Courier New', monospace;
    background-color: #F5F5F5;
    color: #333333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部头部 */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img { 
    width: 35px;
    height: 35px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #2E7D32;
}

/* 导航栏 */
.nav {
    background-color: transparent;
    border: none;
}

.nav-content {
    display: flex;
    gap: 4px;
}

.nav-item {
    padding: 18px 24px;
    border: none;
    background: none;
    font-size: 16px;
    color: #666666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.nav-item:hover {
    background-color: transparent;
    color: #2E7D32;
    border-bottom: 2px solid #2E7D32;
}

.nav-item.active {
    background-color: transparent;
    color: #2E7D32;
    border-bottom: 2px solid #2E7D32;
}

.nav-item[href]:hover {
    background-color: transparent;
    color: #2E7D32;
    border-bottom: 2px solid #2E7D32;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    min-height: calc(100vh - 180px);
    width: 100%;
}

.tab-content.active {
    display: block;
}

.tab-content-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* 板块标题外层容器 */
.section-title-wrapper {
    width: 100%;
}

/* 板块标题 */
.section-title {
    text-align: center;
    padding: 30px;
}

.section-title h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #333333;
    font-weight: 600;
}

.section-title .section-desc {
    margin: 0;
    font-size: 14px;
    color: #666666;
    font-weight: 400;
}

/* 卡片样式 */
.card {
    background-color: transparent;
    border-radius: 6px;
    margin-bottom: 0;
}

.card-header {
    padding: 20px 24px 0px 0px;
    /* border-bottom: 1px solid #F0F0F0; */
    display: flex;
    /* justify-content: center; */
}

.card-body {
    background-color: transparent;
}

.card-header h2 {
    font-size: 24px;
    color: #333333;
    font-weight: 600;
    margin: 20px 0;
}

.label-row label,
.code-container-label label {
    font-size: 24px;
    color: #333333;
    font-weight: 600;
}

.help-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #4CAF50;
    background-color: #FFFFFF;
    color: #4CAF50;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.help-btn:hover {
    background-color: #4CAF50;
    color: #FFFFFF;
}

/* .card-body {
    padding: 24px;
} */

/* 输入组 */
.input-group {
    margin-bottom: 20px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label-row label {
    font-size: 1.2em;
    color: #374151;
    font-weight: 600;
}

.clear-btn {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 24px;
    font-size: 14px;
    cursor: pointer;
}

.text-input-container {
    position: relative;
}

.code-container-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.code-container-label label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 0;
}

.input-group textarea,
.input-group input[type="text"],
.text-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #FFFFFF;
}

.input-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5em;
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
}

.input-group textarea:focus,
.input-group input[type="text"]:focus,
.text-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* 按钮样式 */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: #2E7D32;
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: #0f1a31;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

.btn-secondary {
    background-color: #4CAF50;
    color: #FFFFFF;
}

.btn-secondary:hover {
    background-color: #0f1a31;
}

.btn-outline {
    background-color: #FFFFFF;
    color: #2E7D32;
    border: 1px solid #2E7D32;
}

.btn-outline:hover {
    background-color: #E8F5E9;
    border-color: #0f1a31;
    color: #0f1a31;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    /* justify-content: center; */
}

/* 选项行 */
.options-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.option-group button {
    align-self: center;
}

.option-group select {
    padding: 8px 4px 8px 4px;
    border: none;
    border-radius: 6px;
    background-color: #FFFFFF;
    cursor: pointer;
    outline: none;
}

/* 自定义下拉框样式 */
.select-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.selected-value {
    font-size: 14px;
    color: #333333;
}

.select-arrow {
    font-size: 10px;
    color: #666666;
    transition: transform 0.2s ease;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #FFFFFF;
    border-radius: 0 0 6px 6px;
    z-index: 1000;
    display: none;
    margin-top: -2px;
    max-height: 260px;
    overflow-y: auto;
}

.custom-select.open .select-dropdown {
    display: block;
}

.select-option {
    padding: 8px 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.select-option:hover {
    background-color: rgba(76, 175, 80, 0.1);
    color: #2E7D32;
}

.select-option.selected {
    background-color: rgba(76, 175, 80, 0.15);
    color: #2E7D32;
    font-weight: 500;
}

.option-group input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* 代码展示区域 */
.code-container pre {
    font-size: 14px;
    font-family: Consolas, '微软雅黑', Monaco, 'Courier New', monospace;
    padding: 16px;
    margin: 0;
    line-height: 1.4;
    color: #000000;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* URL结果区域 */
.url-result {
    margin-top: 20px;
}

.url-result h3,
.url-result h4 {
    margin-bottom: 12px;
    color: #333333;
}

.info-group {
    margin-bottom: 16px;
}

.info-group label {
    font-size: 14px;
    font-weight: 500;
    color: #666666;
    display: block;
    margin-bottom: 4px;
}

.info-value {
    padding: 8px 12px;
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 13px;
    color: #333333;
}

.params-table {
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.param-row {
    display: grid;
    grid-template-columns: 2fr 2fr 120px;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #F0F0F0;
    align-items: center;
}

.param-row:last-child {
    border-bottom: none;
}

.param-header {
    background-color: #F5F5F5;
    font-weight: 600;
}

.param-name,
.param-value {
    padding: 8px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 13px;
}

.param-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.param-actions button {
    padding: 4px 12px;
    font-size: 12px;
}

/* IP结果区域 */
.ip-result {
    padding: 20px;
    background-color: #F8F9FA;
    border-radius: 6px;
}

.ip-result h3 {
    margin-bottom: 16px;
    color: #333333;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.info-item {
    background-color: #FFFFFF;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #E0E0E0;
}

.info-item label {
    font-size: 13px;
    color: #666666;
    display: block;
    margin-bottom: 6px;
}

.info-item .info-value {
    font-size: 16px;
    color: #333333;
    border: none;
    padding: 0;
    background: none;
    font-weight: 500;
}

/* 页脚 */
.footer {
    background-color: #FFFFFF;
    border-top: 1px solid #E0E0E0;
    padding: 10px 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-content p {
    font-size: 14px;
    color: #666666;
    margin-bottom: 4px;
}

.footer-content p a {
    color: #666666;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.3s ease;
}

.footer-content p a:hover {
    color: #2E7D32;
    text-decoration: underline;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #F3F3F3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    right: 43%;
    padding: 16px 24px;
    background-color: #4CAF50;
    color: #FFFFFF;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background-color: #f44336;
}

.toast.success {
    background-color: #4CAF50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        height: auto;
        padding: 12px 20px;
        flex-direction: column;
        gap: 12px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .nav-content {
        flex-direction: row;
        padding: 0 12px;
    }
    
    .nav-item {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .main-content {
        padding: 20px 12px;
    }
    
    .card-header h2 {
        font-size: 20px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .param-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .options-row {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .user-area {
        flex-direction: column;
        width: 100%;
    }
    
    .user-area .btn {
        width: 100%;
    }
    
    .input-group textarea {
        font-size: 13px;
    }
    
    .code-container pre {
        font-size: 12px;
    }
}

/* ========== 子页面样式 ========== */

/* 关于我们页面 */
.about-content {
    padding: 20px 0;
}

.about-section {
    margin-bottom: 40px;
}

.about-section h3 {
    font-size: 20px;
    color: #2E7D32;
    margin-bottom: 16px;
    font-weight: 600;
}

.about-section p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 12px;
    font-size: 14px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 12px 0;
    padding-left: 24px;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.feature-list li:before {
    content: "✓";
    left: 0;
    margin-right: 4px;
    color: #2E7D32;
    font-weight: bold;
}

.contact-info {
    background-color: #F8F9FA;
    padding: 24px;
    border-radius: 8px;
    border-left: 4px solid #2E7D32;
    font-size: 14px;
}

.contact-item {
    margin-bottom: 16px;
    line-height: 1.8;
    color: #555;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item a {
    color: #2E7D32;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* 知识分享页面 */
.knowledge-list {
    padding: 20px 0;
}

.knowledge-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E0E0E0;
    overflow: hidden;
}

.knowledge-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.knowledge-link {
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.knowledge-link:hover {
    transform: translateX(8px);
}

.knowledge-link h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.knowledge-link:hover h3 {
    color: #2E7D32;
}

.knowledge-link p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
}

.knowledge-tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: rgba(46, 125, 50, 0.1);
    color: #2E7D32;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 文章详情页面 */
.article-content {
    padding: 20px 0;
    line-height: 1.8;
    color: #555;
    font-size: 14px;
}

.article-intro {
    background-color: #F8F9FA;
    padding: 16px;
    border-left: 4px solid #2E7D32;
    border-radius: 4px;
    margin-bottom: 24px;
}

.article-content h3 {
    font-size: 20px;
    color: #2E7D32;
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
}

.article-steps,
.feature-list {
    padding-left: 24px;
    margin-bottom: 24px;
}

.article-steps li,
.feature-list li {
    margin-bottom: 12px;
    padding-left: 8px;
    line-height: 1.7;
    font-size: 14px;
}

kbd {
    display: inline-block;
    padding: 2px 8px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: monospace;
    font-size: 13px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

code {
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.code-block {
    background-color: #2D2D2D;
    color: #F8F8F2;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 24px 0;
    line-height: 1.6;
}

.code-block code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.warning-box {
    background-color: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    padding: 16px;
    border-radius: 8px;
    margin: 24px 0;
}

.warning-box p,
.warning-box ul {
    margin-bottom: 12px;
}

.warning-box ul {
    padding-left: 24px;
    margin-bottom: 0;
}

.article-tip {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    padding: 16px;
    border-radius: 8px;
    margin: 24px 0;
    line-height: 1.7;
}

.article-tip ul {
    padding-left: 24px;
    margin-bottom: 0;
}

.back-link {
    text-align: center;
    margin: 32px 0;
}

.back-link a {
    display: inline-block;
    padding: 10px 24px;
    background-color: #2E7D32;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.back-link a:hover {
    background-color: #1B5E20;
}

/* 表格样式 */
.aes-table,
.json-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}

.aes-table thead,
.json-table thead {
    background-color: #2E7D32;
    color: white;
}

.aes-table th,
.aes-table td,
.json-table th,
.json-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #E0E0E0;
}

.aes-table tbody tr:nth-child(even),
.json-table tbody tr:nth-child(even) {
    background-color: #F8F9FA;
}

.aes-table tbody tr:hover,
.json-table tbody tr:hover {
    background-color: rgba(46, 125, 50, 0.1);
}

/* ==================== JSON树形视图样式 ==================== */
.json-tree-container {
    font-family: 'Consolas', '微软雅黑', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 16px;
    white-space: pre;
}

.json-node {
    position: relative;
    display: block;
}

/* .json-node-inline {
    position: relative;
    display: inline-block;
} */

.json-toggle {
    position: absolute;
    left: -1.3em;
    width: 1em;
    height: 1.5em;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #000000;
    z-index: 10;
    transition: all 0.2s ease;
}

/* 根节点的折叠符号，不使用负偏移 */

.json-node-inline .json-toggle {
    float: left;;
}

.json-item {
    position: relative;
    padding: 2px 0;
}

.json-toggle::before {
    content: '▼';
    font-size: 15px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.json-toggle-collapsed::before {
    content: '▼';
    font-size: 15px;
    transform: rotate(-90deg);
}

.json-children {
    display: block;
    margin-left: 1.5em;
}

.json-children.json-collapsed {
    display: none;
}

.json-item {
    position: relative;
    padding: 2px 0;
}

.json-key {
    color: #000000;
    font-weight: 500;
    float: left;
}

.json-colon {
    color: #666;
    margin-right: 0.3em;
    float: left;
}

.json-string {
    color: #0c9712;
}

.json-number {
    color: #ff6600;
}

.json-boolean {
    color: #d32f2f;
    font-weight: 600;
}

.json-null {
    color: #999;
    font-style: italic;
}

.json-bracket {
    color: #333;
    font-weight: 600;
}

.json-bracket-open:first-child {
    margin-left: 1.5em !important;
}

.json-bracket-open {
    color: #333;
    font-weight: 600;
}

.json-bracket-close {
    color: #333;
    font-weight: 600;
}

.json-comma {
    color: #666;
}

/* 悬停高亮 */
/* .json-item:hover {
    background-color: rgba(46, 125, 50, 0.03);
} */

/* 折叠状态的括号样式 */
.json-toggle-collapsed + .json-bracket-open {
    color: #2E7D32;
}

/* 折叠时隐藏结束括号和逗号 */
.json-node[data-collapsed="true"] .json-bracket-close,
.json-node[data-collapsed="true"] .json-comma,
.json-node-inline[data-collapsed="true"] .json-bracket-close,
.json-node-inline[data-collapsed="true"] .json-comma {
    display: none !important;
}

/* 确保最外层容器适应父容器 */
.code-container #pythonOutput.json-tree-container {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}