/* style.css - 主样式文件 */

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

* { 
    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.95);
    border-bottom: 1px solid var(--tech-border);
    display: flex;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.site-name {
    font-size: 1.5em;
    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: 15px;
}

.top-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.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 6px 20px rgba(26, 107, 179, 0.4);
}

.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 4px 12px rgba(0, 0, 0, 0.1);
}

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

.nav-item {
    position: relative;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0 25px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1.05em;
    gap: 10px;
    border-bottom: 3px 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: 3px solid var(--tech-accent);
}

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

/* 用户信息面板 */
.user-panel {
    display: none;
    background: white;
    border-bottom: 1px solid var(--tech-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 998;
}

.user-panel.active {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.user-panel-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    min-height: 400px;
}

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

.user-profile {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--tech-border);
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tech-accent), var(--tech-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 2em;
    color: white;
    margin: 0 auto 15px;
}

.user-details h3 {
    color: var(--tech-dark);
    margin-bottom: 5px;
}

.user-details p {
    color: #7a8ca5;
    font-size: 0.9em;
}

.user-menu {
    list-style: none;
    margin-top: 20px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    color: #5a6c7d;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

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

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

.user-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    max-height: 400px;
}

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

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

/* 保存的密码和收藏容器 */
.saved-passwords-container,
.saved-favorites-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.saved-item {
    background: white;
    border: 1px solid var(--tech-border);
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s;
}

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

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

.saved-item-name {
    font-weight: 600;
    color: var(--tech-blue);
    font-size: 1.1em;
}

.saved-item-actions {
    display: flex;
    gap: 10px;
}

.saved-item-action {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    color: #7a8ca5;
    transition: all 0.3s;
    padding: 5px;
    border-radius: 5px;
}

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

.saved-item-details {
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

.password-display {
    font-family: 'Courier New', monospace;
    background: #f8fbff;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    word-break: break-all;
}

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

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

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

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

/* 占位内容样式 */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
    color: #7a8ca5;
}

.placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.3;
}

.placeholder-title {
    font-size: 1.5em;
    color: var(--tech-dark);
    margin-bottom: 15px;
}

/* 按钮组 */
.action-buttons { 
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--tech-border);
}

.btn { 
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
}

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

.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 107, 179, 0.4);
}

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

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

/* 模态框样式 */
.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: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

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

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

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--tech-border);
    border-radius: 8px;
    font-size: 1em;
    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);
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .user-panel-container {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .nav-link { padding: 0 18px; font-size: 1em; }
    .top-bar { padding: 0 20px; }
    .content-container { padding: 20px; }
}

@media (max-width: 768px) {
    .btn { min-width: 100%; }
    .nav-menu { gap: 2px; }
    .nav-link { padding: 0 12px; font-size: 0.9em; }
    .user-panel-container { flex-direction: column; }
    .user-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--tech-border); }
    .user-content { max-height: none; }
}

@media (max-width: 576px) {
    .nav-menu { gap: 0; }
    .nav-link { padding: 0 10px; font-size: 0.85em; }
    .top-btn { padding: 6px 15px; font-size: 0.85em; }
    .content-container { padding: 15px; }
    .content-section { padding: 20px; }
    .saved-passwords-container,
    .saved-favorites-container {
        grid-template-columns: 1fr;
    }
}