/* 密码管理器样式 */
.password-manager {
    display: flex;
    height: calc(100vh - 56px);
}

/* 侧边栏样式 */
.sidebar {
    width: 300px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 20px;
    overflow-y: auto;
}

.group-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.group-item {
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.group-item:hover {
    background-color: #e9ecef;
}

.group-item.active {
    background-color: #007bff;
    color: white;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

.password-card {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.password-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.password-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 10px;
}

.password-info {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-field {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 2px;
}

.copy-btn:hover {
    color: #007bff;
}

/* 模态框样式 */
.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.custom-fields {
    margin-top: 20px;
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

.custom-field {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.custom-field input {
    flex: 1;
}

.remove-field {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
}

/* TOTP相关样式 */
.totp-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.totp-code {
    font-size: 1.5em;
    font-family: monospace;
    letter-spacing: 2px;
    text-align: center;
    margin: 10px 0;
}

.totp-timer {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.totp-progress {
    height: 100%;
    background-color: #28a745;
    transition: width 1s linear;
}

/* 工具栏样式 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    max-width: 300px;
    margin-right: 20px;
}

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

/* 响应式布局 */
@media (max-width: 768px) {
    .password-manager {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .password-list {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .search-box {
        max-width: 100%;
        margin-right: 0;
    }
}
