/* 全局样式 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --light-gray: #f5f5f5;
    --dark-gray: #333;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-light: rgba(0,0,0,0.08);
    --shadow-dark: rgba(0,0,0,0.12);
    --font-family-sans-serif: 'Roboto', sans-serif;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 25px; 
}

body {
    font-family: var(--font-family-sans-serif);
    margin: 0;
    padding: 0;
    color: var(--dark-gray);
    line-height: 1.6;
    background-color: var(--light-gray); /* Added background color using variable */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--white); /* Added background color */
    box-shadow: 0 0 10px var(--shadow-light); /* Added box shadow */
}

.header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px var(--shadow-light);
}

.nav {
    display: flex;
    justify-content: center; /* 中心对齐导航项 */
    background-color: var(--white); /* 改为白色背景 */
    padding: 15px 0; /* 增加上下内边距 */
    position: sticky;
    top: 0;
    z-index: 1000; /* 提高 z-index */
    box-shadow: 0 2px 8px var(--shadow-light); /* 调整阴影效果 */
}

/* 导航项基础样式 */
.nav-item {
    position: relative; /* 为下拉菜单定位 */
    display: inline-block; /* 使项目并排显示 */
}

/* 下拉按钮（一级菜单项） */
.dropbtn {
    /* 继承 .nav a 的部分样式，或单独设置 */
    color: var(--dark-gray);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    transition: color 0.3s, background-color 0.3s;
    font-weight: 500;
    margin: 0 10px;
    cursor: pointer;
    background-color: transparent; /* 确保背景透明 */
    border: none; /* 移除边框 */
    display: inline-block; /* 确保正确显示 */
}

.nav-item:hover .dropbtn,
.nav-item .dropbtn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* 下拉内容容器 */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--white);
    min-width: 220px; /* 调整下拉菜单宽度 */
    box-shadow: 0px 8px 16px 0px var(--shadow-dark);
    z-index: 1;
    border-radius: var(--border-radius-md);
    padding: 10px 0; /* 上下内边距 */
    margin-top: 0; /* 确保紧贴父元素 */
    left: 50%; /* 水平居中 */
    transform: translateX(-50%); /* 水平居中 */
}

/* 下拉菜单中的链接 */
.dropdown-content a.dropdown-item {
    color: var(--dark-gray);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s, color 0.2s;
    font-weight: normal; /* 恢复正常字重 */
    margin: 0; /* 移除外边距 */
    border-radius: 0; /* 移除圆角 */
}

.dropdown-content a.dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

/* 显示下拉菜单 */
.nav-item.dropdown:hover .dropdown-content {
    display: block;
}

/* 二级菜单分组 */
.submenu-group {
    padding: 5px 0;
}

.submenu-group:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 5px;
}

.submenu-header {
    display: block;
    padding: 10px 16px;
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 0.9em;
    text-transform: uppercase;
}

.nav a {
    color: var(--dark-gray); /* 导航链接颜色改为深灰色 */
    text-decoration: none;
    padding: 10px 20px; /* 增加内边距 */
    border-radius: var(--border-radius-sm); /* 轻微增加圆角 */
    transition: color 0.3s, background-color 0.3s;
    font-weight: 500; /* 字体稍粗 */
    margin: 0 10px; /* 增加链接间距 */
}

.nav a:hover,
.nav a.active { /* 为激活状态添加样式 */
    background-color: var(--primary-color); /* 鼠标悬停背景色 */
    color: var(--white); /* 鼠标悬停文字颜色 */
}

.content {
    padding: 20px;
    min-height: 60vh;
}

.footer {
    background-color: var(--dark-gray);
    color: var(--white);
    text-align: center;
    padding: 20px;
    margin-top: 30px;
}

/* 卡片样式 */
.card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 4px 12px var(--shadow-light);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px var(--shadow-dark);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 5px var(--shadow-light);
}

.btn:hover {
    background-color: #357abd; /* Consider var(--primary-darker) or darken function if available */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #5a6268; /* Consider var(--secondary-darker) or darken function */
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

/* 选项卡样式 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
}

.tab.active {
    background-color: var(--white);
    border-color: var(--border-color);
    border-bottom-color: var(--white);
    margin-bottom: -1px;
}

.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
}

.tab-content.active {
    display: block;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade {
    animation: fadeIn 1s;
}


/* Styles from content-sharing.html */
.section {
    background-color: var(--card-bg-color);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.section h3 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.share-tools button {
    margin-right: 10px;
    margin-bottom: 10px;
}

.content textarea {
    width: calc(100% - 22px); /* Adjusted for padding and border */
    padding: 10px;
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    resize: vertical;
    background-color: var(--input-bg-color);
    color: var(--text-color);
}


/* Styles from data-privacy.html */
.privacy-demo {
    background-color: var(--info-bg-color, #e9f5ff); /* Added a fallback for info-bg-color */
    border: 1px solid var(--info-border-color, #cce7ff); /* Added a fallback for info-border-color */
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 15px;
}

.privacy-demo p {
    margin-bottom: 5px;
}

.content form label {
    display: block;
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav a {
        margin: 5px 0;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* 动画相关样式 */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes dash {
    to { stroke-dashoffset: -50; }
}

.node {
    transition: all 0.3s;
}

.text-center {
    text-align: center;
    margin: 15px 0;
}

.hero {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: var(--white);
    padding: 60px 30px;
    border-radius: var(--border-radius-md);
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Kept specific shadow for now */
}

.hero h1 {
    font-size: 3em; /* 增大标题字号 */
    margin-bottom: 10px;
    font-weight: 700;
}

.hero p {
    font-size: 1.2em; /* 增大段落字号 */
    margin-bottom: 20px;
    font-weight: 300;
}

.buttons {
    margin-top: 20px;
}

.buttons .btn {
    margin: 0 10px;
}

.architecture-preview {
    margin: 20px 0;
    background-color: var(--light-gray);
    padding: 15px;
    border-radius: var(--border-radius-md);
}

.advanced-features ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

.advanced-features li {
    margin: 5px 10px 5px 0;
    background-color: var(--light-gray);
    padding: 8px 15px;
    border-radius: var(--border-radius-lg);
}

.advanced-features a {
    text-decoration: none;
    color: var(--primary-color);
}

.decentralized-animation {
    margin-top: 40px;
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: var(--border-radius-md);
}

.network-visualization {
    margin: 20px 0;
}