:root {
    --tech-dark: #0a1a2d;
    --tech-blue: #1a6bb3;
    --tech-light: #2d9cdb;
    --tech-accent: #00c6ff;
    --tech-bg: #f0f8ff;
    --tech-card: #ffffff;
    --tech-border: #c5e1f4;
    --nav-height: 50px;
    --top-bar-height: 45px;
}

* { 
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; 
}

body { 
    background: linear-gradient(135deg, var(--tech-bg) 0%, #e6f2ff 100%);
    color: #333; 
    min-height: 100vh; 
}

/* 顶部栏 */
.top-bar {
    height: var(--top-bar-height);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--tech-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.site-name {
    font-size: 1.3em;
    font-weight: 700;
    background: linear-gradient(90deg, var(--tech-dark), var(--tech-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    flex: 1;
}

.user-actions-top {
    display: flex;
    align-items: center;
    gap: 8px;  /* 按钮间距 */
    flex-wrap: nowrap;  /* 防止换行 */
}

.top-btn {
    padding: 6px 16px;
    border-radius: 16px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;  /* 防止文字换行 */
    height: 32px;  /* 固定高度 */
}

.guest-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* 确保用户信息区域也是横向排列 */
.user-info-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.login-btn {
    background: transparent;
    color: var(--tech-blue);
    border: 1px solid var(--tech-blue);
}

.login-btn:hover {
    background: rgba(26, 107, 179, 0.1);
}

.register-btn {
    background: linear-gradient(135deg, var(--tech-blue), var(--tech-light));
    color: white;
    border: none;
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 107, 179, 0.3);
}

.favorite-btn {
    background: #ffc107;
    color: #333;
    border: none;
}

.favorite-btn:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

/* 导航栏 */
.nav-bar {
    height: var(--nav-height);
    background: linear-gradient(90deg, var(--tech-dark) 0%, #1c3658 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: var(--top-bar-height);
    z-index: 999;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 3px;
    height: 100%;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95em;
    gap: 8px;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background: rgba(0, 198, 255, 0.15);
    border-bottom: 2px solid var(--tech-accent);
}

.nav-icon {
    font-size: 1.1em;
}

/* 内容区域 */
.content-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.content-section {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(10, 26, 45, 0.1);
    border: 1px solid var(--tech-border);
    min-height: calc(100vh - var(--top-bar-height) - var(--nav-height) - 60px);
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 数据生成器样式 */
.main-header { 
    text-align: center; 
    margin-bottom: 20px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid var(--tech-border); 
}

.main-header h1 { 
    color: var(--tech-dark); 
    margin: 0; 
    font-size: 1.6em; 
    background: linear-gradient(90deg, var(--tech-blue), var(--tech-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.main-header p { 
    color: #5a6c7d; 
    font-size: 0.9em; 
    margin-top: 5px;
}

/* 密码生成器样式 - 紧凑版 */
.password-generator {
    max-width: 1000px;
    margin: 0 auto;
}

.password-display-container {
    margin-bottom: 20px;
}

.password-display {
    background: var(--tech-dark);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.4em;
    word-break: break-all;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85em;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.password-strength {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.strength-text {
    font-size: 0.85em;
    color: #7a8ca5;
    margin-top: 5px;
    text-align: center;
}

.password-controls-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.control-group-compact {
    background: #f8fbff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--tech-border);
}

.control-group-compact h3 {
    color: var(--tech-blue);
    margin-bottom: 12px;
    font-size: 1.1em;
}

.checkbox-group-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.checkbox-item-compact input {
    width: 16px;
    height: 16px;
}

.length-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.length-control input[type="range"] {
    flex: 1;
}

.length-value {
    font-weight: 600;
    color: var(--tech-blue);
    min-width: 30px;
}

.password-actions-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn-compact {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-primary-compact {
    background: linear-gradient(135deg, var(--tech-blue), var(--tech-light));
    color: white;
}

.btn-primary-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 107, 179, 0.3);
}

.btn-secondary-compact {
    background: var(--tech-dark);
    color: white;
}

.btn-secondary-compact:hover {
    background: #15243a;
    transform: translateY(-2px);
}

.btn-warning-compact {
    background: #ffc107;
    color: #333;
}

.btn-warning-compact:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

/* 模板选择器 */
.template-selector { 
    background: #eef7ff; 
    padding: 12px; 
    border-radius: 8px; 
    margin-bottom: 15px; 
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.template-selector label { 
    font-weight: 600; 
    color: var(--tech-dark); 
    white-space: nowrap;
    font-size: 0.9em;
}

.template-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.template-btn {
    padding: 8px 16px;
    border: 1px solid var(--tech-border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9em;
}

.template-btn:hover {
    background: #f0f7ff;
    border-color: var(--tech-accent);
}

.template-btn.active {
    background: var(--tech-blue);
    color: white;
    border-color: var(--tech-blue);
}

/* 基础设置区 */
.basic-config { 
    background: linear-gradient(to bottom right, #f8fbff, #edf7ff); 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 15px; 
    border: 1px solid var(--tech-border); 
}

.config-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.config-item { 
    flex: 0 0 auto; 
}

.config-item label { 
    display: block; 
    font-weight: 600; 
    margin-bottom: 6px; 
    color: var(--tech-dark); 
    font-size: 0.85em; 
}

.config-item input, .config-item select { 
    width: 100%; 
    padding: 8px 10px; 
    border: 1px solid var(--tech-border); 
    border-radius: 6px; 
    font-size: 0.9em; 
    transition: all 0.3s; 
    background: white; 
}

.config-item input:focus, .config-item select:focus {
    border-color: var(--tech-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.1);
}

/* 列配置区 */
.columns-config { 
    background: white; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 15px; 
    border: 1px solid var(--tech-border); 
}

.columns-container { 
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    padding: 12px;
    background: #f8fbff;
    border-radius: 8px;
    border: 1px dashed #a0c8e8;
    max-height: 280px;
    overflow-y: auto;
}

.column-block { 
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #d9ecff;
    transition: all 0.2s;
}

.column-block:hover { 
    border-color: var(--tech-accent);
    box-shadow: 0 3px 6px rgba(26, 107, 179, 0.1);
}

.column-block label { 
    font-size: 0.8em;
    font-weight: 600;
    color: var(--tech-blue);
    margin-bottom: 5px;
    display: block;
}

.column-title { 
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #c5e1f4;
    border-radius: 5px;
    margin-bottom: 7px;
    font-size: 0.85em;
}

.column-type { 
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #c5e1f4;
    border-radius: 5px;
    font-size: 0.8em;
    background: white;
}

/* 进度条样式 */
.progress-container {
    display: none;
    margin-top: 15px;
    padding: 12px;
    background: #f8fbff;
    border-radius: 8px;
    border: 1px solid var(--tech-border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.progress-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.progress-time {
    font-size: 0.85em;
    color: var(--tech-blue);
    font-weight: 500;
    min-width: 70px;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tech-accent), var(--tech-light));
    width: 0%;
    transition: width 0.3s ease;
}

.performance-info {
    font-size: 0.8em;
    color: #7a8ca5;
    text-align: center;
    margin-top: 6px;
}

/* 数据预览区 */
.preview-section { 
    margin-top: 20px;
}

#dataTable { 
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

#dataTable th { 
    background: linear-gradient(to right, var(--tech-dark), #1c3658);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border-right: 1px solid #2a4a75;
    font-size: 0.9em;
}

#dataTable td { 
    padding: 10px;
    border: 1px solid #e6f0fa;
    font-size: 0.85em;
}

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

#dataTable tr:hover { 
    background-color: #f0f7ff;
}

/* 用户信息界面 */
.user-info-section {
    display: none;
}

.user-info-section.active {
    display: block;
}

/* 在style.css中添加 */
.user-panel-section {
    display: none;
}

.user-panel-section.active {
    display: block;
}

/* 确保个人中心页面支持新样式 */
#user-info.user-panel-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(10, 26, 45, 0.1);
    border: 1px solid var(--tech-border);
}






.user-info-layout {
    display: flex;
    min-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tech-border);
    background: white;
}

.user-sidebar {
    width: 220px;
    background: #f8fbff;
    border-right: 1px solid var(--tech-border);
    padding: 20px 0;
}

.user-menu {
    list-style: none;
}

.user-menu-item {
    padding: 12px 20px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: #5a6c7d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu-item:hover {
    background: rgba(0, 198, 255, 0.05);
    color: var(--tech-blue);
}

.user-menu-item.active {
    background: rgba(0, 198, 255, 0.1);
    border-left: 3px solid var(--tech-accent);
    color: var(--tech-blue);
}

.user-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.user-content-section {
    display: none;
}

.user-content-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.user-content h2 {
    color: var(--tech-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tech-border);
    font-size: 1.4em;
}

.account-info-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--tech-dark);
    font-size: 0.95em;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tech-border);
    border-radius: 6px;
    font-size: 0.95em;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: var(--tech-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
}

.saved-passwords-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.password-item {
    background: #f8fbff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #d9ecff;
    transition: all 0.3s;
}

.password-item:hover {
    border-color: var(--tech-accent);
    box-shadow: 0 4px 12px rgba(26, 107, 179, 0.1);
}

.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.password-name {
    font-weight: 600;
    color: var(--tech-blue);
}

.password-actions {
    display: flex;
    gap: 8px;
}

.action-btn-small {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    color: #7a8ca5;
    transition: all 0.3s;
    padding: 4px;
    border-radius: 4px;
}

.action-btn-small:hover {
    color: var(--tech-blue);
    background: rgba(0, 198, 255, 0.1);
}

.password-value {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: 4px;
    margin: 10px 0;
    word-break: break-all;
    font-size: 0.9em;
}

.password-meta {
    font-size: 0.8em;
    color: #7a8ca5;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-title {
    font-size: 1.3em;
    color: var(--tech-dark);
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #666;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .columns-container { grid-template-columns: repeat(5, 1fr); }
    .user-info-layout { flex-direction: column; }
    .user-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--tech-border); }
    .user-menu { display: flex; overflow-x: auto; }
    .user-menu-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .user-menu-item.active { border-left: none; border-bottom: 3px solid var(--tech-accent); }
}

@media (max-width: 992px) {
    .nav-link { padding: 0 15px; font-size: 0.9em; }
    .top-bar { padding: 0 15px; }
    .content-container { padding: 15px; }
    .password-controls-compact { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .columns-container { grid-template-columns: repeat(3, 1fr); }
    .config-row { flex-direction: column; align-items: stretch; }
    .btn-compact { min-width: 100%; }
    .template-selector { flex-direction: column; align-items: flex-start; }
    .progress-header { flex-direction: column; align-items: flex-start; }
    .progress-info { width: 100%; justify-content: space-between; }
    .nav-menu { gap: 2px; }
    .nav-link { padding: 0 12px; font-size: 0.85em; }
    .top-btn { padding: 5px 12px; font-size: 0.8em; }
    .content-container { padding: 12px; }
    .content-section { padding: 15px; }
    .saved-passwords-list { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .columns-container { grid-template-columns: repeat(2, 1fr); }
    .nav-menu { gap: 0; }
    .nav-link { padding: 0 10px; font-size: 0.8em; }
    .content-container { padding: 10px; }
    .user-content { padding: 15px; }
}

@media (max-width: 768px) {
    .guest-area {
        gap: 6px;
    }
    
    .top-btn {
        padding: 4px 8px;
        font-size: 0.8em;
    }
}



/* 在style.css末尾添加以下样式 */

/* 用户面板样式 */
.user-panel-section {
    display: none;
}

.user-panel-section.active {
    display: flex;
    min-height: 500px;
}

.user-panel-layout {
    display: flex;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tech-border);
    background: white;
}

.user-panel-sidebar {
    width: 200px;
    background: #f8fbff;
    border-right: 1px solid var(--tech-border);
    padding: 20px 0;
}

.user-panel-menu {
    list-style: none;
}

.user-panel-item {
    padding: 12px 20px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: #5a6c7d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-panel-item:hover {
    background: rgba(0, 198, 255, 0.05);
    color: var(--tech-blue);
}

.user-panel-item.active {
    background: rgba(0, 198, 255, 0.1);
    border-left: 3px solid var(--tech-accent);
    color: var(--tech-blue);
}

.user-panel-content {
    flex: 1;
    padding: 25px;
}

#userInfoArea {
    display: flex;
    align-items: center;
    gap: 10px;  /* 用户名和退出按钮之间的间距 */
}

.user-name {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 600;
    color: var(--tech-blue);
    background: rgba(0, 198, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-name:hover {
    background: rgba(0, 198, 255, 0.2);
}

/* 扩展占位符样式 */
.nav-item[style*="opacity: 0.5"] .nav-link {
    pointer-events: none;
    color: rgba(255, 255, 255, 0.5);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .user-actions-top {
        gap: 8px;
    }
    
    .top-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    #userInfoArea {
        gap: 8px;
    }
    
    .user-name {
        padding: 4px 8px;
        font-size: 0.9em;
    }




    .user-panel-layout {
        flex-direction: column;
    }
    
    .user-panel-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--tech-border);
    }
    
    .user-panel-menu {
        display: flex;
        overflow-x: auto;
    }
    
    .user-panel-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .user-panel-item.active {
        border-left: none;
        border-bottom: 3px solid var(--tech-accent);
    }
}

